@moonshot-ai/kimi-code 0.18.0 → 0.19.0
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/main.mjs +245910 -172596
- package/dist-web/assets/{CodeBlockNode-BBTPBNlr.js → CodeBlockNode-B26hAEdG.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-DW-0ZP66.js → CodeBlockShell.vue_vue_type_style_index_0_lang-DCpGDnBA.js} +1 -1
- package/dist-web/assets/{Tooltip-BEPNqHjy.js → Tooltip-LgIwf1MF.js} +1 -1
- package/dist-web/assets/{arc-DsEMn4wL.js → arc-DZyzZen-.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-CRMgytTq.js → architectureDiagram-3BPJPVTR-04vShicj.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-DZjTWP93.js → blockDiagram-GPEHLZMM-ZXXjkQDj.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-XN05Flkv.js → c4Diagram-AAUBKEIU-jwIjAMhy.js} +1 -1
- package/dist-web/assets/channel-CR6L61dF.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-DB2YVfPY.js → chunk-2J33WTMH-B9WYpP0t.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-Bed6jJZo.js → chunk-4BX2VUAB-CsLa1hKW.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-CHhaYL59.js → chunk-55IACEB6-lg2y1z6m.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-BOJiU2Eb.js → chunk-727SXJPM-kSXB7Ee2.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-C8k6MI_Z.js → chunk-AQP2D5EJ-OzWWS2zu.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-C-MvWtbr.js → chunk-FMBD7UC4-BnloGzDy.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-CEqD9cw0.js → chunk-ND2GUHAM-DQ96qEVb.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-BcJHlqi-.js → chunk-QZHKN3VN-CnmjyYEF.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-BMLEGIwT.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-BMLEGIwT.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-DJ8zjD1S.js → cose-bilkent-S5V4N54A-Ca5pGblJ.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-BrTwtLB1.js → dagre-BM42HDAG-Uh1RPvzw.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-Y7FcZPzP.js → diagram-2AECGRRQ-BGLdrxMz.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-DKHdXG1y.js → diagram-5GNKFQAL-dJHq2s9o.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-VCCXGLOR.js → diagram-KO2AKTUF-Dx74xqL0.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-CYLE3Fzr.js → diagram-LMA3HP47-D70lxzjc.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-DoP7AdmG.js → diagram-OG6HWLK6-BTNo7COP.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-BMcb04Oc.js → erDiagram-TEJ5UH35-B_7lnLw9.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-C6UZeyqx.js → flowDiagram-I6XJVG4X-CwfNwpue.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-ejmlce9Q.js → ganttDiagram-6RSMTGT7-BAQE1PPR.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-0oVWkTiE.js → gitGraphDiagram-PVQCEYII-DjP3_pYV.js} +1 -1
- package/dist-web/assets/index-BiWo3nMo.css +1 -0
- package/dist-web/assets/{index-DrcjPgrD.js → index-CXZzzXGH.js} +3 -3
- package/dist-web/assets/{index-Bj6xsK-Y.js → index-Cny4-3BH.js} +1 -1
- package/dist-web/assets/index-KEPtQokk.js +268 -0
- package/dist-web/assets/{index10-BIb6yLoQ.js → index10-ba-WIDTg.js} +1 -1
- package/dist-web/assets/{index11-BcLwmlar.js → index11-zgOWkVRq.js} +2 -2
- package/dist-web/assets/{index5-BOBUDie_.js → index5-Bm0FC7PH.js} +1 -1
- package/dist-web/assets/{index6-B1AecMuA.js → index6-CvXSHsNA.js} +1 -1
- package/dist-web/assets/{index7-B1vZsaF7.js → index7-wMYBQdIV.js} +1 -1
- package/dist-web/assets/{index8-jsIBLdbS.js → index8-RFRS9KOv.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-C3E_KFZS.js → infoDiagram-5YYISTIA-GLnQZOdj.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-DTMAsXar.js → ishikawaDiagram-YF4QCWOH-BTzUsMXy.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-DlMqknWB.js → journeyDiagram-JHISSGLW-DftCk-C3.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-D8W-yZwQ.js → kanban-definition-UN3LZRKU-bJiUlhIE.js} +1 -1
- package/dist-web/assets/{linear-CXvIR_Cz.js → linear-BhksDCJ0.js} +1 -1
- package/dist-web/assets/{mermaid.core-Cm0scdl_.js → mermaid.core-DiVTz3xq.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-BTR5HSvV.js → mindmap-definition-RKZ34NQL-3nTQ_Edv.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-DgBdBron.js → pieDiagram-4H26LBE5-CzfXAqfK.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-DlJDz6Co.js → quadrantDiagram-W4KKPZXB-Be7SO8y7.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-BILYgyLr.js → requirementDiagram-4Y6WPE33-BBr4uS0C.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-CsB0bfUt.js → sankeyDiagram-5OEKKPKP-Bp5HEQ3a.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-B6sFCfAl.js → sequenceDiagram-3UESZ5HK-d5x9oqBR.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-CR0aRL4-.js → stateDiagram-AJRCARHV-Hpws1aXz.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CHpe74LW.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-Bfmc75An.js → timeline-definition-PNZ67QCA-CatOuZH5.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-bwUT2S9H.js → vennDiagram-CIIHVFJN-Dmka7FWx.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-BJNZCSc8.js → vue.runtime.esm-bundler-z5b-tezL.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-grqTsjin.js → wardley-L42UT6IY-B-DhFMCA.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-By-aofC4.js → wardleyDiagram-YWT4CUSO-Dn3fIGpK.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-BxqaMGkt.js → xychartDiagram-2RQKCTM6-BKssF4ms.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +8 -16
- package/dist-web/assets/channel-Dyiajwlv.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-Cq15LdMD.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Cq15LdMD.js +0 -1
- package/dist-web/assets/index-CNwU-esk.js +0 -268
- package/dist-web/assets/index-D6vWyrW-.css +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-UfuPGBrg.js +0 -1
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-KEf2LMH_.js","assets/katex-HP8lGamR.js","assets/CodeBlockNode-B26hAEdG.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-DCpGDnBA.js","assets/index8-RFRS9KOv.js","assets/index11-zgOWkVRq.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
|
|
3
|
+
* @vue/shared v3.5.35
|
|
4
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
+
* @license MIT
|
|
6
|
+
**/function Xf(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Tt={},Xl=[],xo=()=>{},n2=()=>!1,ou=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Zf=e=>e.startsWith("onUpdate:"),Gt=Object.assign,x1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},AM=Object.prototype.hasOwnProperty,Bt=(e,t)=>AM.call(e,t),it=Array.isArray,Zl=e=>ba(e)==="[object Map]",dl=e=>ba(e)==="[object Set]",gy=e=>ba(e)==="[object Date]",EM=e=>ba(e)==="[object RegExp]",mt=e=>typeof e=="function",Xt=e=>typeof e=="string",so=e=>typeof e=="symbol",Ft=e=>e!==null&&typeof e=="object",T1=e=>(Ft(e)||mt(e))&&mt(e.then)&&mt(e.catch),s2=Object.prototype.toString,ba=e=>s2.call(e),$M=e=>ba(e).slice(8,-1),Qf=e=>ba(e)==="[object Object]",Jf=e=>Xt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,sl=Xf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),eh=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},IM=/-\w/g,Dn=eh(e=>e.replace(IM,t=>t.slice(1).toUpperCase())),NM=/\B([A-Z])/g,Ns=eh(e=>e.replace(NM,"-$1").toLowerCase()),th=eh(e=>e.charAt(0).toUpperCase()+e.slice(1)),xd=eh(e=>e?`on${th(e)}`:""),Kn=(e,t)=>!Object.is(e,t),Ql=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},o2=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},nh=e=>{const t=parseFloat(e);return isNaN(t)?e:t},zd=e=>{const t=Xt(e)?Number(e):NaN;return isNaN(t)?e:t};let vy;const sh=()=>vy||(vy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),LM="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",OM=Xf(LM);function It(e){if(it(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Xt(s)?BM(s):It(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(Xt(e)||Ft(e))return e}const RM=/;(?![^(]*\))/g,PM=/:([^]+)/,DM=/\/\*[^]*?\*\//g;function BM(e){const t={};return e.replace(DM,"").split(RM).forEach(n=>{if(n){const s=n.split(PM);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function $e(e){let t="";if(Xt(e))t=e;else if(it(e))for(let n=0;n<e.length;n++){const s=$e(e[n]);s&&(t+=s+" ")}else if(Ft(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function cde(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Xt(t)&&(e.class=$e(t)),n&&(e.style=It(n)),e}const FM="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",HM=Xf(FM);function i2(e){return!!e||e===""}function WM(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Ai(e[s],t[s]);return n}function Ai(e,t){if(e===t)return!0;let n=gy(e),s=gy(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=so(e),s=so(t),n||s)return e===t;if(n=it(e),s=it(t),n||s)return n&&s?WM(e,t):!1;if(n=Ft(e),s=Ft(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Ai(e[r],t[r]))return!1}}return String(e)===String(t)}function oh(e,t){return e.findIndex(n=>Ai(n,t))}const r2=e=>!!(e&&e.__v_isRef===!0),N=e=>Xt(e)?e:e==null?"":it(e)||Ft(e)&&(e.toString===s2||!mt(e.toString))?r2(e)?N(e.value):JSON.stringify(e,l2,2):String(e),l2=(e,t)=>r2(t)?l2(e,t.value):Zl(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[Gp(s,i)+" =>"]=o,n),{})}:dl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Gp(n))}:so(t)?Gp(t):Ft(t)&&!it(t)&&!Qf(t)?String(t):t,Gp=(e,t="")=>{var n;return so(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function UM(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
|
|
7
|
+
* @vue/reactivity v3.5.35
|
|
8
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
9
|
+
* @license MIT
|
|
10
|
+
**/let Pn;class a2{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&&Pn&&(Pn.active?(this.parent=Pn,this.index=(Pn.scopes||(Pn.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=Pn;try{return Pn=this,t()}finally{Pn=n}}}on(){++this._on===1&&(this.prevScope=Pn,Pn=this)}off(){if(this._on>0&&--this._on===0){if(Pn===this)Pn=this.prevScope;else{let t=Pn;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;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 qM(e){return new a2(e)}function M1(){return Pn}function A1(e,t=!1){Pn&&Pn.cleanups.push(e)}let sn;const Yp=new WeakSet;class Vd{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,Pn&&(Pn.active?Pn.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Yp.has(this)&&(Yp.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||u2(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,yy(this),d2(this);const t=sn,n=Do;sn=this,Do=!0;try{return this.fn()}finally{f2(this),sn=t,Do=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)I1(t);this.deps=this.depsTail=void 0,yy(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Yp.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ig(this)&&this.run()}get dirty(){return ig(this)}}let c2=0,vc,yc;function u2(e,t=!1){if(e.flags|=8,t){e.next=yc,yc=e;return}e.next=vc,vc=e}function E1(){c2++}function $1(){if(--c2>0)return;if(yc){let t=yc;for(yc=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;vc;){let t=vc;for(vc=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function d2(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function f2(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),I1(s),jM(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function ig(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(h2(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function h2(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Rc)||(e.globalVersion=Rc,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ig(e))))return;e.flags|=2;const t=e.dep,n=sn,s=Do;sn=e,Do=!0;try{d2(e);const o=e.fn(e._value);(t.version===0||Kn(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{sn=n,Do=s,f2(e),e.flags&=-3}}function I1(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)I1(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function jM(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function ude(e,t){e.effect instanceof Vd&&(e=e.effect.fn);const n=new Vd(e);t&&Gt(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function dde(e){e.effect.stop()}let Do=!0;const p2=[];function Ei(){p2.push(Do),Do=!1}function $i(){const e=p2.pop();Do=e===void 0?!0:e}function yy(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=sn;sn=void 0;try{t()}finally{sn=n}}}let Rc=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 ih{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(!sn||!Do||sn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==sn)n=this.activeLink=new zM(sn,this),sn.deps?(n.prevDep=sn.depsTail,sn.depsTail.nextDep=n,sn.depsTail=n):sn.deps=sn.depsTail=n,m2(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=sn.depsTail,n.nextDep=void 0,sn.depsTail.nextDep=n,sn.depsTail=n,sn.deps===n&&(sn.deps=s)}return n}trigger(t){this.version++,Rc++,this.notify(t)}notify(t){E1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{$1()}}}function m2(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)m2(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Kd=new WeakMap,ol=Symbol(""),rg=Symbol(""),Pc=Symbol("");function ss(e,t,n){if(Do&&sn){let s=Kd.get(e);s||Kd.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new ih),o.map=s,o.key=n),o.track()}}function bi(e,t,n,s,o,i){const r=Kd.get(e);if(!r){Rc++;return}const l=a=>{a&&a.trigger()};if(E1(),t==="clear")r.forEach(l);else{const a=it(e),c=a&&Jf(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,p)=>{(p==="length"||p===Pc||!so(p)&&p>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Pc)),t){case"add":a?c&&l(r.get("length")):(l(r.get(ol)),Zl(e)&&l(r.get(rg)));break;case"delete":a||(l(r.get(ol)),Zl(e)&&l(r.get(rg)));break;case"set":Zl(e)&&l(r.get(ol));break}}$1()}function VM(e,t){const n=Kd.get(e);return n&&n.get(t)}function Ll(e){const t=$t(e);return t===e?t:(ss(t,"iterate",Pc),Zs(e)?t:t.map(Bo))}function rh(e){return ss(e=$t(e),"iterate",Pc),e}function Jo(e,t){return Ii(e)?ha(ar(e)?Bo(t):t):Bo(t)}const KM={__proto__:null,[Symbol.iterator](){return Xp(this,Symbol.iterator,e=>Jo(this,e))},concat(...e){return Ll(this).concat(...e.map(t=>it(t)?Ll(t):t))},entries(){return Xp(this,"entries",e=>(e[1]=Jo(this,e[1]),e))},every(e,t){return mi(this,"every",e,t,void 0,arguments)},filter(e,t){return mi(this,"filter",e,t,n=>n.map(s=>Jo(this,s)),arguments)},find(e,t){return mi(this,"find",e,t,n=>Jo(this,n),arguments)},findIndex(e,t){return mi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return mi(this,"findLast",e,t,n=>Jo(this,n),arguments)},findLastIndex(e,t){return mi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return mi(this,"forEach",e,t,void 0,arguments)},includes(...e){return Zp(this,"includes",e)},indexOf(...e){return Zp(this,"indexOf",e)},join(e){return Ll(this).join(e)},lastIndexOf(...e){return Zp(this,"lastIndexOf",e)},map(e,t){return mi(this,"map",e,t,void 0,arguments)},pop(){return Xa(this,"pop")},push(...e){return Xa(this,"push",e)},reduce(e,...t){return ky(this,"reduce",e,t)},reduceRight(e,...t){return ky(this,"reduceRight",e,t)},shift(){return Xa(this,"shift")},some(e,t){return mi(this,"some",e,t,void 0,arguments)},splice(...e){return Xa(this,"splice",e)},toReversed(){return Ll(this).toReversed()},toSorted(e){return Ll(this).toSorted(e)},toSpliced(...e){return Ll(this).toSpliced(...e)},unshift(...e){return Xa(this,"unshift",e)},values(){return Xp(this,"values",e=>Jo(this,e))}};function Xp(e,t,n){const s=rh(e),o=s[t]();return s!==e&&!Zs(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const GM=Array.prototype;function mi(e,t,n,s,o,i){const r=rh(e),l=r!==e&&!Zs(e),a=r[t];if(a!==GM[t]){const d=a.apply(e,i);return l?Bo(d):d}let c=n;r!==e&&(l?c=function(d,p){return n.call(this,Jo(e,d),p,e)}:n.length>2&&(c=function(d,p){return n.call(this,d,p,e)}));const u=a.call(r,c,s);return l&&o?o(u):u}function ky(e,t,n,s){const o=rh(e),i=o!==e&&!Zs(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Jo(e,c)),n.call(this,c,Jo(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](r,...s);return l?Jo(e,a):a}function Zp(e,t,n){const s=$t(e);ss(s,"iterate",Pc);const o=s[t](...n);return(o===-1||o===!1)&&ch(n[0])?(n[0]=$t(n[0]),s[t](...n)):o}function Xa(e,t,n=[]){Ei(),E1();const s=$t(e)[t].apply(e,n);return $1(),$i(),s}const YM=Xf("__proto__,__v_isRef,__isVue"),g2=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(so));function XM(e){so(e)||(e=String(e));const t=$t(this);return ss(t,"has",e),t.hasOwnProperty(e)}class v2{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?S2:w2:i?_2:b2).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=it(t);if(!o){let a;if(r&&(a=KM[n]))return a;if(n==="hasOwnProperty")return XM}const l=Reflect.get(t,n,En(t)?t:s);if((so(n)?g2.has(n):YM(n))||(o||ss(t,"get",n),i))return l;if(En(l)){const a=r&&Jf(n)?l:l.value;return o&&Ft(a)?Gd(a):a}return Ft(l)?o?Gd(l):Ys(l):l}}class y2 extends v2{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=it(t)&&Jf(n);if(!this._isShallow){const c=Ii(i);if(!Zs(s)&&!Ii(s)&&(i=$t(i),s=$t(s)),!r&&En(i)&&!En(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:Bt(t,n),a=Reflect.set(t,n,s,En(t)?t:o);return t===$t(o)&&(l?Kn(s,i)&&bi(t,"set",n,s):bi(t,"add",n,s)),a}deleteProperty(t,n){const s=Bt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&bi(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!so(n)||!g2.has(n))&&ss(t,"has",n),s}ownKeys(t){return ss(t,"iterate",it(t)?"length":ol),Reflect.ownKeys(t)}}class k2 extends v2{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const ZM=new y2,QM=new k2,JM=new y2(!0),eA=new k2(!0),lg=e=>e,Vu=e=>Reflect.getPrototypeOf(e);function tA(e,t,n){return function(...s){const o=this.__v_raw,i=$t(o),r=Zl(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?lg:t?ha:Bo;return!t&&ss(i,"iterate",a?rg:ol),Gt(Object.create(c),{next(){const{value:d,done:p}=c.next();return p?{value:d,done:p}:{value:l?[u(d[0]),u(d[1])]:u(d),done:p}}})}}function Ku(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function nA(e,t){const n={get(o){const i=this.__v_raw,r=$t(i),l=$t(o);e||(Kn(o,l)&&ss(r,"get",o),ss(r,"get",l));const{has:a}=Vu(r),c=t?lg:e?ha:Bo;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&ss($t(o),"iterate",ol),o.size},has(o){const i=this.__v_raw,r=$t(i),l=$t(o);return e||(Kn(o,l)&&ss(r,"has",o),ss(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=$t(l),c=t?lg:e?ha:Bo;return!e&&ss(a,"iterate",ol),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return Gt(n,e?{add:Ku("add"),set:Ku("set"),delete:Ku("delete"),clear:Ku("clear")}:{add(o){const i=$t(this),r=Vu(i),l=$t(o),a=!t&&!Zs(o)&&!Ii(o)?l:o;return r.has.call(i,a)||Kn(o,a)&&r.has.call(i,o)||Kn(l,a)&&r.has.call(i,l)||(i.add(a),bi(i,"add",a,a)),this},set(o,i){!t&&!Zs(i)&&!Ii(i)&&(i=$t(i));const r=$t(this),{has:l,get:a}=Vu(r);let c=l.call(r,o);c||(o=$t(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Kn(i,u)&&bi(r,"set",o,i):bi(r,"add",o,i),this},delete(o){const i=$t(this),{has:r,get:l}=Vu(i);let a=r.call(i,o);a||(o=$t(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&bi(i,"delete",o,void 0),c},clear(){const o=$t(this),i=o.size!==0,r=o.clear();return i&&bi(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=tA(o,e,t)}),n}function lh(e,t){const n=nA(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(Bt(n,o)&&o in s?n:s,o,i)}const sA={get:lh(!1,!1)},oA={get:lh(!1,!0)},iA={get:lh(!0,!1)},rA={get:lh(!0,!0)},b2=new WeakMap,_2=new WeakMap,w2=new WeakMap,S2=new WeakMap;function lA(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ys(e){return Ii(e)?e:ah(e,!1,ZM,sA,b2)}function aA(e){return ah(e,!1,JM,oA,_2)}function Gd(e){return ah(e,!0,QM,iA,w2)}function fde(e){return ah(e,!0,eA,rA,S2)}function ah(e,t,n,s,o){if(!Ft(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=lA($M(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function ar(e){return Ii(e)?ar(e.__v_raw):!!(e&&e.__v_isReactive)}function Ii(e){return!!(e&&e.__v_isReadonly)}function Zs(e){return!!(e&&e.__v_isShallow)}function ch(e){return e?!!e.__v_raw:!1}function $t(e){const t=e&&e.__v_raw;return t?$t(t):e}function ir(e){return!Bt(e,"__v_skip")&&Object.isExtensible(e)&&o2(e,"__v_skip",!0),e}const Bo=e=>Ft(e)?Ys(e):e,ha=e=>Ft(e)?Gd(e):e;function En(e){return e?e.__v_isRef===!0:!1}function te(e){return C2(e,!1)}function fl(e){return C2(e,!0)}function C2(e,t){return En(e)?e:new cA(e,t)}class cA{constructor(t,n){this.dep=new ih,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:$t(t),this._value=n?t:Bo(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Zs(t)||Ii(t);t=s?t:$t(t),Kn(t,n)&&(this._rawValue=t,this._value=s?t:Bo(t),this.dep.trigger())}}function hde(e){e.dep&&e.dep.trigger()}function M(e){return En(e)?e.value:e}function pde(e){return mt(e)?e():M(e)}const uA={get:(e,t,n)=>t==="__v_raw"?e:M(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return En(o)&&!En(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function x2(e){return ar(e)?e:new Proxy(e,uA)}class dA{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ih,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function fA(e){return new dA(e)}function mde(e){const t=it(e)?new Array(e.length):{};for(const n in e)t[n]=T2(e,n);return t}class hA{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=so(n)?n:String(n),this._raw=$t(t);let o=!0,i=t;if(!it(t)||so(this._key)||!Jf(this._key))do o=!ch(i)||Zs(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=M(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&En(this._raw[this._key])){const n=this._object[this._key];if(En(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return VM(this._raw,this._key)}}class pA{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function gde(e,t,n){return En(e)?e:mt(e)?new pA(e):Ft(e)&&arguments.length>1?T2(e,t,n):te(e)}function T2(e,t,n){return new hA(e,t,n)}class mA{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ih(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Rc-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&sn!==this)return u2(this,!0),!0}get value(){const t=this.dep.track();return h2(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function gA(e,t,n=!1){let s,o;return mt(e)?s=e:(s=e.get,o=e.set),new mA(s,o,n)}const vde={GET:"get",HAS:"has",ITERATE:"iterate"},yde={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Gu={},Yd=new WeakMap;let er;function kde(){return er}function vA(e,t=!1,n=er){if(n){let s=Yd.get(n);s||Yd.set(n,s=[]),s.push(e)}}function yA(e,t,n=Tt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:Zs(y)||o===!1||o===0?_i(y,1):_i(y);let u,d,p,m,f=!1,v=!1;if(En(e)?(d=()=>e.value,f=Zs(e)):ar(e)?(d=()=>c(e),f=!0):it(e)?(v=!0,f=e.some(y=>ar(y)||Zs(y)),d=()=>e.map(y=>{if(En(y))return y.value;if(ar(y))return c(y);if(mt(y))return a?a(y,2):y()})):mt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(p){Ei();try{p()}finally{$i()}}const y=er;er=u;try{return a?a(e,3,[m]):e(m)}finally{er=y}}:d=xo,t&&o){const y=d,k=o===!0?1/0:o;d=()=>_i(y(),k)}const w=M1(),b=()=>{u.stop(),w&&w.active&&x1(w.effects,u)};if(i&&t){const y=t;t=(...k)=>{y(...k),b()}}let _=v?new Array(e.length).fill(Gu):Gu;const g=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const k=u.run();if(o||f||(v?k.some((I,E)=>Kn(I,_[E])):Kn(k,_))){p&&p();const I=er;er=u;try{const E=[k,_===Gu?void 0:v&&_[0]===Gu?[]:_,m];_=k,a?a(t,3,E):t(...E)}finally{er=I}}}else u.run()};return l&&l(g),u=new Vd(d),u.scheduler=r?()=>r(g,!1):g,m=y=>vA(y,!1,u),p=u.onStop=()=>{const y=Yd.get(u);if(y){if(a)a(y,4);else for(const k of y)k();Yd.delete(u)}},t?s?g(!0):_=u.run():r?r(g.bind(null,!0),!0):u.run(),b.pause=u.pause.bind(u),b.resume=u.resume.bind(u),b.stop=b,b}function _i(e,t=1/0,n){if(t<=0||!Ft(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,En(e))_i(e.value,t,n);else if(it(e))for(let s=0;s<e.length;s++)_i(e[s],t,n);else if(dl(e)||Zl(e))e.forEach(s=>{_i(s,t,n)});else if(Qf(e)){for(const s in e)_i(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&_i(e[s],t,n)}return e}/**
|
|
11
|
+
* @vue/runtime-core v3.5.35
|
|
12
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
+
* @license MIT
|
|
14
|
+
**/const M2=[];function kA(e){M2.push(e)}function bA(){M2.pop()}function bde(e,t){}const _de={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},_A={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function iu(e,t,n,s){try{return s?e(...s):e()}catch(o){_a(o,t,n)}}function Ao(e,t,n,s){if(mt(e)){const o=iu(e,t,n,s);return o&&T1(o)&&o.catch(i=>{_a(i,t,n)}),o}if(it(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Ao(e[i],t,n,s));return o}}function _a(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Tt;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}l=l.parent}if(i){Ei(),iu(i,null,10,[e,a,c]),$i();return}}wA(e,n,o,s,r)}function wA(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const ys=[];let Xo=-1;const Jl=[];let tr=null,Ul=0;const A2=Promise.resolve();let Xd=null;function ut(e){const t=Xd||A2;return e?t.then(this?e.bind(this):e):t}function SA(e){let t=Xo+1,n=ys.length;for(;t<n;){const s=t+n>>>1,o=ys[s],i=Dc(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function N1(e){if(!(e.flags&1)){const t=Dc(e),n=ys[ys.length-1];!n||!(e.flags&2)&&t>=Dc(n)?ys.push(e):ys.splice(SA(t),0,e),e.flags|=1,E2()}}function E2(){Xd||(Xd=A2.then($2))}function Zd(e){it(e)?Jl.push(...e):tr&&e.id===-1?tr.splice(Ul+1,0,e):e.flags&1||(Jl.push(e),e.flags|=1),E2()}function by(e,t,n=Xo+1){for(;n<ys.length;n++){const s=ys[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;ys.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Qd(e){if(Jl.length){const t=[...new Set(Jl)].sort((n,s)=>Dc(n)-Dc(s));if(Jl.length=0,tr){tr.push(...t);return}for(tr=t,Ul=0;Ul<tr.length;Ul++){const n=tr[Ul];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}tr=null,Ul=0}}const Dc=e=>e.id==null?e.flags&2?-1:1/0:e.id;function $2(e){try{for(Xo=0;Xo<ys.length;Xo++){const t=ys[Xo];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),iu(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Xo<ys.length;Xo++){const t=ys[Xo];t&&(t.flags&=-2)}Xo=-1,ys.length=0,Qd(),Xd=null,(ys.length||Jl.length)&&$2()}}let ql,Yu=[];function I2(e,t){var n,s;ql=e,ql?(ql.enabled=!0,Yu.forEach(({event:o,args:i})=>ql.emit(o,...i)),Yu=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{I2(i,t)}),setTimeout(()=>{ql||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Yu=[])},3e3)):Yu=[]}let Xn=null,uh=null;function Bc(e){const t=Xn;return Xn=e,uh=e&&e.type.__scopeId||null,t}function wde(e){uh=e}function Sde(){uh=null}const Cde=e=>kn;function kn(e,t=Xn,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&sf(-1);const i=Bc(t);let r;try{r=e(...o)}finally{Bc(i),s._d&&sf(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function At(e,t){if(Xn===null)return e;const n=cu(Xn),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Tt]=t[o];i&&(mt(i)&&(i={mounted:i,updated:i}),i.deep&&_i(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Qo(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(Ei(),Ao(a,n,8,[e.el,l,e,t]),$i())}}function cn(e,t){if(Gn){let n=Gn.provides;const s=Gn.parent&&Gn.parent.provides;s===n&&(n=Gn.provides=Object.create(s)),n[e]=t}}function Nt(e,t,n=!1){const s=ls();if(s||il){let o=il?il._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&mt(t)?t.call(s&&s.proxy):t}}function xde(){return!!(ls()||il)}const CA=Symbol.for("v-scx"),xA=()=>Nt(CA);function TA(e,t){return ru(e,null,t)}function Tde(e,t){return ru(e,null,{flush:"post"})}function MA(e,t){return ru(e,null,{flush:"sync"})}function ze(e,t,n){return ru(e,t,n)}function ru(e,t,n=Tt){const{immediate:s,deep:o,flush:i,once:r}=n,l=Gt({},n),a=t&&s||!t&&i!=="post";let c;if(cl){if(i==="sync"){const m=xA();c=m.__watcherHandles||(m.__watcherHandles=[])}else if(!a){const m=()=>{};return m.stop=xo,m.resume=xo,m.pause=xo,m}}const u=Gn;l.call=(m,f,v)=>Ao(m,u,f,v);let d=!1;i==="post"?l.scheduler=m=>{Tn(m,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(m,f)=>{f?m():N1(m)}),l.augmentJob=m=>{t&&(m.flags|=4),d&&(m.flags|=2,u&&(m.id=u.uid,m.i=u))};const p=yA(e,t,l);return cl&&(c?c.push(p):a&&p()),p}function AA(e,t,n){const s=this.proxy,o=Xt(e)?e.includes(".")?N2(s,e):()=>s[e]:e.bind(s,s);let i;mt(t)?i=t:(i=t.handler,n=t);const r=wa(this),l=ru(o,i.bind(s),n);return r(),l}function N2(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Qi=new WeakMap,L2=Symbol("_vte"),O2=e=>e.__isTeleport,Xr=e=>e&&(e.disabled||e.disabled===""),EA=e=>e&&(e.defer||e.defer===""),_y=e=>typeof SVGElement<"u"&&e instanceof SVGElement,wy=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ag=(e,t)=>{const n=e&&e.to;return Xt(n)?t?t(n):null:n},$A={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:p,o:{insert:m,querySelector:f,createText:v,createComment:w,parentNode:b}}=c,_=Xr(t.props);let{dynamicChildren:g}=t;const y=(E,S,T)=>{E.shapeFlag&16&&u(E.children,S,T,o,i,r,l,a)},k=(E=t)=>{const S=Xr(E.props),T=E.target=ag(E.props,f),$=cg(T,E,v,m);T&&(r!=="svg"&&_y(T)?r="svg":r!=="mathml"&&wy(T)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(T),S||(y(E,T,$),lc(E,!1)))},I=E=>{const S=()=>{if(Qi.get(E)===S){if(Qi.delete(E),Xr(E.props)){const T=b(E.el)||n;y(E,T,E.anchor),lc(E,!0)}k(E)}};Qi.set(E,S),Tn(S,i)};if(e==null){const E=t.el=v(""),S=t.anchor=v("");if(m(E,n,s),m(S,n,s),EA(t.props)||i&&i.pendingBranch){I(t);return}_&&(y(t,n,S),lc(t,!0)),k()}else{t.el=e.el;const E=t.anchor=e.anchor,S=Qi.get(e);if(S){S.flags|=8,Qi.delete(e),I(t);return}t.targetStart=e.targetStart;const T=t.target=e.target,$=t.targetAnchor=e.targetAnchor,L=Xr(e.props),R=L?n:T,O=L?E:$;if(r==="svg"||_y(T)?r="svg":(r==="mathml"||wy(T))&&(r="mathml"),g?(p(e.dynamicChildren,g,R,o,i,r,l),U1(e,t,!0)):a||d(e,t,R,O,o,i,r,l,!1),_)L?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Xu(t,n,E,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const B=t.target=ag(t.props,f);B&&Xu(t,B,null,c,0)}else L&&Xu(t,T,$,c,1);lc(t,_)}},remove(e,t,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:p}=e,m=i||!Xr(p),f=Qi.get(e);if(f&&(f.flags|=8,Qi.delete(e)),d&&(o(c),o(u)),i&&o(a),!f&&r&16)for(let v=0;v<l.length;v++){const w=l[v];s(w,t,n,m,!!w.dynamicChildren)}},move:Xu,hydrate:IA};function Xu(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!Qi.has(e)&&(!d||Xr(u))&&a&16)for(let p=0;p<c.length;p++)o(c[p],t,n,2);d&&s(l,t,n)}function IA(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function p(w,b){let _=b;for(;_;){if(_&&_.nodeType===8){if(_.data==="teleport start anchor")t.targetStart=_;else if(_.data==="teleport anchor"){t.targetAnchor=_,w._lpa=t.targetAnchor&&r(t.targetAnchor);break}}_=r(_)}}function m(w,b){b.anchor=d(r(w),b,l(w),n,s,o,i)}const f=t.target=ag(t.props,a),v=Xr(t.props);if(f){const w=f._lpa||f.firstChild;t.shapeFlag&16&&(v?(m(e,t),p(f,w),t.targetAnchor||cg(f,t,u,c,l(e)===f?e:null)):(t.anchor=r(e),p(f,w),t.targetAnchor||cg(f,t,u,c),d(w&&r(w),t,f,n,s,o,i))),lc(t,v)}else v&&t.shapeFlag&16&&(m(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const Mde=$A;function lc(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function cg(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[L2]=r,e&&(s(i,e,o),s(r,e,o)),r}const yo=Symbol("_leaveCb"),Za=Symbol("_enterCb");function R2(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Jt(()=>{e.isMounted=!0}),oo(()=>{e.isUnmounting=!0}),e}const ho=[Function,Array],P2={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ho,onEnter:ho,onAfterEnter:ho,onEnterCancelled:ho,onBeforeLeave:ho,onLeave:ho,onAfterLeave:ho,onLeaveCancelled:ho,onBeforeAppear:ho,onAppear:ho,onAfterAppear:ho,onAppearCancelled:ho},D2=e=>{const t=e.subTree;return t.component?D2(t.component):t},NA={name:"BaseTransition",props:P2,setup(e,{slots:t}){const n=ls(),s=R2();return()=>{const o=t.default&&L1(t.default(),!0),i=o&&o.length?B2(o):n.subTree?re():void 0;if(!i)return;const r=$t(e),{mode:l}=r;if(s.isLeaving)return Qp(i);const a=Sy(i);if(!a)return Qp(i);let c=Fc(a,r,s,n,d=>c=d);a.type!==Mn&&hr(a,c);let u=n.subTree&&Sy(n.subTree);if(u&&u.type!==Mn&&!Oo(u,a)&&D2(n).type!==Mn){let d=Fc(u,r,s,n);if(hr(u,d),l==="out-in"&&a.type!==Mn)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Qp(i);l==="in-out"&&a.type!==Mn?d.delayLeave=(p,m,f)=>{const v=F2(s,u);v[String(u.key)]=u,p[yo]=()=>{m(),p[yo]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{f(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function B2(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Mn){t=n;break}}return t}const LA=NA;function F2(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Fc(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:m,onAfterLeave:f,onLeaveCancelled:v,onBeforeAppear:w,onAppear:b,onAfterAppear:_,onAppearCancelled:g}=t,y=String(e.key),k=F2(n,e),I=(T,$)=>{T&&Ao(T,s,9,$)},E=(T,$)=>{const L=$[1];I(T,$),it(T)?T.every(R=>R.length<=1)&&L():T.length<=1&&L()},S={mode:r,persisted:l,beforeEnter(T){let $=a;if(!n.isMounted)if(i)$=w||a;else return;T[yo]&&T[yo](!0);const L=k[y];L&&Oo(e,L)&&L.el[yo]&&L.el[yo](),I($,[T])},enter(T){if(k[y]===e)return;let $=c,L=u,R=d;if(!n.isMounted)if(i)$=b||c,L=_||u,R=g||d;else return;let O=!1;T[Za]=F=>{O||(O=!0,F?I(R,[T]):I(L,[T]),S.delayedLeave&&S.delayedLeave(),T[Za]=void 0)};const B=T[Za].bind(null,!1);$?E($,[T,B]):B()},leave(T,$){const L=String(e.key);if(T[Za]&&T[Za](!0),n.isUnmounting)return $();I(p,[T]);let R=!1;T[yo]=B=>{R||(R=!0,$(),B?I(v,[T]):I(f,[T]),T[yo]=void 0,k[L]===e&&delete k[L])};const O=T[yo].bind(null,!1);k[L]=e,m?E(m,[T,O]):O()},clone(T){const $=Fc(T,t,n,s,o);return o&&o($),$}};return S}function Qp(e){if(lu(e))return e=Ni(e),e.children=null,e}function Sy(e){if(!lu(e))return O2(e.type)&&e.children?B2(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&mt(n.default))return n.default()}}function hr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,hr(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 L1(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Ie?(r.patchFlag&128&&o++,s=s.concat(L1(r.children,t,l))):(t||r.type!==Mn)&&s.push(l!=null?Ni(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Xe(e,t){return mt(e)?Gt({name:e.name},t,{setup:e}):e}function Ade(){const e=ls();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function O1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ede(e){const t=ls(),n=fl(null);if(t){const o=t.refs===Tt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Cy(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Jd=new WeakMap;function ea(e,t,n,s,o=!1){if(it(e)){e.forEach((v,w)=>ea(v,t&&(it(t)?t[w]:t),n,s,o));return}if(xi(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&ea(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?cu(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Tt?l.refs={}:l.refs,d=l.setupState,p=$t(d),m=d===Tt?n2:v=>Cy(u,v)?!1:Bt(p,v),f=(v,w)=>!(w&&Cy(u,w));if(c!=null&&c!==a){if(xy(t),Xt(c))u[c]=null,m(c)&&(d[c]=null);else if(En(c)){const v=t;f(c,v.k)&&(c.value=null),v.k&&(u[v.k]=null)}}if(mt(a))iu(a,l,12,[r,u]);else{const v=Xt(a),w=En(a);if(v||w){const b=()=>{if(e.f){const _=v?m(a)?d[a]:u[a]:f()||!e.k?a.value:u[e.k];if(o)it(_)&&x1(_,i);else if(it(_))_.includes(i)||_.push(i);else if(v)u[a]=[i],m(a)&&(d[a]=u[a]);else{const g=[i];f(a,e.k)&&(a.value=g),e.k&&(u[e.k]=g)}}else v?(u[a]=r,m(a)&&(d[a]=r)):w&&(f(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const _=()=>{b(),Jd.delete(e)};_.id=-1,Jd.set(e,_),Tn(_,n)}else xy(e),b()}}}function xy(e){const t=Jd.get(e);t&&(t.flags|=8,Jd.delete(e))}let Ty=!1;const Ol=()=>{Ty||(console.error("Hydration completed but contains mismatches."),Ty=!0)},OA=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",RA=e=>e.namespaceURI.includes("MathML"),Zu=e=>{if(e.nodeType===1){if(OA(e))return"svg";if(RA(e))return"mathml"}},Vl=e=>e.nodeType===8;function PA(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(g,y)=>{if(!y.hasChildNodes()){n(null,g,y),Qd(),y._vnode=g;return}d(y.firstChild,g,null,null,null),Qd(),y._vnode=g},d=(g,y,k,I,E,S=!1)=>{S=S||!!y.dynamicChildren;const T=Vl(g)&&g.data==="[",$=()=>v(g,y,k,I,E,T),{type:L,ref:R,shapeFlag:O,patchFlag:B}=y;let F=g.nodeType;y.el=g,B===-2&&(S=!1,y.dynamicChildren=null);let q=null;switch(L){case cr:F!==3?y.children===""?(a(y.el=o(""),r(g),g),q=g):q=$():(g.data!==y.children&&(Ol(),g.data=y.children),q=i(g));break;case Mn:_(g)?(q=i(g),b(y.el=g.content.firstChild,g,k)):F!==8||T?q=$():q=i(g);break;case sa:if(T&&(g=i(g),F=g.nodeType),F===1||F===3){q=g;const G=!y.children.length;for(let K=0;K<y.staticCount;K++)G&&(y.children+=q.nodeType===1?q.outerHTML:q.data),K===y.staticCount-1&&(y.anchor=q),q=i(q);return T?i(q):q}else $();break;case Ie:T?q=f(g,y,k,I,E,S):q=$();break;default:if(O&1)(F!==1||y.type.toLowerCase()!==g.tagName.toLowerCase())&&!_(g)?q=$():q=p(g,y,k,I,E,S);else if(O&6){y.slotScopeIds=E;const G=r(g);if(T?q=w(g):Vl(g)&&g.data==="teleport start"?q=w(g,g.data,"teleport end"):q=i(g),t(y,G,null,k,I,Zu(G),S),xi(y)&&!y.type.__asyncResolved){let K;T?(K=pt(Ie),K.anchor=q?q.previousSibling:G.lastChild):K=g.nodeType===3?dt(""):pt("div"),K.el=g,y.component.subTree=K}}else O&64?F!==8?q=$():q=y.type.hydrate(g,y,k,I,E,S,e,m):O&128&&(q=y.type.hydrate(g,y,k,I,Zu(r(g)),E,S,e,d))}return R!=null&&ea(R,null,I,y),q},p=(g,y,k,I,E,S)=>{S=S||!!y.dynamicChildren;const{type:T,props:$,patchFlag:L,shapeFlag:R,dirs:O,transition:B}=y,F=T==="input"||T==="option";if(F||L!==-1){O&&Qo(y,null,k,"created");let q=!1;if(_(g)){q=oS(null,B)&&k&&k.vnode.props&&k.vnode.props.appear;const K=g.content.firstChild;if(q){const oe=K.getAttribute("class");oe&&(K.$cls=oe),B.beforeEnter(K)}b(K,g,k),y.el=g=K}if(R&16&&!($&&($.innerHTML||$.textContent))){let K=m(g.firstChild,y,g,k,I,E,S);for(K&&!Qu(g,1)&&Ol();K;){const oe=K;K=K.nextSibling,l(oe)}}else if(R&8){let K=y.children;K[0]===`
|
|
15
|
+
`&&(g.tagName==="PRE"||g.tagName==="TEXTAREA")&&(K=K.slice(1));const{textContent:oe}=g;oe!==K&&oe!==K.replace(/\r\n|\r/g,`
|
|
16
|
+
`)&&(Qu(g,0)||Ol(),g.textContent=y.children)}if($){if(F||!S||L&48){const K=g.tagName.includes("-");for(const oe in $)(F&&(oe.endsWith("value")||oe==="indeterminate")||ou(oe)&&!sl(oe)||oe[0]==="."||K&&!sl(oe))&&s(g,oe,null,$[oe],void 0,k)}else if($.onClick)s(g,"onClick",null,$.onClick,void 0,k);else if(L&4&&ar($.style))for(const K in $.style)$.style[K]}let G;(G=$&&$.onVnodeBeforeMount)&&$s(G,k,y),O&&Qo(y,null,k,"beforeMount"),((G=$&&$.onVnodeMounted)||O||q)&&aS(()=>{G&&$s(G,k,y),q&&B.enter(g),O&&Qo(y,null,k,"mounted")},I)}return g.nextSibling},m=(g,y,k,I,E,S,T)=>{T=T||!!y.dynamicChildren;const $=y.children,L=$.length;let R=!1;for(let O=0;O<L;O++){const B=T?$[O]:$[O]=Is($[O]),F=B.type===cr;g?(F&&!T&&O+1<L&&Is($[O+1]).type===cr&&(a(o(g.data.slice(B.children.length)),k,i(g)),g.data=B.children),g=d(g,B,I,E,S,T)):F&&!B.children?a(B.el=o(""),k):(R||(R=!0,Qu(k,1)||Ol()),n(null,B,k,null,I,E,Zu(k),S))}return g},f=(g,y,k,I,E,S)=>{const{slotScopeIds:T}=y;T&&(E=E?E.concat(T):T);const $=r(g),L=m(i(g),y,$,k,I,E,S);return L&&Vl(L)&&L.data==="]"?i(y.anchor=L):(Ol(),a(y.anchor=c("]"),$,L),L)},v=(g,y,k,I,E,S)=>{if(Qu(g.parentElement,1)||Ol(),y.el=null,S){const L=w(g);for(;;){const R=i(g);if(R&&R!==L)l(R);else break}}const T=i(g),$=r(g);return l(g),n(null,y,$,T,k,I,Zu($),E),k&&(k.vnode.el=y.el,hh(k,y.el)),T},w=(g,y="[",k="]")=>{let I=0;for(;g;)if(g=i(g),g&&Vl(g)&&(g.data===y&&I++,g.data===k)){if(I===0)return i(g);I--}return g},b=(g,y,k)=>{const I=y.parentNode;I&&I.replaceChild(g,y);let E=k;for(;E;)E.vnode.el===y&&(E.vnode.el=E.subTree.el=g),E=E.parent},_=g=>g.nodeType===1&&g.tagName==="TEMPLATE";return[u,d]}const My="data-allow-mismatch",DA={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Qu(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(My);)e=e.parentElement;const n=e&&e.getAttribute(My);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(DA[t])}}const BA=sh().requestIdleCallback||(e=>setTimeout(e,1)),FA=sh().cancelIdleCallback||(e=>clearTimeout(e)),$de=(e=1e4)=>t=>{const n=BA(t,{timeout:e});return()=>FA(n)};function HA(e){const{top:t,left:n,bottom:s,right:o}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||s>0&&s<i)&&(n>0&&n<r||o>0&&o<r)}const Ide=e=>(t,n)=>{const s=new IntersectionObserver(o=>{for(const i of o)if(i.isIntersecting){s.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(HA(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},Nde=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},Lde=(e=[])=>(t,n)=>{Xt(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function WA(e,t){if(Vl(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Vl(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const xi=e=>!!e.type.__asyncLoader;function ei(e){mt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const p=()=>(d++,c=null,m()),m=()=>{let f;return c||(f=c=t().catch(v=>{if(v=v instanceof Error?v:new Error(String(v)),a)return new Promise((w,b)=>{a(v,()=>w(p()),()=>b(v),d+1)});throw v}).then(v=>f!==c&&c?c:(v&&(v.__esModule||v[Symbol.toStringTag]==="Module")&&(v=v.default),u=v,v)))};return Xe({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(f,v,w){let b=!1;(v.bu||(v.bu=[])).push(()=>b=!0);const _=()=>{b||w()},g=i?()=>{const y=i(_,k=>WA(f,k));y&&(v.bum||(v.bum=[])).push(y)}:_;u?g():m().then(()=>!v.isUnmounted&&g())},get __asyncResolved(){return u},setup(){const f=Gn;if(O1(f),u)return()=>Ju(u,f);const v=g=>{c=null,_a(g,f,13,!s)};if(l&&f.suspense||cl)return m().then(g=>()=>Ju(g,f)).catch(g=>(v(g),()=>s?pt(s,{error:g}):null));const w=te(!1),b=te(),_=te(!!o);return o&&setTimeout(()=>{_.value=!1},o),r!=null&&setTimeout(()=>{if(!w.value&&!b.value){const g=new Error(`Async component timed out after ${r}ms.`);v(g),b.value=g}},r),m().then(()=>{w.value=!0,f.parent&&lu(f.parent.vnode)&&f.parent.update()}).catch(g=>{v(g),b.value=g}),()=>{if(w.value&&u)return Ju(u,f);if(b.value&&s)return pt(s,{error:b.value});if(n&&!_.value)return Ju(n,f)}}})}function Ju(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=pt(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const lu=e=>e.type.__isKeepAlive,UA={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=ls(),s=n.ctx;if(!s.renderer)return()=>{const _=t.default&&t.default();return _&&_.length===1?_[0]:_};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,p=d("div");s.activate=(_,g,y,k,I)=>{const E=_.component;c(_,g,y,0,l),a(E.vnode,_,g,y,E,l,k,_.slotScopeIds,I),Tn(()=>{E.isDeactivated=!1,E.a&&Ql(E.a);const S=_.props&&_.props.onVnodeMounted;S&&$s(S,E.parent,_)},l)},s.deactivate=_=>{const g=_.component;tf(g.m),tf(g.a),c(_,p,null,1,l),Tn(()=>{g.da&&Ql(g.da);const y=_.props&&_.props.onVnodeUnmounted;y&&$s(y,g.parent,_),g.isDeactivated=!0},l)};function m(_){Jp(_),u(_,n,l,!0)}function f(_){o.forEach((g,y)=>{const k=yg(xi(g)?g.type.__asyncResolved||{}:g.type);k&&!_(k)&&v(y)})}function v(_){const g=o.get(_);g&&(!r||!Oo(g,r))?m(g):r&&Jp(r),o.delete(_),i.delete(_)}ze(()=>[e.include,e.exclude],([_,g])=>{_&&f(y=>ac(_,y)),g&&f(y=>!ac(g,y))},{flush:"post",deep:!0});let w=null;const b=()=>{w!=null&&(nf(n.subTree.type)?Tn(()=>{o.set(w,ed(n.subTree))},n.subTree.suspense):o.set(w,ed(n.subTree)))};return Jt(b),R1(b),oo(()=>{o.forEach(_=>{const{subTree:g,suspense:y}=n,k=ed(g);if(_.type===k.type&&_.key===k.key){Jp(k);const I=k.component.da;I&&Tn(I,y);return}m(_)})}),()=>{if(w=null,!t.default)return r=null;const _=t.default(),g=_[0];if(_.length>1)return r=null,_;if(!pr(g)||!(g.shapeFlag&4)&&!(g.shapeFlag&128))return r=null,g;let y=ed(g);if(y.type===Mn)return r=null,y;const k=y.type,I=yg(xi(y)?y.type.__asyncResolved||{}:k),{include:E,exclude:S,max:T}=e;if(E&&(!I||!ac(E,I))||S&&I&&ac(S,I))return y.shapeFlag&=-257,r=y,g;const $=y.key==null?k:y.key,L=o.get($);return y.el&&(y=Ni(y),g.shapeFlag&128&&(g.ssContent=y)),w=$,L?(y.el=L.el,y.component=L.component,y.transition&&hr(y,y.transition),y.shapeFlag|=512,i.delete($),i.add($)):(i.add($),T&&i.size>parseInt(T,10)&&v(i.values().next().value)),y.shapeFlag|=256,r=y,nf(g.type)?g:y}}},Ode=UA;function ac(e,t){return it(e)?e.some(n=>ac(n,t)):Xt(e)?e.split(",").includes(t):EM(e)?(e.lastIndex=0,e.test(t)):!1}function qA(e,t){H2(e,"a",t)}function jA(e,t){H2(e,"da",t)}function H2(e,t,n=Gn){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(dh(t,s,n),n){let o=n.parent;for(;o&&o.parent;)lu(o.parent.vnode)&&zA(s,t,n,o),o=o.parent}}function zA(e,t,n,s){const o=dh(t,e,s,!0);qt(()=>{x1(s[t],o)},n)}function Jp(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function ed(e){return e.shapeFlag&128?e.ssContent:e}function dh(e,t,n=Gn,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Ei();const l=wa(n),a=Ao(t,n,e,r);return l(),$i(),a});return s?o.unshift(i):o.push(i),i}}const Oi=e=>(t,n=Gn)=>{(!cl||e==="sp")&&dh(e,(...s)=>t(...s),n)},VA=Oi("bm"),Jt=Oi("m"),W2=Oi("bu"),R1=Oi("u"),oo=Oi("bum"),qt=Oi("um"),KA=Oi("sp"),GA=Oi("rtg"),YA=Oi("rtc");function XA(e,t=Gn){dh("ec",e,t)}const P1="components",ZA="directives";function QA(e,t){return D1(P1,e,!0,t)||e}const U2=Symbol.for("v-ndc");function os(e){return Xt(e)?D1(P1,e,!1)||e:e||U2}function Rde(e){return D1(ZA,e)}function D1(e,t,n=!0,s=!1){const o=Xn||Gn;if(o){const i=o.type;if(e===P1){const l=yg(i,!1);if(l&&(l===t||l===Dn(t)||l===th(Dn(t))))return i}const r=Ay(o[e]||i[e],t)||Ay(o.appContext[e],t);return!r&&s?i:r}}function Ay(e,t){return e&&(e[t]||e[Dn(t)]||e[th(Dn(t))])}function Ye(e,t,n,s){let o;const i=n&&n[s],r=it(e);if(r||Xt(e)){const l=r&&ar(e);let a=!1,c=!1;l&&(a=!Zs(e),c=Ii(e),e=rh(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?ha(Bo(e[u])):Bo(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(Ft(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function Pde(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(it(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function ta(e,t,n={},s,o){if(Xn.ce||Xn.parent&&xi(Xn.parent)&&Xn.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),C(),qe(Ie,null,[pt("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),C();const r=i&&B1(i(n)),l=n.key||r&&r.key,a=qe(Ie,{key:(l&&!so(l)?l:`_${t}`)+(!r&&s?"_fb":"")},r||(s?s():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function B1(e){return e.some(t=>pr(t)?!(t.type===Mn||t.type===Ie&&!B1(t.children)):!0)?e:null}function Dde(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:xd(s)]=e[s];return n}const ug=e=>e?hS(e)?cu(e):ug(e.parent):null,kc=Gt(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=>ug(e.parent),$root:e=>ug(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>F1(e),$forceUpdate:e=>e.f||(e.f=()=>{N1(e.update)}),$nextTick:e=>e.n||(e.n=ut.bind(e.proxy)),$watch:e=>AA.bind(e)}),em=(e,t)=>e!==Tt&&!e.__isScriptSetup&&Bt(e,t),dg={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const p=r[t];if(p!==void 0)switch(p){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(em(s,t))return r[t]=1,s[t];if(o!==Tt&&Bt(o,t))return r[t]=2,o[t];if(Bt(i,t))return r[t]=3,i[t];if(n!==Tt&&Bt(n,t))return r[t]=4,n[t];fg&&(r[t]=0)}}const c=kc[t];let u,d;if(c)return t==="$attrs"&&ss(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Tt&&Bt(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,Bt(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return em(o,t)?(o[t]=n,!0):s!==Tt&&Bt(s,t)?(s[t]=n,!0):Bt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Tt&&l[0]!=="$"&&Bt(e,l)||em(t,l)||Bt(i,l)||Bt(s,l)||Bt(kc,l)||Bt(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Bt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},JA=Gt({},dg,{get(e,t){if(t!==Symbol.unscopables)return dg.get(e,t,e)},has(e,t){return t[0]!=="_"&&!OM(t)}});function Bde(){return null}function Fde(){return null}function Hde(e){}function Wde(e){}function Ude(){return null}function qde(){}function jde(e,t){return null}function zde(){return q2().slots}function au(){return q2().attrs}function q2(e){const t=ls();return t.setupContext||(t.setupContext=gS(t))}function Hc(e){return it(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Vde(e,t){const n=Hc(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?it(o)||mt(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function Kde(e,t){return!e||!t?e||t:it(e)&&it(t)?e.concat(t):Gt({},Hc(e),Hc(t))}function Gde(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function Yde(e){const t=ls(),n=cl;let s=e();Uc(),n&&oa(!1);const o=()=>{wa(t),n&&oa(!0)},i=()=>{ls()!==t&&t.scope.off(),Uc(),n&&oa(!1)};return T1(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let fg=!0;function e4(e){const t=F1(e),n=e.proxy,s=e.ctx;fg=!1,t.beforeCreate&&Ey(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:m,updated:f,activated:v,deactivated:w,beforeDestroy:b,beforeUnmount:_,destroyed:g,unmounted:y,render:k,renderTracked:I,renderTriggered:E,errorCaptured:S,serverPrefetch:T,expose:$,inheritAttrs:L,components:R,directives:O,filters:B}=t;if(c&&t4(c,s,null),r)for(const G in r){const K=r[G];mt(K)&&(s[G]=K.bind(n))}if(o){const G=o.call(n,n);Ft(G)&&(e.data=Ys(G))}if(fg=!0,i)for(const G in i){const K=i[G],oe=mt(K)?K.bind(n,n):mt(K.get)?K.get.bind(n,n):xo,le=!mt(K)&&mt(K.set)?K.set.bind(n):xo,pe=j({get:oe,set:le});Object.defineProperty(s,G,{enumerable:!0,configurable:!0,get:()=>pe.value,set:be=>pe.value=be})}if(l)for(const G in l)j2(l[G],s,n,G);if(a){const G=mt(a)?a.call(n):a;Reflect.ownKeys(G).forEach(K=>{cn(K,G[K])})}u&&Ey(u,e,"c");function q(G,K){it(K)?K.forEach(oe=>G(oe.bind(n))):K&&G(K.bind(n))}if(q(VA,d),q(Jt,p),q(W2,m),q(R1,f),q(qA,v),q(jA,w),q(XA,S),q(YA,I),q(GA,E),q(oo,_),q(qt,y),q(KA,T),it($))if($.length){const G=e.exposed||(e.exposed={});$.forEach(K=>{Object.defineProperty(G,K,{get:()=>n[K],set:oe=>n[K]=oe,enumerable:!0})})}else e.exposed||(e.exposed={});k&&e.render===xo&&(e.render=k),L!=null&&(e.inheritAttrs=L),R&&(e.components=R),O&&(e.directives=O),T&&O1(e)}function t4(e,t,n=xo){it(e)&&(e=hg(e));for(const s in e){const o=e[s];let i;Ft(o)?"default"in o?i=Nt(o.from||s,o.default,!0):i=Nt(o.from||s):i=Nt(o),En(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function Ey(e,t,n){Ao(it(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function j2(e,t,n,s){let o=s.includes(".")?N2(n,s):()=>n[s];if(Xt(e)){const i=t[e];mt(i)&&ze(o,i)}else if(mt(e))ze(o,e.bind(n));else if(Ft(e))if(it(e))e.forEach(i=>j2(i,t,n,s));else{const i=mt(e.handler)?e.handler.bind(n):t[e.handler];mt(i)&&ze(o,i,e)}}function F1(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>ef(a,c,r,!0)),ef(a,t,r)),Ft(t)&&i.set(t,a),a}function ef(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&ef(e,i,n,!0),o&&o.forEach(r=>ef(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=n4[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const n4={data:$y,props:Iy,emits:Iy,methods:cc,computed:cc,beforeCreate:vs,created:vs,beforeMount:vs,mounted:vs,beforeUpdate:vs,updated:vs,beforeDestroy:vs,beforeUnmount:vs,destroyed:vs,unmounted:vs,activated:vs,deactivated:vs,errorCaptured:vs,serverPrefetch:vs,components:cc,directives:cc,watch:o4,provide:$y,inject:s4};function $y(e,t){return t?e?function(){return Gt(mt(e)?e.call(this,this):e,mt(t)?t.call(this,this):t)}:t:e}function s4(e,t){return cc(hg(e),hg(t))}function hg(e){if(it(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function vs(e,t){return e?[...new Set([].concat(e,t))]:t}function cc(e,t){return e?Gt(Object.create(null),e,t):t}function Iy(e,t){return e?it(e)&&it(t)?[...new Set([...e,...t])]:Gt(Object.create(null),Hc(e),Hc(t??{})):t}function o4(e,t){if(!e)return t;if(!t)return e;const n=Gt(Object.create(null),e);for(const s in t)n[s]=vs(e[s],t[s]);return n}function z2(){return{app:null,config:{isNativeTag:n2,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 i4=0;function r4(e,t){return function(s,o=null){mt(s)||(s=Gt({},s)),o!=null&&!Ft(o)&&(o=null);const i=z2(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:i4++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:P4,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&mt(u.install)?(r.add(u),u.install(c,...d)):mt(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,p){if(!a){const m=c._ceVNode||pt(s,o);return m.appContext=i,p===!0?p="svg":p===!1&&(p=void 0),d&&t?t(m,u):e(m,u,p),a=!0,c._container=u,u.__vue_app__=c,cu(m.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Ao(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=il;il=c;try{return u()}finally{il=d}}};return c}}let il=null;function Xde(e,t,n=Tt){const s=ls(),o=Dn(t),i=Ns(t),r=V2(e,o),l=fA((a,c)=>{let u,d=Tt,p;return MA(()=>{const m=e[o];Kn(u,m)&&(u=m,c())}),{get(){return a(),n.get?n.get(u):u},set(m){const f=n.set?n.set(m):m;if(!Kn(f,u)&&!(d!==Tt&&Kn(m,d)))return;const v=s.vnode.props;v&&(t in v||o in v||i in v)&&(`onUpdate:${t}`in v||`onUpdate:${o}`in v||`onUpdate:${i}`in v)||(u=m,c()),s.emit(`update:${t}`,f),Kn(m,f)&&Kn(m,d)&&!Kn(f,p)&&c(),d=m,p=f}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Tt:l,done:!1}:{done:!0}}}},l}const V2=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Dn(t)}Modifiers`]||e[`${Ns(t)}Modifiers`];function l4(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Tt;let o=n;const i=t.startsWith("update:"),r=i&&V2(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>Xt(u)?u.trim():u)),r.number&&(o=n.map(nh)));let l,a=s[l=xd(t)]||s[l=xd(Dn(t))];!a&&i&&(a=s[l=xd(Ns(t))]),a&&Ao(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Ao(c,e,6,o)}}const a4=new WeakMap;function K2(e,t,n=!1){const s=n?a4:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!mt(e)){const a=c=>{const u=K2(c,t,!0);u&&(l=!0,Gt(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(Ft(e)&&s.set(e,null),null):(it(i)?i.forEach(a=>r[a]=null):Gt(r,i),Ft(e)&&s.set(e,r),r)}function fh(e,t){return!e||!ou(t)?!1:(t=t.slice(2).replace(/Once$/,""),Bt(e,t[0].toLowerCase()+t.slice(1))||Bt(e,Ns(t))||Bt(e,t))}function Td(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:p,setupState:m,ctx:f,inheritAttrs:v}=e,w=Bc(e);let b,_;try{if(n.shapeFlag&4){const y=o||s,k=y;b=Is(c.call(k,y,u,d,m,p,f)),_=l}else{const y=t;b=Is(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),_=t.props?l:u4(l)}}catch(y){bc.length=0,_a(y,e,1),b=pt(Mn)}let g=b;if(_&&v!==!1){const y=Object.keys(_),{shapeFlag:k}=g;y.length&&k&7&&(i&&y.some(Zf)&&(_=d4(_,i)),g=Ni(g,_,!1,!0))}return n.dirs&&(g=Ni(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition&&hr(g,n.transition),b=g,Bc(w),b}function c4(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(pr(o)){if(o.type!==Mn||o.children==="v-if"){if(n)return;n=o}}else return}return n}const u4=e=>{let t;for(const n in e)(n==="class"||n==="style"||ou(n))&&((t||(t={}))[n]=e[n]);return t},d4=(e,t)=>{const n={};for(const s in e)(!Zf(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function f4(e,t,n){const{props:s,children:o,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?Ny(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const p=u[d];if(G2(r,s,p)&&!fh(c,p))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?Ny(s,r,c):!0:!!r;return!1}function Ny(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(G2(t,e,i)&&!fh(n,i))return!0}return!1}function G2(e,t,n){const s=e[n],o=t[n];return n==="style"&&Ft(s)&&Ft(o)?!Ai(s,o):s!==o}function hh({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const Y2={},X2=()=>Object.create(Y2),Z2=e=>Object.getPrototypeOf(e)===Y2;function h4(e,t,n,s=!1){const o={},i=X2();e.propsDefaults=Object.create(null),Q2(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:aA(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function p4(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=$t(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let p=u[d];if(fh(e.emitsOptions,p))continue;const m=t[p];if(a)if(Bt(i,p))m!==i[p]&&(i[p]=m,c=!0);else{const f=Dn(p);o[f]=pg(a,l,f,m,e,!1)}else m!==i[p]&&(i[p]=m,c=!0)}}}else{Q2(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!Bt(t,d)&&((u=Ns(d))===d||!Bt(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=pg(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!Bt(t,d))&&(delete i[d],c=!0)}c&&bi(e.attrs,"set","")}function Q2(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(sl(a))continue;const c=t[a];let u;o&&Bt(o,u=Dn(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:fh(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=$t(n),c=l||Tt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=pg(o,a,d,c[d],e,!Bt(c,d))}}return r}function pg(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=Bt(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&mt(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=wa(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===Ns(n))&&(s=!0))}return s}const m4=new WeakMap;function J2(e,t,n=!1){const s=n?m4:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!mt(e)){const u=d=>{a=!0;const[p,m]=J2(d,t,!0);Gt(r,p),m&&l.push(...m)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return Ft(e)&&s.set(e,Xl),Xl;if(it(i))for(let u=0;u<i.length;u++){const d=Dn(i[u]);Ly(d)&&(r[d]=Tt)}else if(i)for(const u in i){const d=Dn(u);if(Ly(d)){const p=i[u],m=r[d]=it(p)||mt(p)?{type:p}:Gt({},p),f=m.type;let v=!1,w=!0;if(it(f))for(let b=0;b<f.length;++b){const _=f[b],g=mt(_)&&_.name;if(g==="Boolean"){v=!0;break}else g==="String"&&(w=!1)}else v=mt(f)&&f.name==="Boolean";m[0]=v,m[1]=w,(v||Bt(m,"default"))&&l.push(d)}}const c=[r,l];return Ft(e)&&s.set(e,c),c}function Ly(e){return e[0]!=="$"&&!sl(e)}const H1=e=>e==="_"||e==="_ctx"||e==="$stable",W1=e=>it(e)?e.map(Is):[Is(e)],g4=(e,t,n)=>{if(t._n)return t;const s=kn((...o)=>W1(t(...o)),n);return s._c=!1,s},eS=(e,t,n)=>{const s=e._ctx;for(const o in e){if(H1(o))continue;const i=e[o];if(mt(i))t[o]=g4(o,i,s);else if(i!=null){const r=W1(i);t[o]=()=>r}}},tS=(e,t)=>{const n=W1(t);e.slots.default=()=>n},nS=(e,t,n)=>{for(const s in t)(n||!H1(s))&&(e[s]=t[s])},v4=(e,t,n)=>{const s=e.slots=X2();if(e.vnode.shapeFlag&32){const o=t._;o?(nS(s,t,n),n&&o2(s,"_",o,!0)):eS(t,s)}else t&&tS(e,t)},y4=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Tt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:nS(o,t,n):(i=!t.$stable,eS(t,o)),r=t}else t&&(tS(e,t),r={default:1});if(i)for(const l in o)!H1(l)&&r[l]==null&&delete o[l]},Tn=aS;function k4(e){return sS(e)}function b4(e){return sS(e,PA)}function sS(e,t){const n=sh();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:p,setScopeId:m=xo,insertStaticContent:f}=e,v=(P,X,ne,se=null,ce=null,H=null,U=void 0,Q=null,ue=!!X.dynamicChildren)=>{if(P===X)return;P&&!Oo(P,X)&&(se=_e(P),be(P,ce,H,!0),P=null),X.patchFlag===-2&&(ue=!1,X.dynamicChildren=null);const{type:ge,ref:xe,shapeFlag:ie}=X;switch(ge){case cr:w(P,X,ne,se);break;case Mn:b(P,X,ne,se);break;case sa:P==null&&_(X,ne,se,U);break;case Ie:R(P,X,ne,se,ce,H,U,Q,ue);break;default:ie&1?k(P,X,ne,se,ce,H,U,Q,ue):ie&6?O(P,X,ne,se,ce,H,U,Q,ue):(ie&64||ie&128)&&ge.process(P,X,ne,se,ce,H,U,Q,ue,z)}xe!=null&&ce?ea(xe,P&&P.ref,H,X||P,!X):xe==null&&P&&P.ref!=null&&ea(P.ref,null,H,P,!0)},w=(P,X,ne,se)=>{if(P==null)s(X.el=l(X.children),ne,se);else{const ce=X.el=P.el;X.children!==P.children&&c(ce,X.children)}},b=(P,X,ne,se)=>{P==null?s(X.el=a(X.children||""),ne,se):X.el=P.el},_=(P,X,ne,se)=>{[P.el,P.anchor]=f(P.children,X,ne,se,P.el,P.anchor)},g=({el:P,anchor:X},ne,se)=>{let ce;for(;P&&P!==X;)ce=p(P),s(P,ne,se),P=ce;s(X,ne,se)},y=({el:P,anchor:X})=>{let ne;for(;P&&P!==X;)ne=p(P),o(P),P=ne;o(X)},k=(P,X,ne,se,ce,H,U,Q,ue)=>{if(X.type==="svg"?U="svg":X.type==="math"&&(U="mathml"),P==null)I(X,ne,se,ce,H,U,Q,ue);else{const ge=P.el&&P.el._isVueCE?P.el:null;try{ge&&ge._beginPatch(),T(P,X,ce,H,U,Q,ue)}finally{ge&&ge._endPatch()}}},I=(P,X,ne,se,ce,H,U,Q)=>{let ue,ge;const{props:xe,shapeFlag:ie,transition:we,dirs:je}=P;if(ue=P.el=r(P.type,H,xe&&xe.is,xe),ie&8?u(ue,P.children):ie&16&&S(P.children,ue,null,se,ce,tm(P,H),U,Q),je&&Qo(P,null,se,"created"),E(ue,P,P.scopeId,U,se),xe){for(const nt in xe)nt!=="value"&&!sl(nt)&&i(ue,nt,null,xe[nt],H,se);"value"in xe&&i(ue,"value",null,xe.value,H),(ge=xe.onVnodeBeforeMount)&&$s(ge,se,P)}je&&Qo(P,null,se,"beforeMount");const Je=oS(ce,we);Je&&we.beforeEnter(ue),s(ue,X,ne),((ge=xe&&xe.onVnodeMounted)||Je||je)&&Tn(()=>{try{ge&&$s(ge,se,P),Je&&we.enter(ue),je&&Qo(P,null,se,"mounted")}finally{}},ce)},E=(P,X,ne,se,ce)=>{if(ne&&m(P,ne),se)for(let H=0;H<se.length;H++)m(P,se[H]);if(ce){let H=ce.subTree;if(X===H||nf(H.type)&&(H.ssContent===X||H.ssFallback===X)){const U=ce.vnode;E(P,U,U.scopeId,U.slotScopeIds,ce.parent)}}},S=(P,X,ne,se,ce,H,U,Q,ue=0)=>{for(let ge=ue;ge<P.length;ge++){const xe=P[ge]=Q?ki(P[ge]):Is(P[ge]);v(null,xe,X,ne,se,ce,H,U,Q)}},T=(P,X,ne,se,ce,H,U)=>{const Q=X.el=P.el;let{patchFlag:ue,dynamicChildren:ge,dirs:xe}=X;ue|=P.patchFlag&16;const ie=P.props||Tt,we=X.props||Tt;let je;if(ne&&Ur(ne,!1),(je=we.onVnodeBeforeUpdate)&&$s(je,ne,X,P),xe&&Qo(X,P,ne,"beforeUpdate"),ne&&Ur(ne,!0),(ie.innerHTML&&we.innerHTML==null||ie.textContent&&we.textContent==null)&&u(Q,""),ge?$(P.dynamicChildren,ge,Q,ne,se,tm(X,ce),H):U||K(P,X,Q,null,ne,se,tm(X,ce),H,!1),ue>0){if(ue&16)L(Q,ie,we,ne,ce);else if(ue&2&&ie.class!==we.class&&i(Q,"class",null,we.class,ce),ue&4&&i(Q,"style",ie.style,we.style,ce),ue&8){const Je=X.dynamicProps;for(let nt=0;nt<Je.length;nt++){const Ve=Je[nt],ft=ie[Ve],xt=we[Ve];(xt!==ft||Ve==="value")&&i(Q,Ve,ft,xt,ce,ne)}}ue&1&&P.children!==X.children&&u(Q,X.children)}else!U&&ge==null&&L(Q,ie,we,ne,ce);((je=we.onVnodeUpdated)||xe)&&Tn(()=>{je&&$s(je,ne,X,P),xe&&Qo(X,P,ne,"updated")},se)},$=(P,X,ne,se,ce,H,U)=>{for(let Q=0;Q<X.length;Q++){const ue=P[Q],ge=X[Q],xe=ue.el&&(ue.type===Ie||!Oo(ue,ge)||ue.shapeFlag&198)?d(ue.el):ne;v(ue,ge,xe,null,se,ce,H,U,!0)}},L=(P,X,ne,se,ce)=>{if(X!==ne){if(X!==Tt)for(const H in X)!sl(H)&&!(H in ne)&&i(P,H,X[H],null,ce,se);for(const H in ne){if(sl(H))continue;const U=ne[H],Q=X[H];U!==Q&&H!=="value"&&i(P,H,Q,U,ce,se)}"value"in ne&&i(P,"value",X.value,ne.value,ce)}},R=(P,X,ne,se,ce,H,U,Q,ue)=>{const ge=X.el=P?P.el:l(""),xe=X.anchor=P?P.anchor:l("");let{patchFlag:ie,dynamicChildren:we,slotScopeIds:je}=X;je&&(Q=Q?Q.concat(je):je),P==null?(s(ge,ne,se),s(xe,ne,se),S(X.children||[],ne,xe,ce,H,U,Q,ue)):ie>0&&ie&64&&we&&P.dynamicChildren&&P.dynamicChildren.length===we.length?($(P.dynamicChildren,we,ne,ce,H,U,Q),(X.key!=null||ce&&X===ce.subTree)&&U1(P,X,!0)):K(P,X,ne,xe,ce,H,U,Q,ue)},O=(P,X,ne,se,ce,H,U,Q,ue)=>{X.slotScopeIds=Q,P==null?X.shapeFlag&512?ce.ctx.activate(X,ne,se,U,ue):B(X,ne,se,ce,H,U,ue):F(P,X,ue)},B=(P,X,ne,se,ce,H,U)=>{const Q=P.component=fS(P,se,ce);if(lu(P)&&(Q.ctx.renderer=z),pS(Q,!1,U),Q.asyncDep){if(ce&&ce.registerDep(Q,q,U),!P.el){const ue=Q.subTree=pt(Mn);b(null,ue,X,ne),P.placeholder=ue.el}}else q(Q,P,X,ne,ce,H,U)},F=(P,X,ne)=>{const se=X.component=P.component;if(f4(P,X,ne))if(se.asyncDep&&!se.asyncResolved){G(se,X,ne);return}else se.next=X,se.update();else X.el=P.el,se.vnode=X},q=(P,X,ne,se,ce,H,U)=>{const Q=()=>{if(P.isMounted){let{next:ie,bu:we,u:je,parent:Je,vnode:nt}=P;{const Ht=iS(P);if(Ht){ie&&(ie.el=nt.el,G(P,ie,U)),Ht.asyncDep.then(()=>{Tn(()=>{P.isUnmounted||ge()},ce)});return}}let Ve=ie,ft;Ur(P,!1),ie?(ie.el=nt.el,G(P,ie,U)):ie=nt,we&&Ql(we),(ft=ie.props&&ie.props.onVnodeBeforeUpdate)&&$s(ft,Je,ie,nt),Ur(P,!0);const xt=Td(P),Zt=P.subTree;P.subTree=xt,v(Zt,xt,d(Zt.el),_e(Zt),P,ce,H),ie.el=xt.el,Ve===null&&hh(P,xt.el),je&&Tn(je,ce),(ft=ie.props&&ie.props.onVnodeUpdated)&&Tn(()=>$s(ft,Je,ie,nt),ce)}else{let ie;const{el:we,props:je}=X,{bm:Je,m:nt,parent:Ve,root:ft,type:xt}=P,Zt=xi(X);if(Ur(P,!1),Je&&Ql(Je),!Zt&&(ie=je&&je.onVnodeBeforeMount)&&$s(ie,Ve,X),Ur(P,!0),we&&fe){const Ht=()=>{P.subTree=Td(P),fe(we,P.subTree,P,ce,null)};Zt&&xt.__asyncHydrate?xt.__asyncHydrate(we,P,Ht):Ht()}else{ft.ce&&ft.ce._hasShadowRoot()&&ft.ce._injectChildStyle(xt,P.parent?P.parent.type:void 0);const Ht=P.subTree=Td(P);v(null,Ht,ne,se,P,ce,H),X.el=Ht.el}if(nt&&Tn(nt,ce),!Zt&&(ie=je&&je.onVnodeMounted)){const Ht=X;Tn(()=>$s(ie,Ve,Ht),ce)}(X.shapeFlag&256||Ve&&xi(Ve.vnode)&&Ve.vnode.shapeFlag&256)&&P.a&&Tn(P.a,ce),P.isMounted=!0,X=ne=se=null}};P.scope.on();const ue=P.effect=new Vd(Q);P.scope.off();const ge=P.update=ue.run.bind(ue),xe=P.job=ue.runIfDirty.bind(ue);xe.i=P,xe.id=P.uid,ue.scheduler=()=>N1(xe),Ur(P,!0),ge()},G=(P,X,ne)=>{X.component=P;const se=P.vnode.props;P.vnode=X,P.next=null,p4(P,X.props,se,ne),y4(P,X.children,ne),Ei(),by(P),$i()},K=(P,X,ne,se,ce,H,U,Q,ue=!1)=>{const ge=P&&P.children,xe=P?P.shapeFlag:0,ie=X.children,{patchFlag:we,shapeFlag:je}=X;if(we>0){if(we&128){le(ge,ie,ne,se,ce,H,U,Q,ue);return}else if(we&256){oe(ge,ie,ne,se,ce,H,U,Q,ue);return}}je&8?(xe&16&&me(ge,ce,H),ie!==ge&&u(ne,ie)):xe&16?je&16?le(ge,ie,ne,se,ce,H,U,Q,ue):me(ge,ce,H,!0):(xe&8&&u(ne,""),je&16&&S(ie,ne,se,ce,H,U,Q,ue))},oe=(P,X,ne,se,ce,H,U,Q,ue)=>{P=P||Xl,X=X||Xl;const ge=P.length,xe=X.length,ie=Math.min(ge,xe);let we;for(we=0;we<ie;we++){const je=X[we]=ue?ki(X[we]):Is(X[we]);v(P[we],je,ne,null,ce,H,U,Q,ue)}ge>xe?me(P,ce,H,!0,!1,ie):S(X,ne,se,ce,H,U,Q,ue,ie)},le=(P,X,ne,se,ce,H,U,Q,ue)=>{let ge=0;const xe=X.length;let ie=P.length-1,we=xe-1;for(;ge<=ie&&ge<=we;){const je=P[ge],Je=X[ge]=ue?ki(X[ge]):Is(X[ge]);if(Oo(je,Je))v(je,Je,ne,null,ce,H,U,Q,ue);else break;ge++}for(;ge<=ie&&ge<=we;){const je=P[ie],Je=X[we]=ue?ki(X[we]):Is(X[we]);if(Oo(je,Je))v(je,Je,ne,null,ce,H,U,Q,ue);else break;ie--,we--}if(ge>ie){if(ge<=we){const je=we+1,Je=je<xe?X[je].el:se;for(;ge<=we;)v(null,X[ge]=ue?ki(X[ge]):Is(X[ge]),ne,Je,ce,H,U,Q,ue),ge++}}else if(ge>we)for(;ge<=ie;)be(P[ge],ce,H,!0),ge++;else{const je=ge,Je=ge,nt=new Map;for(ge=Je;ge<=we;ge++){const Ke=X[ge]=ue?ki(X[ge]):Is(X[ge]);Ke.key!=null&&nt.set(Ke.key,ge)}let Ve,ft=0;const xt=we-Je+1;let Zt=!1,Ht=0;const Nn=new Array(xt);for(ge=0;ge<xt;ge++)Nn[ge]=0;for(ge=je;ge<=ie;ge++){const Ke=P[ge];if(ft>=xt){be(Ke,ce,H,!0);continue}let en;if(Ke.key!=null)en=nt.get(Ke.key);else for(Ve=Je;Ve<=we;Ve++)if(Nn[Ve-Je]===0&&Oo(Ke,X[Ve])){en=Ve;break}en===void 0?be(Ke,ce,H,!0):(Nn[en-Je]=ge+1,en>=Ht?Ht=en:Zt=!0,v(Ke,X[en],ne,null,ce,H,U,Q,ue),ft++)}const xn=Zt?_4(Nn):Xl;for(Ve=xn.length-1,ge=xt-1;ge>=0;ge--){const Ke=Je+ge,en=X[Ke],Hs=X[Ke+1],qn=Ke+1<xe?Hs.el||rS(Hs):se;Nn[ge]===0?v(null,en,ne,qn,ce,H,U,Q,ue):Zt&&(Ve<0||ge!==xn[Ve]?pe(en,ne,qn,2):Ve--)}}},pe=(P,X,ne,se,ce=null)=>{const{el:H,type:U,transition:Q,children:ue,shapeFlag:ge}=P;if(ge&6){pe(P.component.subTree,X,ne,se);return}if(ge&128){P.suspense.move(X,ne,se);return}if(ge&64){U.move(P,X,ne,z);return}if(U===Ie){s(H,X,ne);for(let ie=0;ie<ue.length;ie++)pe(ue[ie],X,ne,se);s(P.anchor,X,ne);return}if(U===sa){g(P,X,ne);return}if(se!==2&&ge&1&&Q)if(se===0)Q.persisted&&!H[yo]?s(H,X,ne):(Q.beforeEnter(H),s(H,X,ne),Tn(()=>Q.enter(H),ce));else{const{leave:ie,delayLeave:we,afterLeave:je}=Q,Je=()=>{P.ctx.isUnmounted?o(H):s(H,X,ne)},nt=()=>{const Ve=H._isLeaving||!!H[yo];H._isLeaving&&H[yo](!0),Q.persisted&&!Ve?Je():ie(H,()=>{Je(),je&&je()})};we?we(H,Je,nt):nt()}else s(H,X,ne)},be=(P,X,ne,se=!1,ce=!1)=>{const{type:H,props:U,ref:Q,children:ue,dynamicChildren:ge,shapeFlag:xe,patchFlag:ie,dirs:we,cacheIndex:je,memo:Je}=P;if(ie===-2&&(ce=!1),Q!=null&&(Ei(),ea(Q,null,ne,P,!0),$i()),je!=null&&(X.renderCache[je]=void 0),xe&256){X.ctx.deactivate(P);return}const nt=xe&1&&we,Ve=!xi(P);let ft;if(Ve&&(ft=U&&U.onVnodeBeforeUnmount)&&$s(ft,X,P),xe&6)Ne(P.component,ne,se);else{if(xe&128){P.suspense.unmount(ne,se);return}nt&&Qo(P,null,X,"beforeUnmount"),xe&64?P.type.remove(P,X,ne,z,se):ge&&!ge.hasOnce&&(H!==Ie||ie>0&&ie&64)?me(ge,X,ne,!1,!0):(H===Ie&&ie&384||!ce&&xe&16)&&me(ue,X,ne),se&&Be(P)}const xt=Je!=null&&je==null;(Ve&&(ft=U&&U.onVnodeUnmounted)||nt||xt)&&Tn(()=>{ft&&$s(ft,X,P),nt&&Qo(P,null,X,"unmounted"),xt&&(P.el=null)},ne)},Be=P=>{const{type:X,el:ne,anchor:se,transition:ce}=P;if(X===Ie){He(ne,se);return}if(X===sa){y(P);return}const H=()=>{o(ne),ce&&!ce.persisted&&ce.afterLeave&&ce.afterLeave()};if(P.shapeFlag&1&&ce&&!ce.persisted){const{leave:U,delayLeave:Q}=ce,ue=()=>U(ne,H);Q?Q(P.el,H,ue):ue()}else H()},He=(P,X)=>{let ne;for(;P!==X;)ne=p(P),o(P),P=ne;o(X)},Ne=(P,X,ne)=>{const{bum:se,scope:ce,job:H,subTree:U,um:Q,m:ue,a:ge}=P;tf(ue),tf(ge),se&&Ql(se),ce.stop(),H&&(H.flags|=8,be(U,P,X,ne)),Q&&Tn(Q,X),Tn(()=>{P.isUnmounted=!0},X)},me=(P,X,ne,se=!1,ce=!1,H=0)=>{for(let U=H;U<P.length;U++)be(P[U],X,ne,se,ce)},_e=P=>{if(P.shapeFlag&6)return _e(P.component.subTree);if(P.shapeFlag&128)return P.suspense.next();const X=p(P.anchor||P.el),ne=X&&X[L2];return ne?p(ne):X};let Ce=!1;const de=(P,X,ne)=>{let se;P==null?X._vnode&&(be(X._vnode,null,null,!0),se=X._vnode.component):v(X._vnode||null,P,X,null,null,null,ne),X._vnode=P,Ce||(Ce=!0,by(se),Qd(),Ce=!1)},z={p:v,um:be,m:pe,r:Be,mt:B,mc:S,pc:K,pbc:$,n:_e,o:e};let Z,fe;return t&&([Z,fe]=t(z)),{render:de,hydrate:Z,createApp:r4(de,Z)}}function tm({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 Ur({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function oS(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function U1(e,t,n=!1){const s=e.children,o=t.children;if(it(s)&&it(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=ki(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&U1(r,l)),l.type===cr&&(l.patchFlag===-1&&(l=o[i]=ki(l)),l.el=r.el),l.type===Mn&&!l.el&&(l.el=r.el)}}function _4(e){const t=e.slice(),n=[0];let s,o,i,r,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function iS(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:iS(t)}function tf(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function rS(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?rS(t.subTree):null}const nf=e=>e.__isSuspense;let mg=0;const w4={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)S4(t,n,s,o,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}C4(e,t,n,s,o,r,l,a,c)}},hydrate:x4,normalize:T4},Zde=w4;function Wc(e,t){const n=e.props&&e.props[t];mt(n)&&n()}function S4(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),p=e.suspense=lS(e,o,s,t,d,n,i,r,l,a);c(null,p.pendingBranch=e.ssContent,d,null,s,p,i,r),p.deps>0?(Wc(e,"onPending"),Wc(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),na(p,e.ssFallback)):p.resolve(!1,!0)}function C4(e,t,n,s,o,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const p=t.ssContent,m=t.ssFallback,{activeBranch:f,pendingBranch:v,isInFallback:w,isHydrating:b}=d;if(v)d.pendingBranch=p,Oo(v,p)?(a(v,p,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():w&&(b||(a(f,m,n,s,o,null,i,r,l),na(d,m)))):(d.pendingId=mg++,b?(d.isHydrating=!1,d.activeBranch=v):c(v,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),w?(a(null,p,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(f,m,n,s,o,null,i,r,l),na(d,m))):f&&Oo(f,p)?(a(f,p,n,s,o,d,i,r,l),d.resolve(!0)):(a(null,p,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0&&d.resolve()));else if(f&&Oo(f,p))a(f,p,n,s,o,d,i,r,l),na(d,p);else if(Wc(t,"onPending"),d.pendingBranch=p,p.shapeFlag&512?d.pendingId=p.component.suspenseId:d.pendingId=mg++,a(null,p,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:_,pendingId:g}=d;_>0?setTimeout(()=>{d.pendingId===g&&d.fallback(m)},_):_===0&&d.fallback(m)}}function lS(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:p,um:m,n:f,o:{parentNode:v,remove:w}}=c;let b;const _=M4(e);_&&t&&t.pendingBranch&&(b=t.pendingId,t.deps++);const g=e.props?zd(e.props.timeout):void 0,y=i,k={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:mg++,timeout:typeof g=="number"?g:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(I=!1,E=!1){const{vnode:S,activeBranch:T,pendingBranch:$,pendingId:L,effects:R,parentComponent:O,container:B,isInFallback:F}=k;let q=!1;if(k.isHydrating)k.isHydrating=!1;else if(!I){q=T&&$.transition&&$.transition.mode==="out-in";let oe=!1;q&&(T.transition.afterLeave=()=>{L===k.pendingId&&(p($,B,i===y&&!oe?f(T):i,0),Zd(R),F&&S.ssFallback&&(S.ssFallback.el=null))}),T&&!k.isFallbackMountPending&&(v(T.el)===B&&(i=f(T),oe=!0),m(T,O,k,!0),!q&&F&&S.ssFallback&&Tn(()=>S.ssFallback.el=null,k)),q||p($,B,i,0)}k.isFallbackMountPending=!1,na(k,$),k.pendingBranch=null,k.isInFallback=!1;let G=k.parent,K=!1;for(;G;){if(G.pendingBranch){G.effects.push(...R),K=!0;break}G=G.parent}!K&&!q&&Zd(R),k.effects=[],_&&t&&t.pendingBranch&&b===t.pendingId&&(t.deps--,t.deps===0&&!E&&t.resolve()),Wc(S,"onResolve")},fallback(I){if(!k.pendingBranch)return;const{vnode:E,activeBranch:S,parentComponent:T,container:$,namespace:L}=k;Wc(E,"onFallback");const R=f(S),O=()=>{k.isFallbackMountPending=!1,k.isInFallback&&(d(null,I,$,R,T,null,L,l,a),na(k,I))},B=I.transition&&I.transition.mode==="out-in";B&&(k.isFallbackMountPending=!0,S.transition.afterLeave=O),k.isInFallback=!0,m(S,T,null,!0),B||O()},move(I,E,S){k.activeBranch&&p(k.activeBranch,I,E,S),k.container=I},next(){return k.activeBranch&&f(k.activeBranch)},registerDep(I,E,S){const T=!!k.pendingBranch;T&&k.deps++;const $=I.vnode.el;I.asyncDep.catch(L=>{_a(L,I,0)}).then(L=>{if(I.isUnmounted||k.isUnmounted||k.pendingId!==I.suspenseId)return;Uc(),I.asyncResolved=!0;const{vnode:R}=I;gg(I,L,!1),$&&(R.el=$);const O=!$&&I.subTree.el;E(I,R,v($||I.subTree.el),$?null:f(I.subTree),k,r,S),O&&(R.placeholder=null,w(O)),hh(I,R.el),T&&--k.deps===0&&k.resolve()})},unmount(I,E){k.isUnmounted=!0,k.activeBranch&&m(k.activeBranch,n,I,E),k.pendingBranch&&m(k.pendingBranch,n,I,E)}};return k}function x4(e,t,n,s,o,i,r,l,a){const c=t.suspense=lS(t,s,n,e.parentNode,document.createElement("div"),null,o,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function T4(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=Oy(s?n.default:n),e.ssFallback=s?Oy(n.fallback):pt(Mn)}function Oy(e){let t;if(mt(e)){const n=al&&e._c;n&&(e._d=!1,C()),e=e(),n&&(e._d=!0,t=is,cS())}return it(e)&&(e=c4(e)),e=Is(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function aS(e,t){t&&t.pendingBranch?it(e)?t.effects.push(...e):t.effects.push(e):Zd(e)}function na(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,s&&s.subTree===n&&(s.vnode.el=o,hh(s,o))}function M4(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Ie=Symbol.for("v-fgt"),cr=Symbol.for("v-txt"),Mn=Symbol.for("v-cmt"),sa=Symbol.for("v-stc"),bc=[];let is=null;function C(e=!1){bc.push(is=e?null:[])}function cS(){bc.pop(),is=bc[bc.length-1]||null}let al=1;function sf(e,t=!1){al+=e,e<0&&is&&t&&(is.hasOnce=!0)}function uS(e){return e.dynamicChildren=al>0?is||Xl:null,cS(),al>0&&is&&is.push(e),e}function A(e,t,n,s,o,i){return uS(h(e,t,n,s,o,i,!0))}function qe(e,t,n,s,o){return uS(pt(e,t,n,s,o,!0))}function pr(e){return e?e.__v_isVNode===!0:!1}function Oo(e,t){return e.type===t.type&&e.key===t.key}function Qde(e){}const dS=({key:e})=>e??null,Md=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Xt(e)||En(e)||mt(e)?{i:Xn,r:e,k:t,f:!!n}:e:null);function h(e,t=null,n=null,s=0,o=null,i=e===Ie?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&dS(t),ref:t&&Md(t),scopeId:uh,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:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Xn};return l?(q1(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Xt(n)?8:16),al>0&&!r&&is&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&is.push(a),a}const pt=A4;function A4(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===U2)&&(e=Mn),pr(e)){const l=Ni(e,t,!0);return n&&q1(l,n),al>0&&!i&&is&&(l.shapeFlag&6?is[is.indexOf(e)]=l:is.push(l)),l.patchFlag=-2,l}if(O4(e)&&(e=e.__vccOpts),t){t=E4(t);let{class:l,style:a}=t;l&&!Xt(l)&&(t.class=$e(l)),Ft(a)&&(ch(a)&&!it(a)&&(a=Gt({},a)),t.style=It(a))}const r=Xt(e)?1:nf(e)?128:O2(e)?64:Ft(e)?4:mt(e)?2:0;return h(e,t,n,s,o,r,i,!0)}function E4(e){return e?ch(e)||Z2(e)?Gt({},e):e:null}function Ni(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?Kt(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&dS(c),ref:t&&t.ref?n&&i?it(i)?i.concat(Md(t)):[i,Md(t)]:Md(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ie?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ni(e.ssContent),ssFallback:e.ssFallback&&Ni(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&hr(u,a.clone(u)),u}function dt(e=" ",t=0){return pt(cr,null,e,t)}function mr(e,t){const n=pt(sa,null,e);return n.staticCount=t,n}function re(e="",t=!1){return t?(C(),qe(Mn,null,e)):pt(Mn,null,e)}function Is(e){return e==null||typeof e=="boolean"?pt(Mn):it(e)?pt(Ie,null,e.slice()):pr(e)?ki(e):pt(cr,null,String(e))}function ki(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ni(e)}function q1(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(it(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),q1(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Z2(t)?t._ctx=Xn:o===3&&Xn&&(Xn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else mt(t)?(t={default:t,_ctx:Xn},n=32):(t=String(t),s&64?(n=16,t=[dt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Kt(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=$e([t.class,s.class]));else if(o==="style")t.style=It([t.style,s.style]);else if(ou(o)){const i=t[o],r=s[o];r&&i!==r&&!(it(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Zf(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function $s(e,t,n,s=null){Ao(e,t,7,[n,s])}const $4=z2();let I4=0;function fS(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||$4,i={uid:I4++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new a2(!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:J2(s,o),emitsOptions:K2(s,o),emit:null,emitted:null,propsDefaults:Tt,inheritAttrs:s.inheritAttrs,ctx:Tt,data:Tt,props:Tt,attrs:Tt,slots:Tt,refs:Tt,setupState:Tt,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 i.ctx={_:i},i.root=t?t.root:i,i.emit=l4.bind(null,i),e.ce&&e.ce(i),i}let Gn=null;const ls=()=>Gn||Xn;let of,oa;{const e=sh(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};of=t("__VUE_INSTANCE_SETTERS__",n=>Gn=n),oa=t("__VUE_SSR_SETTERS__",n=>cl=n)}const wa=e=>{const t=Gn;return of(e),e.scope.on(),()=>{e.scope.off(),of(t)}},Uc=()=>{Gn&&Gn.scope.off(),of(null)};function hS(e){return e.vnode.shapeFlag&4}let cl=!1;function pS(e,t=!1,n=!1){t&&oa(t);const{props:s,children:o}=e.vnode,i=hS(e);h4(e,s,i,t),v4(e,o,n||t);const r=i?N4(e,t):void 0;return t&&oa(!1),r}function N4(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,dg);const{setup:s}=n;if(s){Ei();const o=e.setupContext=s.length>1?gS(e):null,i=wa(e),r=iu(s,e,0,[e.props,o]),l=T1(r);if($i(),i(),(l||e.sp)&&!xi(e)&&O1(e),l){if(r.then(Uc,Uc),t)return r.then(a=>{gg(e,a,t)}).catch(a=>{_a(a,e,0)});e.asyncDep=r}else gg(e,r,t)}else mS(e,t)}function gg(e,t,n){mt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ft(t)&&(e.setupState=x2(t)),mS(e,n)}let rf,vg;function Jde(e){rf=e,vg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,JA))}}const efe=()=>!rf;function mS(e,t,n){const s=e.type;if(!e.render){if(!t&&rf&&!s.render){const o=s.template||F1(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=Gt(Gt({isCustomElement:i,delimiters:l},r),a);s.render=rf(o,c)}}e.render=s.render||xo,vg&&vg(e)}{const o=wa(e);Ei();try{e4(e)}finally{$i(),o()}}}const L4={get(e,t){return ss(e,"get",""),e[t]}};function gS(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,L4),slots:e.slots,emit:e.emit,expose:t}}function cu(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(x2(ir(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in kc)return kc[n](e)},has(t,n){return n in t||n in kc}})):e.proxy}function yg(e,t=!0){return mt(e)?e.displayName||e.name:e.name||t&&e.__name}function O4(e){return mt(e)&&"__vccOpts"in e}const j=(e,t)=>gA(e,t,cl);function Ut(e,t,n){try{sf(-1);const s=arguments.length;return s===2?Ft(t)&&!it(t)?pr(t)?pt(e,null,[t]):pt(e,t):pt(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&pr(n)&&(n=[n]),pt(e,t,n))}finally{sf(1)}}function tfe(){}function nfe(e,t,n,s){const o=n[s];if(o&&R4(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function R4(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(Kn(n[s],t[s]))return!1;return al>0&&is&&is.push(e),!0}const P4="3.5.35",sfe=xo,ofe=_A,ife=ql,rfe=I2,D4={createComponentInstance:fS,setupComponent:pS,renderComponentRoot:Td,setCurrentRenderingInstance:Bc,isVNode:pr,normalizeVNode:Is,getComponentPublicInstance:cu,ensureValidVNode:B1,pushWarningContext:kA,popWarningContext:bA},lfe=D4,afe=null,cfe=null,ufe=null;/**
|
|
17
|
+
* @vue/runtime-dom v3.5.35
|
|
18
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
+
* @license MIT
|
|
20
|
+
**/let kg;const Ry=typeof window<"u"&&window.trustedTypes;if(Ry)try{kg=Ry.createPolicy("vue",{createHTML:e=>e})}catch{}const vS=kg?e=>kg.createHTML(e):e=>e,B4="http://www.w3.org/2000/svg",F4="http://www.w3.org/1998/Math/MathML",vi=typeof document<"u"?document:null,Py=vi&&vi.createElement("template"),H4={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?vi.createElementNS(B4,e):t==="mathml"?vi.createElementNS(F4,e):n?vi.createElement(e,{is:n}):vi.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>vi.createTextNode(e),createComment:e=>vi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>vi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{Py.innerHTML=vS(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Py.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Vi="transition",Qa="animation",pa=Symbol("_vtc"),yS={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},kS=Gt({},P2,yS),W4=e=>(e.displayName="Transition",e.props=kS,e),Ti=W4((e,{slots:t})=>Ut(LA,bS(e),t)),qr=(e,t=[])=>{it(e)?e.forEach(n=>n(...t)):e&&e(...t)},Dy=e=>e?it(e)?e.some(t=>t.length>1):e.length>1:!1;function bS(e){const t={};for(const R in e)R in yS||(t[R]=e[R]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,f=U4(o),v=f&&f[0],w=f&&f[1],{onBeforeEnter:b,onEnter:_,onEnterCancelled:g,onLeave:y,onLeaveCancelled:k,onBeforeAppear:I=b,onAppear:E=_,onAppearCancelled:S=g}=t,T=(R,O,B,F)=>{R._enterCancelled=F,Ji(R,O?u:l),Ji(R,O?c:r),B&&B()},$=(R,O)=>{R._isLeaving=!1,Ji(R,d),Ji(R,m),Ji(R,p),O&&O()},L=R=>(O,B)=>{const F=R?E:_,q=()=>T(O,R,B);qr(F,[O,q]),By(()=>{Ji(O,R?a:i),Yo(O,R?u:l),Dy(F)||Fy(O,s,v,q)})};return Gt(t,{onBeforeEnter(R){qr(b,[R]),Yo(R,i),Yo(R,r)},onBeforeAppear(R){qr(I,[R]),Yo(R,a),Yo(R,c)},onEnter:L(!1),onAppear:L(!0),onLeave(R,O){R._isLeaving=!0;const B=()=>$(R,O);Yo(R,d),R._enterCancelled?(Yo(R,p),bg(R)):(bg(R),Yo(R,p)),By(()=>{R._isLeaving&&(Ji(R,d),Yo(R,m),Dy(y)||Fy(R,s,w,B))}),qr(y,[R,B])},onEnterCancelled(R){T(R,!1,void 0,!0),qr(g,[R])},onAppearCancelled(R){T(R,!0,void 0,!0),qr(S,[R])},onLeaveCancelled(R){$(R),qr(k,[R])}})}function U4(e){if(e==null)return null;if(Ft(e))return[nm(e.enter),nm(e.leave)];{const t=nm(e);return[t,t]}}function nm(e){return zd(e)}function Yo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[pa]||(e[pa]=new Set)).add(t)}function Ji(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[pa];n&&(n.delete(t),n.size||(e[pa]=void 0))}function By(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let q4=0;function Fy(e,t,n,s){const o=e._endId=++q4,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=_S(e,t);if(!r)return s();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,p),i()},p=m=>{m.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,p)}function _S(e,t){const n=window.getComputedStyle(e),s=f=>(n[f]||"").split(", "),o=s(`${Vi}Delay`),i=s(`${Vi}Duration`),r=Hy(o,i),l=s(`${Qa}Delay`),a=s(`${Qa}Duration`),c=Hy(l,a);let u=null,d=0,p=0;t===Vi?r>0&&(u=Vi,d=r,p=i.length):t===Qa?c>0&&(u=Qa,d=c,p=a.length):(d=Math.max(r,c),u=d>0?r>c?Vi:Qa:null,p=u?u===Vi?i.length:a.length:0);const m=u===Vi&&/\b(?:transform|all)(?:,|$)/.test(s(`${Vi}Property`).toString());return{type:u,timeout:d,propCount:p,hasTransform:m}}function Hy(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Wy(n)+Wy(e[s])))}function Wy(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function bg(e){return(e?e.ownerDocument:document).body.offsetHeight}function j4(e,t,n){const s=e[pa];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const lf=Symbol("_vod"),wS=Symbol("_vsh"),Ro={name:"show",beforeMount(e,{value:t},{transition:n}){e[lf]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Ja(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),Ja(e,!0),s.enter(e)):s.leave(e,()=>{Ja(e,!1)}):Ja(e,t))},beforeUnmount(e,{value:t}){Ja(e,t)}};function Ja(e,t){e.style.display=t?e[lf]:"none",e[wS]=!t}function z4(){Ro.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const SS=Symbol("");function dfe(e){const t=ls();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>af(i,o))},s=()=>{const o=e(t.proxy);t.ce?af(t.ce,o):_g(t.subTree,o),n(o)};W2(()=>{Zd(s)}),Jt(()=>{ze(s,xo,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),qt(()=>o.disconnect())})}function _g(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{_g(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)af(e.el,t);else if(e.type===Ie)e.children.forEach(n=>_g(n,t));else if(e.type===sa){let{el:n,anchor:s}=e;for(;n&&(af(n,t),n!==s);)n=n.nextSibling}}function af(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=UM(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[SS]=s}}const V4=/(?:^|;)\s*display\s*:/;function K4(e,t,n){const s=e.style,o=Xt(n);let i=!1;if(n&&!o){if(t)if(Xt(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&uc(s,l,"")}else for(const r in t)n[r]==null&&uc(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?Y4(e,r,!Xt(t)&&t?t[r]:void 0,l)||uc(s,r,l):uc(s,r,"")}}else if(o){if(t!==n){const r=s[SS];r&&(n+=";"+r),s.cssText=n,i=V4.test(n)}}else t&&e.removeAttribute("style");lf in e&&(e[lf]=i?s.display:"",e[wS]&&(s.display="none"))}const Uy=/\s*!important$/;function uc(e,t,n){if(it(n))n.forEach(s=>uc(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=G4(e,t);Uy.test(n)?e.setProperty(Ns(s),n.replace(Uy,""),"important"):e[s]=n}}const qy=["Webkit","Moz","ms"],sm={};function G4(e,t){const n=sm[t];if(n)return n;let s=Dn(t);if(s!=="filter"&&s in e)return sm[t]=s;s=th(s);for(let o=0;o<qy.length;o++){const i=qy[o]+s;if(i in e)return sm[t]=i}return t}function Y4(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Xt(s)&&n===s}const jy="http://www.w3.org/1999/xlink";function zy(e,t,n,s,o,i=HM(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(jy,t.slice(6,t.length)):e.setAttributeNS(jy,t,n):n==null||i&&!i2(n)?e.removeAttribute(t):e.setAttribute(t,i?"":so(n)?String(n):n)}function Vy(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?vS(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let r=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=i2(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function wi(e,t,n,s){e.addEventListener(t,n,s)}function X4(e,t,n,s){e.removeEventListener(t,n,s)}const Ky=Symbol("_vei");function Z4(e,t,n,s,o=null){const i=e[Ky]||(e[Ky]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=Q4(t);if(s){const c=i[t]=tE(s,o);wi(e,l,c,a)}else r&&(X4(e,l,r,a),i[t]=void 0)}}const Gy=/(?:Once|Passive|Capture)$/;function Q4(e){let t;if(Gy.test(e)){t={};let s;for(;s=e.match(Gy);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ns(e.slice(2)),t]}let om=0;const J4=Promise.resolve(),eE=()=>om||(J4.then(()=>om=0),om=Date.now());function tE(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(it(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&Ao(c,t,5,l)}}else Ao(o,t,5,[s])};return n.value=e,n.attached=eE(),n}const Yy=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,nE=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?j4(e,s,r):t==="style"?K4(e,n,s):ou(t)?Zf(t)||Z4(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):sE(e,t,s,r))?(Vy(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&zy(e,t,s,r,i,t!=="value")):e._isVueCE&&(oE(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Xt(s)))?Vy(e,Dn(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),zy(e,t,s,r))};function sE(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Yy(t)&&mt(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 Yy(t)&&Xt(n)?!1:t in e}function oE(e,t){const n=e._def.props;if(!n)return!1;const s=Dn(t);return Array.isArray(n)?n.some(o=>Dn(o)===s):Object.keys(n).some(o=>Dn(o)===s)}const Xy={};function iE(e,t,n){let s=Xe(e,t);Qf(s)&&(s=Gt({},s,t));class o extends j1{constructor(r){super(s,r,n)}}return o.def=s,o}const ffe=((e,t)=>iE(e,t,_E)),rE=typeof HTMLElement<"u"?HTMLElement:class{};class j1 extends rE{constructor(t,n={},s=ff){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&s!==ff?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Gt({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof j1){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,ut(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!it(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=zd(this._props[a])),(l||(l=Object.create(null)))[Dn(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)Bt(this,s)||Object.defineProperty(this,s,{get:()=>M(n[s])})}_resolveProps(t){const{props:n}=t,s=it(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(Dn))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(i){this._setProp(o,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):Xy;const o=Dn(t);n&&this._numberProps&&this._numberProps[o]&&(s=zd(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Xy?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Ns(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Ns(t),n+""):n||this.removeAttribute(Ns(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),bE(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=pt(this._def,Gt(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,Qf(r[0])?Gt({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),Ns(i)!==i&&o(Ns(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function lE(e){const t=ls(),n=t&&t.ce;return n||null}function hfe(){const e=lE();return e&&e.shadowRoot}function pfe(e="$style"){{const t=ls();if(!t)return Tt;const n=t.type.__cssModules;if(!n)return Tt;const s=n[e];return s||Tt}}const CS=new WeakMap,xS=new WeakMap,cf=Symbol("_moveCb"),Zy=Symbol("_enterCb"),aE=e=>(delete e.props.mode,e),cE=aE({name:"TransitionGroup",props:Gt({},kS,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ls(),s=R2();let o,i;return R1(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!hE(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(uE),o.forEach(dE);const l=o.filter(fE);bg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Yo(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[cf]=p=>{p&&p.target!==c||(!p||p.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[cf]=null,Ji(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=$t(e),l=bS(r);let a=r.tag||Ie;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),hr(u,Fc(u,l,s,n)),CS.set(u,TS(u.el)))}i=t.default?L1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&hr(u,Fc(u,l,s,n))}return pt(a,null,i)}}}),mfe=cE;function uE(e){const t=e.el;t[cf]&&t[cf](),t[Zy]&&t[Zy]()}function dE(e){xS.set(e,TS(e.el))}function fE(e){const t=CS.get(e),n=xS.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${s/a}px,${o/c}px)`,r.transitionDuration="0s",e}}function TS(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function hE(e,t,n){const s=e.cloneNode(),o=e[pa];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(s);const{hasTransform:r}=_S(s);return i.removeChild(s),r}const gr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return it(t)?n=>Ql(t,n):t};function pE(e){e.target.composing=!0}function Qy(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const To=Symbol("_assign");function Jy(e,t,n){return t&&(e=e.trim()),n&&(e=nh(e)),e}const bn={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[To]=gr(o);const i=s||o.props&&o.props.type==="number";wi(e,t?"change":"input",r=>{r.target.composing||e[To](Jy(e.value,n,i))}),(n||i)&&wi(e,"change",()=>{e.value=Jy(e.value,n,i)}),t||(wi(e,"compositionstart",pE),wi(e,"compositionend",Qy),wi(e,"change",Qy))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[To]=gr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?nh(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},uf={deep:!0,created(e,t,n){e[To]=gr(n),wi(e,"change",()=>{const s=e._modelValue,o=ma(e),i=e.checked,r=e[To];if(it(s)){const l=oh(s,o),a=l!==-1;if(i&&!a)r(s.concat(o));else if(!i&&a){const c=[...s];c.splice(l,1),r(c)}}else if(dl(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(AS(e,i))})},mounted:ek,beforeUpdate(e,t,n){e[To]=gr(n),ek(e,t,n)}};function ek(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(it(t))o=oh(t,s.props.value)>-1;else if(dl(t))o=t.has(s.props.value);else{if(t===n)return;o=Ai(t,AS(e,!0))}e.checked!==o&&(e.checked=o)}const MS={created(e,{value:t},n){e.checked=Ai(t,n.props.value),e[To]=gr(n),wi(e,"change",()=>{e[To](ma(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[To]=gr(s),t!==n&&(e.checked=Ai(t,s.props.value))}},df={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=dl(t);wi(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?nh(ma(r)):ma(r));e[To](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,ut(()=>{e._assigning=!1})}),e[To]=gr(s)},mounted(e,{value:t}){tk(e,t)},beforeUpdate(e,t,n){e[To]=gr(n)},updated(e,{value:t}){e._assigning||tk(e,t)}};function tk(e,t){const n=e.multiple,s=it(t);if(!(n&&!s&&!dl(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=ma(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=oh(t,l)>-1}else r.selected=t.has(l);else if(Ai(ma(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ma(e){return"_value"in e?e._value:e.value}function AS(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const mE={created(e,t,n){td(e,t,n,null,"created")},mounted(e,t,n){td(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){td(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){td(e,t,n,s,"updated")}};function ES(e,t){switch(e){case"SELECT":return df;case"TEXTAREA":return bn;default:switch(t){case"checkbox":return uf;case"radio":return MS;default:return bn}}}function td(e,t,n,s,o){const r=ES(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function gE(){bn.getSSRProps=({value:e})=>({value:e}),MS.getSSRProps=({value:e},t)=>{if(t.props&&Ai(t.props.value,e))return{checked:!0}},uf.getSSRProps=({value:e},t)=>{if(it(e)){if(t.props&&oh(e,t.props.value)>-1)return{checked:!0}}else if(dl(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},mE.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=ES(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const vE=["ctrl","shift","alt","meta"],yE={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)=>vE.some(n=>e[`${n}Key`]&&!t.includes(n))},Ge=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const l=yE[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},kE={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},So=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=Ns(o.key);if(t.some(r=>r===i||kE[r]===i))return e(o)}))},$S=Gt({patchProp:nE},H4);let _c,nk=!1;function IS(){return _c||(_c=k4($S))}function NS(){return _c=nk?_c:b4($S),nk=!0,_c}const bE=((...e)=>{IS().render(...e)}),gfe=((...e)=>{NS().hydrate(...e)}),ff=((...e)=>{const t=IS().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=OS(s);if(!o)return;const i=t._component;!mt(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,LS(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),_E=((...e)=>{const t=NS().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=OS(s);if(o)return n(o,!0,LS(o))},t});function LS(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function OS(e){return Xt(e)?document.querySelector(e):e}let sk=!1;const vfe=()=>{sk||(sk=!0,gE(),z4())};/*!
|
|
21
|
+
* shared v11.4.5
|
|
22
|
+
* (c) 2026 kazuya kawaguchi
|
|
23
|
+
* Released under the MIT License.
|
|
24
|
+
*/function wE(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const hf=typeof window<"u",wr=(e,t=!1)=>t?Symbol.for(e):Symbol(e),SE=(e,t,n)=>CE({l:e,k:t,s:n}),CE=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),An=e=>typeof e=="number"&&isFinite(e),RS=e=>V1(e)==="[object Date]",ga=e=>V1(e)==="[object RegExp]",ph=e=>Mt(e)&&Object.keys(e).length===0,$n=Object.assign,xE=Object.create,Yt=(e=null)=>xE(e);let ok;const el=()=>ok||(ok=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Yt());function ik(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function TE(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const ME=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,AE=/^(?:href|src|action|formaction)$/i;function z1(e){return ME.test(e)}function EE(e){const t=/url\s*\(/gi;let n="",s=0,o;for(;(o=t.exec(e))!==null;){const i=o.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const p=e[l];if(c){p===c&&(c=null);continue}if(p==='"'||p==="'")c=p;else if(p==="(")a++;else if(p===")"&&(a--,a===0))break}if(a!==0)break;const u=e.slice(r+1,l).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=e.slice(s,i),n+=z1(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function rk(e,t){if(AE.test(e)&&z1(t))return"about:blank";const n=e.toLowerCase()==="style"?EE(t):t;return TE(n)}function $E(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${rk(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${rk(s,o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,s,o)=>z1(o)?`${s}about:blank`:n),e}const IE=Object.prototype.hasOwnProperty;function Co(e,t){return IE.call(e,t)}const yn=Array.isArray,un=e=>typeof e=="function",st=e=>typeof e=="string",Ot=e=>typeof e=="boolean",Rt=e=>e!==null&&typeof e=="object",NE=e=>Rt(e)&&un(e.then)&&un(e.catch),PS=Object.prototype.toString,V1=e=>PS.call(e),Mt=e=>V1(e)==="[object Object]",LE=e=>e==null?"":yn(e)||Mt(e)&&e.toString===PS?JSON.stringify(e,null,2):String(e);function K1(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const nd=e=>!Rt(e)||yn(e);function Ad(e,t){if(nd(e)||nd(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:o}=n.pop();Object.keys(s).forEach(i=>{i!=="__proto__"&&(Rt(s[i])&&!Rt(o[i])&&(o[i]=Array.isArray(s[i])?[]:Yt()),nd(o[i])||nd(s[i])?o[i]=s[i]:n.push({src:s[i],des:o[i]}))})}}/*!
|
|
25
|
+
* message-compiler v11.4.5
|
|
26
|
+
* (c) 2026 kazuya kawaguchi
|
|
27
|
+
* Released under the MIT License.
|
|
28
|
+
*/function OE(e,t,n){return{line:e,column:t,offset:n}}function wg(e,t,n){return{start:e,end:t}}const Wt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},RE=17;function mh(e,t,n={}){const{domain:s,messages:o,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=s,l}function PE(e){throw e}const Ko=" ",DE="\r",es=`
|
|
29
|
+
`,BE="\u2028",FE="\u2029";function HE(e){const t=e;let n=0,s=1,o=1,i=0;const r=E=>t[E]===DE&&t[E+1]===es,l=E=>t[E]===es,a=E=>t[E]===FE,c=E=>t[E]===BE,u=E=>r(E)||l(E)||a(E)||c(E),d=()=>n,p=()=>s,m=()=>o,f=()=>i,v=E=>r(E)||a(E)||c(E)?es:t[E],w=()=>v(n),b=()=>v(n+i);function _(){return i=0,u(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function g(){return r(n+i)&&i++,i++,t[n+i]}function y(){n=0,s=1,o=1,i=0}function k(E=0){i=E}function I(){const E=n+i;for(;E!==n;)_();i=0}return{index:d,line:p,column:m,peekOffset:f,charAt:v,currentChar:w,currentPeek:b,next:_,peek:g,reset:y,resetPeek:k,skipToPeek:I}}const gi=void 0,WE=".",lk="'",UE="tokenizer";function qE(e,t={}){const n=t.location!==!1,s=HE(e),o=()=>s.index(),i=()=>OE(s.line(),s.column(),s.index()),r=i(),l=o(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(H,U,Q,...ue){const ge=c();if(U.column+=Q,U.offset+=Q,u){const xe=n?wg(ge.startLoc,U):null,ie=mh(H,xe,{domain:UE,args:ue});u(ie)}}function p(H,U,Q){H.endLoc=i(),H.currentType=U;const ue={type:U};return n&&(ue.loc=wg(H.startLoc,H.endLoc)),Q!=null&&(ue.value=Q),ue}const m=H=>p(H,13);function f(H,U){return H.currentChar()===U?(H.next(),U):(d(Wt.EXPECTED_TOKEN,i(),0,U),"")}function v(H){let U="";for(;H.currentPeek()===Ko||H.currentPeek()===es;)U+=H.currentPeek(),H.peek();return U}function w(H){const U=v(H);return H.skipToPeek(),U}function b(H){if(H===gi)return!1;const U=H.charCodeAt(0);return U>=97&&U<=122||U>=65&&U<=90||U===95}function _(H){if(H===gi)return!1;const U=H.charCodeAt(0);return U>=48&&U<=57}function g(H,U){const{currentType:Q}=U;if(Q!==2)return!1;v(H);const ue=b(H.currentPeek());return H.resetPeek(),ue}function y(H,U){const{currentType:Q}=U;if(Q!==2)return!1;v(H);const ue=H.currentPeek()==="-"?H.peek():H.currentPeek(),ge=_(ue);return H.resetPeek(),ge}function k(H,U){const{currentType:Q}=U;if(Q!==2)return!1;v(H);const ue=H.currentPeek()===lk;return H.resetPeek(),ue}function I(H,U){const{currentType:Q}=U;if(Q!==7)return!1;v(H);const ue=H.currentPeek()===".";return H.resetPeek(),ue}function E(H,U){const{currentType:Q}=U;if(Q!==8)return!1;v(H);const ue=b(H.currentPeek());return H.resetPeek(),ue}function S(H,U){const{currentType:Q}=U;if(!(Q===7||Q===11))return!1;v(H);const ue=H.currentPeek()===":";return H.resetPeek(),ue}function T(H,U){const{currentType:Q}=U;if(Q!==9)return!1;const ue=()=>{const xe=H.currentPeek();return xe==="{"?b(H.peek()):xe==="@"||xe==="|"||xe===":"||xe==="."||xe===Ko||!xe?!1:xe===es?(H.peek(),ue()):L(H,!1)},ge=ue();return H.resetPeek(),ge}function $(H){v(H);const U=H.currentPeek()==="|";return H.resetPeek(),U}function L(H,U=!0){const Q=(ge=!1,xe="")=>{const ie=H.currentPeek();return ie==="{"||ie==="@"||!ie?ge:ie==="|"?!(xe===Ko||xe===es):ie===Ko?(H.peek(),Q(!0,Ko)):ie===es?(H.peek(),Q(!0,es)):!0},ue=Q();return U&&H.resetPeek(),ue}function R(H,U){const Q=H.currentChar();return Q===gi?gi:U(Q)?(H.next(),Q):null}function O(H){const U=H.charCodeAt(0);return U>=97&&U<=122||U>=65&&U<=90||U>=48&&U<=57||U===95||U===36}function B(H){return R(H,O)}function F(H){const U=H.charCodeAt(0);return U>=97&&U<=122||U>=65&&U<=90||U>=48&&U<=57||U===95||U===36||U===45}function q(H){return R(H,F)}function G(H){const U=H.charCodeAt(0);return U>=48&&U<=57}function K(H){return R(H,G)}function oe(H){const U=H.charCodeAt(0);return U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102}function le(H){return R(H,oe)}function pe(H){let U="",Q="";for(;U=K(H);)Q+=U;return Q}function be(H){let U="";for(;;){const Q=H.currentChar();if(Q==="\\"){const ue=H.peek();ue==="{"||ue==="}"||ue==="@"||ue==="|"||ue==="\\"?(U+=Q+ue,H.next(),H.next()):(H.resetPeek(),U+=Q,H.next())}else{if(Q==="{"||Q==="}"||Q==="@"||Q==="|"||!Q)break;if(Q===Ko||Q===es)if(L(H))U+=Q,H.next();else{if($(H))break;U+=Q,H.next()}else U+=Q,H.next()}}return U}function Be(H){w(H);let U="",Q="";for(;U=q(H);)Q+=U;const ue=H.currentChar();if(ue&&ue!=="}"&&ue!==gi&&ue!==Ko&&ue!==es&&ue!==" "){const ge=z(H);return d(Wt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,Q+ge),Q+ge}return H.currentChar()===gi&&d(Wt.UNTERMINATED_CLOSING_BRACE,i(),0),Q}function He(H){w(H);let U="";return H.currentChar()==="-"?(H.next(),U+=`-${pe(H)}`):U+=pe(H),H.currentChar()===gi&&d(Wt.UNTERMINATED_CLOSING_BRACE,i(),0),U}function Ne(H){return H!==lk&&H!==es}function me(H){w(H),f(H,"'");let U="",Q="";for(;U=R(H,Ne);)U==="\\"?Q+=_e(H):Q+=U;const ue=H.currentChar();return ue===es||ue===gi?(d(Wt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ue===es&&(H.next(),f(H,"'")),Q):(f(H,"'"),Q)}function _e(H){const U=H.currentChar();switch(U){case"\\":case"'":return H.next(),`\\${U}`;case"u":return Ce(H,U,4);case"U":return Ce(H,U,6);default:return d(Wt.UNKNOWN_ESCAPE_SEQUENCE,i(),0,U),""}}function Ce(H,U,Q){f(H,U);let ue="";for(let ge=0;ge<Q;ge++){const xe=le(H);if(!xe){d(Wt.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${U}${ue}${H.currentChar()}`);break}ue+=xe}return`\\${U}${ue}`}function de(H){return H!=="{"&&H!=="}"&&H!==Ko&&H!==es}function z(H){w(H);let U="",Q="";for(;U=R(H,de);)Q+=U;return Q}function Z(H){let U="",Q="";for(;U=B(H);)Q+=U;return Q}function fe(H){const U=Q=>{const ue=H.currentChar();return ue==="{"||ue==="@"||ue==="|"||ue==="("||ue===")"||!ue||ue===Ko?Q:(Q+=ue,H.next(),U(Q))};return U("")}function P(H){w(H);const U=f(H,"|");return w(H),U}function X(H,U){let Q=null;switch(H.currentChar()){case"{":return U.braceNest>=1&&d(Wt.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),H.next(),Q=p(U,2,"{"),w(H),U.braceNest++,Q;case"}":return U.braceNest>0&&U.currentType===2&&d(Wt.EMPTY_PLACEHOLDER,i(),0),H.next(),Q=p(U,3,"}"),U.braceNest--,U.braceNest>0&&w(H),U.inLinked&&U.braceNest===0&&(U.inLinked=!1),Q;case"@":return U.braceNest>0&&d(Wt.UNTERMINATED_CLOSING_BRACE,i(),0),Q=ne(H,U)||m(U),U.braceNest=0,Q;default:{let ge=!0,xe=!0,ie=!0;if($(H))return U.braceNest>0&&d(Wt.UNTERMINATED_CLOSING_BRACE,i(),0),Q=p(U,1,P(H)),U.braceNest=0,U.inLinked=!1,Q;if(U.braceNest>0&&(U.currentType===4||U.currentType===5||U.currentType===6))return d(Wt.UNTERMINATED_CLOSING_BRACE,i(),0),U.braceNest=0,se(H,U);if(ge=g(H,U))return Q=p(U,4,Be(H)),w(H),Q;if(xe=y(H,U))return Q=p(U,5,He(H)),w(H),Q;if(ie=k(H,U))return Q=p(U,6,me(H)),w(H),Q;if(!ge&&!xe&&!ie)return Q=p(U,12,z(H)),d(Wt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,Q.value),w(H),Q;break}}return Q}function ne(H,U){const{currentType:Q}=U;let ue=null;const ge=H.currentChar();switch((Q===7||Q===8||Q===11||Q===9)&&(ge===es||ge===Ko)&&d(Wt.INVALID_LINKED_FORMAT,i(),0),ge){case"@":return H.next(),ue=p(U,7,"@"),U.inLinked=!0,ue;case".":return w(H),H.next(),p(U,8,".");case":":return w(H),H.next(),p(U,9,":");default:return $(H)?(ue=p(U,1,P(H)),U.braceNest=0,U.inLinked=!1,ue):I(H,U)||S(H,U)?(w(H),ne(H,U)):E(H,U)?(w(H),p(U,11,Z(H))):T(H,U)?(w(H),ge==="{"?X(H,U)||ue:p(U,10,fe(H))):(Q===7&&d(Wt.INVALID_LINKED_FORMAT,i(),0),U.braceNest=0,U.inLinked=!1,se(H,U))}}function se(H,U){let Q={type:13};if(U.braceNest>0)return X(H,U)||m(U);if(U.inLinked)return ne(H,U)||m(U);switch(H.currentChar()){case"{":return X(H,U)||m(U);case"}":return d(Wt.UNBALANCED_CLOSING_BRACE,i(),0),H.next(),p(U,3,"}");case"@":return ne(H,U)||m(U);default:{if($(H))return Q=p(U,1,P(H)),U.braceNest=0,U.inLinked=!1,Q;if(L(H))return p(U,0,be(H));break}}return Q}function ce(){const{currentType:H,offset:U,startLoc:Q,endLoc:ue}=a;return a.lastType=H,a.lastOffset=U,a.lastStartLoc=Q,a.lastEndLoc=ue,a.offset=o(),a.startLoc=i(),s.currentChar()===gi?p(a,13):se(s,a)}return{nextToken:ce,currentOffset:o,currentPosition:i,context:c}}const jE="parser",zE=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,VE=/\\([\\@{}|])/g;function KE(e,t){return t}function GE(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function YE(e={}){const t=e.location!==!1,{onError:n}=e;function s(b,_,g,y,...k){const I=b.currentPosition();if(I.offset+=y,I.column+=y,n){const E=t?wg(g,I):null,S=mh(_,E,{domain:jE,args:k});n(S)}}function o(b,_,g){const y={type:b};return t&&(y.start=_,y.end=_,y.loc={start:g,end:g}),y}function i(b,_,g,y){t&&(b.end=_,b.loc&&(b.loc.end=g))}function r(b,_){const g=b.context(),y=o(3,g.offset,g.startLoc);return y.value=_.replace(VE,KE),i(y,b.currentOffset(),b.currentPosition()),y}function l(b,_){const g=b.context(),{lastOffset:y,lastStartLoc:k}=g,I=o(5,y,k);return I.index=parseInt(_,10),b.nextToken(),i(I,b.currentOffset(),b.currentPosition()),I}function a(b,_){const g=b.context(),{lastOffset:y,lastStartLoc:k}=g,I=o(4,y,k);return I.key=_,b.nextToken(),i(I,b.currentOffset(),b.currentPosition()),I}function c(b,_){const g=b.context(),{lastOffset:y,lastStartLoc:k}=g,I=o(9,y,k);return I.value=_.replace(zE,GE),b.nextToken(),i(I,b.currentOffset(),b.currentPosition()),I}function u(b){const _=b.nextToken(),g=b.context(),{lastOffset:y,lastStartLoc:k}=g,I=o(8,y,k);return _.type!==11?(s(b,Wt.UNEXPECTED_EMPTY_LINKED_MODIFIER,g.lastStartLoc,0),I.value="",i(I,y,k),{nextConsumeToken:_,node:I}):(_.value==null&&s(b,Wt.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,Go(_)),I.value=_.value||"",i(I,b.currentOffset(),b.currentPosition()),{node:I})}function d(b,_){const g=b.context(),y=o(7,g.offset,g.startLoc);return y.value=_,i(y,b.currentOffset(),b.currentPosition()),y}function p(b){const _=b.context(),g=o(6,_.offset,_.startLoc);let y=b.nextToken();if(y.type===8){const k=u(b);g.modifier=k.node,y=k.nextConsumeToken||b.nextToken()}switch(y.type!==9&&s(b,Wt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Go(y)),y=b.nextToken(),y.type===2&&(y=b.nextToken()),y.type){case 10:y.value==null&&s(b,Wt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Go(y)),g.key=d(b,y.value||"");break;case 4:y.value==null&&s(b,Wt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Go(y)),g.key=a(b,y.value||"");break;case 5:y.value==null&&s(b,Wt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Go(y)),g.key=l(b,y.value||"");break;case 6:y.value==null&&s(b,Wt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Go(y)),g.key=c(b,y.value||"");break;default:{s(b,Wt.UNEXPECTED_EMPTY_LINKED_KEY,_.lastStartLoc,0);const k=b.context(),I=o(7,k.offset,k.startLoc);return I.value="",i(I,k.offset,k.startLoc),g.key=I,i(g,k.offset,k.startLoc),{nextConsumeToken:y,node:g}}}return i(g,b.currentOffset(),b.currentPosition()),{node:g}}function m(b){const _=b.context(),g=_.currentType===1?b.currentOffset():_.offset,y=_.currentType===1?_.endLoc:_.startLoc,k=o(2,g,y);k.items=[];let I=null;do{const T=I||b.nextToken();switch(I=null,T.type){case 0:T.value==null&&s(b,Wt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Go(T)),k.items.push(r(b,T.value||""));break;case 5:T.value==null&&s(b,Wt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Go(T)),k.items.push(l(b,T.value||""));break;case 4:T.value==null&&s(b,Wt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Go(T)),k.items.push(a(b,T.value||""));break;case 6:T.value==null&&s(b,Wt.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Go(T)),k.items.push(c(b,T.value||""));break;case 7:{const $=p(b);k.items.push($.node),I=$.nextConsumeToken||null;break}}}while(_.currentType!==13&&_.currentType!==1);const E=_.currentType===1?_.lastOffset:b.currentOffset(),S=_.currentType===1?_.lastEndLoc:b.currentPosition();return i(k,E,S),k}function f(b,_,g,y){const k=b.context();let I=y.items.length===0;const E=o(1,_,g);E.cases=[],E.cases.push(y);do{const S=m(b);I||(I=S.items.length===0),E.cases.push(S)}while(k.currentType!==13);return I&&s(b,Wt.MUST_HAVE_MESSAGES_IN_PLURAL,g,0),i(E,b.currentOffset(),b.currentPosition()),E}function v(b){const _=b.context(),{offset:g,startLoc:y}=_,k=m(b);return _.currentType===13?k:f(b,g,y,k)}function w(b){const _=qE(b,$n({},e)),g=_.context(),y=o(0,g.offset,g.startLoc);return t&&y.loc&&(y.loc.source=b),y.body=v(_),e.onCacheKey&&(y.cacheKey=e.onCacheKey(b)),g.currentType!==13&&s(_,Wt.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,b[g.offset]||""),i(y,_.currentOffset(),_.currentPosition()),y}return{parse:w}}function Go(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function XE(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function ak(e,t){for(let n=0;n<e.length;n++)G1(e[n],t)}function G1(e,t){switch(e.type){case 1:ak(e.cases,t),t.helper("plural");break;case 2:ak(e.items,t);break;case 6:{G1(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function ZE(e,t={}){const n=XE(e);n.helper("normalize"),e.body&&G1(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function QE(e){const t=e.body;return t.type===2?ck(t):t.cases.forEach(n=>ck(n)),e}function ck(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=K1(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}function jl(e){switch(e.t=e.type,e.type){case 0:{const t=e;jl(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)jl(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)jl(n[s]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;jl(t.key),t.k=t.key,delete t.key,t.modifier&&(jl(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function JE(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(v,w){r.code+=v}function c(v,w=!0){const b=w?s:"";a(o?b+" ".repeat(v):b)}function u(v=!0){const w=++r.indentLevel;v&&c(w)}function d(v=!0){const w=--r.indentLevel;v&&c(w)}function p(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:p,helper:v=>`_${v}`,needIndent:()=>r.needIndent}}function e6(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),va(e,t.key),t.modifier?(e.push(", "),va(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function t6(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(va(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function n6(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(va(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function s6(e,t){t.body?va(e,t.body):e.push("null")}function va(e,t){const{helper:n}=e;switch(t.type){case 0:s6(e,t);break;case 1:n6(e,t);break;case 2:t6(e,t);break;case 6:e6(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break}}const o6=(e,t={})=>{const n=st(t.mode)?t.mode:"normal",s=st(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
+
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=JE(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${K1(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),va(l,e),l.deindent(i),l.push("}"),delete e.helpers;const{code:a,map:c}=l.context();return{ast:e,code:a,map:c?c.toJSON():void 0}};function i6(e,t={}){const n=$n({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=YE(n).parse(e);return s?(i&&QE(l),o&&jl(l),{ast:l,code:""}):(ZE(l,n),o6(l,n))}/*!
|
|
31
|
+
* core-base v11.4.5
|
|
32
|
+
* (c) 2026 kazuya kawaguchi
|
|
33
|
+
* Released under the MIT License.
|
|
34
|
+
*/function r6(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(el().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(el().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function ni(e){return Rt(e)&&Y1(e)===0&&(Co(e,"b")||Co(e,"body"))}const DS=["b","body"];function l6(e){return Sr(e,DS)}const BS=["c","cases"];function a6(e){return Sr(e,BS,[])}const FS=["s","static"];function c6(e){return Sr(e,FS)}const HS=["i","items"];function u6(e){return Sr(e,HS,[])}const WS=["t","type"];function Y1(e){return Sr(e,WS)}const US=["v","value"];function sd(e,t){const n=Sr(e,US);if(n!=null)return n;throw qc(t)}const qS=["m","modifier"];function d6(e){return Sr(e,qS)}const jS=["k","key"];function f6(e){const t=Sr(e,jS);if(t)return t;throw qc(6)}function Sr(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(Co(e,o)&&e[o]!=null)return e[o]}return n}const zS=[...DS,...BS,...FS,...HS,...jS,...qS,...US,...WS];function qc(e){return new Error(`unhandled node type: ${e}`)}function im(e){return n=>h6(n,e)}function h6(e,t){const n=l6(t);if(n==null)throw qc(0);if(Y1(n)===1){const i=a6(n);return e.plural(i.reduce((r,l)=>[...r,uk(e,l)],[]))}else return uk(e,n)}function uk(e,t){const n=c6(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=u6(t).reduce((o,i)=>[...o,Sg(e,i)],[]);return e.normalize(s)}}function Sg(e,t){const n=Y1(t);switch(n){case 3:return sd(t,n);case 9:return sd(t,n);case 4:{const s=t;if(Co(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(Co(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw qc(n)}case 5:{const s=t;if(Co(s,"i")&&An(s.i))return e.interpolate(e.list(s.i));if(Co(s,"index")&&An(s.index))return e.interpolate(e.list(s.index));throw qc(n)}case 6:{const s=t,o=d6(s),i=f6(s);return e.linked(Sg(e,i),o?Sg(e,o):void 0,e.type)}case 7:return sd(t,n);case 8:return sd(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const p6=e=>e;let od=Yt();function m6(e,t={}){let n=!1;const s=t.onError||PE;return t.onError=o=>{n=!0,s(o)},{...i6(e,t),detectError:n}}function g6(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&st(e)){Ot(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||p6)(e),o=od[s];if(o)return o;const{ast:i,detectError:r}=m6(e,{...t,location:!1,jit:!0}),l=im(i);return r?l:od[s]=l}else{const n=e.cacheKey;if(n){const s=od[n];return s||(od[n]=im(e))}else return im(e)}}let jc=null;function v6(e){jc=e}function y6(e,t,n){jc&&jc.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const k6=b6("function:translate");function b6(e){return t=>jc&&jc.emit(e,t)}const Si={INVALID_ARGUMENT:RE,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},_6=24;function Ci(e){return mh(e,null,void 0)}function X1(e,t){return t.locale!=null?dk(t.locale):dk(e.locale)}let rm;function dk(e){if(st(e))return e;if(un(e)){if(e.resolvedOnce&&rm!=null)return rm;if(e.constructor.name==="Function"){const t=e();if(NE(t))throw Ci(Si.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return rm=t}else throw Ci(Si.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Ci(Si.NOT_SUPPORT_LOCALE_TYPE)}function w6(e,t,n){return[...new Set([n,...yn(t)?t:Rt(t)?Object.keys(t):st(t)?[t]:[n]])]}function Cg(e,t,n){const s=st(n)?n:zc,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;yn(r);)r=fk(i,r,t);const l=yn(t)||!Mt(t)?t:t.default?t.default:null;r=st(l)?[l]:l,yn(r)&&fk(i,r,!1),o.__localeChainCache.set(s,i)}return i}function fk(e,t,n){let s=!0;for(let o=0;o<t.length&&Ot(s);o++){const i=t[o];st(i)&&(s=S6(e,t[o],n))}return s}function S6(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=C6(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function C6(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(yn(n)||Mt(n))&&n[o]&&(s=n[o])}return s}const Cr=[];Cr[0]={w:[0],i:[3,0],"[":[4],o:[7]};Cr[1]={w:[1],".":[2],"[":[4],o:[7]};Cr[2]={w:[2],i:[3,0],0:[3,0]};Cr[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Cr[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Cr[5]={"'":[4,0],o:8,l:[5,0]};Cr[6]={'"':[4,0],o:8,l:[6,0]};const x6=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function T6(e){return x6.test(e)}function M6(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function A6(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function E6(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:T6(t)?M6(t):"*"+t}function $6(e){const t=[];let n=-1,s=0,o=0,i,r,l,a,c,u,d;const p=[];p[0]=()=>{r===void 0?r=l:r+=l},p[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},p[2]=()=>{p[0](),o++},p[3]=()=>{if(o>0)o--,s=4,p[0]();else{if(o=0,r===void 0||(r=E6(r),r===!1))return!1;p[1]()}};function m(){const f=e[n+1];if(s===5&&f==="'"||s===6&&f==='"')return n++,l="\\"+f,p[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&m())){if(a=A6(i),d=Cr[s],c=d[a]||d.l||8,c===8||(s=c[0],c[1]!==void 0&&(u=p[c[1]],u&&(l=i,u()===!1))))return;if(s===7)return t}}const hk=new Map;function I6(e,t){return Rt(e)?e[t]:null}function N6(e,t){if(!Rt(e))return null;let n=hk.get(t);if(n||(n=$6(t),n&&hk.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(zS.includes(r)&&ni(o)||!Rt(o)||!Co(o,r))return null;const l=o[r];if(l===void 0||un(o))return null;o=l,i++}return o}const L6="11.4.5",gh=-1,zc="en-US",pf="",pk=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function O6(){return{upper:(e,t)=>t==="text"&&st(e)?e.toUpperCase():t==="vnode"&&Rt(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&st(e)?e.toLowerCase():t==="vnode"&&Rt(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&st(e)?pk(e):t==="vnode"&&Rt(e)&&"__v_isVNode"in e?pk(e.children):e}}let VS;function R6(e){VS=e}let KS;function P6(e){KS=e}let GS;function D6(e){GS=e}let YS=null;const B6=e=>{YS=e},F6=()=>YS;let XS=null;const mk=e=>{XS=e},H6=()=>XS;let gk=0;function W6(e={}){const t=un(e.onWarn)?e.onWarn:wE,n=st(e.version)?e.version:L6,s=st(e.locale)||un(e.locale)?e.locale:zc,o=un(s)?zc:s,i=yn(e.fallbackLocale)||Mt(e.fallbackLocale)||st(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Mt(e.messages)?e.messages:lm(o),l=Mt(e.datetimeFormats)?e.datetimeFormats:lm(o),a=Mt(e.numberFormats)?e.numberFormats:lm(o),c=$n(Yt(),e.modifiers,O6()),u=e.pluralRules||Yt(),d=un(e.missing)?e.missing:null,p=Ot(e.missingWarn)||ga(e.missingWarn)?e.missingWarn:!0,m=Ot(e.fallbackWarn)||ga(e.fallbackWarn)?e.fallbackWarn:!0,f=!!e.fallbackFormat,v=!!e.unresolving,w=un(e.postTranslation)?e.postTranslation:null,b=Mt(e.processor)?e.processor:null,_=Ot(e.warnHtmlMessage)?e.warnHtmlMessage:!0,g=!!e.escapeParameter,y=un(e.messageCompiler)?e.messageCompiler:VS,k=un(e.messageResolver)?e.messageResolver:KS||I6,I=un(e.localeFallbacker)?e.localeFallbacker:GS||w6,E=Rt(e.fallbackContext)?e.fallbackContext:void 0,S=e,T=Rt(S.__datetimeFormatters)?S.__datetimeFormatters:new Map,$=Rt(S.__numberFormatters)?S.__numberFormatters:new Map,L=Rt(S.__meta)?S.__meta:{};gk++;const R={version:n,cid:gk,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:p,fallbackWarn:m,fallbackFormat:f,unresolving:v,postTranslation:w,processor:b,warnHtmlMessage:_,escapeParameter:g,messageCompiler:y,messageResolver:k,localeFallbacker:I,fallbackContext:E,onWarn:t,__meta:L};return R.datetimeFormats=l,R.numberFormats=a,R.__datetimeFormatters=T,R.__numberFormatters=$,__INTLIFY_PROD_DEVTOOLS__&&y6(R,n,L),R}const lm=e=>({[e]:Yt()});function Z1(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return st(l)?l:t}else return t}function ec(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function U6(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function q6(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(U6(e,t[s]))return!0;return!1}function vk(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!st(t[0])&&!RS(t[0])&&!An(t[0]))return pf;const[a,c,u,d]=xg(...t),p=Ot(u.missingWarn)?u.missingWarn:e.missingWarn;Ot(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,f=X1(e,u),v=r(e,o,f);if(!st(a)||a===""){const I=new Intl.DateTimeFormat(f.replace(/!/g,""),d);return m?I.formatToParts(c):I.format(c)}let w={},b,_=null;const g="datetime format";for(let I=0;I<v.length&&(b=v[I],w=n[b]||{},_=w[a],!Mt(_));I++)Z1(e,a,b,p,g);if(!Mt(_)||!st(b))return s?gh:a;let y=`${b}__${a}`;ph(d)||(y=`${y}__${JSON.stringify(d)}`);let k=l.get(y);return k||(k=new Intl.DateTimeFormat(b,$n({},_,d)),l.set(y,k)),m?k.formatToParts(c):k.format(c)}const ZS=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function xg(...e){const[t,n,s,o]=e,i=Yt();let r=Yt(),l;if(st(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Ci(Si.INVALID_ISO_DATE_ARGUMENT);const c=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();l=new Date(c);try{l.toISOString()}catch{throw Ci(Si.INVALID_ISO_DATE_ARGUMENT)}}else if(RS(t)){if(isNaN(t.getTime()))throw Ci(Si.INVALID_DATE_ARGUMENT);l=t}else if(An(t))l=t;else throw Ci(Si.INVALID_ARGUMENT);return st(n)?i.key=n:Mt(n)&&Object.keys(n).forEach(a=>{ZS.includes(a)?r[a]=n[a]:i[a]=n[a]}),st(s)?i.locale=s:Mt(s)&&(r=s),Mt(o)&&(r=o),[i.key||"",l,i,r]}function yk(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function kk(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!An(t[0]))return pf;const[a,c,u,d]=Tg(...t),p=Ot(u.missingWarn)?u.missingWarn:e.missingWarn;Ot(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,f=X1(e,u),v=r(e,o,f);if(!st(a)||a===""){const I=new Intl.NumberFormat(f.replace(/!/g,""),d);return m?I.formatToParts(c):I.format(c)}let w={},b,_=null;const g="number format";for(let I=0;I<v.length&&(b=v[I],w=n[b]||{},_=w[a],!Mt(_));I++)Z1(e,a,b,p,g);if(!Mt(_)||!st(b))return s?gh:a;let y=`${b}__${a}`;ph(d)||(y=`${y}__${JSON.stringify(d)}`);let k=l.get(y);return k||(k=new Intl.NumberFormat(b,$n({},_,d)),l.set(y,k)),m?k.formatToParts(c):k.format(c)}const QS=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Tg(...e){const[t,n,s,o]=e,i=Yt();let r=Yt();if(!An(t))throw Ci(Si.INVALID_ARGUMENT);const l=t;return st(n)?i.key=n:Mt(n)&&Object.keys(n).forEach(a=>{QS.includes(a)?r[a]=n[a]:i[a]=n[a]}),st(s)?i.locale=s:Mt(s)&&(r=s),Mt(o)&&(r=o),[i.key||"",l,i,r]}function bk(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const j6=e=>e,z6=e=>"",V6="text",K6=e=>e.length===0?"":K1(e),G6=LE;function am(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function Y6(e){const t=An(e.pluralIndex)?e.pluralIndex:-1;return An(e.named?.count)?e.named.count:An(e.named?.n)?e.named.n:t}function X6(e={}){const t=e.locale,n=Y6(e),s=st(t)&&un(e.pluralRules?.[t])?e.pluralRules[t]:am,o=s===am?void 0:am,i=b=>b[s(n,b.length,o)],r=e.list||[],l=b=>r[b],a=e.named||Yt();An(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=b=>a[b];function u(b,_){const g=un(e.messages)?e.messages(b,!!_):Rt(e.messages)?e.messages[b]:!1;return g||(e.parent?e.parent.message(b):z6)}const d=b=>e.modifiers?e.modifiers[b]:j6,p=un(e.processor?.normalize)?e.processor.normalize:K6,m=un(e.processor?.interpolate)?e.processor.interpolate:G6,f=st(e.processor?.type)?e.processor.type:V6,w={list:l,named:c,plural:i,linked:(b,..._)=>{const[g,y]=_;let k="text",I="";_.length===1?Rt(g)?(I=g.modifier||I,k=g.type||k):st(g)&&(I=g||I):_.length===2&&(st(g)&&(I=g||I),st(y)&&(k=y||k));const E=u(b,!0)(w),S=E===""||E===void 0?b:E,T=k==="vnode"&&yn(S)&&I?S[0]:S;return I?d(I)(T,k):T},message:u,type:f,interpolate:m,normalize:p,values:$n(Yt(),r,a)};return w}const _k=()=>"",bo=e=>un(e);function wk(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Mg(...t),u=Ot(c.missingWarn)?c.missingWarn:e.missingWarn,d=Ot(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,p=Ot(c.escapeParameter)?c.escapeParameter:e.escapeParameter,m=!!c.resolvedMessage,f=st(c.default)||Ot(c.default)?Ot(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,v=n||f!=null&&(st(f)||un(f)),w=X1(e,c);p&&Z6(c);let[b,_,g]=m?[a,w,l[w]||Yt()]:JS(e,a,w,r,d,u),y=b,k=a;if(!m&&!(st(y)||ni(y)||bo(y))&&v&&(y=f,k=y),!m&&(!(st(y)||ni(y)||bo(y))||!st(_)))return o?gh:a;let I=!1;const E=()=>{I=!0},S=bo(y)?y:eC(e,a,_,y,k,E);if(I)return y;const T=e$(e,_,g,c),$=X6(T),L=Q6(e,S,$);let R=s?s(L,a):L;if(p&&st(R)&&(R=$E(R)),__INTLIFY_PROD_DEVTOOLS__){const O={timestamp:Date.now(),key:st(a)?a:bo(y)?y.key:"",locale:_||(bo(y)?y.locale:""),format:st(y)?y:bo(y)?y.source:"",message:R};O.meta=$n({},e.__meta,F6()||{}),k6(O)}return R}function Z6(e){yn(e.list)?e.list=e.list.map(t=>st(t)?ik(t):t):Rt(e.named)&&Object.keys(e.named).forEach(t=>{st(e.named[t])&&(e.named[t]=ik(e.named[t]))})}function JS(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=Yt(),p,m=null;const f="translate";for(let v=0;v<u.length&&(p=u[v],d=r[p]||Yt(),(m=a(d,t))===null&&(m=d[t]),!(st(m)||ni(m)||bo(m)));v++)if(!q6(p,u)){const w=Z1(e,t,p,i,f);w!==t&&(m=w)}return[m,p,d]}function eC(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(bo(s)){const c=s;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>s);return c.locale=n,c.key=t,c}const a=r(s,J6(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function Q6(e,t,n){return t(n)}function Mg(...e){const[t,n,s]=e,o=Yt();if(!st(t)&&!An(t)&&!bo(t)&&!ni(t))throw Ci(Si.INVALID_ARGUMENT);const i=An(t)?String(t):(bo(t),t);return An(n)?o.plural=n:st(n)?o.default=n:Mt(n)&&!ph(n)?o.named=n:yn(n)&&(o.list=n),An(s)?o.plural=s:st(s)?o.default=s:Mt(s)&&$n(o,s),[i,o]}function J6(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>SE(t,n,r)}}function e$(e,t,n,s){const{modifiers:o,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,p={locale:t,modifiers:o,pluralRules:i,messages:(m,f)=>{let v=r(n,m);if(v==null&&(u||f)){const[w,,b]=JS(u||e,m,t,l,a,c);v=w??r(b,m)}if(st(v)||ni(v)){let w=!1;const _=eC(e,m,t,v,m,()=>{w=!0});return w?_k:_}else return bo(v)?v:_k}};return e.processor&&(p.processor=e.processor),s.list&&(p.list=s.list),s.named&&(p.named=s.named),An(s.plural)&&(p.pluralIndex=s.plural),p}r6();/*!
|
|
35
|
+
* vue-i18n v11.4.5
|
|
36
|
+
* (c) 2026 kazuya kawaguchi
|
|
37
|
+
* Released under the MIT License.
|
|
38
|
+
*/const t$="11.4.5";function n$(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(el().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(el().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(el().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(el().__INTLIFY_PROD_DEVTOOLS__=!1)}const ks={UNEXPECTED_RETURN_TYPE:_6,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Ls(e,...t){return mh(e,null,void 0)}const Ag=wr("__translateVNode"),Eg=wr("__datetimeParts"),$g=wr("__numberParts"),tC=wr("__setPluralRules"),nC=wr("__injectWithOption"),Kl=wr("__dispose");function Vc(e){if(!Rt(e)||ni(e))return e;for(const t in e)if(Co(e,t))if(!t.includes("."))Rt(e[t])&&Vc(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=Yt()),!Rt(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(ni(o)?zS.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!ni(o)){const r=o[n[s]];Rt(r)&&Vc(r)}}return e}function Q1(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Mt(n)?n:yn(s)?Yt():{[e]:Yt()};if(yn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Yt(),Ad(c,r[a])):Ad(c,r)}else st(l)&&Ad(JSON.parse(l),r)}),o==null&&i)for(const l in r)Co(r,l)&&Vc(r[l]);return r}function sC(e){return e.type}function oC(e,t,n){let s=Rt(t.messages)?t.messages:Yt();"__i18nGlobal"in n&&(s=Q1(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(Rt(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(Rt(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Sk(e){return pt(cr,null,e,0)}function Kc(){return ls()}const Ck="__INTLIFY_META__",xk=()=>[],s$=()=>!1;let Tk=0;function Mk(e){return((t,n,s,o)=>e(n,s,Kc()||void 0,o))}const o$=()=>{const e=Kc();let t=null;return e&&(t=sC(e)[Ck])?{[Ck]:t}:null};function mf(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=hf?te:fl;let r=Ot(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:st(e.locale)?e.locale:zc),a=i(t&&r?t.fallbackLocale.value:st(e.fallbackLocale)||yn(e.fallbackLocale)||Mt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Q1(l.value,e)),u=i(Mt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Mt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let p=t?t.missingWarn:Ot(e.missingWarn)||ga(e.missingWarn)?e.missingWarn:!0,m=t?t.fallbackWarn:Ot(e.fallbackWarn)||ga(e.fallbackWarn)?e.fallbackWarn:!0,f=t?t.fallbackRoot:Ot(e.fallbackRoot)?e.fallbackRoot:!0,v=!!e.fallbackFormat,w=un(e.missing)?e.missing:null,b=un(e.missing)?Mk(e.missing):null,_=un(e.postTranslation)?e.postTranslation:null,g=t?t.warnHtmlMessage:Ot(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const k=t?t.modifiers:Mt(e.modifiers)?e.modifiers:{};let I=e.pluralRules||t&&t.pluralRules,E;E=(()=>{s&&mk(null);const ie={version:t$,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:k,pluralRules:I,missing:b===null?void 0:b,missingWarn:p,fallbackWarn:m,fallbackFormat:v,unresolving:!0,postTranslation:_===null?void 0:_,warnHtmlMessage:g,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ie.datetimeFormats=u.value,ie.numberFormats=d.value,ie.__datetimeFormatters=Mt(E)?E.__datetimeFormatters:void 0,ie.__numberFormatters=Mt(E)?E.__numberFormatters:void 0;const we=W6(ie);return s&&mk(we),we})(),ec(E,l.value,a.value);function T(){return[l.value,a.value,c.value,u.value,d.value]}const $=j({get:()=>l.value,set:ie=>{E.locale=ie,l.value=ie}}),L=j({get:()=>a.value,set:ie=>{E.fallbackLocale=ie,a.value=ie,ec(E,l.value,ie)}}),R=j(()=>c.value),O=j(()=>u.value),B=j(()=>d.value);function F(){return un(_)?_:null}function q(ie){_=ie,E.postTranslation=ie}function G(){return w}function K(ie){ie!==null&&(b=Mk(ie)),w=ie,E.missing=b}const oe=(ie,we,je,Je,nt,Ve)=>{T();let ft;try{__INTLIFY_PROD_DEVTOOLS__,s||(E.fallbackContext=t?H6():void 0),ft=ie(E)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(E.fallbackContext=void 0)}if(je!=="translate exists"&&An(ft)&&ft===gh||je==="translate exists"&&!ft){const[xt,Zt]=we();return t&&f?Je(t):nt(xt)}else{if(Ve(ft))return ft;throw Ls(ks.UNEXPECTED_RETURN_TYPE)}};function le(...ie){return oe(we=>Reflect.apply(wk,null,[we,...ie]),()=>Mg(...ie),"translate",we=>Reflect.apply(we.t,we,[...ie]),we=>we,we=>st(we))}function pe(...ie){const[we,je,Je]=ie;if(Je&&!Rt(Je))throw Ls(ks.INVALID_ARGUMENT);return le(we,je,$n({resolvedMessage:!0},Je||{}))}function be(...ie){return oe(we=>Reflect.apply(vk,null,[we,...ie]),()=>xg(...ie),"datetime format",we=>Reflect.apply(we.d,we,[...ie]),()=>pf,we=>st(we)||yn(we))}function Be(...ie){return oe(we=>Reflect.apply(kk,null,[we,...ie]),()=>Tg(...ie),"number format",we=>Reflect.apply(we.n,we,[...ie]),()=>pf,we=>st(we)||yn(we))}function He(ie){return ie.map(we=>st(we)||An(we)||Ot(we)?Sk(String(we)):we)}const me={normalize:He,interpolate:ie=>ie,type:"vnode"};function _e(...ie){return oe(we=>{let je;const Je=we;try{Je.processor=me,je=Reflect.apply(wk,null,[Je,...ie])}finally{Je.processor=null}return je},()=>Mg(...ie),"translate",we=>we[Ag](...ie),we=>[Sk(we)],we=>yn(we))}function Ce(...ie){return oe(we=>Reflect.apply(kk,null,[we,...ie]),()=>Tg(...ie),"number format",we=>we[$g](...ie),xk,we=>st(we)||yn(we))}function de(...ie){return oe(we=>Reflect.apply(vk,null,[we,...ie]),()=>xg(...ie),"datetime format",we=>we[Eg](...ie),xk,we=>st(we)||yn(we))}function z(ie){I=ie,E.pluralRules=I}function Z(ie,we){return oe(()=>{if(!ie)return!1;const je=st(we)?we:l.value,Je=st(we)?[je]:Cg(E,a.value,je);for(let nt=0;nt<Je.length;nt++){const Ve=X(Je[nt]);let ft=E.messageResolver(Ve,ie);if(ft===null&&(ft=Ve[ie]),ni(ft)||bo(ft)||st(ft))return!0}return!1},()=>[ie],"translate exists",je=>Reflect.apply(je.te,je,[ie,we]),s$,je=>Ot(je))}function fe(ie){let we=null;const je=Cg(E,a.value,l.value);for(let Je=0;Je<je.length;Je++){const nt=c.value[je[Je]]||{},Ve=E.messageResolver(nt,ie);if(Ve!=null){we=Ve;break}}return we}function P(ie){const we=fe(ie);return we??(t?t.tm(ie)||{}:{})}function X(ie){return c.value[ie]||{}}function ne(ie,we){if(o){const je={[ie]:we};for(const Je in je)Co(je,Je)&&Vc(je[Je]);we=je[ie]}c.value[ie]=we,E.messages=c.value}function se(ie,we){c.value[ie]=c.value[ie]||{};const je={[ie]:we};if(o)for(const Je in je)Co(je,Je)&&Vc(je[Je]);we=je[ie],Ad(we,c.value[ie]),E.messages=c.value}function ce(ie){return u.value[ie]||{}}function H(ie,we){u.value[ie]=we,E.datetimeFormats=u.value,yk(E,ie,we)}function U(ie,we){u.value[ie]=$n(u.value[ie]||{},we),E.datetimeFormats=u.value,yk(E,ie,we)}function Q(ie){return d.value[ie]||{}}function ue(ie,we){d.value[ie]=we,E.numberFormats=d.value,bk(E,ie,we)}function ge(ie,we){d.value[ie]=$n(d.value[ie]||{},we),E.numberFormats=d.value,bk(E,ie,we)}Tk++,t&&hf&&(ze(t.locale,ie=>{r&&(l.value=ie,E.locale=ie,ec(E,l.value,a.value))}),ze(t.fallbackLocale,ie=>{r&&(a.value=ie,E.fallbackLocale=ie,ec(E,l.value,a.value))}));const xe={id:Tk,locale:$,fallbackLocale:L,get inheritLocale(){return r},set inheritLocale(ie){r=ie,ie&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,ec(E,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:R,get modifiers(){return k},get pluralRules(){return I||{}},get isGlobal(){return s},get missingWarn(){return p},set missingWarn(ie){p=ie,E.missingWarn=p},get fallbackWarn(){return m},set fallbackWarn(ie){m=ie,E.fallbackWarn=m},get fallbackRoot(){return f},set fallbackRoot(ie){f=ie},get fallbackFormat(){return v},set fallbackFormat(ie){v=ie,E.fallbackFormat=v},get warnHtmlMessage(){return g},set warnHtmlMessage(ie){g=ie,E.warnHtmlMessage=ie},get escapeParameter(){return y},set escapeParameter(ie){y=ie,E.escapeParameter=ie},t:le,getLocaleMessage:X,setLocaleMessage:ne,mergeLocaleMessage:se,getPostTranslationHandler:F,setPostTranslationHandler:q,getMissingHandler:G,setMissingHandler:K,[tC]:z};return xe.datetimeFormats=O,xe.numberFormats=B,xe.rt=pe,xe.te=Z,xe.tm=P,xe.d=be,xe.n=Be,xe.getDateTimeFormat=ce,xe.setDateTimeFormat=H,xe.mergeDateTimeFormat=U,xe.getNumberFormat=Q,xe.setNumberFormat=ue,xe.mergeNumberFormat=ge,xe[nC]=n,xe[Ag]=_e,xe[Eg]=de,xe[$g]=Ce,xe}function i$(e){const t=st(e.locale)?e.locale:zc,n=st(e.fallbackLocale)||yn(e.fallbackLocale)||Mt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=un(e.missing)?e.missing:void 0,o=Ot(e.silentTranslationWarn)||ga(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Ot(e.silentFallbackWarn)||ga(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Ot(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Mt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=un(e.postTranslation)?e.postTranslation:void 0,d=st(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,p=!!e.escapeParameterHtml,m=Ot(e.sync)?e.sync:!0;let f=e.messages;if(Mt(e.sharedMessages)){const k=e.sharedMessages;f=Object.keys(k).reduce((E,S)=>{const T=E[S]||(E[S]={});return $n(T,k[S]),E},f||{})}const{__i18n:v,__root:w,__injectWithOption:b}=e,_=e.datetimeFormats,g=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:f,flatJson:y,datetimeFormats:_,numberFormats:g,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:p,messageResolver:e.messageResolver,inheritLocale:m,__i18n:v,__root:w,__injectWithOption:b}}function Ig(e={}){const t=mf(i$(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return Ot(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=Ot(o)?!o:o},get silentFallbackWarn(){return Ot(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=Ot(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function r$(e,t,n){return{beforeCreate(){const s=Kc();if(!s)throw Ls(ks.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=Ak(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Ig(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Ak(e,o);else{this.$i18n=Ig({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&oC(t,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(s,this.$i18n)},mounted(){},unmounted(){const s=Kc();if(!s)throw Ls(ks.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function Ak(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[tC](t.pluralizationRules||e.pluralizationRules);const n=Q1(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const J1={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function l$({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Ie?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},Yt())}function iC(){return Ie}const a$=Xe({name:"i18n-t",props:$n({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>An(e)||!isNaN(e)}},J1),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||_t({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Yt();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=st(e.plural)?+e.plural:e.plural);const u=l$(t,a);return o[Ag](e.keypath,u,c)},r=$n(Yt(),s),l=st(e.tag)||Rt(e.tag)?e.tag:iC();return Rt(l)?Ut(l,r,{default:i}):Ut(l,r,i())}}}),Ek=a$;function c$(e){return yn(e)&&!st(e[0])}function rC(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Yt();e.locale&&(c.locale=e.locale),st(e.format)?c.key=e.format:Rt(e.format)&&(st(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((m,f)=>n.includes(f)?$n(Yt(),m,{[f]:e.format[f]}):m,Yt()));const d=s(e.value,c,u);let p=[c.key];return yn(d)?p=d.map((m,f)=>{const v=o[m.type],w=v?v({[m.type]:m.value,index:f,parts:d}):[m.value];return c$(w)&&(w[0].key=`${m.type}-${f}`),w}):st(d)&&(p=[d]),p},l=$n(Yt(),i),a=st(e.tag)||Rt(e.tag)?e.tag:iC();return Rt(a)?Ut(a,l,{default:r}):Ut(a,l,r())}}const u$=Xe({name:"i18n-n",props:$n({value:{type:Number,required:!0},format:{type:[String,Object]}},J1),setup(e,t){const n=e.i18n||_t({useScope:e.scope,__useComponent:!0});return rC(e,t,QS,(...s)=>n[$g](...s))}}),$k=u$;function d$(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function f$(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Ls(ks.UNEXPECTED_ERROR);const c=d$(e,l.$),u=Ik(a);return[Reflect.apply(c.t,c,[...Nk(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);hf&&(r.__i18nWatcher=ze(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{hf&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:l})=>{if(r.__composer){const a=r.__composer,c=Ik(l);r.textContent=Reflect.apply(a.t,a,[...Nk(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Ik(e){if(st(e))return{path:e};if(Mt(e)){if(!("path"in e))throw Ls(ks.REQUIRED_VALUE,"path");return e}else throw Ls(ks.INVALID_VALUE)}function Nk(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return st(n)&&(r.locale=n),An(o)&&(r.plural=o),An(i)&&(r.plural=i),[t,l,r]}function h$(e,t,...n){const s=Mt(n[0])?n[0]:{};(Ot(s.globalInstall)?s.globalInstall:!0)&&([Ek.name,"I18nT"].forEach(i=>e.component(i,Ek)),[$k.name,"I18nN"].forEach(i=>e.component(i,$k)),[Rk.name,"I18nD"].forEach(i=>e.component(i,Rk))),e.directive("t",f$(t))}const p$=wr("global-vue-i18n");function m$(e={}){const t=__VUE_I18N_LEGACY_API__&&Ot(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Ot(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=g$(e,t),r=wr("");function l(d){return s.get(d)||null}function a(d,p){s.set(d,p)}function c(d){s.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...p){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),Mt(p[0])){const v=p[0];u.__composerExtend=v.__composerExtend,u.__vueI18nExtend=v.__vueI18nExtend}let m=null;!t&&n&&(m=S$(d,u.global)),__VUE_I18N_FULL_INSTALL__&&h$(d,u,...p),__VUE_I18N_LEGACY_API__&&t&&d.mixin(r$(i,i.__composer,u));const f=d.unmount;d.unmount=()=>{m&&m(),u.dispose(),f()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function _t(e={}){const t=Kc();if(t==null)throw Ls(ks.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ls(ks.NOT_INSTALLED);const n=v$(t),s=k$(n),o=sC(t),i=y$(e,o);if(i==="global")return oC(s,e,o),s;if(i==="parent"){let a=Lk(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw Ls(ks.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=$n({},e),u=Lk(n,t);c.__root=u||s;const d=mf(c);return a.__composerExtend&&(d[Kl]=a.__composerExtend(d)),M1()&&A1(()=>{const m=d[Kl];m&&(m(),delete d[Kl])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=$n({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=mf(a),r.__composerExtend&&(l[Kl]=r.__composerExtend(l)),_$(r,t,l),r.__setInstance(t,l)}return l}function g$(e,t){const n=qM(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Ig(e)):n.run(()=>mf(e));if(s==null)throw Ls(ks.UNEXPECTED_ERROR);return[n,s]}function v$(e){const t=Nt(e.isCE?p$:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ls(e.isCE?ks.NOT_INSTALLED_WITH_PROVIDE:ks.UNEXPECTED_ERROR);return t}function y$(e,t){return ph(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function k$(e){return e.mode==="composition"?e.global:e.global.__composer}function Lk(e,t,n=!1){let s=null;const o=t.root;let i=b$(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(s=l.__composer,n&&s&&!s[nC]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function b$(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function _$(e,t,n){Jt(()=>{},t),qt(()=>{const s=n;e.__deleteInstance(t);const o=s[Kl];o&&(o(),delete s[Kl])},t)}const w$=["locale","fallbackLocale","availableLocales"],Ok=["t","rt","d","n","tm","te"];function S$(e,t){const n=Object.create(null);return w$.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Ls(ks.UNEXPECTED_ERROR);const r=En(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,Ok.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Ls(ks.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,Ok.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const C$=Xe({name:"i18n-d",props:$n({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},J1),setup(e,t){const n=e.i18n||_t({useScope:e.scope,__useComponent:!0});return rC(e,t,ZS,(...s)=>n[Eg](...s))}}),Rk=C$;n$();R6(g6);P6(N6);D6(Cg);if(__INTLIFY_PROD_DEVTOOLS__){const e=el();e.__INTLIFY__=!0,v6(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const x$={class:"row"},T$={class:"lead","aria-hidden":"true"},M$={key:0,class:"run-ico",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none"},A$={key:1,class:"unread-dot"},E$={class:"archive-label"},$$={class:"left"},I$=["onKeydown"],N$={class:"ts"},L$=["title"],O$={class:"tag-text"},R$=["title"],P$={class:"tag-text"},D$=["title"],B$={class:"tag-text"},F$=["title"],H$=Xe({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=_t(),o=e,i=n,r=te(!1),l=te(null),a=te(null);function c(T){const $=T.target;a.value?.contains($)||l.value?.contains($)||d()}function u(T){T.stopPropagation(),r.value?d():(r.value=!0,setTimeout(()=>document.addEventListener("mousedown",c),0))}function d(){r.value=!1,document.removeEventListener("mousedown",c)}qt(()=>document.removeEventListener("mousedown",c));const p=te(!1),m=te(""),f=te(null);async function v(){d(),p.value=!0,m.value=o.session.title,await ut();try{f.value?.focus(),f.value?.select()}catch{}}function w(){const T=m.value.trim();T&&i("rename",o.session.id,T),p.value=!1}function b(){p.value=!1}const _=te(!1);function g(){navigator.clipboard.writeText(o.session.id).then(()=>{_.value=!0,setTimeout(()=>{_.value=!1},1200)}).catch(()=>{})}function y(){d(),i("fork",o.session.id)}const k=te(!1);function I(){d(),k.value=!0}function E(){i("archive",o.session.id),k.value=!1}function S(){k.value=!1}return t({closeMenu:d,cancelArchive:S}),(T,$)=>(C(),A("div",{class:$e(["se",{on:e.active}]),onClick:$[5]||($[5]=L=>i("select",e.session.id))},[h("div",x$,[h("span",T$,[e.session.busy?(C(),A("svg",M$,[...$[6]||($[6]=[h("circle",{class:"run-track",cx:"8",cy:"8",r:"6","stroke-width":"2"},null,-1),h("path",{class:"run-arc",d:"M8 2 A6 6 0 1 1 2 8","stroke-width":"2","stroke-linecap":"round"},null,-1)])])):e.unread?(C(),A("span",A$)):re("",!0)]),k.value?(C(),A("div",{key:0,class:"archive-confirm",onClick:$[0]||($[0]=Ge(()=>{},["stop"]))},[h("span",E$,N(M(s)("sidebar.archiveConfirm")),1),h("button",{class:"btn-confirm",onClick:Ge(E,["stop"])},N(M(s)("sidebar.confirm")),1),h("button",{class:"btn-cancel",onClick:Ge(S,["stop"])},N(M(s)("sidebar.cancel")),1)])):(C(),A(Ie,{key:1},[h("div",$$,[p.value?At((C(),A("input",{key:0,ref_key:"renameInputRef",ref:f,"onUpdate:modelValue":$[1]||($[1]=L=>m.value=L),class:"rename-input",onClick:$[2]||($[2]=Ge(()=>{},["stop"])),onKeydown:[So(Ge(w,["stop"]),["enter"]),So(Ge(b,["stop"]),["esc"])],onBlur:w},null,40,I$)),[[bn,m.value]]):(C(),A("span",{key:1,class:"t",onDblclick:Ge(v,["stop"])},N(e.session.title),33))]),h("span",N$,N(e.session.time),1),!p.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(C(),A("span",{key:0,class:"tag tag-ask",title:M(s)("workspace.awaitingAnswerTitle")},[h("span",O$,N(M(s)("workspace.awaitingAnswer")),1)],8,L$)):re("",!0),!p.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(C(),A("span",{key:1,class:"tag tag-approve",title:M(s)("workspace.awaitingPermissionTitle")},[h("span",P$,N(M(s)("workspace.awaitingPermission")),1)],8,R$)):re("",!0),!p.value&&e.session.status==="aborted"?(C(),A("span",{key:2,class:"tag tag-aborted",title:M(s)("workspace.abortedTitle")},[h("span",B$,N(M(s)("workspace.aborted")),1)],8,D$)):re("",!0),p.value?re("",!0):(C(),A("button",{key:3,ref_key:"kebabRef",ref:l,class:$e(["kebab",{open:r.value}]),title:M(s)("sidebar.options"),onClick:$[3]||($[3]=Ge(L=>u(L),["stop"]))},[...$[7]||($[7]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"8",cy:"3",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,F$))],64))]),r.value?(C(),A("div",{key:0,ref_key:"menuRef",ref:a,class:"menu",onClick:$[4]||($[4]=Ge(()=>{},["stop"]))},[h("button",{class:"menu-item copy-id",onClick:Ge(g,["stop"])},N(_.value?"已复制 ✓":"复制 Session ID ⧉"),1),$[8]||($[8]=h("div",{class:"menu-divider"},null,-1)),h("button",{class:"menu-item",onClick:Ge(v,["stop"])},N(M(s)("sidebar.rename")),1),h("button",{class:"menu-item",onClick:Ge(y,["stop"])},N(M(s)("sidebar.fork")),1),h("button",{class:"menu-item archive",onClick:Ge(I,["stop"])},N(M(s)("sidebar.archive")),1)],512)):re("",!0)],2))}}),vt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Pk=vt(H$,[["__scopeId","data-v-490f8224"]]),W$={class:"side"},U$={class:"ch"},q$={class:"ch-brand"},j$=["title","aria-label"],z$=["title","aria-label"],V$={class:"search"},K$=["placeholder","aria-label","onKeydown"],G$=["title","aria-label"],Y$={class:"btn-wrap"},X$={key:0,class:"sessions"},Z$={key:1,class:"empty"},Q$={key:1,class:"sessions"},J$={key:0,class:"empty"},eI=["onClick","onContextmenu"],tI={class:"gh-top"},nI={class:"gh-folder",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},sI={key:0,class:"gh-name"},oI=["title","aria-label","aria-expanded","onClick"],iI=["title","aria-label","onClick"],rI=["title"],lI={class:"group-sessions"},aI=["onClick"],cI={key:1,class:"group-empty"},cm=10,uI=Xe({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","selectWorkspaces","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te(""),r=j(()=>i.value.trim()),l=j(()=>r.value.length>0),a=j(()=>{const H=r.value.toLowerCase();return H?s.sessions.filter(U=>{const Q=(U.title??"").toLowerCase(),ue=(U.lastPrompt??"").toLowerCase();return Q.includes(H)||ue.includes(H)}):[]});function c(){i.value=""}function u(H){c(),y(H)}const d=te(new Set);function p(H){return d.value.has(H)}function m(H){const U=new Set(d.value);if(U.has(H)){U.delete(H);const Q=new Set(f.value);Q.delete(H),f.value=Q}else U.add(H);d.value=U}const f=te(new Set);function v(H){return f.value.has(H)}function w(H){const U=new Set(f.value);U.has(H)?U.delete(H):U.add(H),f.value=U}function b(H,U,Q){if(U||H.length<=cm)return H;const ue=H.slice(0,cm);if(Q&&!ue.some(ge=>ge.id===Q)){const ge=H.find(xe=>xe.id===Q);ge&&(ue[cm-1]=ge)}return ue}const _=te(new Set);function g(H,U){if(U.shiftKey){U.stopPropagation();const Q=new Set(_.value);Q.has(H)?Q.delete(H):Q.add(H),_.value=Q,o("selectWorkspaces",Array.from(Q));return}_.value=new Set,o("selectWorkspaces",[]),m(H)}function y(H){_.value=new Set,o("selectWorkspaces",[]),o("select",H)}const k=te(null),I=te(""),E=te(null);function S(H,U){k.value=H,I.value=U,ut().then(()=>E.value?.focus())}function T(){const H=k.value,U=I.value.trim();H&&U&&o("renameWorkspace",H,U),k.value=null}function $(){k.value=null}const L=te(!1),R=te(null),O=te({}),B=te(null);function F(H){B.value&&!B.value.contains(H.target)&&G()}function q(H,U){if(U.shiftKey){U.stopPropagation();const Q=new Set(_.value);Q.has(H.id)?Q.delete(H.id):Q.add(H.id),_.value=Q,o("selectWorkspaces",Array.from(Q));return}U.preventDefault(),U.stopPropagation(),R.value=H,O.value={top:`${U.clientY}px`,left:`${U.clientX}px`},L.value=!0,document.addEventListener("mousedown",F,!0)}function G(){L.value=!1,document.removeEventListener("mousedown",F,!0),R.value=null,Be()}function K(){R.value&&navigator.clipboard.writeText(R.value.root),G()}function oe(){R.value&&S(R.value.id,R.value.name),G()}function le(){const H=R.value;H&&He(H.id)&&(o("deleteWorkspace",H.id),G())}const pe=te(null);let be;function Be(){clearTimeout(be),pe.value=null}function He(H){return pe.value===H?(Be(),!0):(clearTimeout(be),pe.value=H,be=setTimeout(()=>{pe.value=null},2500),!1)}const Ne=te(null),me=te(null),_e=te({}),Ce=te(null);function de(H){const U=H.target;U.closest(".gh-more")||U.closest(".ws-menu")||Z()}async function z(H,U){if(Ne.value===H.id){Z();return}const Q=U.currentTarget;me.value=H,Ne.value=H.id,document.addEventListener("mousedown",de),document.addEventListener("scroll",Z,!0),window.addEventListener("resize",Z),await ut();const ue=Ce.value,ge=Q.getBoundingClientRect(),xe=4,ie=8,we=ue?.offsetHeight??0,je=ue?.offsetWidth??0;let Je=ge.bottom+xe;Je+we>window.innerHeight-ie&&(Je=Math.max(ie,ge.top-we-xe));let nt=ge.right-je;nt<ie&&(nt=ie),_e.value={top:`${Math.round(Je)}px`,left:`${Math.round(nt)}px`}}function Z(){Ne.value=null,me.value=null,Be(),document.removeEventListener("mousedown",de),document.removeEventListener("scroll",Z,!0),window.removeEventListener("resize",Z)}function fe(H){navigator.clipboard.writeText(H.root),Z()}function P(H){S(H.id,H.name),Z()}function X(H){He(H.id)&&(o("deleteWorkspace",H.id),Z())}oo(()=>{document.removeEventListener("mousedown",F,!0),document.removeEventListener("mousedown",de),document.removeEventListener("scroll",Z,!0),window.removeEventListener("resize",Z),clearTimeout(be)});const ne=te(null);let se;function ce(){const H=ne.value;H&&(H.classList.remove("blink-now"),H.getBoundingClientRect(),H.classList.add("blink-now"),clearTimeout(se),se=setTimeout(()=>H.classList.remove("blink-now"),300))}return(H,U)=>(C(),A("aside",W$,[h("div",{class:"col",style:It({width:e.colWidth+"px"})},[h("div",U$,[h("div",q$,[(C(),A("svg",{ref_key:"logoRef",ref:ne,class:"ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:ce},[...U[20]||(U[20]=[mr('<defs data-v-94a6163e><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-94a6163e><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-94a6163e></rect><g class="ch-eyes" fill="#000" data-v-94a6163e><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-94a6163e></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-94a6163e></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-94a6163e></rect>',2)])],512)),U[21]||(U[21]=h("span",{class:"ch-name"},"Kimi Code",-1))]),h("button",{type:"button",class:"collapse-btn",title:M(n)("sidebar.collapseSidebar"),"aria-label":M(n)("sidebar.collapseSidebar"),onClick:U[0]||(U[0]=Ge(Q=>o("collapse"),["stop"]))},[...U[22]||(U[22]=[mr('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-94a6163e><path d="M11 6h9" data-v-94a6163e></path><path d="M11 12h9" data-v-94a6163e></path><path d="M11 18h9" data-v-94a6163e></path><path d="M7 9l-3 3 3 3" data-v-94a6163e></path></svg>',1)])],8,j$),h("button",{type:"button",class:"settings-btn",title:M(n)("settings.title"),"aria-label":M(n)("settings.title"),onClick:U[1]||(U[1]=Ge(Q=>o("openSettings"),["stop"]))},[...U[23]||(U[23]=[h("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("circle",{cx:"12",cy:"12",r:"3"}),h("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l-.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09A1.65 1.65 0 0 0 15 4.6a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09A1.65 1.65 0 0 0 19.4 15z"})],-1)])],8,z$)]),h("div",V$,[U[25]||(U[25]=h("svg",{class:"search-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("circle",{cx:"7",cy:"7",r:"5"}),h("path",{d:"M11 11l3 3"})],-1)),At(h("input",{"onUpdate:modelValue":U[2]||(U[2]=Q=>i.value=Q),class:"search-input",type:"text",placeholder:M(n)("sidebar.searchPlaceholder"),"aria-label":M(n)("sidebar.searchPlaceholder"),onKeydown:So(Ge(c,["stop"]),["esc"])},null,40,K$),[[bn,i.value]]),l.value?(C(),A("button",{key:0,type:"button",class:"search-clear",title:M(n)("sidebar.searchClear"),"aria-label":M(n)("sidebar.searchClear"),onClick:Ge(c,["stop"])},[...U[24]||(U[24]=[h("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,G$)):re("",!0)]),h("div",Y$,[h("button",{class:"btn-new-chat",onClick:U[3]||(U[3]=Ge(Q=>o("create"),["stop"]))},[U[26]||(U[26]=h("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),h("span",null,N(M(n)("sidebar.newChat")),1)]),re("",!0)]),l.value?(C(),A("div",X$,[a.value.length>0?(C(!0),A(Ie,{key:0},Ye(a.value,Q=>(C(),qe(Pk,{key:Q.id,session:Q,active:Q.id===e.activeId,"approval-count":e.pendingBySession[Q.id]?.approvals??0,"question-count":e.pendingBySession[Q.id]?.questions??0,unread:e.unreadBySession[Q.id]??!1,onSelect:U[5]||(U[5]=ue=>u(ue)),onRename:U[6]||(U[6]=(ue,ge)=>o("rename",ue,ge)),onArchive:U[7]||(U[7]=ue=>o("archive",ue)),onFork:U[8]||(U[8]=ue=>o("fork",ue))},null,8,["session","active","approval-count","question-count","unread"]))),128)):(C(),A("div",Z$,N(M(n)("sidebar.searchNoResults")),1))])):(C(),A("div",Q$,[e.groups.length===0?(C(),A("div",J$,N(M(n)("workspace.noWorkspace")),1)):(C(!0),A(Ie,{key:1},Ye(e.groups,Q=>(C(),A("div",{key:Q.workspace.id,class:"group"},[h("div",{class:$e(["gh",{on:Q.workspace.id===e.activeWorkspaceId,sel:_.value.has(Q.workspace.id)}]),onClick:Ge(ue=>g(Q.workspace.id,ue),["stop"]),onContextmenu:ue=>q(Q.workspace,ue)},[h("div",tI,[(C(),A("svg",nI,[p(Q.workspace.id)?(C(),A(Ie,{key:0},[U[28]||(U[28]=h("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),U[29]||(U[29]=h("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(C(),A(Ie,{key:1},[U[30]||(U[30]=h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),U[31]||(U[31]=h("path",{d:"M1 5.5h12"},null,-1))],64))])),k.value!==Q.workspace.id?(C(),A("span",sI,N(Q.workspace.name),1)):At((C(),A("input",{key:1,ref_for:!0,ref_key:"renameInputRef",ref:E,"onUpdate:modelValue":U[9]||(U[9]=ue=>I.value=ue),class:"gh-rename",type:"text",onKeydown:[So(T,["enter"]),So($,["esc"])],onBlur:$,onClick:U[10]||(U[10]=Ge(()=>{},["stop"]))},null,544)),[[bn,I.value]]),h("button",{type:"button",class:$e(["gh-more",{open:Ne.value===Q.workspace.id}]),title:M(n)("sidebar.options"),"aria-label":M(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":Ne.value===Q.workspace.id,onClick:Ge(ue=>z(Q.workspace,ue),["stop"])},[...U[32]||(U[32]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"8",cy:"3",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,oI),h("button",{type:"button",class:"gh-add",title:M(n)("workspace.newInGroup"),"aria-label":M(n)("workspace.newInGroup"),onClick:Ge(ue=>o("createInWorkspace",Q.workspace.id),["stop"])},[...U[33]||(U[33]=[h("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M8 3v10M3 8h10"})],-1)])],8,iI)]),h("div",{class:"gh-path",title:Q.workspace.root},N(Q.workspace.shortPath||Q.workspace.root),9,rI)],42,eI),At(h("div",lI,[(C(!0),A(Ie,null,Ye(b(Q.sessions,v(Q.workspace.id),e.activeId),ue=>(C(),qe(Pk,{key:ue.id,session:ue,active:ue.id===e.activeId,"approval-count":e.pendingBySession[ue.id]?.approvals??0,"question-count":e.pendingBySession[ue.id]?.questions??0,unread:e.unreadBySession[ue.id]??!1,onSelect:U[11]||(U[11]=ge=>y(ge)),onRename:U[12]||(U[12]=(ge,xe)=>o("rename",ge,xe)),onArchive:U[13]||(U[13]=ge=>o("archive",ge)),onFork:U[14]||(U[14]=ge=>o("fork",ge))},null,8,["session","active","approval-count","question-count","unread"]))),128)),!v(Q.workspace.id)&&b(Q.sessions,!1,e.activeId).length<Q.sessions.length?(C(),A("button",{key:0,class:"show-more",onClick:Ge(ue=>w(Q.workspace.id),["stop"])},N(M(n)("sidebar.showMore",{count:Q.sessions.length-b(Q.sessions,!1,e.activeId).length})),9,aI)):re("",!0),Q.sessions.length===0?(C(),A("div",cI,N(M(n)("sidebar.noSessions")),1)):re("",!0)],512),[[Ro,!p(Q.workspace.id)]])]))),128))]))],4),L.value?(C(),A("div",{key:0,ref_key:"ghMenuRef",ref:B,class:"gh-menu",style:It(O.value),onClick:U[15]||(U[15]=Ge(()=>{},["stop"]))},[h("button",{type:"button",class:"ghm-item",onClick:K},N(M(n)("sidebar.copyPath")),1),h("button",{type:"button",class:"ghm-item",onClick:oe},N(M(n)("sidebar.rename")),1),h("button",{type:"button",class:"ghm-item del",onClick:le},N(R.value&&pe.value===R.value.id?M(n)("sidebar.confirm"):M(n)("sidebar.removeWorkspace")),1)],4)):re("",!0),Ne.value!==null&&me.value?(C(),A("div",{key:1,ref_key:"wsMenuRef",ref:Ce,class:"ws-menu",style:It(_e.value),onClick:U[19]||(U[19]=Ge(()=>{},["stop"]))},[h("button",{class:"ws-menu-item",onClick:U[16]||(U[16]=Ge(Q=>fe(me.value),["stop"]))},N(M(n)("sidebar.copyPath")),1),U[34]||(U[34]=h("div",{class:"ws-menu-divider"},null,-1)),h("button",{class:"ws-menu-item",onClick:U[17]||(U[17]=Ge(Q=>P(me.value),["stop"]))},N(M(n)("sidebar.rename")),1),U[35]||(U[35]=h("div",{class:"ws-menu-divider"},null,-1)),h("button",{class:"ws-menu-item del",onClick:U[18]||(U[18]=Ge(Q=>X(me.value),["stop"]))},N(pe.value===me.value.id?M(n)("sidebar.confirm"):M(n)("sidebar.removeWorkspace")),1)],4)):re("",!0)]))}}),dI=vt(uI,[["__scopeId","data-v-94a6163e"]]),jt={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",theme:"kimi-web.theme",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",betaToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align"};function Dk(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function Sn(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function wn(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function uu(e){try{globalThis.localStorage.removeItem(e)}catch{}}function fI(e){try{const t=Sn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function hI(e,t){try{wn(e,String(t))}catch{}}function pI(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(b){return Number.isFinite(b)?Math.min(o,Math.max(s,Math.round(b))):n}const l=te(r(fI(t)??n)),a=te(!1);function c(b){const _=r(b);l.value=_,hI(t,_)}let u=0,d=0,p=null,m=-1;function f(b){if(!a.value)return;const _=b.clientX-u;c(d+(i?-_:_))}function v(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),p){try{p.releasePointerCapture(m)}catch{}p.removeEventListener("pointermove",f),p.removeEventListener("pointerup",v),p.removeEventListener("pointercancel",v)}p=null,m=-1}}function w(b){b.preventDefault(),a.value=!0,u=b.clientX,d=l.value,p=b.currentTarget,m=b.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{p.setPointerCapture(m)}catch{}p.addEventListener("pointermove",f),p.addEventListener("pointerup",v),p.addEventListener("pointercancel",v)}return oo(v),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:w}}const mI=["aria-label"],gI=Xe({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),{width:i,dragging:r,onPointerDown:l}=pI({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:n.max,reverse:n.reverse});return s("update:width",i.value),ze(i,a=>s("update:width",a)),ze(r,a=>s("update:dragging",a)),(a,c)=>(C(),A("div",{class:$e(["rh",{dragging:M(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??M(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>M(l)&&M(l)(...u))},[...c[1]||(c[1]=[h("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,mI))}}),Bk=vt(gI,[["__scopeId","data-v-419b78b9"]]),vI={preview:"Preview"},yI={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",comingSoon:"Coming soon…"},kI={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive session?",confirm:"Confirm",cancel:"Cancel",options:"Options",rename:"Rename",copyPath:"Copy path",archive:"Archive",fork:"Fork session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Show more ({count})",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchClear:"Clear search",searchNoResults:"No matching sessions"},bI={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},_I={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",confirm:"Confirm",cancel:"Cancel",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…"},wI={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",modelTooltip:"Click to switch model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionTooltip:"Click to cycle permission mode",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",modesTooltip:"Mode: Plan / Goal / Swarm",goalLabel:"Goal",swarmLabel:"Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},SI={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",steerNow:"Steer now ⌃S",steerTitle:"Inject into the running turn without waiting (Ctrl+S / ⌘S)",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking"},CI={title:"Sign in to Kimi Code",close:"Close (Esc)",starting:"Starting authorization flow…",lead:"Click the button below to authorize in a new browser tab.",authorizeInBrowser:"Authorize in browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",waitingAuth:"Waiting for authorization",waitingAutoClose:"Waiting for authorization, signs in automatically…",success:"Authorized",successHint:"Loading, will close automatically…",expiredTitle:"Authorization code expired",expiredHint:"Please restart the authorization flow",retry:"Retry",closeBtn:"Close",errorTitle:"The current daemon does not support login yet",errorHint:"Please upgrade kimi-code and try again"},xI={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",confirm:"Confirm",cancel:"Cancel",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},TI={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size}k ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},MI={title:"New session",close:"Close (Esc)",cwdLabel:"Working directory",cwdPlaceholder:"Absolute path of the working directory, e.g. /Users/you/project",recentLabel:"Recent directories",titleFieldLabel:"Title",titleFieldPlaceholder:"Optional, named automatically if left blank",create:"Create",cancel:"Cancel",footerHint:"Enter to create · Esc to close"},AI={title:"Sessions",close:"Close",searchPlaceholder:"Search sessions by title…",noWorkspace:"No workspace",emptyNone:"No sessions yet",emptyNoMatch:"No matching sessions",footerHint:"↑↓ to navigate · Enter to switch · Esc to close",justNow:"just now"},EI={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",generic:"Approve action?"},subagentBadge:"sub agent · {name}",required:"APPROVAL REQUIRED",danger:"Danger: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"Explain why you are rejecting… (Enter to submit, Esc to cancel)",feedbackHint:"Enter to submit · Esc to cancel",approve:"Approve",approveSession:"Approve for session",reject:"Reject",feedback:"+Feedback"},$I={title:"Question",step:"Q{current}/{total}",prev:"‹ Prev",next:"Next ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},II={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",dockQueue:"Queue",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",todoTag:"todos",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",collapse:"Collapse",expand:"Expand"},NI={panelTitle:"Thinking",close:"Close"},LI={title:"Changes",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} changes",empty:"No git changes / not provided by daemon",clean:"Working tree clean, no changes",back:"Back",loading:"Loading diff…",noDiff:"No line changes for this file",list:"List",tree:"Tree",close:"Close"},OI={},RI={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},PI={searching:"Searching…",noMatch:"No matches"},DI={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",contentType:"Content type",details:"Server details",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",status:"HTTP status",timeout:"Timeout"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},BI={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},sessions:{desc:"Browse & switch sessions"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},FI={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Plan",task:"Task"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"}},HI={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},WI={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},UI={label:"Theme",modern:"Explore",kimi:"Native",colorSchemeLabel:"Appearance",light:"Light",dark:"Dark",system:"System"},qI={preview:"预览"},jI={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",comingSoon:"敬请期待"},zI={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"归档会话?",confirm:"确认",cancel:"取消",options:"选项",rename:"重命名",copyPath:"复制路径",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"展开更多 ({count})",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchClear:"清除搜索",searchNoResults:"没有匹配的会话"},VI={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},KI={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"确定撤销?",confirm:"确定",cancel:"取消",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…"},GI={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",modelTooltip:"点击切换模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionTooltip:"点击循环切换审批模式",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",modesTooltip:"模式:计划 / 目标 / Swarm",goalLabel:"目标",swarmLabel:"Swarm",modeOff:"未启用",goalPlaceholder:"让 Agent 完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},YI={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",steerNow:"立即插入 ⌃S",steerTitle:"不等当前回合结束,把消息直接插进正在运行的任务(Ctrl+S / ⌘S)",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking"},XI={title:"登录 Kimi Code",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 kimi-code 后重试"},ZI={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",confirm:"确认",cancel:"取消",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},QI={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},JI={title:"新建会话",close:"关闭 (Esc)",cwdLabel:"工作目录",cwdPlaceholder:"工作目录绝对路径,如 /Users/you/project",recentLabel:"最近目录",titleFieldLabel:"标题",titleFieldPlaceholder:"可选,留空则自动命名",create:"新建",cancel:"取消",footerHint:"Enter 新建 · Esc 关闭"},e5={title:"会话",close:"关闭",searchPlaceholder:"按标题搜索会话…",noWorkspace:"无工作区",emptyNone:"暂无会话",emptyNoMatch:"没有匹配的会话",footerHint:"↑↓ 切换 · Enter 进入 · Esc 关闭",justNow:"刚刚"},t5={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈"},n5={title:"提问",step:"Q{current}/{total}",prev:"‹ 上一",next:"下一 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},s5={tag:"tasks",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",dockQueue:"队列",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",todoTag:"待办",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",collapse:"折叠",expand:"展开"},o5={panelTitle:"思考过程",close:"关闭"},i5={title:"改动",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},r5={},l5={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},a5={searching:"搜索中…",noMatch:"无匹配"},c5={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",contentType:"响应类型",details:"服务端详情",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",status:"HTTP 状态",timeout:"超时设置"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},u5={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},sessions:{desc:"浏览/切换会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},d5={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"计划",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"}},f5={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},h5={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},p5={label:"主题",modern:"探索",kimi:"原生",colorSchemeLabel:"外观",light:"浅色",dark:"深色",system:"跟随系统"},m5={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",themeLabel:"Theme",modernDesc:"Bubbles, conversational, softer.",kimiDesc:"Native look: calm, flat.",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},g5={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",themeLabel:"主题",modernDesc:"气泡、对话感、更柔和。",kimiDesc:"原生风格:安静、扁平。",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},v5={title:"Settings",tabs:{general:"General",agent:"Agent",advanced:"Advanced",experimental:"Experimental"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",permission:{manual:"Manual",auto:"Auto",yolo:"YOLO"},defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Telemetry",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",beta:"Experimental",betaToc:"Proportional conversation outline",betaTocHint:" Larger bubbles, viewport indicator, and hover tooltip"},y5={title:"设置",tabs:{general:"通用",agent:"Agent",advanced:"高级",experimental:"实验性"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",permission:{manual:"手动",auto:"自动",yolo:"全自动"},defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"遥测",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",beta:"实验性",betaToc:"对话目录增强",betaTocHint:"更大的气泡、视口指示器和悬停提示"},k5={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",confirmArchive:"Confirm archive?"},b5={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"detached",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",confirmArchive:"确认归档?"},_5={title:"Side chat",subtitle:"forked from this session",empty:"Ask a quick question on the side — it shares this session’s context.",placeholder:"Ask the side chat…",send:"Send"},w5={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},S5={en:{common:vI,app:yI,sidebar:kI,workspace:bI,conversation:_I,status:wI,composer:SI,login:CI,providers:xI,model:TI,newSession:MI,sessions:AI,approval:EI,question:$I,tasks:II,thinking:NI,diff:LI,fileTree:OI,filePreview:RI,mention:PI,warnings:DI,commands:BI,tools:FI,layout:HI,mobile:WI,theme:UI,onboarding:m5,settings:v5,header:k5,sideChat:_5},zh:{common:qI,app:jI,sidebar:zI,workspace:VI,conversation:KI,status:GI,composer:YI,login:XI,providers:ZI,model:QI,newSession:JI,sessions:e5,approval:t5,question:n5,tasks:s5,thinking:o5,diff:i5,fileTree:r5,filePreview:l5,mention:a5,warnings:c5,commands:u5,tools:d5,layout:f5,mobile:h5,theme:p5,onboarding:g5,settings:y5,header:b5,sideChat:w5}},lC=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function C5(){const e=Sn(jt.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Cn=m$({legacy:!1,locale:C5(),fallbackLocale:"en",messages:S5});function aC(e){Cn.global.locale.value=e,wn(jt.locale,e)}const ia=Cn.global.t,x5={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task"},T5={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search"};function du(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return T5[t]??t}function Fk(e){const t=x5[du(e)];return t?ia(t):e}const M5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="2.5" y="1.5" width="9" height="13" rx="1"/><line x1="5" y1="5" x2="9" y2="5"/><line x1="5" y1="7.5" x2="11" y2="7.5"/><line x1="5" y1="10" x2="10" y2="10"/></svg>',A5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="1.5" y="2.5" width="13" height="11" rx="1.5"/><polyline points="4,6 6.5,8 4,10"/><line x1="8" y1="10" x2="12" y2="10"/></svg>',Hk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M10.5 2.5l3 3-8 8H2.5v-3l8-8z"/><line x1="8.5" y1="4.5" x2="11.5" y2="7.5"/></svg>',E5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M3 12V4.5L8 2l5 2.5V12H3z"/><line x1="6" y1="7" x2="10" y2="7"/><line x1="8" y1="5" x2="8" y2="9"/></svg>',Wk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="6.5" cy="6.5" r="4"/><line x1="9.5" y1="9.5" x2="13.5" y2="13.5"/></svg>',$5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M5 2.5C3.5 2.5 3.5 5 3.5 6.5S2.5 8 2.5 8s1 0 1 1.5S3.5 13.5 5 13.5"/><path d="M11 2.5c1.5 0 1.5 2.5 1.5 4S13.5 8 13.5 8s-1 0-1 1.5.5 4-1.5 4"/><line x1="8" y1="6" x2="8" y2="10"/><line x1="6.3" y1="6.8" x2="9.7" y2="9.2"/><line x1="9.7" y1="6.8" x2="6.3" y2="9.2"/></svg>',I5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',N5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="6"/><path d="M8 2c-2 2-3 3.6-3 6s1 4 3 6"/><path d="M8 2c2 2 3 3.6 3 6s-1 4-3 6"/><line x1="2" y1="8" x2="14" y2="8"/></svg>',Uk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><polyline points="2,4.5 3.5,6 5.5,3"/><polyline points="2,11 3.5,12.5 5.5,9.5"/><line x1="8" y1="4.5" x2="14" y2="4.5"/><line x1="8" y1="11" x2="14" y2="11"/></svg>',L5='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M8.5 1L3 9h4l-1.5 6 5.5-8h-4l1.5-6z"/></svg>',O5="";function R5(e){switch(du(e)){case"read":return M5;case"bash":return A5;case"edit":return Hk;case"multi_edit":return Hk;case"write":return E5;case"grep":return Wk;case"search":return Wk;case"glob":return $5;case"ls":return I5;case"web_fetch":return N5;case"todo":return Uk;case"task":return Uk;default:return(e??"").trim().toLowerCase().includes("skill")?L5:O5}}const cC=80;function P5(e,t=cC){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function D5(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function B5(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Dt(e){return typeof e=="string"&&e.length>0?e:void 0}function jr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function F5(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean)[0];return n?`${t.host}/${n}`:t.host}catch{return e.replace(/^https?:\/\//,"")}}function um(e){return Dt(e.path)??Dt(e.file_path)??Dt(e.filePath)??Dt(e.filename)}const H5=64;function qk(e,t,n=!1){const s=(o,i=cC)=>n?o.trim():P5(o,i);try{const o=B5(t);if(!n&&D5(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(du(e)){case"read":{const r=um(o);if(!r)return i();const l=jr(o.offset)??jr(o.line_start)??jr(o.start_line),a=jr(o.limit)??jr(o.length),c=jr(o.line_end)??jr(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=um(o);return r?s(`${r} ${ia("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=um(o);return r?s(r):i()}case"bash":{const r=Dt(o.command)??Dt(o.cmd)??Dt(o.script);return r?s(r,H5):i()}case"grep":case"search":{const r=Dt(o.pattern)??Dt(o.query)??Dt(o.regex),l=Dt(o.path)??Dt(o.glob)??Dt(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=Dt(o.pattern)??Dt(o.glob)??Dt(o.query),l=Dt(o.path)??Dt(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):Dt(o.path)?s(Dt(o.path)):i()}case"ls":{const r=Dt(o.path)??Dt(o.dir)??Dt(o.directory)??Dt(o.cwd);return r?s(r):i()}case"web_fetch":{const r=Dt(o.url)??Dt(o.uri);return r?s(F5(r)):i()}case"todo":case"task":{const r=Dt(o.description)??Dt(o.title)??Dt(o.prompt)??Dt(o.name)??Dt(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(ia("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function W5(e){try{switch(du(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return ia("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return ia("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?ia("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const U5=["title"],q5=["title"],j5=["src","alt"],z5=["src"],V5=["src"],K5={class:"car",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},G5=["points"],Y5=["innerHTML"],X5={class:"a"},Z5=["title"],Q5={class:"rt"},J5={key:0,class:"chip"},eN={key:1,class:"spin",role:"status","aria-label":"running"},tN={key:3,class:"tm"},nN={key:0,class:"bb"},sN={key:0,class:"bb-summary"},oN={key:1,class:"bb-empty"},iN=Xe({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=j(()=>n.tool.status==="running"&&/^bash$/i.test(n.tool.name)),i=j(()=>!!n.tool.output&&n.tool.output.length>0),r=j(()=>i.value||o.value),l=te(n.tool.defaultExpanded===!0&&r.value);function a(){r.value&&(l.value=!l.value)}ze(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status,n.tool.name],()=>{n.tool.defaultExpanded===!0&&r.value&&(l.value=!0)});const c=()=>n.tool.status==="error"?"✕":"✓",u=()=>Fk(n.tool.name),d=()=>R5(n.tool.name),p=()=>qk(n.tool.name,n.tool.arg),m=()=>qk(n.tool.name,n.tool.arg,!0),f=()=>W5({name:n.tool.name,arg:n.tool.arg,output:n.tool.output,timing:n.tool.timing,status:n.tool.status}),v=()=>n.tool.status==="error",w=j(()=>n.tool.status==="ok"?n.tool.media:void 0);function b(k){return k.split(/[\\/]+/).pop()||k}function _(k){return k<1024?`${k} B`:k<1024*1024?`${(k/1024).toFixed(1)} KB`:`${(k/1024/1024).toFixed(1)} MB`}const g=j(()=>{const k=w.value;if(!k)return"";const I=[k.path?b(k.path):Fk(n.tool.name)];return k.mimeType&&I.push(k.mimeType),k.bytes!==void 0&&I.push(_(k.bytes)),k.dimensions&&I.push(k.dimensions),I.join(" · ")});function y(){const k=w.value;k?.kind==="image"&&s("openMedia",k)}return(k,I)=>w.value?(C(),A("div",{key:0,class:$e(["media-tool",{mob:e.mobile}])},[h("div",{class:"media-title",title:w.value.path||g.value},N(g.value),9,U5),w.value.kind==="image"?(C(),A("button",{key:0,type:"button",class:"media-image-button",title:w.value.path||g.value,onClick:y},[h("img",{class:"media-image",src:w.value.url,alt:w.value.path?b(w.value.path):g.value,loading:"lazy"},null,8,j5)],8,q5)):w.value.kind==="video"?(C(),A("video",{key:1,class:"media-video",src:w.value.url,controls:"",preload:"metadata"},null,8,z5)):(C(),A("audio",{key:2,class:"media-audio",src:w.value.url,controls:""},null,8,V5))],2)):(C(),A("div",{key:1,class:$e(["box",{open:l.value,err:v(),mob:e.mobile,stacked:e.stackPosition!=="single","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[h("div",{class:"bh",onClick:a},[(C(),A("svg",K5,[h("polyline",{points:l.value?"4,6 8,10 12,6":"6,4 10,8 6,12"},null,8,G5)])),d()?(C(),A("span",{key:0,class:"gl",innerHTML:d(),"aria-hidden":"true"},null,8,Y5)):re("",!0),h("span",X5,N(u()),1),l.value?re("",!0):(C(),A("span",{key:1,class:"p",title:p()},N(p()),9,Z5)),h("span",Q5,[f()?(C(),A("span",J5,N(f()),1)):re("",!0),e.tool.status==="running"?(C(),A("span",eN)):(C(),A("span",{key:2,class:$e(e.tool.status==="ok"?"ok":"er")},N(c()),3)),e.tool.timing&&e.tool.name!=="bash"?(C(),A("span",tN,N(e.tool.timing),1)):re("",!0)])]),l.value?(C(),A("div",nN,[m()?(C(),A("div",sN,N(m()),1)):re("",!0),i.value?re("",!0):(C(),A("div",oN,"Waiting for output…")),(C(!0),A(Ie,null,Ye(e.tool.output??[],(E,S)=>(C(),A("div",{key:S},N(E),1))),128))])):re("",!0)],2))}}),id=vt(iN,[["__scopeId","data-v-62dadf8a"]]);var rN=Object.create,ev=Object.defineProperty,lN=Object.getOwnPropertyDescriptor,uC=Object.getOwnPropertyNames,aN=Object.getPrototypeOf,cN=Object.prototype.hasOwnProperty,dC=(e,t)=>function(){return t||(0,e[uC(e)[0]])((t={exports:{}}).exports,t),t.exports},fC=e=>{let t={};for(var n in e)ev(t,n,{get:e[n],enumerable:!0});return t},uN=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=uC(t),i=0,r=o.length,l;i<r;i++)l=o[i],!cN.call(e,l)&&l!==n&&ev(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=lN(t,l))||s.enumerable});return e},hC=(e,t,n)=>(n=e!=null?rN(aN(e)):{},uN(ev(n,"default",{value:e,enumerable:!0}),e));function dN(e,t,n,s){const o=Number(e[t].meta.id+1).toString();let i="";return typeof s.docId=="string"&&(i=`-${s.docId}-`),i+o}function fN(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function hN(e,t,n,s,o){const i=o.rules.footnote_anchor_name(e,t,n,s,o),r=o.rules.footnote_caption(e,t,n,s,o);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function pN(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
39
|
+
`:`<hr class="footnotes-sep">
|
|
40
|
+
`)+`<section class="footnotes">
|
|
41
|
+
<ol class="footnotes-list">
|
|
42
|
+
`}function mN(){return`</ol>
|
|
43
|
+
</section>
|
|
44
|
+
`}function gN(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function vN(){return`</li>
|
|
45
|
+
`}function yN(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function kN(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=hN,e.renderer.rules.footnote_block_open=pN,e.renderer.rules.footnote_block_close=mN,e.renderer.rules.footnote_open=gN,e.renderer.rules.footnote_close=vN,e.renderer.rules.footnote_anchor=yN,e.renderer.rules.footnote_caption=fN,e.renderer.rules.footnote_anchor_name=dN;function s(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],p=l.eMarks[a];if(d+4>p||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let m;for(m=d+2;m<p;m++){if(l.src.charCodeAt(m)===32)return!1;if(l.src.charCodeAt(m)===93)break}if(m===d+2||m+1>=p||l.src.charCodeAt(++m)!==58)return!1;if(u)return!0;m++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const f=l.src.slice(d+2,m-2);l.env.footnotes.refs[`:${f}`]=-1;const v=new l.Token("footnote_reference_open","",1);v.meta={label:f},v.level=l.level++,l.tokens.push(v);const w=l.bMarks[a],b=l.tShift[a],_=l.sCount[a],g=l.parentType,y=m,k=l.sCount[a]+m-(l.bMarks[a]+l.tShift[a]);let I=k;for(;m<p;){const S=l.src.charCodeAt(m);if(n(S))S===9?I+=4-I%4:I++;else break;m++}l.tShift[a]=m-y,l.sCount[a]=I-k,l.bMarks[a]=y,l.blkIndent+=4,l.parentType="footnote",l.sCount[a]<l.blkIndent&&(l.sCount[a]+=l.blkIndent),l.md.block.tokenize(l,a,c,!0),l.parentType=g,l.blkIndent-=4,l.tShift[a]=b,l.sCount[a]=_,l.bMarks[a]=w;const E=new l.Token("footnote_reference_close","",-1);return E.level=--l.level,l.tokens.push(E),!0}function o(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,p=t(l,u+1);if(p<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const m=l.env.footnotes.list.length,f=[];l.md.inline.parse(l.src.slice(d,p),l.md,l.env,f);const v=l.push("footnote_ref","",0);v.meta={id:m},l.env.footnotes.list[m]={content:l.src.slice(d,p),tokens:f}}return l.pos=p+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const p=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${p}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let m;l.env.footnotes.refs[`:${p}`]<0?(m=l.env.footnotes.list.length,l.env.footnotes.list[m]={label:p,count:0},l.env.footnotes.refs[`:${p}`]=m):m=l.env.footnotes.refs[`:${p}`];const f=l.env.footnotes.list[m].count;l.env.footnotes.list[m].count++;const v=l.push("footnote_ref","",0);v.meta={id:m,subId:f,label:p}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const p={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(f){return f.type==="footnote_reference_open"?(d=!0,c=[],u=f.meta.label,!1):f.type==="footnote_reference_close"?(d=!1,p[":"+u]=c,!1):(d&&c.push(f),!d)}),!l.env.footnotes.list))return;const m=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let f=0,v=m.length;f<v;f++){const w=new l.Token("footnote_open","",1);if(w.meta={id:f,label:m[f].label},l.tokens.push(w),m[f].tokens){a=[];const g=new l.Token("paragraph_open","p",1);g.block=!0,a.push(g);const y=new l.Token("inline","",0);y.children=m[f].tokens,y.content=m[f].content,a.push(y);const k=new l.Token("paragraph_close","p",-1);k.block=!0,a.push(k)}else m[f].label&&(a=p[`:${m[f].label}`]);a&&(l.tokens=l.tokens.concat(a));let b;l.tokens[l.tokens.length-1].type==="paragraph_close"?b=l.tokens.pop():b=null;const _=m[f].count>0?m[f].count:1;for(let g=0;g<_;g++){const y=new l.Token("footnote_anchor","",0);y.meta={id:f,subId:g,label:m[f].label},l.tokens.push(y)}b&&l.tokens.push(b),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",s,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",o),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function bN(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==43)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){let i;const r=[],l=o.length;for(let a=0;a<l;a++){const c=o[a];if(c.marker!==43||c.end===-1)continue;const u=o[c.end];i=s.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=s.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",s.tokens[u.token-1].type==="text"&&s.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<s.tokens.length&&s.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=s.tokens[c],s.tokens[c]=s.tokens[a],s.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(s){const o=s.tokens_meta,i=(s.tokens_meta||[]).length;n(s,s.delimiters);for(let r=0;r<i;r++)o[r]&&o[r].delimiters&&n(s,o[r].delimiters)})}function _N(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==61)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){const i=[],r=o.length;for(let l=0;l<r;l++){const a=o[l];if(a.marker!==61||a.end===-1)continue;const c=o[a.end],u=s.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=s.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",s.tokens[c.token-1].type==="text"&&s.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<s.tokens.length&&s.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=s.tokens[a];s.tokens[a]=s.tokens[l],s.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(s){let o;const i=s.tokens_meta,r=(s.tokens_meta||[]).length;for(n(s,s.delimiters),o=0;o<r;o++)i[o]&&i[o].delimiters&&n(s,i[o].delimiters)})}const wN=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function SN(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==126||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(wN,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function CN(e){e.inline.ruler.after("emphasis","sub",SN)}const xN=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function TN(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==94||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(xN,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function MN(e){e.inline.ruler.after("emphasis","sup",TN)}var AN=dC({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(v,w){w=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},w),v.core.ruler.after("inline","github-task-lists",function(b){for(var _=b.tokens,g=0,y=2;y<_.length;y++)o(_,y)&&(i(_[y],g,w,b.Token),g+=1,n(_[y-2],"class",w.liClass),n(_[s(_,y-2)],"class",w.ulClass))})};function n(v,w,b){var _=v.attrIndex(w),g=[w,b];_<0?v.attrPush(g):v.attrs[_]=g}function s(v,w){for(var b=v[w].level-1,_=w-1;_>=0;_--)if(v[_].level===b)return _;return-1}function o(v,w){return d(v[w])&&p(v[w-1])&&m(v[w-2])&&f(v[w])}function i(v,w,b,_){var g=b.idPrefix+w;v.children[0].content=v.children[0].content.slice(3),v.children.unshift(l(g,_)),v.children.push(a(_)),v.children.unshift(r(v,g,b,_)),b.divWrap&&(v.children.unshift(c(b,_)),v.children.push(u(_)))}function r(v,w,b,_){var g=new _("checkbox_input","input",0);return g.attrs=[["type","checkbox"],["id",w]],/^\[[xX]\][ \u00A0]/.test(v.content)===!0&&g.attrs.push(["checked","true"]),b.disabled===!0&&g.attrs.push(["disabled","true"]),g}function l(v,w){var b=new w("label_open","label",1);return b.attrs=[["for",v]],b}function a(v){return new v("label_close","label",-1)}function c(v,w){var b=new w("checkbox_open","div",0);return b.attrs=[["class",v.divClass]],b}function u(v){return new v("checkbox_close","div",-1)}function d(v){return v.type==="inline"}function p(v){return v.type==="paragraph_open"}function m(v){return v.type==="list_item_open"}function f(v){return/^\[[xX \u00A0]\][ \u00A0]/.test(v.content)}})}),EN=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),$N=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),dm;const IN=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),NN=(dm=String.fromCodePoint)!==null&&dm!==void 0?dm:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function LN(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=IN.get(e))!==null&&t!==void 0?t:e}var Un;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Un||(Un={}));const ON=32;var rr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(rr||(rr={}));function Ng(e){return e>=Un.ZERO&&e<=Un.NINE}function RN(e){return e>=Un.UPPER_A&&e<=Un.UPPER_F||e>=Un.LOWER_A&&e<=Un.LOWER_F}function PN(e){return e>=Un.UPPER_A&&e<=Un.UPPER_Z||e>=Un.LOWER_A&&e<=Un.LOWER_Z||Ng(e)}function DN(e){return e===Un.EQUALS||PN(e)}var Wn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Wn||(Wn={}));var sr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(sr||(sr={}));var BN=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Wn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=sr.Strict}startEntity(e){this.decodeMode=e,this.state=Wn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Wn.EntityStart:return e.charCodeAt(t)===Un.NUM?(this.state=Wn.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Wn.NamedEntity,this.stateNamedEntity(e,t));case Wn.NumericStart:return this.stateNumericStart(e,t);case Wn.NumericDecimal:return this.stateNumericDecimal(e,t);case Wn.NumericHex:return this.stateNumericHex(e,t);case Wn.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|ON)===Un.LOWER_X?(this.state=Wn.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Wn.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,s){if(t!==n){const o=n-t;this.result=this.result*Math.pow(s,o)+parseInt(e.substr(t,o),s),this.consumed+=o}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Ng(s)||RN(s))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Ng(s))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Un.SEMI)this.consumed+=1;else if(this.decodeMode===sr.Strict)return 0;return this.emitCodePoint(LN(this.result),this.consumed),this.errors&&(e!==Un.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let s=n[this.treeIndex],o=(s&rr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=FN(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===sr.Attribute&&(o===0||DN(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&rr.VALUE_LENGTH)>>14,o!==0){if(i===Un.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==sr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&rr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~rr.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case Wn.NamedEntity:return this.result!==0&&(this.decodeMode!==sr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Wn.NumericDecimal:return this.emitNumericEntity(0,2);case Wn.NumericHex:return this.emitNumericEntity(0,3);case Wn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Wn.EntityStart:return 0}}};function pC(e){let t="";const n=new BN(e,s=>t+=NN(s));return function(o,i){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(i);const c=n.write(o,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+o.slice(r);return t="",a}}function FN(e,t,n,s){const o=(t&rr.BRANCH_LENGTH)>>7,i=t&rr.JUMP_TABLE;if(o===0)return i!==0&&s===i?n:-1;if(i){const a=s-i;return a<0||a>=o?-1:e[n+a]-1}let r=n,l=r+o-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<s)r=a+1;else if(c>s)l=a-1;else return e[a+o]}return-1}const HN=pC(EN);pC($N);function tv(e,t=sr.Legacy){return HN(e,t)}var WN=hC(AN());const jk={};function UN(e){let t=jk[e];if(t)return t;t=jk[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);t.push(s)}for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}function vh(e,t){typeof t!="string"&&(t=vh.defaultChars);const n=UN(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(s){let o="";for(let i=0,r=s.length;i<r;i+=3){const l=parseInt(s.slice(i+1,i+3),16);if(l<128){o+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(s.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?o+="��":o+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?o+="���":o+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16),u=parseInt(s.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}o+="�"}return o})}vh.defaultChars=";/?:@&=+$,#";vh.componentChars="";var Lg=vh;const zk={};function qN(e){let t=zk[e];if(t)return t;t=zk[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);/^[0-9a-z]$/i.test(s)?t.push(s):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function yh(e,t,n){typeof t!="string"&&(n=t,t=yh.defaultChars),typeof n>"u"&&(n=!0);const s=qN(t);let o="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){o+=e.slice(i,i+3),i+=2;continue}if(l<128){o+=s[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){o+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[i])}return o}yh.defaultChars=";/?:@&=+$,-_.!~*'()#";yh.componentChars="-_.!~*'()";var mC=yh;function nv(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function gf(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const jN=/^([a-z0-9.+-]+:)/i,zN=/:[0-9]*$/,VN=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,KN=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
46
|
+
`," "]),GN=["'"].concat(KN),Vk=["%","/","?",";","#"].concat(GN),Kk=["/","?","#"],YN=255,Gk=/^[+a-z0-9A-Z_-]{0,63}$/,XN=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Yk={javascript:!0,"javascript:":!0},Xk={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function ZN(e,t){if(e&&e instanceof gf)return e;const n=new gf;return n.parse(e,t),n}gf.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=VN.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=jN.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=i.substr(0,2)==="//",o&&!(r&&Yk[r])&&(i=i.substr(2),this.slashes=!0)),!Yk[r]&&(o||r&&!Xk[r])){let c=-1;for(let f=0;f<Kk.length;f++)s=i.indexOf(Kk[f]),s!==-1&&(c===-1||s<c)&&(c=s);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let f=0;f<Vk.length;f++)s=i.indexOf(Vk[f]),s!==-1&&(c===-1||s<c)&&(c=s);c===-1&&(c=i.length),i[c-1]===":"&&c--;const p=i.slice(0,c);i=i.slice(c),this.parseHost(p),this.hostname=this.hostname||"";const m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m){const f=this.hostname.split(/\./);for(let v=0,w=f.length;v<w;v++){const b=f[v];if(b&&!b.match(Gk)){let _="";for(let g=0,y=b.length;g<y;g++)b.charCodeAt(g)>127?_+="x":_+=b[g];if(!_.match(Gk)){const g=f.slice(0,v),y=f.slice(v+1),k=b.match(XN);k&&(g.push(k[1]),y.unshift(k[2])),y.length&&(i=y.join(".")+i),this.hostname=g.join(".");break}}}}this.hostname.length>YN&&(this.hostname=""),m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=i.indexOf("#");l!==-1&&(this.hash=i.substr(l),i=i.slice(0,l));const a=i.indexOf("?");return a!==-1&&(this.search=i.substr(a),i=i.slice(0,a)),i&&(this.pathname=i),Xk[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};gf.prototype.parseHost=function(e){let t=zN.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var sv=ZN,gC=fC({decode:()=>Lg,encode:()=>mC,format:()=>nv,parse:()=>sv}),vC=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,yC=/[\0-\x1F\x7F-\x9F]/,QN=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,kC=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,JN=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,bC=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,e8=fC({Any:()=>vC,Cc:()=>yC,Cf:()=>QN,P:()=>kC,S:()=>JN,Z:()=>bC}),t8=Object.defineProperty,_C=e=>{let t={};for(var n in e)t8(t,n,{get:e[n],enumerable:!0});return t},n8=_C({arrayReplaceAt:()=>c8,assign:()=>l8,countLines:()=>vn,escapeHtml:()=>y8,escapeRE:()=>b8,fromCodePoint:()=>Yc,has:()=>r8,isMdAsciiPunct:()=>kf,isPunctChar:()=>yf,isPunctCode:()=>Og,isSpace:()=>a8,isString:()=>o8,isValidEntityCode:()=>bh,isWhiteSpace:()=>Gc,lib:()=>_8,mdurl:()=>gC,normalizeReference:()=>kh,ucmicro:()=>vf,unescapeAll:()=>Xc,unescapeMd:()=>h8});const vf=e8;function s8(e){return Object.prototype.toString.call(e)}function o8(e){return s8(e)==="[object String]"}const i8=Object.prototype.hasOwnProperty;function r8(e,t){return i8.call(e,t)}function l8(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(s=>{e[s]=n[s]})}}),e}function a8(e){return e===9||e===32}function Gc(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function yf(e){return vf.P.test(e)||vf.S.test(e)}const Zk=new Map;function Og(e){if(kf(e))return!0;const t=Zk.get(e);if(t!==void 0)return t;const n=yf(String.fromCharCode(e));return Zk.set(e,n),n}function kf(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function kh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function c8(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function bh(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Yc(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const wC=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,u8=new RegExp(`${wC.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),d8=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function f8(e,t){if(t.charCodeAt(0)===35&&d8.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return bh(s)?Yc(s):e}const n=tv(e);return n!==e?n:e}function h8(e){return e.includes("\\")?e.replace(wC,"$1"):e}function Xc(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(u8,(t,n,s)=>n||f8(t,s))}const p8=/[&<>"]/,m8=/[&<>"]/g,g8={"&":"&","<":"<",">":">",'"':"""};function v8(e){return g8[e]}function y8(e){return p8.test(e)?e.replace(m8,v8):e}const k8=/[.?*+^$[\]\\(){}|-]/g;function b8(e){return e.replace(k8,"\\$&")}const _8={mdurl:gC,ucmicro:vf};function vn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
47
|
+
`,n+1))!==-1;)t++;return t}const w8=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,S8=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,C8=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,ov=["references","footnotes","abbreviations","abbr","abbrs"],iv=Symbol.for("markdown-it-ts.global-state"),rv=Object.prototype.hasOwnProperty;function Qk(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Po(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ur(e){if(Array.isArray(e))return e.map(t=>ur(t));if(Po(e)){const t={};for(const n of Object.keys(e))t[n]=ur(e[n]);return t}return e}function bf(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Po(e)?Object.keys(e):[]}function Rg(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Rg(e[n],t[n]))return!1;return!0}if(Po(e)||Po(t)){if(!Po(e)||!Po(t))return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of n)if(!rv.call(t,o)||!Rg(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function SC(e,t){if(Array.isArray(e))return e[Number(t)];if(Po(e))return e[t]}function x8(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=ur(t[n]);return e}if(Po(e)&&Po(t)){for(const n of Object.keys(e))rv.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=ur(t[n]);return e}return ur(t)}function T8(e,t,n){const s=n.ownedKeys??[],o=e[t];if(Po(o)||Array.isArray(o)){const i=new Set(bf(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=ur(SC(n.value,r)):delete o[r];!n.existed&&bf(o).length===0&&delete e[t];return}n.existed?e[t]=ur(n.value):delete e[t]}function lv(e){const t=e[iv];return Qk(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Qk(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function M8(e,t){Object.defineProperty(e,iv,{value:t,enumerable:!1,configurable:!0,writable:!0})}function ts(e){return e?w8.test(e)?"footnote-definition":S8.test(e)?"abbreviation-definition":C8.test(e)?"reference-definition":null:null}function fu(e){return lv(e)?.reason??null}function ra(e,t,n){if(fu(e)&&Li(e),!t)return n();av(e,t);try{const s=n();return cv(e),s}catch(s){throw Li(e),s}}function av(e,t){try{Li(e);const n={};for(const s of ov)n[s]=rv.call(e,s)?{existed:!0,value:ur(e[s])}:{existed:!1};M8(e,{reason:t,snapshot:n})}catch{}}function cv(e){const t=lv(e);if(t)for(const n of ov){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!Po(o)&&!Array.isArray(o))continue;const i=new Set(bf(s.existed?s.value:void 0));s.ownedKeys=bf(o).filter(r=>i.has(r)?!Rg(o[r],SC(s.value,r)):!0)}}function Li(e){const t=lv(e);if(t){for(const n of ov){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){T8(e,n,s);continue}s.existed?e[n]=x8(e[n],s.value):delete e[n]}delete e[iv]}}const Pg=Symbol.for("markdown-it-ts.diagnostics");function _h(e,t){if(e)try{const n=e[Pg];if(n&&typeof n=="object")return n;if(!t)return;const s={};return Object.defineProperty(e,Pg,{value:s,enumerable:!1,configurable:!0,writable:!0}),s}catch{return}}function yi(e){return _h(e,!1)}function A8(e){if(e)try{delete e[Pg]}catch{}}function Gs(e){A8(e)}function Vn(e,t){const n=_h(e,!0);n&&(n.strategy=t)}function fm(e,t){const n=_h(e,!0);n&&(n.chunk=t)}function CC(e,t){const n=_h(e,!0);n&&(n.unbounded=t)}function E8(e){const t={};e=e||{},t.src_Any=vC.source,t.src_Cc=yC.source,t.src_Z=bC.source,t.src_P=kC.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Dg(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function wh(e){return Object.prototype.toString.call(e)}function $8(e){return wh(e)==="[object String]"}function I8(e){return wh(e)==="[object Object]"}function N8(e){return wh(e)==="[object RegExp]"}function Jk(e){return wh(e)==="[object Function]"}function L8(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const xC={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function O8(e){return Object.keys(e||{}).reduce(function(t,n){return t||xC.hasOwnProperty(n)},!1)}const R8={"http:":{validate:function(e,t,n){const s=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(s)?s.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const s=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(s)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const s=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(s)?s.match(n.re.mailto)[0].length:0}}},P8="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",D8="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function B8(e){e.__index__=-1,e.__text_cache__=""}function F8(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function eb(){return function(e,t){t.normalize(e)}}function _f(e){const t=e.re=E8(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(P8),n.push(t.src_xn),t.src_tlds=n.join("|");function s(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const o=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,I8(a)){N8(a.validate)?c.validate=F8(a.validate):Jk(a.validate)?c.validate=a.validate:i(l,a),Jk(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=eb();return}if($8(a)){o.push(l);return}i(l,a)}),o.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:eb()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(L8).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),B8(e)}function H8(e,t){const n=e.__index__,s=e.__last_index__,o=e.__text_cache__.slice(n,s);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=s+t,this.raw=o,this.text=o,this.url=o}function Bg(e,t){const n=new H8(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function io(e,t){if(!(this instanceof io))return new io(e,t);t||O8(e)&&(t=e,e={}),this.__opts__=Dg({},xC,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Dg({},R8,e),this.__compiled__={},this.__tlds__=D8,this.__tlds_replaced__=!1,this.re={},_f(this)}io.prototype.add=function(t,n){return this.__schemas__[t]=n,_f(this),this};io.prototype.set=function(t){return this.__opts__=Dg(this.__opts__,t),this};io.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,s,o,i,r,l,a,c,u;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(t))!==null;)if(i=this.testSchemaAt(t,n[2],a.lastIndex),i){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(s=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(r=s.index+s[1].length,(this.__index__<0||r<this.__index__)&&(this.__schema__="",this.__index__=r,this.__last_index__=s.index+s[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(o=t.match(this.re.email_fuzzy))!==null&&(r=o.index+o[1].length,l=o.index+o[0].length,(this.__index__<0||r<this.__index__||r===this.__index__&&l>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=l))),this.__index__>=0};io.prototype.pretest=function(t){return this.re.pretest.test(t)};io.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};io.prototype.match=function(t){const n=[];let s=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Bg(this,s)),s=this.__last_index__);let o=s?t.slice(s):t;for(;this.test(o);)n.push(Bg(this,s)),o=o.slice(this.__last_index__),s+=this.__last_index__;return n.length?n:null};io.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const s=this.testSchemaAt(t,n[2],n[0].length);return s?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s,Bg(this,0)):null};io.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(s,o,i){return s!==i[o-1]}).reverse(),_f(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,_f(this),this)};io.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};io.prototype.onCompile=function(){};var TC=io,W8=dC({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,p=/[^\0-\x7F]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=35,w=Math.floor,b=String.fromCharCode;function _(F){throw new RangeError(f[F])}function g(F,q){const G=[];let K=F.length;for(;K--;)G[K]=q(F[K]);return G}function y(F,q){const G=F.split("@");let K="";G.length>1&&(K=G[0]+"@",F=G[1]),F=F.replace(m,".");const oe=g(F.split("."),q).join(".");return K+oe}function k(F){const q=[];let G=0;const K=F.length;for(;G<K;){const oe=F.charCodeAt(G++);if(oe>=55296&&oe<=56319&&G<K){const le=F.charCodeAt(G++);(le&64512)==56320?q.push(((oe&1023)<<10)+(le&1023)+65536):(q.push(oe),G--)}else q.push(oe)}return q}const I=F=>String.fromCodePoint(...F),E=function(F){return F>=48&&F<58?26+(F-48):F>=65&&F<91?F-65:F>=97&&F<123?F-97:36},S=function(F,q){return F+22+75*(F<26)-((q!=0)<<5)},T=function(F,q,G){let K=0;for(F=G?w(F/700):F>>1,F+=w(F/q);F>v*26>>1;K+=36)F=w(F/v);return w(K+(v+1)*F/(F+38))},$=function(F){const q=[],G=F.length;let K=0,oe=128,le=72,pe=F.lastIndexOf("-");pe<0&&(pe=0);for(let be=0;be<pe;++be)F.charCodeAt(be)>=128&&_("not-basic"),q.push(F.charCodeAt(be));for(let be=pe>0?pe+1:0;be<G;){const Be=K;for(let Ne=1,me=36;;me+=36){be>=G&&_("invalid-input");const _e=E(F.charCodeAt(be++));_e>=36&&_("invalid-input"),_e>w((2147483647-K)/Ne)&&_("overflow"),K+=_e*Ne;const Ce=me<=le?1:me>=le+26?26:me-le;if(_e<Ce)break;const de=36-Ce;Ne>w(2147483647/de)&&_("overflow"),Ne*=de}const He=q.length+1;le=T(K-Be,He,Be==0),w(K/He)>2147483647-oe&&_("overflow"),oe+=w(K/He),K%=He,q.splice(K++,0,oe)}return String.fromCodePoint(...q)},L=function(F){const q=[];F=k(F);const G=F.length;let K=128,oe=0,le=72;for(const Be of F)Be<128&&q.push(b(Be));const pe=q.length;let be=pe;for(pe&&q.push("-");be<G;){let Be=2147483647;for(const Ne of F)Ne>=K&&Ne<Be&&(Be=Ne);const He=be+1;Be-K>w((2147483647-oe)/He)&&_("overflow"),oe+=(Be-K)*He,K=Be;for(const Ne of F)if(Ne<K&&++oe>2147483647&&_("overflow"),Ne===K){let me=oe;for(let _e=36;;_e+=36){const Ce=_e<=le?1:_e>=le+26?26:_e-le;if(me<Ce)break;const de=me-Ce,z=36-Ce;q.push(b(S(Ce+de%z,0))),me=w(de/z)}q.push(b(S(me,0))),le=T(oe,He,be===pe),oe=0,++be}++oe,++K}return q.join("")},B={version:"2.3.1",ucs2:{decode:k,encode:I},decode:$,encode:L,toASCII:function(F){return y(F,function(q){return p.test(q)?"xn--"+L(q):q})},toUnicode:function(F){return y(F,function(q){return d.test(q)?$(q.slice(4).toLowerCase()):q})}};t.exports=B})}),MC=hC(W8()),Yn=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,s=t.length;n<s;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}};function uv(e,t,n){let s,o=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(s=e.charCodeAt(o),s===10||s===60)return i;if(s===62)return i.pos=o+1,i.str=Xc(e.slice(t+1,o)),i.ok=!0,i;if(s===92&&o+1<n){o+=2;continue}o++}return i}let r=0;for(;o<n&&(s=e.charCodeAt(o),!(s===32||s<32||s===127));){if(s===92&&o+1<n){if(e.charCodeAt(o+1)===32)break;o+=2;continue}if(s===40&&(r++,r>32))return i;if(s===41){if(r===0)break;r--}o++}return t===o||r!==0||(i.str=Xc(e.slice(t,o)),i.pos=o,i.ok=!0),i}var AC=uv;const Ed=-2;function U8(e,t,n){let s=t+1;for(;s<n;){const o=e.charCodeAt(s);if(o===93)return s;if(o===92){s+=2;continue}if(o===96||o===60||o===33&&s+1<n&&e.charCodeAt(s+1)===91||o===91)return Ed;s++}return-1}function dv(e,t,n){let s=1,o=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.__mdtsLinkLabelNoCloseFrom;if(typeof u=="number"&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.__mdtsLinkLabelNoCloseFrom=t+1,-1;const p=U8(l,t,a);if(p!==Ed)return p;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(s--,s===0)){o=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)s++;else if(n)return e.pos=c,-1}}let m=-1;return o&&(m=e.pos),e.pos=c,m}var wf=dv;function fv(e,t,n,s){let o,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)r.str=s.str,r.marker=s.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(o=e.charCodeAt(i),o===r.marker)return r.pos=i+1,r.str+=Xc(e.slice(t,i)),r.ok=!0,r;if(o===40&&r.marker===41)return r;o===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Xc(e.slice(t,i)),r}var EC=fv;function Sh(e,t){if(!e.attrs)return-1;for(let n=0;n<e.attrs.length;n++)if(e.attrs[n][0]===t)return n;return-1}function hv(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function q8(e,t,n){const s=Sh(e,t),o=[t,n];s<0?hv(e,o):e.attrs[s]=o}function j8(e,t){const n=Sh(e,t);return n>=0?e.attrs[n][1]:null}function z8(e,t,n){const s=Sh(e,t);s<0?hv(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var V8=_C({attrGet:()=>j8,attrIndex:()=>Sh,attrJoin:()=>z8,attrPush:()=>hv,attrSet:()=>q8,parseLinkDestination:()=>uv,parseLinkLabel:()=>dv,parseLinkTitle:()=>fv});function K8(e){return e.includes("\r")||e.includes("\0")}function $C(e){return typeof e=="string"?e:e.toString()}function G8(e){if(e.inlineMode){const t=new Yn("inline","",0);t.content=$C(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const Y8=/^([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])?)*)$/,X8=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Z8(e,t){let n=e.pos;const s=e.src;if(s.charCodeAt(n)!==60)return!1;const o=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=s.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=s.slice(o+1,n);if(X8.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}if(Y8.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}return!1}var Q8=Z8;function J8(e,t){const n=e.src;let s=e.pos;if(n.charCodeAt(s)!==96)return!1;const o=s;s++;const i=e.posMax;for(;s<i&&n.charCodeAt(s)===96;)s++;const r=n.slice(o,s),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=o)return t||(e.pending+=r),e.pos+=l,!0;let a=s,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let p=n.slice(s,c);p.includes(`
|
|
48
|
+
`)&&(p=p.replace(/\n/g," ")),p.length>2&&p.charCodeAt(0)===32&&p.charCodeAt(p.length-1)===32&&(p=p.slice(1,-1)),d.content=p}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var eL=J8;function tb(e){const t={},n=e.length;if(!n)return;let s=0,o=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[s].marker!==l.marker||o!==l.token-1)&&(s=r),o=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=s-i[s]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let p=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(p=!0),!p){const m=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+m,i[c]=m,l.open=!1,d.end=r,d.close=!1,u=-1,o=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function tL(e){const t=e.tokens_meta,n=e.tokens_meta.length;tb(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&tb(t[s].delimiters)}var nL=tL;function sL(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==95&&s!==42)return!1;const o=e.scanDelims(e.pos,s===42);if(!o||o.length===0)return!1;for(let i=0;i<o.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function nb(e,t){const n=t.length;for(let s=n-1;s>=0;s--){const o=t[s];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const i=t[o.end],r=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===o.marker&&t[s-1].token===o.token-1&&t[o.end+1].token===i.token+1,l=String.fromCharCode(o.marker),a=e.tokens[o.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[s-1].token].content="",e.tokens[t[o.end+1].token].content="",s--)}}function oL(e){const t=e.tokens_meta,n=e.tokens_meta.length;nb(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&nb(e,t[s].delimiters)}const sb={tokenize:sL,postProcess:oL};function IC(e){return tv(e)}function pv(e){return e>=48&&e<=57}function iL(e){const t=e|32;return pv(e)||t>=97&&t<=102}function NC(e){const t=e|32;return t>=97&&t<=122}function rL(e){return NC(e)||pv(e)}function lL(e,t,n){let s=t+2;if(s>=n)return null;let o=!1,i=7,r=s;for((e.charCodeAt(s)|32)===120&&(o=!0,i=6,s++,r=s);s<n&&s-r<i;){const l=e.charCodeAt(s);if(!(o?iL(l):pv(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function aL(e,t,n){let s=t+1;if(s>=n||!NC(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&rL(e.charCodeAt(s));)s++;if(s-t-1<2||s>=n||e.charCodeAt(s)!==59)return null;const o=e.slice(t,s+1);return IC(o)!==o?o:null}function cL(e,t){const n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=s)return!1;if(e.src.charCodeAt(n+1)===35){const o=lL(e.src,n,s);if(o){if(!t){const i=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=bh(i)?Yc(i):Yc(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=aL(e.src,n,s);if(o){const i=IC(o);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var uL=cL;const LC=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Fg=new Array(128),OC=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Fg[e]=`\\${t}`,OC[e]=LC[e]?t:Fg[e]}function ob(e,t,n){e.pending&&e.pushPending();const s=new Yn("text_special","",0);s.level=e.level,s.content=t,s.markup=n,s.info="escape",e.pendingLevel=e.level,e.tokens.push(s),e.tokens_meta.push(null)}function dL(e,t){let n=e.pos;const s=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=s))return!1;let i=o.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<s&&(i=o.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(ob(e,OC[i],Fg[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return ob(e,i<256&&LC[i]?r:l,l),e.pos=n+1,!0}var fL=dL;function hL(e){let t,n,s=0;const o=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=o[t];r&&(r.nesting&&r.nesting<0&&s--,r.level=s,r.nesting&&r.nesting>0&&s++,r.type==="text"&&t+1<i&&o[t+1]?.type==="text"?o[t+1].content=r.content+o[t+1].content:(t!==n&&(o[n]=r),n++))}t!==n&&(o.length=n)}var pL=hL;const RC=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,PC="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",mL=new RegExp(`^(?:${RC}|${PC}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),gL=new RegExp(`^(?:${RC}|${PC})`);function DC(e){return e===32||e===9||e===10||e===12||e===13}function vL(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||DC(t)}function yL(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t<e.length;t++){const n=e.charCodeAt(t);if(n===62)return!0;if(!DC(n))return!1}return!1}function kL(e){const t=e|32;return t>=97&&t<=122}function bL(e,t){if(!e.md.options.html)return!1;const n=e.posMax,s=e.pos,o=e.src;if(o.charCodeAt(s)!==60||s+2>=n)return!1;const i=o.charCodeAt(s+1);if(i!==33&&i!==63&&i!==47&&!kL(i))return!1;const r=o.slice(s).match(mL);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,vL(l)&&e.linkLevel++,yL(l)&&e.linkLevel--}return e.pos+=l.length,!0}var _L=bL;function wL(e,t){let n,s,o,i,r,l,a,c,u="";const d=e.pos,p=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const m=e.pos+2,f=wf(e,e.pos+1,!1);if(f<0)return!1;if(i=f+1,i<p&&e.src.charCodeAt(i)===40){for(i++;i<p&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=p)return!1;if(l=AC(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i<p&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=EC(e.src,i,e.posMax),i<p&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<p&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=p||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<p&&e.src.charCodeAt(i)===91?(c=i+1,i=wf(e,i),i>=0?o=e.src.slice(c,i++):i=f+1):i=f+1,o||(o=e.src.slice(m,f)),r=e.env.references[kh(o)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){s=e.src.slice(m,f);const v=[];e.md.inline.parse(s,e.md,e.env,v);const w=e.push("image","img",0);w.attrs=[["src",u],["alt",""]],w.children=v,w.content=s,a&&w.attrs.push(["title",a])}return e.pos=i,e.posMax=p,!0}var SL=wL;function CL(e,t){let n,s,o,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,p=e.pos+1,m=wf(e,e.pos,!0);if(m<0)return!1;let f=m+1;if(f<d&&e.src.charCodeAt(f)===40){for(c=!1,f++;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(f>=d)return!1;if(o=AC(e.src,f,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?f=o.pos:r="",a=f;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(o=EC(e.src,f,e.posMax),f<d&&a!==f&&o.ok)for(l=o.str,f=o.pos;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);}(f>=d||e.src.charCodeAt(f)!==41)&&(c=!0),f++}if(c){if(typeof e.env.references>"u")return!1;if(f<d&&e.src.charCodeAt(f)===91?(a=f+1,f=wf(e,f),f>=0?s=e.src.slice(a,f++):f=m+1):f=m+1,s||(s=e.src.slice(p,m)),i=e.env.references[kh(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=p,e.posMax=m;const v=e.push("link_open","a",1),w=[["href",r]];v.attrs=w,l&&w.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=d,!0}var xL=CL;function BC(e){const t=e|32;return t>=97&&t<=122}function TL(e){return e>=48&&e<=57}function ML(e){return BC(e)||TL(e)||e===43||e===45||e===46}function AL(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&ML(e.charCodeAt(t));)t--;return t++,t>=e.length||!BC(e.charCodeAt(t))?null:e.slice(t)}function EL(e,t,n){let s=t;for(;s<n;){const o=e.charCodeAt(s);if(o<=32||o===127||o===60)break;s++}return e.slice(t,s)}function $L(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,s=e.posMax;if(n+3>s||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=AL(e.pending);if(!o)return!1;const i=EL(e.src,n-o.length,s),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const p=e.push("link_close","a",-1);p.markup="linkify",p.info="auto"}return e.pos+=l.length-o.length,!0}function IL(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const s=e.pending.length-1,o=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let i=s-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<o;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var NL=IL;function LL(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==126)return!1;const o=e.scanDelims(e.pos,!0);if(!o)return!1;let i=o.length;const r=String.fromCharCode(s);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:s,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function ib(e,t){let n;const s=[],o=t.length;for(let i=0;i<o;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&s.push(l.token-1)}for(;s.length;){const i=s.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function OL(e){const t=e.delimiters;ib(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&ib(e,n[s].delimiters)}const rb={tokenize:LL,postProcess:OL};function lb(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function RL(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||lb(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!lb(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var PL=RL;function mv(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function DL(e){if(e.length===0)return 0;const t=e.slice().sort((s,o)=>s-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function BL(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function FC(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,s={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:mv(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function la(e,t,n,s,o,i){const r=FC(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=BL(t,n));a.calls++,a.inclusiveMs+=s,s>a.maxMs&&(a.maxMs=s),a.samples.push(s),i?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=mv()}function FL(e){const t=FC(e);if(!t)return null;const n=Object.keys(t.records);for(let s=0;s<n.length;s++){const o=t.records[n[s]];o.medianMs=DL(o.samples)}return t.completedAt=mv(),t}var ab=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const s=this.rules.findIndex(o=>o.name===e);s>=0&&this.rules.splice(s,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const s=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(s<0)return;const o=this.rules[s];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(s<0)throw new Error(`Parser rule not found: ${e}`);this.rules[s].fn=t,n?.alt!==void 0&&(this.rules[s].alt=n.alt),this.invalidateCache()}before(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const s of this.rules)if(s.enabled&&s.alt)for(const o of s.alt)e.add(o);const t=new Map,n=new Map;for(const s of e){const o=[],i=[];for(const r of this.rules)r.enabled&&(s!==""&&!r.alt?.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(s,o),n.set(s,i)}this.cache=t,this.namedCache=n}},HC=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;maxNesting;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s,this.tokens_meta=new Array(s.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Yn("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Yn(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const s=new Yn(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(o),s}scanDelims(e,t){const{src:n,posMax:s}=this,o=n.charCodeAt(e);let i=e;for(;i<s&&n.charCodeAt(i)===o;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<s?n.charCodeAt(i):32,c=Gc(l),u=Gc(a),d=Og(l),p=Og(a),m=!u&&(!p||c||d),f=!c&&(!d||u||p);return{can_open:m&&(t||!f||d),can_close:f&&(t||!m||p),length:r}}};HC.prototype.Token=Yn;function HL(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function WC(e){for(let t=0;t<e.length;t++)if(HL(e.charCodeAt(t)))return!1;return!0}var WL=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new ab,this.ruler2=new ab,this.ruler.push("text",PL),this.ruler.push("linkify",$L),this.ruler.push("newline",NL),this.ruler.push("escape",fL),this.ruler.push("backticks",eL),this.ruler.push("strikethrough",rb.tokenize),this.ruler.push("emphasis",sb.tokenize),this.ruler.push("link",xL),this.ruler.push("image",SL),this.ruler.push("autolink",Q8),this.ruler.push("html_inline",_L),this.ruler.push("entity",uL),this.ruler2.push("balance_pairs",nL),this.ruler2.push("strikethrough",rb.postProcess),this.ruler2.push("emphasis",sb.postProcess),this.ruler2.push("fragments_join",pL),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),s=n.length,o=e.cache,i=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<s;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(la(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<s;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,s=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=o[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(la(e.env,"inline",o[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,s){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&WC(e)){const a=new Yn("text","",0);a.content=e,s.push(a);return}const o=new HC(e,t,n,s);this.tokenize(o);const i=this.getRules2(),r=i.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](o,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(o,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();la(o.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,s){this.parseSource(e,t,n,s)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function UL(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let s=0,o=t.length;s<o;s++){const i=t[s];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&WC(i.content)){const r=new Yn("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const qL=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,jL=/[0-9a-z]/i;function zL(e){return/^<a[>\s]/i.test(e)}function VL(e){return/^<\/a\s*>/i.test(e)}function KL(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const s=t.raw[n-1],o=t.raw[n];if(!qL.test(s)||!jL.test(o))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function GL(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const s=t[n];if(s.type!=="inline"||!e.md.linkify.pretest(s.content))continue;let o=s.children;o||(o=[],s.children=o);let i=0;for(let r=o.length-1;r>=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(zL(l.content)&&i>0&&i--,VL(l.content)&&i++),i>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let c=(e.md.linkify.match(a)||[]).map(m=>KL(e.md.linkify,m));if(c.length===0)continue;const u=[];let d=l.level,p=0;c.length>0&&c[0].index===0&&r>0&&o[r-1].type==="text_special"&&(c=c.slice(1));for(let m=0;m<c.length;m++){const f=c[m],v=e.md.normalizeLink(f.url);if(!e.md.validateLink(v))continue;let w=f.text;f.schema?f.schema==="mailto:"&&!/^mailto:/i.test(w)?w=e.md.normalizeLinkText(`mailto:${w}`).replace(/^mailto:/,""):w=e.md.normalizeLinkText(w):w=e.md.normalizeLinkText(`http://${w}`).replace(/^http:\/\//,"");const b=f.index;if(b>p){const k=new Yn("text","",0);k.content=a.slice(p,b),k.level=d,u.push(k)}const _=new Yn("link_open","a",1);_.attrs=[["href",v]],_.level=d++,_.markup="linkify",_.info="auto",u.push(_);const g=new Yn("text","",0);g.content=w,g.level=d,u.push(g);const y=new Yn("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),p=f.lastIndex}if(p!==0){if(p<a.length){const m=new Yn("text","",0);m.content=a.slice(p),m.level=d,u.push(m)}o.splice(r,1,...u)}}}}const YL=/\r\n?|\n/g,XL=/\0/g;function ZL(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),s=t.includes("\0");if(!n&&!s)return;let o=t;n&&(o=o.replace(YL,`
|
|
49
|
+
`)),s&&(o=o.replace(XL,"�")),e.src=o}const UC=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,QL=/\((?:c|tm|r)\)/i,JL=/\((c|tm|r)\)/gi,eO={c:"©",r:"®",tm:"™"};function tO(e,t){return eO[t.toLowerCase()]}function nO(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&(s.content=s.content.replace(JL,tO)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function sO(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&UC.test(s.content)&&(s.content=s.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function oO(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");QL.test(s)&&nO(n.children||[]),UC.test(s)&&sO(n.children||[])}}var iO=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(s=>s.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(s=>s.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const rO=/['"]/,cb=/['"]/g,ub="’";function rd(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function lO(e,t){let n;const s=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=s.length-1;n>=0&&!(s[n].level<=l);n--);if(s.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){cb.lastIndex=c;const d=cb.exec(a);if(!d)break;let p=!0,m=!0;c=d.index+1;const f=d[0]==="'";let v=32;if(d.index-1>=0)v=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){v=e[n].content.charCodeAt(e[n].content.length-1);break}let w=32;if(c<u)w=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){w=e[n].content.charCodeAt(0);break}const b=kf(v)||yf(String.fromCharCode(v)),_=kf(w)||yf(String.fromCharCode(w)),g=Gc(v),y=Gc(w);if(y?p=!1:_&&(g||b||(p=!1)),g?m=!1:b&&(y||_||(m=!1)),w===34&&d[0]==='"'&&v>=48&&v<=57&&(m=p=!1),p&&m&&(p=b,m=_),!p&&!m){f&&(r.content=rd(r.content,d.index,ub));continue}if(m)for(n=s.length-1;n>=0;n--){let k=s[n];if(s[n].level<l)break;if(k.single===f&&s[n].level===l){k=s[n];let I,E;f?(I=o[2]||"‘",E=o[3]||"’"):(I=o[0]||"“",E=o[1]||"”"),r.content=rd(r.content,d.index,E),e[k.token].content=rd(e[k.token].content,k.pos,I),c+=E.length-1,k.token===i&&(c+=I.length-1),a=r.content,u=a.length,s.length=n;continue e}}p?s.push({token:i,pos:d.index,single:f,level:l}):m&&f&&(r.content=rd(r.content,d.index,ub))}}}function aO(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!rO.test(s)||!n.children||lO(n.children,e)}}function cO(e){const t=e.tokens||[],n=t.length;for(let s=0;s<n;s++){const o=t[s];if(o.type!=="inline"||!Array.isArray(o.children))continue;const i=o.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const uO=/^(?:vbscript|javascript|file|data):/,dO=/^data:image\/(?:gif|png|jpeg|webp);/,qC=["http:","https:","mailto:"];function jC(e){const t=e.trim().toLowerCase();return uO.test(t)?dO.test(t):!0}function zC(e){const t=sv(e,!0);if(t.hostname&&(!t.protocol||qC.includes(t.protocol)))try{t.hostname=MC.default.toASCII(t.hostname)}catch{}return mC(nv(t))}function VC(e){const t=sv(e,!0);if(t.hostname&&(!t.protocol||qC.includes(t.protocol)))try{t.hostname=MC.default.toUnicode(t.hostname)}catch{}return Lg(nv(t),`${Lg.defaultChars}%`)}function fO(e){switch(e){case 9:case 32:return!0}return!1}function hO(e,t,n,s){const o=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const p=e.lineMax;if(a[t]-e.blkIndent>=4||o.charCodeAt(u)!==62)return!1;if(s)return!0;const m=[],f=[],v=[],w=[],b=e.md.block.ruler.getRulesForState(e,"blockquote"),_=e.parentType;e.parentType="blockquote";let g=!1,y;for(y=t;y<n;y++){const T=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(o.charCodeAt(u++)===62&&!T){let L=a[y]+1,R,O;o.charCodeAt(u)===32?(u++,L++,O=!1,R=!0):o.charCodeAt(u)===9?(R=!0,(c[y]+L)%4===3?(u++,L++,O=!1):O=!0):R=!1;let B=L;for(m.push(i[y]),i[y]=u;u<d;){const F=o.charCodeAt(u);if(fO(F))F===9?B+=4-(B+c[y]+(O?1:0))%4:B++;else break;u++}g=u>=d,f.push(c[y]),c[y]=a[y]+1+(R?1:0),v.push(a[y]),a[y]=B-L,w.push(l[y]),l[y]=u-i[y];continue}if(g)break;let $=!1;for(let L=0,R=b.length;L<R;L++)if(b[L](e,y,n,!0)){$=!0;break}if($){e.lineMax=y,e.blkIndent!==0&&(m.push(i[y]),f.push(c[y]),w.push(l[y]),v.push(a[y]),a[y]-=e.blkIndent);break}m.push(i[y]),f.push(c[y]),w.push(l[y]),v.push(a[y]),a[y]=-1}const k=e.blkIndent;e.blkIndent=0;const I=e.push("blockquote_open","blockquote",1);I.markup=">";const E=[t,0];I.map=E,e.md.block.tokenize(e,t,y);const S=e.push("blockquote_close","blockquote",-1);S.markup=">",e.lineMax=p,e.parentType=_,E[1]=e.line;for(let T=0;T<w.length;T++)i[T+t]=m[T],l[T+t]=w[T],a[T+t]=v[T],c[T+t]=f[T];return e.blkIndent=k,!0}function pO(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,o=s;for(;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}e.line=o;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,o,4+e.blkIndent,!1)}
|
|
50
|
+
`,i.map=[t,e.line],!0}function mO(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>i)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const c=e.src.slice(l,o),u=e.src.slice(o,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(s)return!0;let d=t,p=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],o<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(o)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(o=e.skipChars(o,r),!(o-l<a)&&(o=e.skipSpaces(o),!(o<i)))){p=!0;break}a=e.sCount[t],e.line=d+(p?1:0);const m=e.push("fence","code",0);return m.info=u,m.content=e.getLines(t+1,d,a,!0),m.markup=c,m.map=[t,e.line],!0}const db=["","h1","h2","h3","h4","h5","h6"],fb=["","#","##","###","####","#####","######"];function hb(e){switch(e){case 9:case 32:return!0}return!1}function gO(e,t,n,s){const o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=o.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=o.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=o.charCodeAt(++a);if(d>6||a<c&&!hb(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const p=e.skipCharsBack(c,35,a);p>a&&hb(o.charCodeAt(p-1))&&(c=p),e.line=t+1;const m=e.push("heading_open",db[d],1);m.markup=fb[d],m.map=[t,e.line];const f=e.push("inline","",0);f.content=o.slice(a,c).trim(),f.map=[t,e.line],f.children=[];const v=e.push("heading_close",db[d],-1);return v.markup=fb[d],!0}function vO(e){switch(e){case 9:case 32:return!0}return!1}function yO(e,t,n,s){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<o;){const c=e.src.charCodeAt(i++);if(c!==r&&!vO(c))return!1;c===r&&l++}if(l<3)return!1;if(s)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const Rl=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"].join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${gL.source}\\s*$`),/^$/,!1]];function kO(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,i),l=0;for(;l<Rl.length&&!Rl[l][0].test(r);l++);if(l===Rl.length)return!1;if(s)return Rl[l][2];let a=t+1;if(!Rl[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(o=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(o,i),Rl[l][1].test(r)){r.length!==0&&a++;break}}e.line=a;const c=e.push("html_block","",0);return c.map=[t,a],c.content=e.getLines(t,a,e.blkIndent,!0),!0}function bO(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function KC(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function GC(e,t,n){if(t>=n)return!1;const s=e.charCodeAt(t);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:bO(e,t,n)}const pb=["","h1","h2"];function _O(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=KC(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let p=0,m,f=t+1;for(;f<n;f++){const y=i[f]+r[f],k=l[f];if(y>=k)break;if(a[f]-c>3)continue;if(a[f]>=c&&(m=o.charCodeAt(y),m===45||m===61)){let E=y+1,S=E;for(;E<k&&o.charCodeAt(E)===m;)E++;for(S=E;E<k;){const T=o.charCodeAt(E);if(T!==9&&T!==32)break;E++}if(E>=k){p=m===61?1:2;break}if(S-y>1)continue}if(a[f]<0||u&&!GC(o,y,k))continue;let I=!1;for(let E=0,S=s.length;E<S;E++)if(s[E](e,f,n,!0)){I=!0;break}if(I)break}if(!p)return!1;let v;if(f===t+1){const y=i[t]+r[t];let k=l[t];for(;k>y;){const I=o.charCodeAt(k-1);if(I!==9&&I!==32)break;k--}v=o.slice(y,k)}else v=e.getLines(t,f,c,!1).trim();e.line=f+1;const w=m===61?"=":"-",b=e.push("heading_open",pb[p],1);b.markup=w,b.map=[t,e.line];const _=e.push("inline","",0);_.content=v,_.map=[t,e.line-1],_.children=[];const g=e.push("heading_close",pb[p],-1);return g.markup=w,e.parentType=d,!0}function YC(e){switch(e){case 9:case 32:return!0}return!1}function mb(e,t){const n=e.eMarks,s=e.bMarks,o=e.tShift,i=e.src,r=n[t];let l=s[t]+o[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!YC(i.charCodeAt(l))?-1:l}function gb(e,t){const n=e.bMarks,s=e.tShift,o=e.eMarks,i=e.src,r=n[t]+s[t],l=o[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!YC(c))?-1:a}function wO(e,t,n){const s=e.bMarks,o=e.tShift,i=e.src,r=s[t]+o[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const SO=["0","1","2","3","4","5","6","7","8","9"];function CO(e,t){const n=e.level+2,s=e.tokens;for(let o=t+2,i=s.length-2;o<i;o++){const r=s[o];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,s[o+2].hidden=!0,o+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++o<i;)l+=s[o].nesting}}}}function xO(e,t,n,s){let o,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;s&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,p;const m=e.src,f=e.bMarks,v=e.tShift,w=e.eMarks,b=e.sCount,_=e.bsCount,g=f[l]+v[l];if(g>=w[l])return!1;const y=m.charCodeAt(g);if(y>=48&&y<=57){if(p=gb(e,l),p<0||(u=!0,r=g,d=wO(e,l,p),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(p=mb(e,l),p<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(p)>=w[l])return!1;if(s)return!0;const k=m.charCodeAt(p-1),I=String.fromCharCode(k);if(u){const R=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(R.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const E=[l,0];e.tokens[e.tokens.length-1].map=E,e.tokens[e.tokens.length-1].markup=I;let S=!1;const T=e.tokens.length-1,$=e.md.block.ruler.getRulesForState(e,"list"),L=e.parentType;for(e.parentType="list";l<n;){i=p,o=w[l];const R=b[l]+p-(f[l]+v[l]);let O=R;for(;i<o;){const He=m.charCodeAt(i);if(He===9)O+=4-(O+_[l])%4;else if(He===32)O++;else break;i++}const B=i;let F;B>=o?F=1:F=O-R,F>4&&(F=1);const q=R+F,G=e.push("list_item_open","li",1);G.markup=I;const K=[l,0];G.map=K,u&&(G.info=p-r-1===1?SO[m.charCodeAt(r)-48]:m.slice(r,p-1));const oe=e.tight,le=e.tShift[l],pe=e.sCount[l],be=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=q,e.tight=!0,e.tShift[l]=B-f[l],e.sCount[l]=O,B>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||S)&&(a=!1),S=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=be,e.tShift[l]=le,e.sCount[l]=pe,e.tight=oe,e.push("list_item_close","li",-1).markup=I,l=e.line,K[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let Be=!1;for(let He=0,Ne=$.length;He<Ne;He++)if($[He](e,l,n,!0)){Be=!0;break}if(Be)break;if(u){if(p=gb(e,l),p<0)break;r=f[l]+v[l]}else if(p=mb(e,l),p<0)break;if(k!==m.charCodeAt(p-1))break}return u?e.push("ordered_list_close","ol",-1).markup=I:e.push("bullet_list_close","ul",-1).markup=I,E[1]=l,e.line=l,e.parentType=L,a&&CO(e,T),!0}function vb(e){return e===9||e===32}function TO(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=KC(e);let p=t+1;for(e.parentType="paragraph";p<n&&!e.isEmpty(p);p++){if(c[p]-u>3||c[p]<0)continue;if(o==="list"&&c[p]>=u){const g=r[p]+l[p],y=a[p];if(g<y){const k=i.charCodeAt(g);if(k===42||k===45||k===43){if(g+1>=y||vb(i.charCodeAt(g+1)))break}else if(k>=48&&k<=57&&g+1<y){let I=g+1;for(;;){if(I>=y){I=-1;break}const E=i.charCodeAt(I++);if(E>=48&&E<=57){if(I-g>=10){I=-1;break}continue}if((E===41||E===46)&&(I>=y||vb(i.charCodeAt(I))))break;I=-1;break}if(I>=0)break}}}const w=r[p]+l[p],b=a[p];if(d&&!GC(i,w,b))continue;let _=!1;for(let g=0,y=s.length;g<y;g++)if(s[g](e,p,n,!0)){_=!0;break}if(_)break}const m=e.getLines(t,p,u,!1).trim();e.line=p;const f=e.push("paragraph_open","p",1);f.map=[t,e.line];const v=e.push("inline","",0);return v.content=m,v.map=[t,e.line],v.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function ld(e){switch(e){case 9:case 32:return!0}return!1}function MO(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(g){const y=e.lineMax;if(g>=y||e.isEmpty(g))return null;let k=!1;if(e.sCount[g]-e.blkIndent>3&&(k=!0),e.sCount[g]<0&&(k=!0),!k){const S=e.parentType;e.parentType="reference";let T=!1;for(let $=0,L=l.length;$<L;$++)if(l[$](e,g,y,!0)){T=!0;break}if(e.parentType=S,T)return null}const I=e.bMarks[g]+e.tShift[g],E=e.eMarks[g];return e.src.slice(I,E+1)}let c=e.src.slice(o,i+1);i=c.length;let u=-1;for(o=1;o<i;o++){const g=c.charCodeAt(o);if(g===91)return!1;if(g===93){u=o;break}else if(g===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(g===92&&(o++,o<i&&c.charCodeAt(o)===10)){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const g=c.charCodeAt(o);if(g===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!ld(g))break}const d=e.md.helpers.parseLinkDestination(c,o,i);if(!d.ok)return!1;const p=e.md.normalizeLink(d.str);if(!e.md.validateLink(p))return!1;o=d.pos;const m=o,f=r,v=o;for(;o<i;o++){const g=c.charCodeAt(o);if(g===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!ld(g))break}let w=e.md.helpers.parseLinkTitle(c,o,i);for(;w.can_continue;){const g=a(r);if(g===null)break;c+=g,o=i,i=c.length,r++,w=e.md.helpers.parseLinkTitle(c,o,i,w)}let b;for(o<i&&v!==o&&w.ok?(b=w.str,o=w.pos):(b="",o=m,r=f);o<i&&ld(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&b)for(b="",o=m,r=f;o<i&&ld(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const _=kh(c.slice(1,u));return _?(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[_]>"u"&&(e.env.references[_]={title:b,href:p}),e.line=r),!0):!1}function hm(e){switch(e){case 9:case 32:return!0}return!1}const AO=65536;function pm(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function EO(e,t){for(let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];n<s;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function yb(e){const t=[],n=e.length;let s=0,o=e.charCodeAt(s),i=!1,r=0,l="";for(;s<n;)o===124&&(i?(l+=e.substring(r,s-1),r=s):(t.push(l+e.substring(r,s)),l="",r=s+1)),i=o===92,s++,o=e.charCodeAt(s);return t.push(l+e.substring(r)),t}function $O(e,t,n,s){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let i=e.bMarks[o]+e.tShift[o];if(i>=e.eMarks[o])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[o])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!hm(l)||r===45&&hm(l)||!EO(e,t))return!1;for(;i<e.eMarks[o];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!hm(y))return!1;i++}let a=pm(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const k=c[y].trim();if(!k){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(k))return!1;k.charCodeAt(k.length-1)===58?u.push(k.charCodeAt(0)===58?"center":"right"):k.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=pm(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=yb(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(s)return!0;const p=e.parentType;e.parentType="table";const m=e.md.block.ruler.getRulesForState(e,"blockquote"),f=e.push("table_open","table",1),v=[t,0];f.map=v;const w=e.push("thead_open","thead",1);w.map=[t,t+1];const b=e.push("tr_open","tr",1);b.map=[t,t+1];for(let y=0;y<c.length;y++){const k=e.push("th_open","th",1);u[y]&&(k.attrs=[["style",`text-align:${u[y]}`]]);const I=e.push("inline","",0);I.content=c[y].trim(),I.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let _,g=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let y=!1;for(let I=0,E=m.length;I<E;I++)if(m[I](e,o,n,!0)){y=!0;break}if(y||(a=pm(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=yb(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),g+=d-c.length,g>AO))break;if(o===t+2){const I=e.push("tbody_open","tbody",1);I.map=_=[t+2,0]}const k=e.push("tr_open","tr",1);k.map=[o,o+1];for(let I=0;I<d;I++){const E=e.push("td_open","td",1);u[I]&&(E.attrs=[["style",`text-align:${u[I]}`]]);const S=e.push("inline","",0);S.content=c[I]?c[I].trim():"",S.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return _&&(e.push("tbody_close","tbody",-1),_[1]=o),e.push("table_close","table",-1),v[1]=o,e.parentType=p,e.line=o,!0}var IO=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}after(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:s,fn:o})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=o(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return la(i?.env,"block",s,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const s=this._rules.findIndex(o=>o.name===e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[s].fn=t,n?.alt&&(this._rules[s].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this._rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const s of this._rules)if(s.enabled)for(const o of s.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const s of e){const o=[],i=[];for(const r of this._rules)r.enabled&&(s!==""&&!r.alt.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t[s]=o,n[s]=i}this.cache=t,this.namedCache=n}};function kb(e){switch(e){case 9:case 32:return!0}return!1}var XC=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s;const o=this.src;let i=0,r=0,l=0,a=!1;for(let c=0,u=o.length;c<u;c++){const d=o.charCodeAt(c);if(!a)if(kb(d)){i++,d===9?r+=4-r%4:r++;continue}else a=!0;(d===10||c===u-1)&&(d!==10&&c++,this.bMarks.push(l),this.eMarks.push(c),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),a=!1,i=0,r=0,l=c+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const o=new Yn(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new Yn(e,t,n);return s.block=!0,n<0&&this.level--,s.level=this.level,n>0&&this.level++,this.tokens.push(s),s}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,s=this.eMarks;for(let o=this.lineMax;e<o&&!(t[e]+n[e]<s[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const s=t.charCodeAt(e);if(s!==9&&s!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const s=n.charCodeAt(--e);if(s!==9&&s!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let s=n.length;e<s&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const s=this.src;for(;e>n;)if(t!==s.charCodeAt(--e))return e+1;return e}getLines(e,t,n,s){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let p=d;const m=s?this.eMarks[u]+1:this.eMarks[u];let f=0;const v=this.src,w=this.bsCount,b=this.tShift;for(;p<m&&f<n;){const _=v.charCodeAt(p);if(_===9||_===32)_===9?f+=4-(f+w[u])%4:f++;else if(p-d<b[u])f++;else break;p++}return f>n?new Array(f-n+1).join(" ")+v.slice(p,m):v.slice(p,m)}const o=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let p=0;const m=r[d];let f=m,v;for(d+1<t||s?v=l[d]+1:v=l[d];f<v&&p<n;){const w=i.charCodeAt(f);if(kb(w))w===9?p+=4-(p+a[d])%4:p++;else if(f-m<c[d])p++;else break;f++}p>n?o[u]=new Array(p-n+1).join(" ")+i.slice(f,v):o[u]=i.slice(f,v)}return o.join("")}};XC.prototype.Token=Yn;const ad=[["table",$O,["paragraph","reference"]],["code",pO],["fence",mO,["paragraph","reference","blockquote","list"]],["blockquote",hO,["paragraph","reference","blockquote","list"]],["hr",yO,["paragraph","reference","blockquote","list"]],["list",xO,["paragraph","reference","blockquote"]],["reference",MO],["html_block",kO,["paragraph","reference","blockquote"]],["heading",gO,["paragraph","reference","blockquote"]],["lheading",_O],["paragraph",TO]];var NO=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new IO;for(let e=0;e<ad.length;e++)this.ruler.push(ad[e][0],ad[e][1],{alt:(ad[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const s=this.getRules(),o=s.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const m=e.line;let f=!1;for(let v=0;v<o;v++)if(f=s[v](e,u,n,!1),f){if(m>=e.line)throw new Error("block rule didn't increment state.line");break}if(!f)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const p=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const m=e.line;let f=!1;for(let v=0;v<o;v++){const w=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();f=p[v].fn(e,u,n,!1);const b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(la(e.env,"block",p[v].name,b-w,f,!1),f){if(m>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!f)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,s){if(!e||e.length===0)return;const o=new XC(e,t,n,s);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},ZC=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};ZC.prototype.Token=Yn;const bb=[["normalize",ZL],["block",G8],["inline",UL],["linkify",GL],["replacements",oO],["smartquotes",aO],["text_join",cO]],LO={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},OO={parseLinkLabel:dv,parseLinkDestination:uv,parseLinkTitle:fv};function RO(){return{...LO}}function PO(){return{...OO}}var DO=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new NO,this.inline=new WL,this.ruler=new iO;for(let e=0;e<bb.length;e++){const[t,n]=bb[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:RO(),helpers:PO(),normalizeLink:zC,normalizeLinkText:VC,validateLink:jC,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new TC),this.fallbackParser.block!==this.block&&(this.fallbackParser.block=this.block),this.fallbackParser.inline!==this.inline&&(this.fallbackParser.inline=this.inline),this.fallbackParser.core=this,this.fallbackParser.linkify=this.linkifyInstance,this.fallbackParser)}createState(e,t={},n){return new ZC(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let s=0;s<n.length;s++)n[s](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();la(e.env,"core",t[n].name,o-s,!0,!1)}FL(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&K8(e))return this.parse($C(e),t,n);const s=this.createState(e,t,n);return this.process(s),this.lastState=s,s}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const BO={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function Sf(e,t,n={},s){Gs(n);const o={...BO,...s||{}},i=ts(t);if(o.fallbackOnGlobalState!==!1&&i)return fm(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),ra(n,i,()=>e.core.parse(t,n,e).tokens);let r=$d(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=UO(r,o.maxChunks)),Id(t,r))return fm(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),ra(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return fm(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),ra(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),p=e.core.parse(d,n,e).tokens;l!==0&&p.length&&HO(p,l),WO(a,p),l+=u.lineCount}return a})}function $d(e,t,n=!0){const s=[];let o=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(p){p<=r||(s.push({start:r,end:p,lineCount:l}),r=p,o=0,i=0,l=0)}for(let p=0;p<e.length;){let m=e.indexOf(`
|
|
51
|
+
`,p),f=m;m===-1?(m=e.length,f=e.length):f=m+1;const v=qO(e,p,m);if(t.fenceAware){let _=p;for(;_<m;){const y=e.charCodeAt(_);if(y===32||y===9)_++;else break}const g=e[_];if(g==="`"||g==="~"){let y=_;for(;y<m&&e[y]===g;)y++;const k=y-_;k>=3&&(u?u.marker===g&&k>=u.length&&(u=null):u={marker:g,length:k})}}const w=f-p;o+=w,i+=1,l+=1,v?(a=0,c=0):(a+=1,c+=w);const b=v;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(b)d(f);else{const _=Math.max(10,Math.floor(t.maxChunkLines*.5)),g=Math.max(t.maxChunkChars,8e3);(a>=_||c>=g)&&d(f)}p=f}return n&&d(e.length),s}function Id(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!FO(e,t[o].end))return!0;return!1}function FO(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let s=n+1;s<t-1;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function HO(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function WO(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function UO(e,t){if(e.length<=t)return e;const n=[];let s=0;for(let o=0;o<t;o++){const i=t-o,r=e.length-s,l=Math.ceil(r/i),a=e.slice(s,s+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),s+=l}return n}function qO(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}const QC=4e6,JC=8e4,jO=1e4,zO=200,VO=1e4,KO=200;function ex(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function GO(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function Ki(e){return e.length===0?0:vn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function YO(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function XO(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
|
|
52
|
+
`,s);o===-1&&(o=e.length);let i=s;for(;i<o;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<o&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}s=o===e.length?e.length:o+1}return n!==null}function ZO(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return YO(e,n+1,e.length-1)?!XO(e,t):!1}function QO(e,t,n,s={}){const o=s.mode??"full",i=s.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(s.maxChunkChars!==void 0||s.maxChunkLines!==void 0||s.autoTune===!1){const r=s.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??VO:e.options.fullChunkSizeChars??jO),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??KO:e.options.fullChunkSizeLines??zO);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var hu=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=Ki(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=$d(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(Id(this.pending,s,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const o=this.commitRanges(s,e);return this.pending=this.pending.slice(o),this.updateEnvDiagnostics(e,t,Ki(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!ZO(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Ki(this.pending)),null;const n=$d(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,Ki(this.pending)),null;const s=Id(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Ki(this.pending)}]:n;return this.commitRanges(s,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const s=this.resolveWindow();return this.updateEnvDiagnostics(e,s,0),this.tokens}const t=this.resolveWindow(),n=$d(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=Id(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Ki(this.pending)}]:n;this.commitRanges(s,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:Ki(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+Ki(this.pending);return QO(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(fu(e)&&Li(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=ts(t);n&&(av(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let s=0;s<e.length;s++){const o=e[s],i=this.pending.slice(o.start,o.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&GO(r,a),this.options.retainTokens!==!1&&ex(this.tokens,r),this.committedChars+=i.length,this.committedLines+=o.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:o.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=o.end}return this.markedGlobalStateReason&&cv(t),n}catch(s){throw this.markedGlobalStateReason&&(Li(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){CC(e,{mode:this.options.mode??"full",maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:n,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,globalStateDetected:this.markedGlobalStateReason||void 0})}};function JO(e,t,n={},s={}){Gs(n);const o=new hu(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function eR(e,t,n={},s={}){Gs(n);const o=new hu(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function tR(e,t,n,s={},o={}){Gs(s);const i=new hu(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}async function nR(e,t,n,s={},o={}){Gs(s);const i=new hu(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}function tx(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??QC,o=e.options.autoUnboundedThresholdLines??JC;return t>=s||n>=o}function nx(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??QC))return"yes";const s=e.options.autoUnboundedThresholdLines??JC;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function wc(e,t,n={},s={}){Gs(n);const o=ts(t);if(fu(n)&&Li(n),s.fallbackOnGlobalState!==!1&&o)return CC(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:vn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),ra(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new hu(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){ex(i,l)}});if(o&&av(n,o),r.feed(t),r.flushForce(n),o&&(cv(n),s.fallbackOnGlobalState===!1)){const l=yi(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const aa=(e,t,n)=>e<t?t:e>n?n:e;function sx(e){return e.experimental?{...e,...e.experimental}:e}const _b=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],wb=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function ox(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function sR(e,t=Math.max(0,e/40|0),n={}){const s=sx(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<_b.length;l++){const a=_b[l];if(e<=a.max){if(a.strategy!=="adaptive")return ox(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:aa(Math.ceil(e/i),8e3,64e3),maxChunkLines:aa(Math.ceil(t/i),150,700),maxChunks:aa(Math.ceil(e/64e3),i,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.fullChunkSizeChars??1e4,maxChunkLines:s.fullChunkSizeLines??200,fenceAware:o,maxChunks:s.fullChunkMaxChunks}}function Sb(e,t=Math.max(0,e/40|0),n={}){const s=sx(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<wb.length;l++){const a=wb[l];if(e<=a.max){if(a.strategy!=="adaptive")return ox(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:aa(Math.ceil(e/i),8e3,64e3),maxChunkLines:aa(Math.ceil(t/i),150,700),maxChunks:aa(Math.ceil(e/64e3),i,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.streamChunkSizeChars??1e4,maxChunkLines:s.streamChunkSizeLines??200,maxChunks:s.streamChunkMaxChunks,fenceAware:o}}var oR={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},iR={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},rR={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};const lR=/[&<>"]/,Cb=/[&<>"]/g,aR=/&/g,cR=/[<>"]/g,uR={"&":"&","<":"<",">":">",'"':"""};function mm(e){return uR[e]||e}function rn(e){if(e.length===0)return"";if(e.length<32)return lR.test(e)?e.replace(Cb,mm):e;const t=e.includes("&"),n=e.includes("<"),s=e.includes(">"),o=e.includes('"');return!t&&!n&&!s&&!o?e:t&&!n&&!s&&!o?e.replace(aR,"&"):t?e.replace(Cb,mm):e.replace(cR,mm)}const dR=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),fR=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function ix(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(dR,(t,n,s)=>{if(n)return n;if(fR.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return bh(i)?Yc(i):"�"}const o=tv(t);return o!==t?o:t})}function Ch(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Nd(e,t){if(Ch(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const xb=e=>Ch(e)?e:Promise.resolve(e);function Sc(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return rn(e)}}function vr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Sc(t[0])}="${rn(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${Sc(o[0])}="${rn(o[1])}"`}return n}function rx(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const s=e.charCodeAt(t);if(s===32||s===9||s===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const s=e.charCodeAt(n);if(s!==32&&s!==9&&s!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function Cc(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
|
|
53
|
+
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${rn(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
|
|
54
|
+
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${s}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${vr(r)}>${t}</code></pre>
|
|
55
|
+
`}return`<pre><code${vr(e.attrs)}>${t}</code></pre>
|
|
56
|
+
`}function Cf(e){return!e.attrs||e.attrs.length===0?`<code>${rn(e.content)}</code>`:`<code${vr(e.attrs)}>${rn(e.content)}</code>`}function Hg(e){const t=rn(e.content);return e.attrs?`<pre${vr(e.attrs)}><code>${t}</code></pre>
|
|
57
|
+
`:`<pre><code>${t}</code></pre>
|
|
58
|
+
`}function hR(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}<p>`;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}<td>`;case"th_open":return`${t}<th>`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}<td style="${rn(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${rn(n[0][1])}">`}return null}function Tb(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Sc(t[0][0])}="${rn(t[0][1])}">`:t.length===2?`<a ${Sc(t[0][0])}="${rn(t[0][1])}" ${Sc(t[1][0])}="${rn(t[1][1])}">`:`<a${vr(t)}>`}function pR(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function Mb(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function xf(e,t){if(e.hidden)return"";const n=e.attrs,s=e.nesting,o=e.tag;if(!n||n.length===0)return s===0?t?`<${o} />`:`<${o}>`:s===-1?`</${o}>`:`<${o}>`;let i=(s===-1?"</":"<")+o+vr(n);return s===0&&t&&(i+=" /"),`${i}>`}const mR={langPrefix:"language-",xhtmlOut:!1,breaks:!1},cd=Object.prototype.hasOwnProperty,Qt={code_inline(e,t){return Cf(e[t])},code_block(e,t){return Hg(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?ix(i.info).trim():"",{langName:l,langAttrs:a}=rx(r),c=n.highlight,u=rn(i.content);if(!c)return Cc(i,u,r,l,n);const d=c(i.content,l,a);return Ch(d)?d.then(p=>Cc(i,p||u,r,l,n)):Cc(i,d||u,r,l,n)},image(e,t,n,s,o){const i=e[t],r=o.renderInlineAsText(i.children||[],n,s),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],xf(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
59
|
+
`:`<br>
|
|
60
|
+
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
61
|
+
`:`<br>
|
|
62
|
+
`:`
|
|
63
|
+
`},text(e,t){return rn(e[t].content)},text_special(e,t){return rn(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Ab(e,t,n){const s=e.info?ix(e.info).trim():"",{langName:o,langAttrs:i}=rx(s),r=t.highlight,l=rn(e.content);if(!r)return Cc(e,l,s,o,t);const a=r(e.content,o,i);if(Ch(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Cc(e,a||l,s,o,t)}function ud(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===Qt.text)return l.content.length===0?"":rn(l.content);break;case"text_special":if(o.text_special===Qt.text_special)return l.content.length===0?"":rn(l.content);break;case"softbreak":if(o.softbreak===Qt.softbreak)return r;break;case"hardbreak":if(o.hardbreak===Qt.hardbreak)return i;break;case"html_inline":if(o.html_inline===Qt.html_inline)return l.content;break;case"code_inline":if(o.code_inline===Qt.code_inline)return Cf(l);break}const a=o[l.type];if(!a)return xf(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:Nd(c,l.type)}var gR=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Qt}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const s=this.mergeOptions(t),o=n??{},i=this.rules,r=s.xhtmlOut===!0;let l,a,c,u,d,p,m="",f="",v=!1,w="";for(let b=0;b<e.length;b++){const _=e[b],g=_.type,y=b>0&&e[b-1].hidden?`
|
|
64
|
+
`:"";if(g==="list_item_open"&&(!_.attrs||_.attrs.length===0)&&b+3<e.length){const E=e[b+1],S=e[b+2],T=e[b+3];if(E.type==="paragraph_open"&&E.hidden&&S.type==="inline"&&T.type==="paragraph_close"&&T.hidden){w+=`${y}<li>${this.renderInlineTokens(S.children||[],s,o)}`,b+=3;continue}}if(b+2<e.length){const E=e[b+1],S=e[b+2];if(E.type==="inline"&&S.nesting===-1&&S.tag===_.tag&&!S.hidden){const T=hR(_,y);if(T!==null){w+=`${T+this.renderInlineTokens(E.children||[],s,o)}</${_.tag}>
|
|
65
|
+
`,b+=2;continue}}}if(g==="inline"){const E=_.children||[];if(E.length===1){v||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,p=i.code_inline,m=s.xhtmlOut?`<br />
|
|
66
|
+
`:`<br>
|
|
67
|
+
`,f=s.breaks?m:`
|
|
68
|
+
`,v=!0);const S=E[0];switch(S.type){case"text":if(l===Qt.text){w+=rn(S.content);continue}break;case"text_special":if(a===Qt.text_special){w+=rn(S.content);continue}break;case"softbreak":if(c===Qt.softbreak){w+=f;continue}break;case"hardbreak":if(u===Qt.hardbreak){w+=m;continue}break;case"html_inline":if(d===Qt.html_inline){w+=S.content;continue}break;case"code_inline":if(p===Qt.code_inline){w+=Cf(S);continue}break}}w+=this.renderInlineTokens(E,s,o);continue}const k=i[g];if(!k){const E=_.attrs;if(!_.hidden){if(!E||E.length===0)switch(g){case"hr":w+=r?`<hr />
|
|
69
|
+
`:`<hr>
|
|
70
|
+
`;continue;case"heading_open":w+=`<${_.tag}>`;continue;case"heading_close":w+=`</${_.tag}>
|
|
71
|
+
`;continue;case"paragraph_open":w+=`${y}<p>`;continue;case"paragraph_close":w+=`</p>
|
|
72
|
+
`;continue;case"list_item_open":{const S=e[b+1];w+=y+(S&&(S.type==="inline"||S.hidden||S.nesting===-1&&S.tag==="li")?"<li>":`<li>
|
|
73
|
+
`);continue}case"list_item_close":w+=`</li>
|
|
74
|
+
`;continue;case"bullet_list_open":w+=`${y}<ul>
|
|
75
|
+
`;continue;case"bullet_list_close":w+=`</ul>
|
|
76
|
+
`;continue;case"blockquote_open":w+=y+(e[b+1]&&e[b+1].nesting===-1&&e[b+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
77
|
+
`);continue;case"blockquote_close":w+=`</blockquote>
|
|
78
|
+
`;continue;case"ordered_list_open":w+=`${y}<ol>
|
|
79
|
+
`;continue;case"ordered_list_close":w+=`</ol>
|
|
80
|
+
`;continue;case"table_open":w+=`${y}<table>
|
|
81
|
+
`;continue;case"table_close":w+=`</table>
|
|
82
|
+
`;continue;case"thead_open":w+=`${y}<thead>
|
|
83
|
+
`;continue;case"thead_close":w+=`</thead>
|
|
84
|
+
`;continue;case"tbody_open":w+=`${y}<tbody>
|
|
85
|
+
`;continue;case"tbody_close":w+=`</tbody>
|
|
86
|
+
`;continue;case"tr_open":w+=`${y}<tr>
|
|
87
|
+
`;continue;case"tr_close":w+=`</tr>
|
|
88
|
+
`;continue;case"td_open":w+=`${y}<td>`;continue;case"td_close":w+=`</td>
|
|
89
|
+
`;continue;case"th_open":w+=`${y}<th>`;continue;case"th_close":w+=`</th>
|
|
90
|
+
`;continue}else if(E.length===1){const S=E[0];if(g==="ordered_list_open"&&S[0]==="start"){w+=`${y}<ol start="${rn(S[1])}">
|
|
91
|
+
`;continue}if(g==="td_open"&&S[0]==="style"){w+=`${y}<td style="${rn(S[1])}">`;continue}if(g==="th_open"&&S[0]==="style"){w+=`${y}<th style="${rn(S[1])}">`;continue}}}w+=this.renderToken(e,b,s);continue}if(g==="code_block"&&k===Qt.code_block){w+=Hg(_);continue}if(g==="fence"&&k===Qt.fence){w+=Ab(_,s);continue}if(g==="html_block"&&k===Qt.html_block){w+=_.content;continue}const I=k(e,b,s,o,this);typeof I=="string"?w+=I:w+=Nd(I,_.type)}return w}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const s=this.mergeOptions(t),o=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],s,o);continue}const c=i[a.type];c?r+=await xb(c(e,l,s,o,this)):r+=this.renderToken(e,l,s)}return r}renderInline(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokens(e,s,o)}async renderInlineAsync(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokensAsync(e,s,o)}renderInlineAsText(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineAsTextInternal(e,s,o)}renderAttrs(e){return vr(e.attrs)}renderToken(e,t,n){const s=e[t];if(s.hidden)return"";const o=s.block,i=s.nesting,r=s.tag,l=s.attrs;let a=!1;if(o&&(a=!0,i===1&&t+1<e.length)){const p=e[t+1];(p.type==="inline"||p.hidden||p.nesting===-1&&p.tag===r)&&(a=!1)}const c=o&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
92
|
+
`:"",u=a?`>
|
|
93
|
+
`:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+vr(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const s=()=>(n||(n={...t}),n);if(cd.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),cd.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(cd.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(cd.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...mR,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===Qt.code_block)return Hg(t);if(i==="html_block"&&o.html_block===Qt.html_block)return t.content;const r=this.mergeOptions(n),l=s??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[i];if(!a)return t.block?this.renderToken(e,0,r):xf(t,r.xhtmlOut===!0);if(i==="fence"&&a===Qt.fence)return Ab(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Nd(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const s=this.rules,o=s.text,i=s.text_special,r=s.softbreak,l=s.hardbreak,a=s.html_inline,c=s.code_inline,u=s.link_open,d=s.link_close,p=s.em_open,m=s.em_close,f=s.strong_open,v=s.strong_close,w=t.xhtmlOut===!0,b=w?`<br />
|
|
94
|
+
`:`<br>
|
|
95
|
+
`,_=t.breaks?b:`
|
|
96
|
+
`;if(e.length===1)return ud(e,t,n,this,s,b,_);let g="";for(let y=0;y<e.length;y++){const k=e[y];if(k.type==="link_open"&&!u&&!d&&y+2<e.length){const S=e[y+1];if(e[y+2].type==="link_close"&&pR(S)){const T=`${Tb(k)+ud([S],t,n,this,s,b,_)}</a>`;if(r===Qt.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){g+=T+_,y+=3;continue}g+=T,y+=2;continue}}if(k.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){g+=`${Tb(k)}</a>`,y+=1;continue}if(k.type==="em_open"&&!p&&!m&&y+2<e.length){const S=e[y+1];if(e[y+2].type==="em_close"&&Mb(S)){g+=`<em>${ud([S],t,n,this,s,b,_)}</em>`,y+=2;continue}}if(k.type==="strong_open"&&!f&&!v&&y+2<e.length){const S=e[y+1];if(e[y+2].type==="strong_close"&&Mb(S)){g+=`<strong>${ud([S],t,n,this,s,b,_)}</strong>`,y+=2;continue}}switch(k.type){case"text":if(o===Qt.text){const S=k.content.length===0?"":rn(k.content);if(a===Qt.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(g+=S+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)g+=e[++y].content;continue}g+=S;continue}break;case"text_special":if(i===Qt.text_special){k.content.length!==0&&(g+=rn(k.content));continue}break;case"softbreak":if(r===Qt.softbreak){g+=_;continue}break;case"hardbreak":if(l===Qt.hardbreak){g+=b;continue}break;case"html_inline":if(a===Qt.html_inline){for(g+=k.content;y+1<e.length&&e[y+1].type==="html_inline";)g+=e[++y].content;continue}break;case"code_inline":if(c===Qt.code_inline){g+=Cf(k);continue}break}const I=s[k.type];if(!I){g+=k.block?this.renderToken(e,y,t):xf(k,w);continue}const E=I(e,y,t,n,this);typeof E=="string"?g+=E:g+=Nd(E,k.type)}return g}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const s=this.rules;let o="";for(let i=0;i<e.length;i++){const r=s[e[i].type];r?o+=await xb(r(e,i,t,n,this)):o+=this.renderToken(e,i,t)}return o}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let s="";for(let o=0;o<e.length;o++){const i=e[o];switch(i.type){case"text":case"text_special":s+=i.content;break;case"image":s+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":s+=i.content;break;case"softbreak":case"hardbreak":s+=`
|
|
97
|
+
`;break}}return s}},vR=gR;const yR=[];function Eb(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var kR=class{core;cache=null;stats=Eb();MIN_SIZE_FOR_OPTIMIZATION=1e3;DEFAULT_SKIP_CACHE_CHARS=1e6;DEFAULT_SKIP_CACHE_LINES=1e5;IMPLICIT_STREAM_CHUNK_MIN_CHARS=16e4;MIN_LIST_LINES_FOR_MERGE=80;MIN_LIST_CHARS_FOR_MERGE=800;MIN_TABLE_LINES_FOR_MERGE=48;MIN_TABLE_CHARS_FOR_MERGE=1200;MIN_UNBOUNDED_APPEND_TOTAL_CHARS=5e5;MIN_UNBOUNDED_APPEND_CHARS=64e3;MIN_UNBOUNDED_APPEND_LINES=700;constructor(e){this.core=e}reset(){this.cache=null,this.stats.resets+=1,this.stats.lastMode="reset"}resetStats(){const{resets:e}=this.stats;this.stats=Eb(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(Gs(s??o?.env),!o||s&&s!==o.env){const R=s??{},O=!!n.__explicitStreamChunkFallbackSetting,B=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,F=!!n.options?.streamChunkedFallback,q=!O&&B,G=F||q,K=n.options?.streamChunkAdaptive!==!1,oe=n.options?.streamChunkTargetChunks??8,le=n.options?.streamChunkSizeChars,pe=n.options?.streamChunkSizeLines,be=n.options?.streamChunkMaxChunks,Be=!!n.__explicitStreamChunkConfig,He=n.options?.autoTuneChunks!==!1,Ne=n.options?.streamChunkFenceAware??!0,me=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,_e=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let Ce,de=e.length>=me;if(!de&&_e!==void 0&&(Ce=vn(e),de=Ce>=_e),de){const Z=this.parseFullDocument(e,R,n,Ce,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Vn(R,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!yi(R)?.unbounded}),Z.tokens}else if(G){const Z=(H,U,Q)=>H<U?U:H>Q?Q:H;Ce===void 0&&(Ce=vn(e));const fe=He&&!Be?Sb(e.length,Ce,n.options):null,P=fe?.maxChunkChars??(K?Z(Math.ceil(e.length/oe),8e3,64e3):le??1e4),X=fe?.maxChunkLines??(K?Z(Math.ceil(Ce/oe),150,700):pe??200),ne=fe?.maxChunks??(K?Z(Math.ceil(e.length/64e3),oe,32):be),se=e.length>0&&e.charCodeAt(e.length-1)===10,ce=q&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&fe?.strategy!=="plain";if((F||ce)&&(e.length>=P*2||Ce>=X*2)&&se){const H=Sf(n,e,R,{maxChunkChars:P,maxChunkLines:X,fenceAware:fe?.fenceAware??Ne,maxChunks:ne});return this.cache={src:e,tokens:H,env:R,lineCount:Ce,lastSegment:void 0,globalStateReason:ts(e)},this.updateCacheLineCount(this.cache,Ce),this.recordChunkedParseResult(R,F?"explicit-initial-large-doc":"default-initial-large-doc"),H}}const z=this.parseFullDocument(e,R,n,Ce);return Ce=z.lineCount,this.cache={src:e,tokens:z.tokens,env:R,lineCount:Ce,lastSegment:void 0,globalStateReason:ts(e)},this.updateCacheLineCount(this.cache,Ce),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Vn(R,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!yi(R)?.unbounded}),z.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",Vn(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;let i=o.globalStateReason;i===void 0&&(i=ts(o.src),o.globalStateReason=i);const r=ts(e),l=i||r;if(l){const R=s??o.env;Li(R);const O=this.parseFullDocument(e,R,n),B=O.tokens,F=O.lineCount;return this.cache={src:e,tokens:B,env:R,lineCount:F,lastSegment:void 0,globalStateReason:r},this.updateCacheLineCount(this.cache,F),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Vn(R,{area:"stream",path:"stream-full",reason:`global-state:${l}`,unbounded:!!yi(R)?.unbounded}),B}const a=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length<a&&e.length<a*1.5&&!e.startsWith(o.src)){const R=s??o.env,O=this.parseFullDocument(e,R,n),B=O.tokens,F=O.lineCount;return this.cache={src:e,tokens:B,env:R,lineCount:F,lastSegment:void 0,globalStateReason:ts(e)},this.updateCacheLineCount(this.cache,F),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Vn(R,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!yi(R)?.unbounded}),B}const c=this.getAppendedSegment(o.src,e);if(c&&!this.shouldPreferTailReparseForAppend(o)){let K=function(Ne){const me=Ne.length;let _e=0;for(;_e<=me;){let Ce=Ne.indexOf(`
|
|
98
|
+
`,_e);Ce===-1&&(Ce=me);const de=Ce<me;let z=_e,Z=0;for(;z<Ce;){const fe=Ne.charCodeAt(z);if(fe===32){if(Z++,z++,Z>=4)return!0;continue}if(fe===9){if(Z+=4-Z%4,z++,Z>=4)return!0;continue}break}if(z<Ce){const fe=Ne.charCodeAt(z);switch(fe){case 35:{let P=z;for(;P<Ce&&Ne.charCodeAt(P)===35;)P++;const X=P-z;if(X>0&&X<=6){if(P<Ce){const ne=Ne.charCodeAt(P);if(ne===32||ne===9||ne===13)return!0}else if(P===Ce&&de)return!0}break}case 62:{const P=z+1;if(P<Ce){const X=Ne.charCodeAt(P);if(X===32||X===9||X===13)return!0}else if(P===Ce&&de)return!0;break}case 45:case 42:case 43:{const P=z+1;if(P<Ce){const X=Ne.charCodeAt(P);if(X===32||X===9||X===13)return!0}else if(P===Ce&&de)return!0;break}case 96:case 126:{let P=z;for(;P<Ce&&Ne.charCodeAt(P)===fe;)P++;if(P-z>=3)return!0;break}default:if(fe>=48&&fe<=57){let P=z+1;for(;P<Ce;){const X=Ne.charCodeAt(P);if(X<48||X>57)break;P++}if(P<Ce&&Ne.charCodeAt(P)===46){const X=P+1;if(X<Ce){const ne=Ne.charCodeAt(X);if(ne===32||ne===9||ne===13)return!0}else if(X===Ce&&de)return!0}}break}}if(Ce===me)break;_e=Ce+1}return!1};const R=o.lineCount??vn(o.src);let O=3;c.length>5e3?O=8:c.length>1e3?O=6:c.length>200&&(O=4),O=Math.min(O,R);let B=null;const F=n.options?.streamContextParseStrategy??"chars",q=n.options?.streamContextParseMinChars??200,G=n.options?.streamContextParseMinLines??2;let oe=null;const le=()=>(oe===null&&(oe=vn(c)),oe),pe=this.canDirectlyParseAppend(o),be=pe&&this.shouldUseUnboundedAppend(e,o,c);let Be=!1;if(!pe)switch(F){case"lines":Be=le()>=G;break;case"constructs":if(c.length>=q){Be=!0;break}if(K(c)){Be=!0;break}Be=le()>=G;break;case"chars":default:Be=c.length>=q}if(O>0&&Be){const Ne=this.getTailLines(o.src,O)+c;try{const me=this.core.parse(Ne,o.env,n).tokens,_e=me.findIndex(Ce=>Ce.map&&typeof Ce.map[1]=="number"&&Ce.map[1]>O);if(_e!==-1){const Ce=me.slice(_e),de=R-O;de!==0&&this.shiftTokenLines(Ce,de),B={tokens:Ce}}}catch{B=null}}else B=null;if(!B){const Ne=R;if(be)B={tokens:wc(n,c,o.env,{mode:"stream"})},Ne>0&&this.shiftTokenLines(B.tokens,Ne);else{const me=this.core.parse(c,o.env,n);Ne>0&&this.shiftTokenLines(me.tokens,Ne),B=me}}if(o.tokens.length>0&&B.tokens.length>0){const Ne=o.tokens[o.tokens.length-1],me=B.tokens[0];try{Ne.type==="inline"&&me.type==="inline"&&(me.children&&me.children.length>0&&(Ne.children||(Ne.children=[]),this.appendTokens(Ne.children,me.children)),Ne.content=(Ne.content||"")+(me.content||""),B.tokens.shift())}catch{}}const He=o.tokens.length;if(B.tokens.length>0){let Ce=function(fe,P){if(!fe&&!P)return!0;if(!fe||!P||fe.length!==P.length)return!1;for(let X=0;X<fe.length;X++)if(fe[X][0]!==P[X][0]||fe[X][1]!==P[X][1])return!1;return!0},de=function(fe,P){if(!fe&&!P)return!0;if(!fe||!P||fe.length!==P.length)return!1;for(let X=0;X<fe.length;X++)if(!z(fe[X],P[X]))return!1;return!0},z=function(fe,P){if(!fe||!P||fe.type!==P.type)return!1;const X=fe.map,ne=P.map;return!!X!=!!ne||X&&ne&&(X[0]!==ne[0]||X[1]!==ne[1])||fe.tag!==P.tag||fe.nesting!==P.nesting||fe.markup!==P.markup||fe.info!==P.info||fe.block!==P.block||fe.hidden!==P.hidden||!Ce(fe.attrs,P.attrs)||!de(fe.children,P.children)?!1:(fe.type==="inline",(fe.content||"")===(P.content||""))};const Ne=o.tokens,me=B.tokens,_e=Math.min(Ne.length,me.length);let Z=0;for(let fe=_e;fe>0;fe--){let P=!0;for(let X=0;X<fe;X++){const ne=Ne[Ne.length-fe+X],se=me[X];if(!z(ne,se)){P=!1;break}}if(P){Z=fe;break}}Z>0&&me.splice(0,Z),me.length>0&&this.appendTokens(o.tokens,me)}if(o.src=e,o.globalStateReason=ts(e),o.lineCount=R+(oe??vn(c)),o.tokens.length>He){const Ne=this.getLastSegment(o.tokens.slice(He),e);Ne?o.lastSegment={tokenStart:He+Ne.tokenStart,tokenEnd:He+Ne.tokenEnd,lineStart:Ne.lineStart,lineEnd:Ne.lineEnd,srcOffset:Ne.srcOffset}:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,be&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",Vn(o.env,{area:"stream",path:be?"stream-unbounded-append":"stream-append",reason:be?"large-delta":"safe-append",unbounded:be}),o.tokens}const u=s??o.env,d=this.tryTailSegmentReparse(e,o,u,n);if(d)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",Vn(u,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),d;const p=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,f=!!n.options?.streamChunkedFallback,v=!p&&!c&&m,w=f||v,b=n.options?.streamChunkAdaptive!==!1,_=n.options?.streamChunkTargetChunks??8,g=n.options?.streamChunkSizeChars,y=n.options?.streamChunkSizeLines,k=n.options?.streamChunkMaxChunks,I=!!n.__explicitStreamChunkConfig,E=n.options?.autoTuneChunks!==!1,S=n.options?.streamChunkFenceAware??!0;let T=c&&o.lineCount!==void 0?o.lineCount+vn(c):void 0;if(w){T===void 0&&(T=vn(e));const R=(oe,le,pe)=>oe<le?le:oe>pe?pe:oe,O=E&&!I?Sb(e.length,T,n.options):null,B=O?.maxChunkChars??(b?R(Math.ceil(e.length/_),8e3,64e3):g??1e4),F=O?.maxChunkLines??(b?R(Math.ceil(T/_),150,700):y??200),q=O?.maxChunks??(b?R(Math.ceil(e.length/64e3),_,32):k),G=e.length>0&&e.charCodeAt(e.length-1)===10,K=v&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&O?.strategy!=="plain";if((f||K)&&(e.length>=B*2||T>=F*2)&&G){const oe=Sf(n,e,u,{maxChunkChars:B,maxChunkLines:F,fenceAware:O?.fenceAware??S,maxChunks:q});return this.cache={src:e,tokens:oe,env:u,lineCount:T,lastSegment:void 0,globalStateReason:ts(e)},this.updateCacheLineCount(this.cache,T),this.recordChunkedParseResult(u,f?"explicit-fallback-large-doc":"default-fallback-large-doc"),oe}}const $=this.parseFullDocument(e,u,n,T),L=$.tokens;return T=$.lineCount,this.cache={src:e,tokens:L,env:u,lineCount:T,lastSegment:void 0,globalStateReason:ts(e)},this.updateCacheLineCount(this.cache,T),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Vn(u,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!yi(u)?.unbounded}),L}recordChunkedParseResult(e,t){const n=yi(e)?.chunk,s=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,s){this.stats.fullParses+=1,this.stats.lastMode="full",Vn(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!yi(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",Vn(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=ts(e);fu(t)&&Li(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?nx(n,e.length,s):"no";if(r==="yes"){const a=wc(n,e,t);return Vn(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?vn(e):0)}}let l=s;if(r==="need-lines"&&(l=vn(e),tx(n,e.length,l))){const a=wc(n,e,t);return Vn(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?vn(e):0),{tokens:ra(t,i,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length<this.MIN_UNBOUNDED_APPEND_TOTAL_CHARS&&n.length<this.MIN_UNBOUNDED_APPEND_CHARS?!1:n.length>=this.MIN_UNBOUNDED_APPEND_CHARS?!0:vn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t){if(!t.startsWith(e)||!e.endsWith(`
|
|
99
|
+
`))return null;const n=t.slice(e.length);if(!n)return null;const s=n.length;if(n.charCodeAt(s-1)!==10)return null;let o=0,i=-1;for(let l=0;l<s&&!(n.charCodeAt(l)===10&&(i===-1&&(i=l),o++,o>=2));l++);if(o<2)return null;const r=(i===-1?n:n.slice(0,i)).trim();if(r.length===0)return null;if(/^[-=]+$/.test(r)){const l=e.slice(0,-1),a=l.lastIndexOf(`
|
|
100
|
+
`);if(l.slice(a+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(n)?null:n}tryTailSegmentReparse(e,t,n,s){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const i=t.src.slice(0,o.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,s,o,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,s),u=this.getLastSegment(c.tokens,l);return o.lineStart>0&&this.shiftTokenLines(c.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=ts(e),t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=vn(e),u?t.lastSegment={tokenStart:o.tokenStart+u.tokenStart,tokenEnd:o.tokenStart+u.tokenEnd,lineStart:o.lineStart+u.lineStart,lineEnd:o.lineStart+u.lineEnd,srcOffset:o.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let s=e.length-1;s>=0;s--)if(e.charCodeAt(s)===10&&(n--,n===0))return e.slice(s+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,s=e.slice(n),o=s.length;let i=null,r=0;for(;r<=o;){let l=s.indexOf(`
|
|
101
|
+
`,r);l===-1&&(l=o);let a=r;for(;a<l;){const c=s.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=s.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&s.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===o)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??yR}getStats(){return{...this.stats}}appendTokens(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}updateCacheLineCount(e,t){e.lineCount=t??vn(e.src),e.lastSegment=void 0}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t){if(e.length===0)return null;let n=Number.POSITIVE_INFINITY,s=-1,o=0;for(let i=e.length-1;i>=0;i--){const r=e[i];if(r.map&&(r.map[0]<n&&(n=r.map[0]),r.map[1]>s&&(s=r.map[1])),r.nesting<0){o+=-r.nesting;continue}if(r.nesting>0){if(o-=r.nesting,r.level===0&&o<=0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}continue}if(r.level===0&&o===0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}}return null}getLineStartOffset(e,t){if(t<=0)return 0;let n=t,s=-1;for(;n>0;){if(s=e.indexOf(`
|
|
102
|
+
`,s+1),s===-1)return e.length;n--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,s,o,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,s,o,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,s,o,i,r);default:return null}}tryListTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const p=t.lineCount??vn(t.src);p>0&&this.shiftTokenLines(d,p);const m=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),f=this.getListParagraphMode(u,0,u.length,0);return(m==="loose"||f==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=ts(e),t.lineCount=vn(e),r.map&&(r.map[1]=this.getDocLineCount(e)),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:this.getDocLineCount(e),srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(o.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const p=this.getTableBodySection(d,0,d.length,0),m=this.getTableBodySection(t.tokens,o.tokenStart,t.tokens.length,r.level);if(!p||!m||p.tbodyOpenIndex<0||p.tbodyCloseIndex<0)return null;const f=m.tbodyOpenIndex>=0?d.slice(p.tbodyOpenIndex+1,p.tbodyCloseIndex):d.slice(p.tbodyOpenIndex,p.tbodyCloseIndex+1);if(f.length===0)return null;const v=o.lineEnd-2;v!==0&&this.shiftTokenLines(f,v);const w=m.tbodyCloseIndex>=0?m.tbodyCloseIndex:m.tableCloseIndex;t.tokens.splice(w,0,...f),t.src=e,t.env=n,t.globalStateReason=ts(e),t.lineCount=vn(e);const b=this.getDocLineCount(e);if(r.map&&(r.map[1]=b),m.tbodyOpenIndex>=0){const _=t.tokens[m.tbodyOpenIndex];_?.map&&(_.map[1]=b)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:b,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
103
|
+
`);if(t<0)return null;const n=e.indexOf(`
|
|
104
|
+
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,s){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===s){o=l;break}}if(o<0)return null;let i=-1,r=-1;for(let l=t+1;l<o;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===s+1){i=l;break}}if(i>=0){for(let l=o-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===s+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,s){if(e.length<2)return!1;const o=e[0],i=e[e.length-1];if(o.type!==t||i.type!==n||o.level!==0||i.level!==0||s!==void 0&&o.markup!==s)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,s){let o=!1,i=!1;const r=s+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?o=!0:i=!0,o&&i))return"loose"}return i?"loose":o?"tight":"none"}setListParagraphVisibility(e,t,n,s,o){const i=s+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=o)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const s=e.charCodeAt(n);if(s===32||s===9){n--;continue}return s===10}return!0}getDocLineCount(e){const t=vn(e);return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;const n=[...e];for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}};const $b={default:iR,zero:rR,commonmark:oR};function bR(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function _R(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function Ib(e){return e.experimental?{...e,...e.experimental}:e}function go(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function Nb(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(go(t,o)||go(e,o))return!0}return!1}function Lb(e,t,n){return go(t,n)||go(e,n)}function Ob(e,t){const n=yi(e)?.chunk;if(n?.fallback){Vn(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}Vn(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function wR(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},s="default",o;!t&&typeof e!="string"?(o=e,s="default"):typeof e=="string"&&(s=e,o=t);const i=$b[s];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${s}", check name`);if(i?.options&&(n={...n,...i.options}),o&&(n={...n,...o}),n=Ib(n),typeof n.quotes=="string"){const k=n.quotes;k.length>=4?n.quotes=[k[0],k[1],k[2],k[3]]:n.quotes=["“","”","‘","’"]}let r=Nb(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=Nb(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=Lb(i?.options,o,"fullChunkedFallback"),c=Lb(i?.options,o,"streamChunkedFallback"),u=!1,d=null;const p=new DO;let m=null;const f=()=>(m||(m=new vR(n)),m);let v=null;const w=()=>(v||(v=new kR(p)),v);let b=null;const _=()=>(b||(b=new TC),b),g=k=>!u&&!!d&&!_R(k,d),y={core:p,block:p.block,inline:p.inline,get linkify(){const k=_();return Object.defineProperty(this,"linkify",{value:k,writable:!0,configurable:!0}),k},get renderer(){const k=f();return Object.defineProperty(this,"renderer",{value:k,writable:!0,configurable:!0}),k},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return g(this)},set(k){const I=Ib(k);return this.options={...this.options,...I},(go(k,"fullChunkSizeChars")||go(k,"fullChunkSizeLines")||go(k,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(go(k,"streamChunkSizeChars")||go(k,"streamChunkSizeLines")||go(k,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),go(k,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),go(k,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(I),typeof I.stream=="boolean"&&(this.stream.enabled=I.stream,v&&(v.reset(),v.resetStats())),this},configure(k){const I=typeof k=="string"?$b[k]:k;if(!I)throw new Error("Wrong `markdown-it` preset, can't be empty");if(I.options&&this.set(I.options),I.components){const E=I.components;E.core?.rules&&this.core.ruler.enableOnly(E.core.rules),E.block?.rules&&this.block.ruler.enableOnly(E.block.rules),E.inline?.rules&&this.inline.ruler.enableOnly(E.inline.rules),E.inline2?.rules&&this.inline.ruler2.enableOnly(E.inline2.rules)}return this},enable(k,I){const E=Array.isArray(k)?k:[k],S=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],T=new Set;for(const $ of S){if(!$)continue;const L=$.enable(E,!0);for(let R=0;R<L.length;R++)T.add(L[R])}if(!I){const $=E.filter(L=>!T.has(L));if($.length)throw new Error(`Rules manager: invalid rule name ${$.join(", ")}`)}return this},disable(k,I){const E=Array.isArray(k)?k:[k],S=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],T=new Set;for(const $ of S){if(!$)continue;const L=$.disable(E,!0);for(let R=0;R<L.length;R++)T.add(L[R])}if(!I){const $=E.filter(L=>!T.has(L));if($.length)throw new Error(`Rules manager: invalid rule name ${$.join(", ")}`)}return this},use(k,...I){const E=typeof k=="function"?k:k&&typeof k.default=="function"?k.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const S=[this,...I],T=k;return u=!0,E.apply(T,S),this},render(k,I={}){const E=this.parse(k,I);return f().render(E,this.options,I)},async renderAsync(k,I={}){const E=this.parse(k,I);return f().renderAsync(E,this.options,I)},renderIterable(k,I={}){const E=this.parseIterable(k,I);return f().render(E,this.options,I)},async renderAsyncIterable(k,I={}){const E=await this.parseAsyncIterable(k,I);return f().renderAsync(E,this.options,I)},renderInline(k,I={}){const E=this.parseInline(k,I);return f().render(E,this.options,I)},validateLink:jC,normalizeLink:zC,normalizeLinkText:VC,utils:n8,helpers:{...V8},parse(k,I={}){if(typeof k!="string")throw new TypeError("Input data should be a String");Gs(I);let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&g(this)){const T=nx(this,k.length);if(T==="yes"){const $=wc(this,k,I);return Vn(I,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),$}T==="need-lines"&&(E=vn(k))}if(!this.stream.enabled){const T=k.length,$=E??vn(k),L=this.options.autoTuneChunks!==!1,R=r,O=!a&&g(this),B=!!this.options.fullChunkedFallback,F=O&&T>=2e5,q=L&&!R?sR(T,$,this.options):null;if((B||F)&&(B?T>=(this.options.fullChunkThresholdChars??2e4)||$>=(this.options.fullChunkThresholdLines??400):F)){if(q&&q.strategy!=="plain"){const G=Sf(this,k,I,{maxChunkChars:q.maxChunkChars,maxChunkLines:q.maxChunkLines,fenceAware:q.fenceAware,maxChunks:q.maxChunks});return Ob(I,B?"explicit-full-chunk":"default-large-string"),G}if(B){const G=(me,_e,Ce)=>me<_e?_e:me>Ce?Ce:me,K=this.options.fullChunkAdaptive!==!1,oe=this.options.fullChunkTargetChunks??8,le=G(Math.ceil(T/oe),8e3,64e3),pe=G(Math.ceil($/oe),150,700),be=K?le:this.options.fullChunkSizeChars??1e4,Be=K?pe:this.options.fullChunkSizeLines??200,He=K?G(Math.ceil(T/64e3),oe,32):this.options.fullChunkMaxChunks,Ne=Sf(this,k,I,{maxChunkChars:be,maxChunkLines:Be,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:He});return Ob(I,"explicit-full-chunk"),Ne}}if(E!==void 0&&g(this)&&tx(this,T,$)){const G=wc(this,k,I);return Vn(I,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),G}}const S=ts(k);return Vn(I,{area:"parse",path:"plain",reason:"default-plain"}),ra(I,S,()=>p.parse(k,I,this).tokens)},parseIterable(k,I={}){return Gs(I),JO(this,k,I)},parseAsyncIterable(k,I={}){return Gs(I),eR(this,k,I)},parseIterableToSink(k,I,E={}){return Gs(E),tR(this,k,I,E)},parseAsyncIterableToSink(k,I,E={}){return Gs(E),nR(this,k,I,E)},parseInline(k,I={}){if(typeof k!="string")throw new TypeError("Input data should be a String");Gs(I),fu(I)&&Li(I);const E=p.createState(k,I,this);return E.inlineMode=!0,p.process(E),E.tokens}};if(y.stream={enabled:!!n.stream,parse(k,I){return y.stream.enabled?w().parse(k,I,y):y.parse(k,I??{})},reset(){w().reset()},peek(){return v?v.peek():[]},stats(){return v?v.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){v&&v.resetStats()}},i?.components){const k=i.components;k.core?.rules&&y.core.ruler.enableOnly(k.core.rules),k.block?.rules&&y.block.ruler.enableOnly(k.block.rules),k.inline?.rules&&y.inline.ruler.enableOnly(k.inline.rules),k.inline2?.rules&&y.inline.ruler2.enableOnly(k.inline2.rules)}return d=bR(y),y}var SR=wR;function CR(e,t,n){function s(p){return p.trim().split(" ",2)[0]===t}function o(p,m,f,v,w){return p[m].nesting===1&&p[m].attrJoin("class",t),w.renderToken(p,m,f,v,w)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||s,u=n.render||o;function d(p,m,f,v){let w,b=!1,_=p.bMarks[m]+p.tShift[m],g=p.eMarks[m];if(l!==p.src.charCodeAt(_))return!1;for(w=_+1;w<=g&&r[(w-_)%a]===p.src[w];w++);const y=Math.floor((w-_)/a);if(y<i)return!1;w-=(w-_)%a;const k=p.src.slice(_,w),I=p.src.slice(w,g);if(!c(I,k))return!1;if(v)return!0;let E=m;for(;E++,!(E>=f||(_=p.bMarks[E]+p.tShift[E],g=p.eMarks[E],_<g&&p.sCount[E]<p.blkIndent));)if(l===p.src.charCodeAt(_)&&!(p.sCount[E]-p.blkIndent>=4)){for(w=_+1;w<=g&&r[(w-_)%a]===p.src[w];w++);if(!(Math.floor((w-_)/a)<y)&&(w-=(w-_)%a,w=p.skipSpaces(w),!(w<g))){b=!0;break}}const S=p.parentType,T=p.lineMax;p.parentType="container",p.lineMax=E;const $=p.push("container_"+t+"_open","div",1);$.markup=k,$.block=!0,$.info=I,$.map=[m,E],p.md.block.tokenize(p,m+1,E);const L=p.push("container_"+t+"_close","div",-1);return L.markup=p.src.slice(_,w),L.block=!0,p.parentType=S,p.lineMax=T,p.line=E+(b?1:0),!0}e.block.ruler.before("fence","container_"+t,d,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules["container_"+t+"_open"]=u,e.renderer.rules["container_"+t+"_close"]=u}function xR(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const s=[];let o="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){o+=c,a+1<n.length&&(o+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,o+=c;continue}if(!i&&c==='"'){r=!r,o+=c;continue}if(!i&&!r&&c===","){s.push(o.trim()),o="";continue}o+=c}o.trim()&&s.push(o.trim());const l={};for(const a of s){if(!a)continue;let c=!1,u=!1,d=-1;for(let w=0;w<a.length;w++){const b=a[w];if(b==="\\"){w++;continue}if(!u&&b==="'"){c=!c;continue}if(!c&&b==='"'){u=!u;continue}if(!c&&!u&&b===":"){d=w;break}}if(d===-1)return null;const p=a.slice(0,d).trim(),m=a.slice(d+1).trim();if(!p)return null;let f=p;if(f.startsWith('"')&&f.endsWith('"')||f.startsWith("'")&&f.endsWith("'"))try{f=JSON.parse(f.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(f))return null;let v;if(!m)v="";else if(m.startsWith('"')&&m.endsWith('"')||m.startsWith("'")&&m.endsWith("'"))try{v=JSON.parse(m.replace(/^'/,'"').replace(/'$/,'"'))}catch{v=m}else/^-?\d+(?:\.\d+)?$/.test(m)?v=Number(m):m==="true"||m==="false"?v=m==="true":m==="null"?v=null:v=m;l[f]=v}return l}function TR(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(CR,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
105
|
+
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,s,o)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let p,m;const f=d.indexOf("{"),v=f>=0?d.slice(f).trimStart():void 0;if(f===-1)p=d||void 0;else{if(p=d.slice(0,f).trim()||void 0,v?.startsWith("{")){let k=0,I=-1;for(let E=0;E<v.length;E++)if(v[E]==="{"?k++:v[E]==="}"&&k--,k===0){I=E+1;break}I>0&&(m=v.slice(0,I))}m||(p=d||void 0)}if(o)return!0;const w=!!i.env.__markstreamFinal;let b=n+1,_=!1;for(;b<=s;){const k=i.bMarks[b]+i.tShift[b],I=i.eMarks[b];if(i.src.slice(k,I).trim()===":::"){_=!0;break}b++}_||(b=s);const g=i.push("vmr_container_open","div",1);if(g.attrSet("class",`vmr-container vmr-container-${u}`),g.meta={...g.meta??{},unclosed:!_&&!w},p&&g.attrSet("data-args",p),m)try{const k=JSON.parse(m);for(const[I,E]of Object.entries(k)){const S=E!=null&&typeof E=="object";g.attrSet(`data-${I}`,S?JSON.stringify(E):String(E))}}catch{const k=xR(m);if(k)for(const[I,E]of Object.entries(k)){const S=E!=null&&typeof E=="object";g.attrSet(`data-${I}`,S?JSON.stringify(E):String(E))}else g.attrSet("data-attrs",m)}const y=[];for(let k=n+1;k<b;k++){const I=i.bMarks[k]+i.tShift[k],E=i.eMarks[k];y.push(i.src.slice(I,E))}if(y.some(k=>k.trim().length>0)){let k=y.join(`
|
|
106
|
+
`);k.endsWith(`
|
|
107
|
+
`)||(k+=`
|
|
108
|
+
`),k.endsWith(`
|
|
109
|
+
|
|
110
|
+
`)||(k+=`
|
|
111
|
+
`);const I=i.tokens[i.tokens.length-1];I&&(I.raw=k);const E=[];i.md.block.parse(k,i.md,i.env,E),i.tokens.push(...E)}return _&&i.push("vmr_container_close","div",-1),i.line=_?b+1:b,!0},{alt:["paragraph","reference","blockquote","list"]})}const lx=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],MR=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],ax=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],AR=["svg","g","path"],ER=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],$R=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","srcdoc","ping"],IR=["action","data","href","src","srcset","poster","xlink:href","formaction"],NR=["script"],LR=["pre","script","style","textarea","title"],hl=new Set(lx),OR=new Set(ax),Zc=new Set([...lx,...MR,...ax,...AR]),cx=new Set([...Zc,...ER]),RR=new Set($R),PR=new Set(IR),pu=new Set(NR),ux=new Set(LR);function dx(e){let t="";for(const n of e){const s=n.charCodeAt(0);s<=31||s>=127&&s<=159||/\s/u.test(n)||(t+=n)}return t}const DR={amp:"&",bsol:"\\",colon:":",newline:`
|
|
112
|
+
`,sol:"/",tab:" "};function fx(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,s,o)=>{const i=n??s;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return DR[String(o??"").toLowerCase()]??t})}const dd=new Set(["http","https","mailto","tel"]),tc=new Set(["http","https"]);function hx(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function BR(e,t){return t==="href"||t==="xlink:href"?dd:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?tc:dd}function ca(e,t={}){const n=dx(fx(e)).toLowerCase(),s=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return s==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=hx(n);return i?!BR(s,o).has(i):!1}function FR(e){const t=fx(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=hx(dx(t).toLowerCase());return n==="http"||n==="https"}function HR(e,t={}){const n=String(e??"").trim();return n?ca(n,t)?"":n:""}function Rb(e){return HR(e,{tagName:"img",attrName:"src"})}function Qs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fn(e){let t=!1,n=!1;for(let s=0;s<e.length;s++){const o=e[s];if(o==="\\"){s++;continue}if(!n&&o==="'"){t=!t;continue}if(!t&&o==='"'){n=!n;continue}if(!t&&!n&&o===">")return s}return-1}function xh(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=s[2]||s[3]||s[4]||"";t.push([o,i])}return t}const WR=/^[a-z][a-z0-9_-]*$/;function Pb(e){return WR.test(String(e??"").trim().toLowerCase())}function Eo(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return Pb(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const s=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const o=t.slice(s,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":Pb(o)?o:""}function Sa(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=Eo(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function UR(...e){const t=new Set,n=[];for(const s of e)for(const o of Sa(s))t.has(o)||(t.add(o),n.push(o));return n}function qR(e){const t=Sa(e);return{key:t.join(","),tags:t}}function px(e){return Eo(e)}function jR(e,t){const n=String(e??""),s=Eo(t);if(!s)return!1;const o=Qs(s),i=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function mx(e,t){const n=Eo(t);return!!n&&!Zc.has(n)&&!jR(e,n)}function zR(e,t){const n=String(e??""),s=Eo(t);if(!s)return n;const o=Qs(s),i=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const gx=hl,VR=Zc,vx=new Set(OR);vx.delete("details");const KR=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,GR=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Wg=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,YR=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Tf(e){return(e.match(Wg)?.[1]??"").toLowerCase()}function gv(e){return/^\s*<\s*\//.test(e)}function vv(e,t){return gx.has(t)||/\/\s*>\s*$/.test(e)}function XR(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(!o||o.type!=="html_inline")continue;const i=String(o.content??""),r=Tf(i);if(r===t){if(gv(i)){if(n===0)return s;n--;continue}vv(i,r)||n++}}return-1}function ZR(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=Tf(o);if(i===t){if(gv(o)){n>0&&n--;continue}vv(o,i)||n++}}return n}function Db(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${Qs(t)}(?=[\s>/])[^>]*>`,"gi");s.lastIndex=Math.max(0,n);let o=0,i;for(;(i=s.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:i.index,end:i.index+r.length};o--;continue}a||o++}return null}function QR(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Qs(t)}(?=[\s>/])[^>]*>`,"gi");let s=0,o;for(;(o=n.exec(e))!==null;){const i=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(i);if(r){s>0&&s--;continue}l||s++}return s}function Mf(e){const t=e;return String(t.raw??t.content??t.markup??"")}function JR(e){const t=e;return t.meta||(t.meta={}),t.meta}function gm(e,t,n){const s=JR(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function eP(e,t){if(!t.size)return;const n=Array.from(t,m=>new RegExp(String.raw`<\s*${Qs(m)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=m=>m?n.some(f=>f.test(m)):!1,r=m=>{if(!(!m||!s.length))for(const f of s)f.raw+=m,f.inner+=m},l=()=>{!s.length||!o||(r(`
|
|
113
|
+
`),o=!1)},a=m=>{r(m)},c=m=>{for(let v=0;v<s.length;v++)s[v].raw+=m,v<s.length-1&&(s[v].inner+=m);const f=s.pop();gm(f.token,f.raw,f.inner)},u=m=>{const f=s[s.length-1]?.tag;if(!f)return null;const v=new RegExp(String.raw`^\s*<\s*\/\s*${Qs(f)}\s*>`,"i");return m.match(v)?.[0]??null},d=m=>!!u(m),p=(m,f,v)=>{const w=v??(m.type==="html_inline"?Tf(f):"");if(!(w&&t.has(w))){r(f);return}const b=gv(f),_=!b&&vv(f,w);if(b){if(!s.length||s[s.length-1].tag!==w){r(f);return}c(f);return}if(r(f),_){gm(m,f,"");return}s.push({tag:w,token:m,raw:f,inner:""})};for(const m of e){if(m.type==="inline"&&Array.isArray(m.children)){const f=String(m.content??"");if(d(f)?o=!1:l(),!s.length&&!i(f)){o=!1;continue}let v=0,w=!0;for(const b of m.children){const _=Mf(b),g=b.type==="html_inline"?Tf(_):"",y=g&&t.has(g);let k=_;if(w&&f&&_&&(s.length||y)){const I=f.indexOf(_,v);if(I!==-1)a(f.slice(v,I)),k=f.slice(I,I+_.length),v=I+_.length;else{if(s.length&&!y)continue;w=!1}}p(b,k,g)}w&&f&&v<f.length&&s.length&&a(f.slice(v)),o=s.length>0;continue}if(s.length&&typeof m.content=="string"){const f=Mf(m),v=m.type==="html_block"?u(f):null;if(v){c(`${o?`
|
|
114
|
+
`:""}${v}`),o=s.length>0;continue}if(!m.content)continue;l(),r(m.content),o=!0}}for(const m of s)gm(m.token,m.raw,m.inner)}function tP(e){return/^\s*<\s*[!?]/.test(e)}function nP(e){const t=new Set(VR);if(e&&Array.isArray(e))for(const n of e){const s=String(n??"").trim();if(!s)continue;const o=s.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function Bb(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function sP(e,t){let n=null;for(const i of e.matchAll(KR)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Bb(l,t)&&fn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(GR)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Bb(l,t)&&fn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const s=/<\/\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const o=/<\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function oP(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function iP(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(oP(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const p=a.slice(d),m=p.match(Wg);if(!m){i("<",c),u=d+1;continue}const f=fn(p);if(f===-1){i("<",c),u=d+1;continue}const v=p.slice(0,f+1),w=(m[1]??"").toLowerCase();t.has(w)?n.push({type:"html_inline",tag:"",content:v,raw:v}):i(v,c),u=d+v.length}}function l(a,c){if(!a)return;const u=sP(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),s={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},o=s.buffer}for(const a of e){if(s){s.buffer+=Mf(a),o=s.buffer;const c=fn(s.buffer);if(c===-1)continue;const u=s.buffer.slice(0,c+1),d=s.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),s=null,o=null,d&&l(d);continue}if(a.type==="html_inline"){const c=Mf(a),u=(c.match(Wg)?.[1]??"").toLowerCase();if(u&&t.has(u)&&fn(c)===-1){s={tag:u,buffer:c,closing:/^<\s*\//.test(c)},o=s.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:o??void 0}}const rP=["a","span","strong","em","b","i","u"];function lP(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const p of t.customHtmlTags){const m=Eo(p);m&&n.add(m)}const s=p=>{const m=p,f=new Set(n),v=Array.isArray(m.env?.__markstreamCustomHtmlTags)?m.env.__markstreamCustomHtmlTags:[];for(const g of v){const y=Eo(String(g??""));y&&f.add(y)}const w=nP(Array.from(f)),b=new Set(rP);for(const g of f)b.add(g);return{autoCloseInlineTagSet:b,commonHtmlTags:w,customTagSet:f,shouldMergeHtmlBlockTag:g=>f.has(g)||!w.has(g)||vx.has(g)}},o=p=>{if(p.type==="html_block")return String(p.content??"");if(p.type!=="inline"||!Array.isArray(p.children)||p.children.length!==1)return"";const m=p.children[0];return m?.type!=="html_block"?"":String(p.content??m.content??"")},i=(p,m)=>{p.type="html_block",p.content=m,p.raw=m,p.children=[]},r=p=>p.replace(/^(?:\r?\n)+/,""),l=p=>/^(?: {4}|\t)/.test(p),a=p=>p.replace(/^(?: {4}|\t)/gm,""),c=(p,m)=>{const f=r(p);if(!/\S/.test(f))return[];if(l(f))return[{type:"code_block",content:a(f),raw:f}];const v=f.replace(/^[\t ]+/,"");if(!v)return[];if(v.startsWith("<"))return[{type:"html_block",content:v}];const w={type:"inline",tag:"",nesting:0,content:v,children:[{type:"text",content:v,raw:v}]};return m==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},w,{type:"paragraph_close",tag:"p",nesting:-1}]:m==="text"?[{type:"text",content:v,raw:v}]:[w]},u=(p,m,f)=>p[m-1]?.type==="paragraph_open"&&p[m+1]?.type==="paragraph_close"?"inline":f,d=(p,m)=>{const f=r(m);return!/\S/.test(f)||p.type!=="inline"||!Array.isArray(p.children)?!1:(p.content=`${String(p.content??"")}${f}`,p.children.push({type:"text",content:f,raw:f}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",p=>{const m=p.tokens??[],{commonHtmlTags:f,customTagSet:v}=s(p);for(const w of m){const b=w;if(b.type!=="inline"||!Array.isArray(b.children))continue;const _=String(b.content??""),g=b.children.length?b.children:_.includes("<")?[{type:"text",content:_,raw:_}]:null;if(g)try{const y=iP(g,f);if(b.children=y.children,y.pendingBuffer){const k=_.lastIndexOf(y.pendingBuffer);if(k!==-1){const I=_.slice(0,k);b.content=I,typeof b.raw=="string"&&(b.raw=I)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}eP(m,v)}),e.core.ruler.push("fix_html_inline_tokens",p=>{const m=p.tokens??[],{autoCloseInlineTagSet:f,customTagSet:v,shouldMergeHtmlBlockTag:w}=s(p),b=[];for(let _=0;_<m.length;_++){const g=m[_];if(b.length>0){const[k,I]=b[b.length-1];if(_!==I){if(g.type==="paragraph_open"||g.type==="paragraph_close"){m.splice(_,1),_--;continue}const E=String(g.content??g.raw??"");if(E){const S=m[I],T=`${String(S.content||"")}
|
|
115
|
+
${E}`,$=fn(T),L=$===-1?null:Db(T,k,$+1);if(L){const R=T.slice(0,L.end),O=T.slice(L.end);S.content=R,S.loading=!1,m.splice(_,1),b.pop();const B=d(S,O)?[]:c(O,u(m,_,"paragraph"));B.length&&m.splice(_,0,...B),_--;continue}S.content=T,S.loading!==!1&&(S.loading=!0)}m.splice(_,1),_--;continue}}const y=o(g);if(y){if(tP(y))continue;const k=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),I=/^\s*<\s*\//.test(y);if(!k||!w(k))continue;if(i(g,y),!I)k&&!new RegExp(`^\\s*<\\s*${k}\\b[^>]*\\/\\s*>`,"i").test(y)&&QR(y,k)>0&&b.push([k,_]);else if(b.length>0&&k&&b[b.length-1][0]===k){const[,E]=b[b.length-1],S=m[E];S.content=`${String(S.content||"")}
|
|
116
|
+
${y}`,S.loading=!1,b.pop(),m.splice(_,1),_--}continue}else if(b.length>0){if(g.type==="paragraph_open"||g.type==="paragraph_close"){m.splice(_,1),_--;continue}const k=g.content||"",I=new RegExp(`<\\s*\\/\\s*${b[b.length-1][0]}\\s*>`,"i").test(k);if(k){const[,E]=b[b.length-1],S=m[E];S.content=`${S.content||""}
|
|
117
|
+
${k}`,S.loading!==!1&&(S.loading=!I)}I&&b.pop(),m.splice(_,1),_--}else continue}if(v.size>0){const _=new Map,g=new Map,y=E=>{let S=_.get(E);return S||(S=new RegExp(`<\\s*${E}\\b`,"i"),_.set(E,S)),S},k=E=>{let S=g.get(E);return S||(S=new RegExp(`<\\s*\\/\\s*${E}\\s*>`,"i"),g.set(E,S)),S},I=[];for(let E=0;E<m.length;E++){const S=m[E],T=String(S.content??"");if(I.length>0){const L=I[I.length-1],R=m[L.index],O=S.type==="html_block"?k(L.tag).exec(T):null;if(O){const q=O.index+O[0].length,G=T.slice(0,q),K=T.slice(q);R.content=`${String(R.content??"")}
|
|
118
|
+
${G}`,Array.isArray(R.children)&&R.children.push({type:"html_inline",content:`</${L.tag}>`,raw:`</${L.tag}>`}),I.pop();const oe=d(R,K)?[]:c(K,u(m,E,"paragraph"));oe.length?m.splice(E,1,...oe):(m.splice(E,1),E--);continue}if(S.type!=="inline")continue;const B=Array.isArray(S.children)?S.children:[],F=XR(B,L.tag);if(F!==-1){const q=B.slice(0,F+1),G=B.slice(F+1),K=q.map(oe=>String(oe?.content??oe?.raw??"")).join("");if(R.content=`${String(R.content??"")}
|
|
119
|
+
${K}`,Array.isArray(R.children)&&R.children.push(...q),G.length){const oe=G.map(le=>String(le.content??le.raw??"")).join("");if(oe.trim()){const le=oe.replace(/^\s+/,"");if(d(R,oe))m.splice(E,1),E--;else if(le.startsWith("<"))m.splice(E,1,{type:"html_block",content:le});else{const pe=c(oe,u(m,E,"paragraph"));m.splice(E,1,...pe)}}else m.splice(E,1),E--}else m.splice(E,1),E--;I.pop();continue}R.content=`${String(R.content??"")}
|
|
120
|
+
${T}`,Array.isArray(R.children)&&R.children.push(...B),m.splice(E,1),E--;continue}if(S.type!=="inline")continue;const $=Array.isArray(S.children)?S.children:[];for(const L of v)if(($.length?ZR($,L):y(L).test(T)&&!k(L).test(T)?1:0)>0){I.push({tag:L,index:E});break}}}{let _=0;for(let g=0;g<m.length;g++){const y=m[g];if(y.type==="paragraph_open"){_++;continue}y.type==="paragraph_close"&&(_>0?_--:(m.splice(g,1),g--))}}for(let _=0;_<m.length;_++){const g=m[_];if(g.type==="html_block"){const S=(g.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(S.startsWith("!")||S.startsWith("?")){g.loading=!1;continue}if(v.has(S)){const F=String(g.content??""),q=fn(F),G=q===-1?null:Db(F,S,q+1);g.loading=G?!1:g.loading!==void 0?g.loading:!0;const K=G?.start??-1,oe=G?G.end-G.start:0;if(K!==-1){const le=F.slice(0,K+oe);let pe="";q!==-1&&q<K&&(pe=F.slice(q+1,K)),g.children=[{type:S,content:pe,raw:le,attrs:[],tag:S,loading:!1}],g.content=le,g.raw=le;const be=c(F.slice(K+oe)||"","text");be.length&&m.splice(_+1,0,...be)}else g.children=[{type:S,content:"",raw:F,attrs:[],tag:S,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(S))continue;g.type="inline";const T=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let $;for(;($=T.exec(g.content||""))!==null;)$[1],$[2]||$[3]||$[4];const L=String(g.content??""),R=new RegExp(`<\\/\\s*${S}\\s*>`,"i").exec(L),O=R?R.index:-1,B=R?R[0].length:0;if(O!==-1){const F=L.slice(0,O+B),q=(L.slice(O+B)||"").replace(/^\s+/,"");g.children=[{type:"html_block",content:F,tag:S,loading:!1}],g.content=F,g.raw=F,q&&m.splice(_+1,0,q.startsWith("<")?{type:"html_block",content:q}:{type:"text",content:q,raw:q})}else g.children=[{type:"html_block",content:g.content,tag:S,loading:!0}];continue}if(!g||g.type!=="inline")continue;if(g.children.length===2&&g.children[0].type==="html_inline"){const S=(g.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),T=g.children[1],$=String(T?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(T?.type==="html_inline"&&$===S)continue;f.has(S)?(g.children[0].loading=!0,g.children[0].tag=S,g.children.push({type:"html_inline",tag:S,loading:!0,content:`</${S}>`})):g.children=[{type:"html_block",loading:!0,tag:S,content:String(g.children[0]?.content??"")+String(g.children[1]?.content??"")}];continue}else if(g.children.length===3&&g.children[0].type==="html_inline"&&g.children[2].type==="html_inline"){const S=(g.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(f.has(S))continue;g.children=[{type:"html_block",loading:!1,tag:S,content:g.children.map(T=>T.content).join("")}];continue}if(!g.content?.startsWith("<")||g.children?.length!==1)continue;const y=String(g.content),k=g,I=k.children[0];if(I?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(k.children.length=0);continue}const E=String(I.content??y).match(YR)?.[1]?.toLowerCase()??"";if(E){if(/\/\s*>\s*$/.test(y)||gx.has(E)){k.children=[{type:"html_inline",content:y}];continue}k.children.length=0}}})}function aP(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|<!--|-->)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function cP(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const s=n.tokens??[];for(let o=0;o<s.length;o++){const i=s[o];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!aP(l[0]??"")){const a=l[0]??"",c=i.level??0;s.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),o+=2}}})}const yx=/\.([a-z0-9]{1,15})$/i,uP=/[_()[\]{}<>]/u,dP=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,fP=/[?#@]/u,hP=/[\\/]/u,pP=/^[\p{L}\p{N}./\\-]+$/u,mP=/^[A-Za-z0-9-]{1,63}$/u,gP=/^xn--[a-z0-9-]{2,59}$/i,vP=/^(?:[A-Z]{1,6}|\d{1,8})$/u,yP=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,kP=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,bP=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,_P=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,wP=new Set(["ai","md","py","rs","sh","zip"]),kx=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),SP=new Set([...kx,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),CP=new Set(["com","dev","io","page","site"]),xP=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),TP=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]);function Qc(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function vm(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Qc(n)?n:void 0}function Fb(e,t){if(!Qc(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function Hb(e){const t=mu(e);return Qc(t)?t:void 0}function MP(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Wb(e,t){if(!Qc(t))return;const n=String(e??"").trim().split(/\s+/u).map(MP).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>Af(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>Af(o,{marketTicker:!0}))&&(s.marketTicker=!0),Qc(s)?s:void 0}function xr(e,t=!1){let n;return{options(s){return t||s==null?Fb(e,n):Fb(e,vm(Hb(s),Wb(s,n)))},remember(s){const o=Hb(s);n=t?vm(n,o):vm(o,Wb(s,n))},reset(){n=void 0}}}function Ub(e){return mP.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function AP(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return Ub(n)||gP.test(n)?t.every(Ub):!1}function bx(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function EP(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function $P(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function _x(e,t,n){const s=EP(t);return bx(e)&&$P(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function mu(e){const t=String(e??"");return{explicitFilename:kP.test(t),filename:bP.test(t),marketTicker:_P.test(t)}}function IP(e){return AP(e.split(/[\\/]/)[0]??"")}function NP(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function LP(e){if(uP.test(e)||!pP.test(e))return!0;if(hP.test(e))return!IP(e);const t=e.replace(yx,"");return bx(t)?!0:t.split(".").filter(Boolean).some(NP)}function OP(e,t,n){if(!(n?SP:kx).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?yP:vP).test(s)}function Af(e,t={}){if(!e||dP.test(e)||fP.test(e))return!1;const n=e.match(yx);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return OP(e,s,t.marketTicker===!0)?!0:TP.has(s)?!wP.has(s)||t.filename?!0:LP(e):!!(t.explicitFilename&&CP.has(s)||t.filename&&xP.has(s))}const qb=["!"];function Es(e){return{type:"text",content:e,raw:e}}function zr(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function Vr(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Gi(e,t,n){let s="";if(t.includes('"')){const o=t.split('"');t=o[0].trim(),s=o[1].trim()}return{type:"link",loading:n,href:t,title:s,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function RP(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(Es(t))}}function jb(e,t){let n=-1;for(const s of t){const o=e.indexOf(s);o!==-1&&(n===-1||o<n)&&(n=o)}return n}function PP(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function DP(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(s=>s?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function BP(e,t,n){let s="";for(let o=t+1;o<n;o++){const i=e[o];if(i?.type!=="text"||typeof i.content!="string")return null;s+=i.content}return s||null}function FP(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=HP(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function HP(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=mu(t);for(let s=0;s<=e.length-1;s++){s<0&&(s=0);const o=e[s];if(!o)break;if(o.type==="link_open"&&(o.markup==="linkify"||o.markup==="autolink")){let i=-1;for(let r=s+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=BP(e,s,i),l=PP(o);if(o.markup==="linkify"&&r&&!_x(r,l,t)&&Af(r,n)){e.splice(s,i-s+1,Es(r));continue}const a=jb(l,qb);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=jb(u.content,qb);if(d===-1)continue;const p=u.content[d],m=u.content.slice(0,d);let f=u.content.slice(d);for(let b=c+1;b<i;b++){const _=e[b];_?.type==="text"&&typeof _.content=="string"&&(f+=_.content)}u.content=m,u.raw=m;const v=i-(c+1);v>0&&(e.splice(c+1,v),i=c+1);let w=l;if(a!==-1)w=l.slice(0,a);else if(f){const b=encodeURI(f);if(b&&l.endsWith(b))w=l.slice(0,l.length-b.length);else{const _=p?encodeURI(p):"",g=_?l.indexOf(_):-1;g!==-1&&(w=l.slice(0,g))}}w!==l&&DP(o,w),f&&e.splice(i+1,0,Es(f));break}}}if(o?.type==="em_open"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("*")){const i=e[s-1].content?.replace(/(\*+)$/,"")||"";e[s-1].content=i,o.type="strong_open",o.tag="strong",o.markup="**";for(let r=s+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(o?.type==="text"&&o.content?.endsWith("(")&&e[s+1]?.type==="link_open"){const i=o.content.match(/\[([^\]]+)\]/);if(i){let r=o.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(Es(r));const c=i[1],u=l[1].length;zr(a,u);let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(Gi(c,d,!e[s+4]?.content?.startsWith(")"))),Vr(a,u),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)\**/,"");p&&a.push(Es(p)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(Es(r));let c=i[1];const u=c.match(/^\*+/);if(u){const p=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let m=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(m+=e[s+4]?.content||"",e[s+4].content=""),zr(a,p),a.push(Gi(c,m,!e[s+4]?.content?.startsWith(")"))),Vr(a,p),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(Es(f)),e.splice(s,5,...a)}else e.splice(s,4,...a);s===0?s=a.length-1:s-=a.length+1;continue}let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(Gi(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)/,"");p&&a.push(Es(p)),e.splice(s,5,...a)}else e.splice(s,4,...a)}s-=a.length+1;continue}}else if(o.type==="link_open"&&o.markup==="linkify"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("(")){if(e[s-2]?.type==="link_close"){const i=[],r=e[s-3].content||"";let l=o.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[s+3]?.type==="text"){const a=(e[s+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[s+3]?.content?.slice(0,a)||"",e[s+3].content=""),i.push(Gi(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(Es(u)),e.splice(s-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(s-4,7,...i);continue}else if(e[s-1].content==="]("&&e[s-3]?.type==="text"&&e[s-3].content?.endsWith(")"))if(e[s-2]?.type==="strong_open"){const[i,r]=e[s-3].content?.split("[**")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else if(e[s-2]?.type==="em_open"){const[i,r]=e[s-3].content?.split("[*")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else{const[i,r]=e[s-3].content?.split("[")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}}if(o.type==="link_close"&&o.nesting===-1&&e[s-2]?.type==="link_open"&&e[s+1]?.type==="text"&&e[s-1]?.type==="text"){const i=e[s-1].content||"",r=e[s-2].attrs||[],l=r.find(f=>f[0]==="href")?.[1]||"",a=r.find(f=>f[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[s-3]?.content||"").match(/^(\*+)$/),p=[];if(d){u+=1;const f=d[1].length;zr(p,f)}if(o.markup!=="linkify"&&e[s+1].type==="text"&&e[s+1]?.content?.startsWith("](")){c+=1;for(let f=s+1;f<e.length;f++){const v=d?d[1].length:e[s-3].markup.length,w=e[f];if(v===1&&w.type==="em_close")break;if(v===2&&w.type==="strong_close")break;if(v===3&&(w.type==="em_close"||w.type==="strong_close"))break;c+=1}}const m={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(p.push(m),d){const f=d[1].length;Vr(p,f)}e.splice(s-u,c,...p),s-=p.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].markup?.includes("*")&&e[s-4]?.type==="text"&&e[s-4].content?.endsWith("[")){const i=e[s-1].markup.length,r=[],l=e[s-4].content.slice(0,e[s-4].content.length-i);l&&r.push(Es(l)),zr(r,i);const a=e[s-2].content||"";let c=o.content.slice(2),u=!0;if(e[s+1]?.type==="text"){const d=(e[s+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[s+1]?.content?.slice(0,d)||"",e[s+1].content="")}if(r.push(Gi(a,c,u)),Vr(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(Es(d)),e.splice(s-4,8,...r)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...r):e.splice(s-4,7,...r);s-=r.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].type==="strong_close"&&e[s-4]?.type==="text"&&e[s-4]?.content?.includes("**[")){const i=[],r=e[s-4].content.split("**[")[0];r&&i.push(Es(r)),zr(i,2);const l=e[s-2].content||"";let a=o.content.slice(2),c=!0;if(e[s+1]?.type==="text"){const u=(e[s+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[s+1]?.content?.slice(0,u)||"",e[s+1].content="")}if(i.push(Gi(l,a,c)),Vr(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(Es(u)),e.splice(s-4,8,...i)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...i):e.splice(s-4,7,...i);s-=i.length+1;continue}else if(o.type==="strong_close"&&e[s+1]?.type==="text"&&e[s+1].content?.includes("](")&&e[s-1].type==="text"&&/\[.*$/.test(e[s-1].content||"")){const i=[],[r,l]=e[s-1].content?.split("[")||["",""];r&&i.push(Es(r)),zr(i,2);let[a,c]=e[s+1].content.split("](");a=l+a;let u=4;if(e[s+2]?.type==="link_open"){const p=e[s+2].attrs?.find(m=>m[0]==="href")?.[1];e[s+5]?.type==="text"&&e[s+5].content==="."?(c=(p||c)+e[s+5].content,e[s+5].content=""):c=p||c,u+=3}let d=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,"")),e[s+2]?.type==="text"){const p=(e[s+2]?.content??"").indexOf(")");d=p===-1,p===-1&&(c+=e[s+2]?.content?.slice(0,p)||"",e[s+2].content="")}i.push(Gi(a,c,d)),Vr(i,2),e.splice(s-2,u,...i)}if(o.type==="text"&&/\*+\[[^\]]*$/.test(o.content||"")&&e[s+1]?.type==="strong_open"&&e[s+2]?.type==="text"&&e[s+2].content==="]("&&e[s+3]?.type==="link_open"&&e[s+5]?.type==="link_close"&&e[s+6]?.type==="text"&&e[s+6].content===")"&&e[s+7]?.type==="strong_close"){const i=(o.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[s+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[s+4]?.type==="text"&&(l=e[s+4].content||"");const a=[];zr(a,2),a.push(Gi(r,l,!1)),Vr(a,2),e.splice(s,9,...a),s-=a.length-1;continue}}}for(let s=0;s<e.length-1;s++){const o=e[s],i=e[s+1];if(o?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(o.href??"");if(String(o.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;RP(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function WP(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=UP(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function UP(e){const t=e[e.length-1],n=String(t?.content??"");return t?.type==="text"&&/^\s*\d+\.\s*$/.test(n)&&e[e.length-2]?.tag==="br"&&e.splice(e.length-1,1),e}function qP(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=jP(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function jP(e){let t=0;const n=new Set,s=new Set;let o=0;for(let u=0;u<e.length;u++){const d=e[u],p=d.type;if(p==="strong_open"){t++;const m=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const v=e[f];let w=u+1;for(;w<e.length&&e[w].type==="text"&&e[w].content==="";)w++;const b=e[w];m==="__"&&(v?.content?.endsWith("_")||b?.content?.startsWith("_")||b?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=m,d.raw=m,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(p==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(p==="em_open"){o++;const m=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const v=e[f];let w=u+1;for(;w<e.length&&e[w].type==="text"&&e[w].content==="";)w++;const b=e[w];m==="_"&&(v?.content?.endsWith("_")||b?.content?.startsWith("_")||b?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=m,d.raw=m,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,s.add(o))}else p==="em_close"&&(s.has(o)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),o--,o<0&&(o=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,p=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],m=c.slice(0,-1);m&&p.unshift({type:"text",content:m,raw:m}),l.splice(i,d,...p)}return l=zP(l),l}function zP(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const s=e[n],o=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const p=u.slice(0,d),m=u.slice(d+2);t.push(s),t.push(o),t.push(l),p&&t.push({...c,type:"text",content:p,raw:p}),t.push(a),m&&t.push({...c,type:"text",content:m,raw:m}),n+=6;continue}}if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=VP(e,n+6);if(u){t.push(s),t.push(o),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(s)}return t}function VP(e,t){for(let n=t;n<e.length;n++){const s=e[n];if(s?.type==="strong_open")return null;if(s?.type!=="text")continue;const o=String(s.content??""),i=o.indexOf("**");if(i!==-1)return{index:n,beforeClose:o.slice(0,i),afterClose:o.slice(i+2)}}return null}function KP(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=JP(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(s)&&(n.tokens=s)}catch(s){console.error("[applyFixTableTokens] failed to fix table tokens",s)}})}function zb(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function Vb(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function Kb(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function wx(e,t){if(!e.startsWith("|")||e.includes(`
|
|
121
|
+
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(s=>s.trim().length>0)?n:null}function ym(e){return wx(e)!==null}function Sx(e){return/^:?-+:?$/.test(e.trim())}function GP(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(Sx)}function YP(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function XP(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(Sx)&&YP(n)}function ZP(e){return e==="|"||e==="|:"}function QP(e){const t=wx(e);return t!==null&&t.every(n=>!n.includes(":"))}function JP(e,t=!1,n=""){const s=[...e];if(e.length<3)return s;const o=e.length-2,i=e[o];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
122
|
+
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
123
|
+
`),d=!t&&!r.includes(`
|
|
124
|
+
`)&&/\r?\n$/.test(n)&&ym(r);if(!t&&(r.includes(`
|
|
125
|
+
`)&&u.length===0&&ym(a)&&XP(c)||d)){const p=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>Kb(f)),m=[...zb(),...p,...Vb()];s.splice(o-1,3,...m)}else if(r.includes(`
|
|
126
|
+
`)&&u.length===0&&ym(a)&&GP(c)){const p=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>Kb(f)),m=[...zb(),...p,...Vb()];s.splice(o-1,3,...m)}else r.includes(`
|
|
127
|
+
`)&&u.length===0&&QP(a)&&ZP(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function e7(e,t,n,s){const o=e.length;if(n==="$$"&&s==="$$"){let c=t;for(;c<o-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=s;let l=0,a=t;for(;a<o;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var t7=e7;const n7=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Ef=n7.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),s7=/\\[a-z]+/i,Cx="(?:\\\\|\\u0008)",o7=new RegExp(String.raw`${Cx}(?:${Ef})\s*\{[^}]+\}`,"i"),i7=new RegExp(String.raw`(?:${Cx})?(?:${Ef})\s*\{`,"i"),r7=/\\(?:text|frac|left|right|times)/,l7=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,a7=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,c7=/[A-Z]+\s*\([^)]+\)/i,u7=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,d7=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,f7=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,h7={"\b":"\\b","\v":"\\v","\f":"\\f"};function p7(e){let t="";for(const n of e)t+=h7[n]??n;return t}function dc(e){if(!e)return!1;const t=p7(e),n=t.trim();if(f7.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=s7.test(t),o=o7.test(t),i=i7.test(t),r=r7.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=l7.test(t)&&!a7.test(t),c=c7.test(t),u=u7.test(n),d=d7.test(t),p=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),m=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return s||o||i||r||l||a||c||u||d||p||m}const xx=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],m7=["cdot","mathbf{","partial","mu_{"],Tx=xx.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Mx="[ \r\b\f\v]",g7=new RegExp(`([^\\\\])(${m7.map(e=>e).join("|")})+`,"g"),v7=/span\{([^}]+)\}/,y7=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,k7=/(^|[^\\])\\\r?\n/g,b7=/(^|[^\\])\\$/g,_7=new RegExp(`(${Mx})|(${Tx})\\b`,"g"),Gb=new Map,Yb=new Map;function w7(e){if(!e)return _7;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=Gb.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${Mx})|(${o})\\b`,"g");return Gb.set(n,i),i}function S7(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=Yb.get(s);if(o)return o;const i=e?[Ef,Tx].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Ef].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return Yb.set(s,r),r}const Xb={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Zb(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Qb(e){const t=/(^|[^\\])(__|\*\*)/g;let n,s=null;for(;(n=t.exec(e))!==null;)s={marker:n[2],index:n.index+(n[1]?.length??0)};return s}function Yi(e,t){const n=t?.commands??xx,s=t?.escapeExclamation??!0,o=t?.commands==null,i=w7(o?void 0:n);let r=e.replace(i,(c,u,d,p,m)=>{if(u!==void 0&&Xb[u]!==void 0)return`\\${Xb[u]}`;if(d&&n.includes(d)){const f=m&&typeof p=="number"?m[p-1]:void 0;return f==="\\"||f&&/\w/.test(f)?c:`\\${d}`}return c});s&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=S7(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(v7,"span\\{$1\\}").replace(y7,"\\operatorname{span}\\{$1\\}"),l=l.replace(k7,`$1\\\\
|
|
128
|
+
`),l=l.replace(b7,"$1\\\\"),l=l.replace(g7,"$1\\$2"),l}function Jb(e){const t=e.trim();return!(!dc(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function C7(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const s=n;let o=1;for(;s+o<e.length&&e[s+o]==="`";)o++;let i=s+o,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===o){r=i;break}i+=l}if(r!==-1){t.push([s,r+o]),n=r+o;continue}n=s+o}return t}function e_(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function x7(e,t=!1){const n=[];let s=0;for(;s<e.length-1;){if(e[s]==="!"&&e[s+1]==="["){const o=s;let i=s+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([o,l]),s=l;continue}if(t){n.push([o,e.length]),s=e.length;continue}}}s++}return n}function Ax(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function Ug(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(Ax(e,s)){n=s+1;continue}return s}return-1}function km(e,t){let n=t;for(;n<e.length;){const s=Ug(e,n);if(s===-1)return-1;if(s>0&&e[s-1]==="$"||s+1<e.length&&e[s+1]==="$"){n=s+1;continue}return s}return-1}function bm(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function T7(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const s=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(s)?!1:s===""||/^[)\s,.!?;:]/.test(s)}function _m(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function M7(e,t){const n=(i,r)=>{const l=i,a=!!t?.strictDelimiters,c=!l?.env?.__markstreamFinal,u=(b,_)=>{let g=_;for(;g<b.length&&(b[g]===" "||b[g]===" ");)g++;if(g===_||!(b[g]===`
|
|
129
|
+
`||b[g]==="\r"&&b[g+1]===`
|
|
130
|
+
`))return _;const y=b.slice(_,g),k=l.push("text","",0);return k.content=y,g};if(/^\*[^*]+/.test(l.src))return!1;const d=[["$$","$$"],["$","$"],["\\(","\\)"]],p=String(l.pending??""),m=Math.max(0,l.pos-p.length);let f=m,v=m;const w=m;for(const[b,_]of d){const g=l.src,y=C7(g),k=x7(g,c);let I=!1;b==="$$"&&f!==w&&(f=w);let E=-1,S=-1,T=0;const $=L=>{if((L==="undefined"||L==null)&&(L=""),L==="\\"){l.pos=l.pos+L.length,f=l.pos;return}if(L==="\\)"||L==="\\("){const B=l.push("text_special","",0);B.content=L==="\\)"?")":"(",B.markup=L,l.pos=l.pos+L.length,f=l.pos;return}if(!L)return;if(b==="$$"&&L.includes("$")){let B=0;for(;B<L.length;){const F=Ug(L,B);if(F===-1){const Ne=L.slice(B);if(Ne){const me=l.push("text","",0);me.content=Ne,l.pos=l.pos+Ne.length,f=l.pos}break}if(F>0&&L[F-1]==="$"||F+1<L.length&&L[F+1]==="$"){const Ne=L.slice(B,F+1);if(Ne){const me=l.push("text","",0);me.content=Ne,l.pos=l.pos+Ne.length,f=l.pos}B=F+1;continue}const q=L.slice(B,F);if(q){const Ne=l.push("text","",0);Ne.content=q,l.pos=l.pos+q.length,f=l.pos}const G=km(L,F+1);if(G===-1){const Ne=L.slice(F),me=l.push("text","",0);me.content=Ne,l.pos=l.pos+Ne.length,f=l.pos;break}const K=L.slice(F+1,G),oe=K.includes("`"),le=!K||!K.trim(),pe=L[G+1],be=bm(K,pe),Be=_m(K);if(!oe&&!le&&!be&&!Be){const Ne=l.push("math_inline","math",0);Ne.content=Yi(K,t),Ne.markup="$",Ne.raw=`$${K}$`,Ne.loading=!1,l.pos=l.pos+(G-F+1),f=l.pos,B=G+1;continue}const He=l.push("text","",0);He.content="$",l.pos=l.pos+1,f=l.pos,B=F+1}return}const R=L.indexOf("![");if(R!==-1){if(R>0){const q=L.slice(0,R),G=l.push("text","",0);G.content=q,l.pos=l.pos+q.length,f=l.pos}const B=L.slice(R).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(B){const[,q,G]=B,K=G.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),oe=K?K[1]:G,le=K&&K[2]?K[2]:null,pe=l.push("image","img",0);pe.attrs=[["src",oe],["alt",q]],le&&pe.attrs.push(["title",le]),pe.content=q,pe.children=[{type:"text",content:q,tag:""}],l.pos=l.pos+B[0].length,f=l.pos;const be=L.slice(R+B[0].length);be&&$(be);return}const F=l.push("text","",0);F.content=L,l.pos=l.pos+L.length,f=l.pos;return}const O=l.push("text","",0);O.content=L,l.pos=l.pos+L.length,f=l.pos};for(;!(f>=g.length);){const L=g.indexOf(b,f);if(L===-1)break;if(Ax(g,L)){f=L+Math.max(1,b.length);continue}const R=e_(y,L);if(R){f=R[1];continue}const O=e_(k,L);if(O){f=O[1];continue}if(L===E&&f===S){if(T++,T>2){f=L+Math.max(1,b.length);continue}}else T=0,E=L,S=f;if(b==="("&&L>0){let be=L-1;for(;be>=0&&g[be]===" ";)be--;if(be>=0&&g[be]==="]"){f=L+b.length;continue}}if(b==="$"&&L>0&&g[L-1]==="$"){f=L+1;continue}if(b==="$"&&L<g.length-1&&g[L+1]==="$"){f=L+2;continue}const B=b==="$"?km(g,L+b.length):t7(g,L+b.length,b,_);if(B===-1){const be=g.slice(L+b.length);if(be.includes(b)){f=g.indexOf(b,L+b.length);continue}if(B===-1){const Be=b==="$"&&T7(be);if(c&&!a&&!Be&&dc(be)&&!be.includes("`")){if(f=L+b.length,I=!0,!r){l.pending="";const He=v?g.slice(v,f):g.slice(0,f),Ne=Zb(He)%2===1;if(v)$(g.slice(v,f));else{let me=g.slice(0,f);me.endsWith(b)&&(me=me.slice(0,me.length-b.length)),$(me)}if(Ne){const me=Qb(He)?.marker??"**",_e=l.push("strong_open","",0);_e.markup=me;const Ce=l.push("math_inline","math",0);Ce.content=Yi(be,t),Ce.markup=b==="$$"?"$$":b==="\\("?"\\(\\)":b==="$"?"$":"()",Ce.raw=`${b}${be}${_}`,Ce.loading=!0,_e.content=be,l.push("strong_close","",0)}else{const me=l.push("math_inline","math",0);me.content=Yi(be,t),me.markup=b==="$$"?"$$":b==="\\("?"\\(\\)":b==="$"?"$":"()",me.raw=`${b}${be}${_}`,me.loading=!0}l.pos=g.length}f=g.length,v=f}break}}const F=g.slice(L+b.length,B),q=F.includes("`"),G=!F||!F.trim(),K=b==="$",oe=g[B+_.length],le=K&&bm(F,oe),pe=K&&_m(F);if(a?q||G||le||pe:q||G||le||pe||!K&&!dc(F)){f=B+_.length;const be=g.slice(l.pos,f);l.pending||($(be),v=f);continue}if(I=!0,!r){const be=g.slice(l.pos-(l.pending??"").length,L);let Be=g.slice(0,f)?g.slice(v,L):be;const He=Zb(Be)%2===1;L!==l.pos&&He&&(Be=l.pending+g.slice(l.pos,L));const Ne=He?Qb(Be):null,me=Ne?.marker??"**";if(l.pending!==Be)if(l.pending="",He)if(Ne){const _e=Be.slice(Ne.index+me.length);$(Be.slice(0,Ne.index));const Ce=l.push("strong_open","",0);Ce.markup=me;const de=l.push("text","",0);de.content=_e,l.push("strong_close","",0)}else $(Be);else $(Be);if(He){const _e=l.push("strong_open","",0);_e.markup=me;const Ce=l.push("math_inline","math",0);Ce.content=Yi(F,t),Ce.markup=b==="$$"?"$$":b==="\\("?"\\(\\)":b==="$"?"$":"()",Ce.raw=`${b}${F}${_}`,Ce.loading=!1;const de=g.slice(B+_.length).startsWith(me);return de&&l.push("strong_close","",0),l.pos=u(g,B+_.length),f=l.pos,v=f,de||l.push("strong_close","",0),!0}else{const _e=l.push("math_inline","math",0);_e.content=Yi(F,t),_e.markup=b==="$$"?"$$":b==="\\("?"\\(\\)":b==="$"?"$":"()",_e.raw=`${b}${F}${_}`,_e.loading=!1}}return f=u(g,B+_.length),v=f,l.pos=f,!0}if(I){if(r)l.pos=f;else{if(b==="$$"&&f<g.length&&g.slice(f).includes("$")){let L=f;for(;!(L>=g.length);){const R=Ug(g,L);if(R===-1)break;if(R+1<g.length&&g[R+1]==="$"){L=R+2;continue}if(R>0&&g[R-1]==="$"){L=R+1;continue}const O=km(g,R+1);if(O===-1)break;const B=g.slice(R+1,O),F=B.includes("`"),q=!B||!B.trim(),G=g[O+1],K=bm(B,G),oe=_m(B);if(!F&&!q&&!K&&!oe){const le=g.slice(f,R);le&&$(le);const pe=l.push("math_inline","math",0);pe.content=Yi(B,t),pe.markup="$",pe.raw=`$${B}$`,pe.loading=!1,f=O+1,L=O+1}else $("$"),L=R+1}L<g.length&&$(g.slice(L))}else f<g.length&&$(g.slice(f));l.pos=g.length}return!0}}return!1},s=(i,r,l,a)=>{const c=i,u=!c?.env?.__markstreamFinal,d=t?.strictDelimiters,p=d?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[r]+c.tShift[r];let f=c.src.slice(m,c.eMarks[r]).trim(),v=!1,w="",b="",_=!1;for(const[F,q]of p)if(f.startsWith(F))if(F.includes("["))if(t?.strictDelimiters){if(f.replace("\\","")==="["){if(r+1<l){v=!0,w=F,b=q;break}continue}}else if(f.replace("\\","")==="["){if(r+1<l){v=!0,w=F,b=q;break}continue}else{const G=c.tokens[c.tokens.length-1];if(G&&G.type==="list_item_open"&&G.mark==="-"&&f.slice(F.length,f.indexOf("]")).trim()==="x")continue;if(f.replace("\\","").startsWith("[")&&!f.includes("](")){const K=f.indexOf("]");if(f.slice(K).trim()!=="]")continue;const oe=f.slice(F.length,K);if(F==="["?Jb(oe):dc(oe)){v=!0,w=F,b=q;break}continue}}else{v=!0,w=F,b=q;break}else if(F==="$$"&&f.endsWith(F)&&!f.slice(0,f.length-F.length).trim().includes(F)&&r+1<l){c.push("text","",0).content=f.slice(0,f.length-F.length);const G=c.bMarks[r+1]+c.tShift[r+1];f=c.src.slice(G,c.eMarks[r+1]).trim(),_=!0,v=!0,w=F,b=q;break}if(!v)return!1;if(a)return!0;const g=f.indexOf(w),y=g+w.length,k=!d&&w==="["?f.indexOf("\\]",y):-1,I=k>=0?"\\]":b,E=k>=0?k:f.indexOf(b,y);if(E>w.length){const F=f.slice(g+w.length,E),q=c.push("math_block","math",0);return q.content=Yi(F),q.markup=w==="$$"?"$$":w==="["?"[]":"\\[\\]",q.map=[r,r+1],q.raw=`${w}${F}${I}`,q.block=!0,q.loading=!1,c.line=r+1,!0}let S=r,T="",$=!1;const L=f===w?"":f.slice(w.length),R=!d&&w==="\\["?"]":"";if(L.includes(b)){const F=L.indexOf(b);T=L.slice(0,F),$=!0,S=r}else for(L&&!_&&(T=L),S=r+1;S<l;S++){const F=c.bMarks[S]+c.tShift[S],q=c.eMarks[S],G=c.src.slice(F,q),K=G.trim();if(!d&&w==="["&&K==="\\]"){b="\\]",$=!0;break}if(R&&G.trim()===R){b=R,$=!0;break}if(K===b){$=!0;break}else if(!d&&w==="["&&G.includes("\\]")){$=!0;const oe=G.indexOf("\\]");b="\\]",T+=(T?`
|
|
131
|
+
`:"")+G.slice(0,oe);break}else if(G.includes(b)){$=!0;const oe=G.indexOf(b);T+=(T?`
|
|
132
|
+
`:"")+G.slice(0,oe);break}T+=(T?`
|
|
133
|
+
`:"")+G}if((!u||d)&&!$)return!1;const O=/^\s*!\[/.test(T);if(!(w==="$$"?!O:w==="["?Jb(T):dc(T)))return!1;const B=c.push("math_block","math",0);return B.content=Yi(T),B.markup=w==="$$"?"$$":w==="["?"[]":"\\[\\]",B.raw=`${w}${T}${T.startsWith(`
|
|
134
|
+
`)?`
|
|
135
|
+
`:""}${b}`,B.map=[r,S+1],B.block=!0,B.loading=!$,c.line=S+1,!0},o=(i,r,l,a)=>{const c=i,u=c.bMarks[r]+c.tShift[r],d=c.src.slice(u,c.eMarks[r]).trim();return!d.startsWith("$$")&&!d.startsWith("\\[")?!1:s(i,r,l,a)};e.inline.ruler.before("escape","math",n),e.block.ruler.before("lheading","explicit_math_block",o,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function A7(e){const t=e.renderer.rules.image||function(n,s,o,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,s,o):""};e.renderer.rules.image=(n,s,o,i,r)=>{const l=n;return l[s].attrSet?.("loading","lazy"),t(l,s,o,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,s)=>{const o=n[s],i=String(o.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(o.content??""))}</code></pre>`})}function E7(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},s=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=new SR({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return(e.enableMath??!0)&&M7(o,{...e.mathOptions??{}}),(e.enableContainers??!0)&&TR(o),e.enableFixIndentedCodeBlock!==!1&&cP(o),FP(o),qP(o),WP(o),KP(o),A7(o),lP(o,{customHtmlTags:e.customHtmlTags}),o}function rl(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>rl(n))),t}function $7(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function I7(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,s=n===""||n==="true";return{type:"checkbox_input",checked:s,raw:s?"[x]":"[ ]"}}function N7(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function fd(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];o+=String(e[i].content??l.text??""),r.push(e[i]),i++}return s.push(...hn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const t_=/\r?\n[ \t]*`+\s*$/,Ex=["diff ","index ","--- ","+++ ","@@ "],L7=/\r?\n/;function O7(e){const t=String(e??"");return t?Ex.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function n_(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function R7(e,t){const n=[],s=[],o=[],i=[],r=e.split(L7),l=/\r?\n$/.test(e),a=r.some(m=>m.startsWith("diff ")||m.startsWith("--- ")||m.startsWith("+++ ")||m.startsWith("@@ ")),c=m=>{const f=m;if(!Ex.some(v=>f.startsWith(v)))if(f.startsWith("-")){const v=f.slice(1);o.push(!a&&v.startsWith(" ")?` ${v}`:v)}else if(f.startsWith("+")){const v=f.slice(1);i.push(!a&&v.startsWith(" ")?` ${v}`:v)}else{n_(n,s,o,i);const v=a&&f.startsWith(" ")?f.slice(1):f;n.push(v),s.push(v)}},u=l?Math.max(0,r.length-1):r.length;for(let m=0;m<u;m++){const f=r[m]??"";!t&&!l&&m===u-1&&O7(f)||c(f)}(t||o.length>0||i.length>0)&&n_(n,s,o,i);const d=n.join(`
|
|
136
|
+
`),p=s.join(`
|
|
137
|
+
`);return{original:t&&l&&d?`${d}
|
|
138
|
+
`:d,updated:t&&l&&p?`${p}
|
|
139
|
+
`:p}}function yv(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},s=typeof n.closed=="boolean"?n.closed:void 0,o=s===!0||s!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(t_.test(a)&&(a=a.replace(t_,"")),r){const{original:c,updated:u}=R7(a,o===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t}}function P7(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function D7(){return{type:"hardbreak",raw:`\\
|
|
140
|
+
`}}function B7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...hn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let wm=null;const Sm=new WeakMap;function s_(){return wm||(wm={customTagSet:null,allowedTagSet:Mh()}),wm}function $x(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function Ix(e){return/^<\s*\//.test(e)}function Nx(e,t){return/\/\s*>\s*$/.test(t)||hl.has(e)}function F7(e){if(!e||e.length===0)return s_();const t=Sm.get(e);if(t)return t;const n=e.map(Eo).filter(Boolean);if(!n.length){const o=s_();return Sm.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:Mh({customHtmlTags:e})};return Sm.set(e,s),s}function Lx(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function H7(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function $f(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function W7(e,t,n){const s=e.slice();return $f(s,"href")||s.push(["href",t]),n!=null&&!$f(s,"title")&&s.push(["title",n]),s}function qg(e){return e.map(Lx).join("")}function Ld(e){const t=[],n=s=>{const o=String(s??"");if(!o)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${o}`,i.raw=`${i.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const s of e)if(s){if(s.type==="reference"||s.type==="footnote_reference"){n(String(s.raw??""));continue}if("children"in s&&Array.isArray(s.children)){t.push({...s,children:Ld(s.children)});continue}t.push(s)}return t}function U7(e,t,n){let s=0;for(let o=t;o<e.length;o++){const i=e[o];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=$x(r),a=Ix(r),c=Nx(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function Cm(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?U7(e,t+1,n):-1;return l!==-1?(o=e.slice(t+1,l),s.push(...o,e[l]),i=l+1,r=!0):(o=e.slice(t+1),o.length&&s.push(...o),i=e.length),{closed:r,html:qg(s),innerTokens:o,nextIndex:i}}function q7(e,t,n,s,o,i,r){const l=String(e.content??""),a=$x(l),{customTagSet:c,allowedTagSet:u}=F7(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!Cm(t,n,a).closed){const k=Lx(e);return[{type:"text",content:k,raw:k},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=Ix(l),p=Nx(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const k=Cm(t,n,a),I=xh(l),E=k.innerTokens,S=String($f(I,"href")??""),T=$f(I,"title"),$=T==null?null:String(T),L=W7(I,S,$),R=Ld(E.length?s(E,o,i,r):[]),O=E.length?qg(E):S||"";return!R.length&&O&&R.push({type:"text",content:O,raw:O}),[{type:"link",href:S,title:$,text:O,attrs:L,children:R,loading:!k.closed,raw:k.html||l},k.nextIndex]}if(p)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const m=Cm(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Ld(m.innerTokens.length?s(m.innerTokens,o,i,r):[]),raw:m.html},m.nextIndex];const f=Ld(m.innerTokens.length?s(m.innerTokens,o,i,r):[]);let v=m.html||l,w=!m.closed,b=!1;if(!m.closed){const k=`</${a}>`;v.toLowerCase().includes(k.toLowerCase())||(v+=k),b=!0,w=!0}const _=[],g=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=g.exec(l))!==null;){const k=y[1],I=y[2]||y[3]||y[4]||"";_.push([k,I])}if(c?.has(a)){const k=H7(e);return[{type:a,tag:a,attrs:_,content:k?k.inner:m.innerTokens.length?qg(m.innerTokens):"",children:m.innerTokens.length?s(m.innerTokens,o,i,r):[],raw:k?.raw??v,loading:e.loading||w,autoClosed:b},m.nextIndex]}return[{type:"html_inline",tag:a,attrs:_,content:v,children:f,raw:v,loading:w,autoClosed:b},m.nextIndex]}function Ox(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>Ox(t)).join(""):String(e.content??"")}function j7(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>Ox(t)).join("")}function o_(e,t=!1){let n=e.attrs??[],s=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const p=d.attrs;if(Array.isArray(p)&&p.length>0){n=p,s=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=j7(s??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):s?.content!=null&&String(s.content).length>0?l=String(s.content):Array.isArray(s?.children)&&s.children[0]?.content?l=String(s.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:o,alt:l,title:c,raw:u,loading:t}}function z7(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function V7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...hn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function K7(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const s=n?.[0];s&&t.push([String(s),String(n?.[1]??"")])}return t}function If(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function G7(e,t,n){const s=e.slice();return If(s,"href")||s.push(["href",t]),n!=null&&!If(s,"title")&&s.push(["title",n]),s}function hd(e,t,n){const s=e[t],o=K7(s.attrs),i=String(If(o,"href")??""),r=If(o,"title"),l=r==null?null:String(r),a=G7(o,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let p=u;const m=u[u.length-1];if(n?.__insideStrong&&m?.type==="text"&&String(m.content??"").endsWith("**")&&!u.some(w=>w.type==="strong_open")){const w=String(m.content??""),b=String(m.raw??w),_=rl(m);_.content=w.slice(0,-2),_.raw=b.replace(/\*\*$/,""),p=u.slice(),p[p.length-1]=_}const f=hn(p,void 0,void 0,n),v=f.map(w=>{const b=w;return"content"in w?String(b.content??""):String(b.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:v,children:f,raw:`[${v}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function i_(e){const t=e.content??"",n=e.raw==="$$"?`$${t}$`:e.raw||"";return{type:"math_inline",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function Y7(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function r_(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...hn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const X7=/\\([\\()[\]`$|*_\-!])/g;function Z7(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(X7,"$1")===t))return n}function nc(e,t,n,s){const o=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...s,__insideStrong:!0};return o.push(...hn(l,Z7(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function Q7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)o+=String(e[i].content??""),r.push(e[i]),i++;s.push(...hn(r,void 0,void 0,n));const l=String(e[t].content??""),a=o||l;return{node:{type:"subscript",children:s.length>0?s:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function J7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...hn(r,void 0,void 0,n)),{node:{type:"superscript",children:s.length>0?s:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function eD(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const tD=/[^~]*~{2,}[^~]+/,nD=/\*\*/,sD=/[[_*^~]/,oD=/\\([\\()[\]`$|*_\-!])/g,kv=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),iD=/\s/u,rD=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,lD=/\p{P}/u,aD=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,cD=/:\/\//;function uD(e){let t=0,n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="*"){n+=2;continue}e[n]==="*"&&t++,n++}return t}function Rx(e,t=0){if(!e)return-1;let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&kv.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function yr(e){return!!e&&iD.test(e)}function kr(e){return!!e&&(rD.test(e)||lD.test(e))}function dD(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||yr(s)?!1:!(kr(s)&&n&&!yr(n)&&!kr(n))}function fD(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||yr(n)?!1:!(kr(n)&&s&&!yr(s)&&!kr(s))}function hD(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?Rx(e,s):t.indexOf("*",s);if(i===-1)break;if(fD(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function pD(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||yr(s)?!1:!(kr(s)&&n&&!yr(n)&&!kr(n))}function mD(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||yr(n)?!1:!(kr(n)&&s&&!yr(s)&&!kr(s))}function gD(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(mD(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function vD(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let s=0;for(;n+s<e.length&&e[n+s]==="\\";)s++;const o=e[n+s];if(t+="\\".repeat(Math.floor(s/2)),s%2===1){if(o&&kv.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function yD(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&kv.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function kD(e,t,n){const s=yD(e,t);if(s===-1||e[s]!==n)return!1;let o=0;for(let i=s-1;i>=0&&e[i]==="\\";i--)o++;return o%2===1}const bD=/[\p{L}\p{N}]/u,_D=/^[\p{L}\p{N}]+$/u;function jg(e){return e?bD.test(e):!1}function Px(e){return e?_D.test(e):!1}function xc(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const s=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return{len:n-t,prev:s,next:o,intraword:jg(s)&&jg(o)}}function wD(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=xc(e,n),o=n+s.len;s.len>=2&&s.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n<t.length-1;n++){const s=t[n],o=t[n+1];if(!Px(e.slice(s.end,o.start)))return o.end}return-1}function SD(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function CD(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=xc(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function xD(e){return e?aD.test(e)||cD.test(e):!1}function TD(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function hn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=mu(t),r={filename:o?.filename||i.filename,explicitFilename:o?.explicitFilename||i.explicitFilename,marketTicker:o?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(s={...s,__linkifyDemotionContext:r});const l=s,a=[];let c=null,u=0;const d=s?.requireClosingStrong,p=e;function m(){return e===p&&(e=e.slice()),e}function f(){c=null}function v(z,Z){const fe=e.length===1?t:String(Z.content??""),P=[],X=wD(z);if(X!==-1){k(z.slice(0,X),z.slice(0,X));const se=z.slice(X);return se&&($({type:"text",content:se,raw:se}),u--),u++,!0}if(tD.test(z)){const se=z.indexOf("~~");se!==-1&&P.push({type:"strikethrough",index:se})}if(nD.test(z)){const se=z.indexOf("**");se!==-1&&P.push({type:"strong",index:se})}if(/[^*]*\*[^*]+/.test(z)){const se=fe?Rx(fe,0):z.indexOf("*");if(fe&&se===-1)return!1;se!==-1&&P.push({type:"emphasis",index:se})}P.sort((se,ce)=>se.index!==ce.index?se.index-ce.index:se.type===ce.type?0:se.type==="strong"?-1:ce.type==="strong"?1:0);const ne=P[0];if(!ne)return!1;if(ne.type==="strikethrough"){const se=ne.index,ce=se>-1?z.slice(0,se):"";if(ce&&k(ce,ce),se===-1)return u++,!0;const H=z.indexOf("~~",se+2),U=H===-1?z.slice(se+2):z.slice(se+2,H),Q=H===-1?"":z.slice(H+2),{node:ue}=r_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:U,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return f(),y(ue),Q&&($({type:"text",content:Q,raw:Q}),u--),u++,!0}if(ne.type==="strong"){const se=ne.index,ce=se>-1?z.slice(0,se):"";if(ce&&k(ce,ce),se===-1)return u++,!0;if(t&&se===0){let xe=!1,ie=0;for(;ie<z.length&&z[ie]==="*";)ie++;if(t.startsWith("\\*")&&(xe=!0),xe){let we=0,je=0;for(;je<t.length&&we<ie;)if(t[je]==="\\"&&je+1<t.length&&t[je+1]==="*")we+=1,je+=2;else{if(t[je]==="*")break;je++}if(we>=2)return k(z,z),u++,!0}}if(t&&(z.match(/\*/g)||[]).length>uD(t))return k(z.slice(ce.length),z.slice(ce.length)),u++,!0;const H=xc(z,se);if(H.len>=3){const xe=CD(z,se+H.len);if(xe!==-1){const ie=z.slice(se+H.len,xe);if(SD(ie)){const{node:we}=nc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ie,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);f(),y(we);const je=z.slice(xe+3);return je&&($({type:"text",content:je,raw:je}),u--),u++,!0}}}if(!pD(z,se)){const xe=z.slice(se,se+H.len);k(xe,xe);const ie=z.slice(se+H.len);return ie&&($({type:"text",content:ie,raw:ie}),u--),u++,!0}const U=gD(z,se+2);let Q="",ue="";if(U.index!==-1){Q=z.slice(se+2,U.index),ue=z.slice(U.index+2);const xe=U.index,ie=xc(z,xe);if(H.intraword&&ie.intraword&&!Px(Q)||!Q&&H.len>=4&&H.intraword)return k(z.slice(ce.length),z.slice(ce.length)),u++,!0}else{if(d||U.sawInvalidClose||H.intraword)return k(z.slice(ce.length),z.slice(ce.length)),u++,!0;Q=z.slice(se+2),ue=""}if(!Q&&/^\*+$/.test(ue))return k(z,z),u++,!0;const{node:ge}=nc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:Q,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return f(),y(ge),ue&&($({type:"text",content:ue,raw:ue}),u--),u++,!0}if(ne.type==="emphasis"){let se=ne.index;se===-1&&(se=0);const ce=z.slice(0,se);if(ce&&k(ce,ce),!dD(z,se)){k(z[se],z[se]);const xe=z.slice(se+1);return xe&&($({type:"text",content:xe,raw:xe}),u--),u++,!0}const H=xc(z,se),U=hD(fe,z,se+1),Q=U.index,ue=e[u+1];if(s?.final&&ue?.type==="em_open"&&Q!==-1&&z.slice(se+1,Q).trim()!==z.slice(se+1,Q)||Q===-1&&(U.sawInvalidClose||s?.final||H.intraword||!jg(z[se+1])))return k(z.slice(se),z.slice(se)),u++,!0;const{node:ge}=fd([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Q>-1?z.slice(se+1,Q):z.slice(se+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(f(),y(ge),Q!==-1&&Q<z.length-1){const xe=z.slice(Q+1);xe&&($({type:"text",content:xe,raw:xe}),u--)}return u++,!0}return!1}function w(z,Z){if(!z.includes("`"))return!1;const P=(ue=>{for(let ge=0;ge<ue.length;ge++){if(ue[ge]!=="`")continue;let xe=0;for(let ie=ge-1;ie>=0&&ue[ie]==="\\";ie--)xe++;if(xe%2===0)return ge}return-1})(z);if(P===-1)return!1;let X=1;for(let ue=P+1;ue<z.length&&z[ue]==="`";ue++)X++;const ne="`".repeat(X),se=P+X,ce=z.indexOf(ne,se);if(ce===-1){if(X===1){const ge=z.slice(0,P),xe=z.slice(P+1);return ge&&(v(ge,Z)?u--:k(ge,ge)),_({type:"inline_code",code:xe,raw:String(xe)}),u++,!0}let ue=z;for(let ge=u+1;ge<e.length;ge++)ue+=String((e[ge].content??"")+(e[ge].markup??""));return u=e.length-1,k(ue,ue),u++,!0}f();const H=z.slice(0,P),U=z.slice(P+X,ce),Q=z.slice(ce+X);return H&&(v(H,Z)?u--:k(H,H)),_({type:"inline_code",code:U,raw:String(U??"")}),Q&&($({type:"text",content:Q,raw:Q}),u--),u++,!0}function b(z){const Z=l?.__markdownIt;if(!Z||e.length<=1||!e.some(ne=>ne?.type==="math_inline")||!sD.test(z))return null;const fe=Z.parseInline(z,{__markstreamFinal:!!s?.final});if(!Array.isArray(fe)||fe.length===0)return null;const P=(fe.find(ne=>ne?.type==="inline")?.children??[]).filter(ne=>!(ne?.type==="text"&&String(ne.content??"")===""));if(!P.length||!P.some(ne=>ne?.type!=="text")||P.length===1&&P[0]?.type==="text"&&String(P[0].content??"")===z)return null;const X=hn(P,z,n,s);return X.length?X:null}function _(z){f(),a.push(z)}function g(z){f();const Z=rl(z);a.push(Z)}function y(z){_(z)}function k(z,Z){c?(c.content+=z,c.raw+=Z??z):(c={type:"text",content:String(z??""),raw:String(Z??z??"")},a.push(c))}function I(z,Z){if(!z)return;const fe=hn([{...Z,type:"text",content:z,raw:z}],z,n,s);if(fe.length===1&&fe[0]?.type==="text"){const P=fe[0];k(String(P.content??""),String(P.raw??P.content??""));return}for(const P of fe)y(P)}function E(z,Z){return String(z.markup??"").startsWith(Z)}function S(z){return z.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function T(z,Z){let fe=z;const P=String(Z.content??"");return fe.endsWith("\\")&&!E(Z,"\\\\")&&!P.endsWith("\\\\")&&(fe=fe.slice(0,-1)),fe.endsWith("(")&&!E(Z,"\\(")&&!P.endsWith("\\(")&&(fe=fe.slice(0,-1)),/\*+$/.test(fe)&&!E(Z,"\\*")&&!P.endsWith("\\*")&&(fe=fe.replace(/\*+$/,"")),fe}for(;u<e.length;){const z=e[u];$(z)}function $(z){switch(z.type){case"text":R(z);break;case"softbreak":c?(c.content+=`
|
|
141
|
+
`,c.raw+=`
|
|
142
|
+
`):(c={type:"text",content:`
|
|
143
|
+
`,raw:`
|
|
144
|
+
`},a.push(c)),u++;break;case"code_inline":y(z7(z)),u++;break;case"html_inline":{const[Z,fe]=q7(z,e,u,hn,t,n,s);y(Z),u=fe;break}case"link_open":O(z);break;case"image":Be(z)||(f(),y(o_(z)),u++);break;case"strong_open":{f();const{node:Z,nextIndex:fe}=nc(e,u,z.content,s);y(Z),u=fe;break}case"em_open":{f();const{node:Z,nextIndex:fe}=fd(e,u,s);y(Z),u=fe;break}case"s_open":{f();const{node:Z,nextIndex:fe}=r_(e,u,s);y(Z),u=fe;break}case"mark_open":{f();const{node:Z,nextIndex:fe}=B7(e,u,s);y(Z),u=fe;break}case"ins_open":{f();const{node:Z,nextIndex:fe}=V7(e,u,s);y(Z),u=fe;break}case"sub_open":{f();const{node:Z,nextIndex:fe}=Q7(e,u,s);y(Z),u=fe;break}case"sup_open":{f();const{node:Z,nextIndex:fe}=J7(e,u,s);y(Z),u=fe;break}case"sub":f(),y({type:"subscript",children:[{type:"text",content:String(z.content??""),raw:String(z.content??"")}],raw:`~${String(z.content??"")}~`}),u++;break;case"sup":f(),y({type:"superscript",children:[{type:"text",content:String(z.content??""),raw:String(z.content??"")}],raw:`^${String(z.content??"")}^`}),u++;break;case"emoji":{f();const Z=e[u-1];Z?.type==="text"&&/\|:-+/.test(String(Z.content??""))?k("",""):y(N7(z)),u++;break}case"checkbox":f(),y($7(z)),u++;break;case"checkbox_input":f(),y(I7(z)),u++;break;case"footnote_ref":f(),y(P7(z)),u++;break;case"footnote_anchor":{f();const Z=z.meta??{};_({type:"footnote_anchor",id:String(Z.label??z.content??""),raw:String(z.content??"")}),u++;break}case"hardbreak":f(),y(D7()),u++;break;case"fence":f(),y(yv(e[u])),u++;break;case"math_inline":f(),!z.content&&z.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(i_({...z,content:e[u+1].content})),u+=2):y(i_(z)),u++;break;case"reference":F(z);break;case"text_special":k(String(z.content??""),String(z.content??"")),u++;break;default:{const Z=z;if(z.type==="link"&&Z.href!=null&&s?.validateLink&&!s.validateLink(String(Z.href))){f();const fe=String(Z.text??"");k(fe,fe),u++}else He(z)||G(z)||oe(z)||q(z)||g(z),u++;break}}}function L(z,Z,fe,P){const X=eD({...Z,content:z});if(c){c.content+=T(X.content,Z),c.raw+=X.raw;return}const ne=fe?.tag==="br"&&e[u-2]?.content==="[";P||(X.content=T(X.content,Z)),c=X,c.center=ne,a.push(c)}function R(z){const Z=String(z.content??""),fe=e.length===1&&Z.includes("\\")&&typeof t=="string"?String(t):"";let P=fe?vD(fe):Z.replace(oD,"$1");if(z.content==="<"||P==="1"&&e[u-1]?.tag==="br"){u++;return}const X=P.indexOf("$");X!==-1&&X===P.lastIndexOf("$")&&P.endsWith("$")&&(P=P.slice(0,-1)),P.endsWith("undefined")&&!t?.endsWith("undefined")&&(P=P.slice(0,-9));let ne=a.length,se="";for(let Q=a.length-1;Q>=0;Q--){const ue=a[Q];if(ue.type!=="text")break;ne=Q,se=String(ue.content??"")+se}ne<a.length&&(P.startsWith(se)?(c=null,a.length=ne):c=a[a.length-1]);const ce=e[u+1];if((P==="`"||P==="|"||P==="$")&&!E(z,`\\${P}`)||/^\*+$/.test(P)&&!E(z,"\\*")){u++;return}if(!ce&&/[^\]]\s*\(\s*$/.test(P)&&(P=P.replace(/\(\s*$/,"")),!P){u++;return}if(be(P)||Ne(P))return;if(!(P.includes("*")||P.includes("_")||P.includes("~")||P.includes("`")||P.includes("[")||P.includes("!")||P.includes("$")||P.includes("|")||P.includes("("))){L(P,z,e[u-1],ce),u++;return}if(de(P))return;const H=e[u-1];if(P==="["&&!ce?.markup?.includes("*")&&!E(z,"\\[")||P==="]"&&!H?.markup?.includes("*")&&!E(z,"\\]")){u++;return}if(w(Z,z)||Ce(P)||(e[u+1]?.type!=="link_open"||S(P))&&_e(P,z))return;const U=b(Z);if(U){f();for(const Q of U)y(Q);u++;return}v(P,z)||(L(P,z,H,ce),u++)}function O(z){if(B(z))return;if(me()){const{node:ce,nextIndex:H}=hd(e,u,s),U=String(ce.text||ce.href||"");k(U,U),u=H;return}f();const{node:Z,nextIndex:fe}=hd(e,u,s);u=fe;const P=Z.text||Z.href||"";if(z.markup==="linkify"&&!_x(P,Z.href,t)&&Af(P,l?.__linkifyDemotionContext)){k(P,P);return}const X=Z.children.length===1&&Z.children[0]?.type==="text";if(Z.loading&&t&&Z.text===Z.href&&X){const ce=TD(t,Z.href);ce&&(Z.text=ce,Z.children=[{type:"text",content:ce,raw:ce}],Z.raw=`[${ce}](${Z.href}${Z.title?` "${Z.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(Z.href)){k(Z.text,Z.text);return}const ne=z.attrs?.find(([ce])=>ce==="href")?.[1],se=String(ne??"");if(t&&se){const ce=t.indexOf("](");if(ce!==-1){const H=t.indexOf(")",ce+2);H===-1?Z.loading=!0:Z.loading&&t.slice(ce+2,H).includes(se)&&(Z.loading=!1)}}q(Z)||_(Z)}function B(z){if(z.markup!=="linkify")return!1;const{node:Z,nextIndex:fe}=hd(e,u,s);return K(Z,fe)?(u=fe,!0):!1}function F(z){f(),y(Y7(z)),u++}function q(z){if(z.type!=="link")return!1;const Z=a[a.length-1];if(!Z||Z.type!=="text")return!1;const fe=String(Z.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!fe)return!1;const P=z,X=String(P.href??""),ne=String(P.text??""),se=String(fe[2]??""),ce=X.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!X||!(ne===X||ne===ce||xD(ne)))return!1;const H=String(fe[1]??"");return H?(Z.content=H,Z.raw=H):a.pop(),_({...z,text:se,children:[{type:"text",content:se,raw:se}],raw:`[${se}](${X}${P.title?` "${P.title}"`:""})`}),!0}function G(z){if(z.type!=="link")return!1;const Z=z,fe=String(Z.href??"");return fe?K({href:fe,title:Z.title==null||Z.title===""?null:String(Z.title),loading:!!Z.loading},u+1):!1}function K(z,Z){const fe=a[a.length-1];if(fe?.type!=="image"||fe.src||!fe.loading||!String(fe.raw??"").endsWith("]("))return!1;const P=e[Z],X=String(P?.content??"");if(P?.type!=="text"||!X.startsWith(")"))return!1;a.pop(),c=null;const ne=String(fe.alt??"");_({type:"image",src:z.href,alt:ne,title:z.title,raw:``,loading:!!z.loading});const se=X.slice(1),ce=rl(P);return ce.content=se,ce.raw=se,m()[Z]=ce,!0}function oe(z){if(z.type!=="link")return!1;const Z=a[a.length-1],fe=e[u-1];if(!Z||Z.type!=="text"||fe?.type!=="text")return!1;const P=String(Z.content??""),X=String(fe.content??"");if(!P.endsWith("!")||!X.endsWith("!")||E(fe,"\\!"))return!1;const ne=P.slice(0,-1);ne?(Z.content=ne,Z.raw=ne,c=Z):(a.pop(),c=null);const se=z,ce=String(se.text??se.children?.map(Q=>String(Q?.content??Q?.raw??"")).join("")??""),H=String(se.href??""),U=se.title==null||se.title===""?null:String(se.title);return _({type:"image",src:H,alt:ce,title:U,raw:``,loading:!!se.loading}),!0}function le(z,Z="",fe=null){const P=String(z.alt??z.raw??"");return{type:"link",href:Z,title:fe,text:P,children:[z],raw:`[${P}](${Z}${fe?` "${fe}"`:""})`,loading:!0}}function pe(z){const Z=z.startsWith(";return{type:"image",src:"",alt:P===-1?fe.replace(/\]$/,""):fe.slice(0,P),title:null,raw:Z,loading:!0}}function be(z){const Z=z.indexOf("[![");if(Z===-1||typeof t=="string"&&e.length===1&&kD(t,Z,"["))return!1;const fe=z.slice(0,Z);return fe&&k(fe,fe),_(le(pe(z.slice(Z+1)))),u++,!0}function Be(z){if(s?.final)return!1;const Z=e[u-1];if(Z?.type!=="text"||!String(Z.content??"").endsWith("[")||E(Z,"\\["))return!1;const fe=a[a.length-1];if(fe?.type==="text"&&fe.content.endsWith("[")){const P=fe.content.slice(0,-1);P?(fe.content=P,fe.raw=P,c=fe):(a.pop(),c=null)}return _(le(o_(z))),u++,!0}function He(z){if(z.type!=="link")return!1;const Z=z,fe=String(Z.raw??""),P=String(Z.text??"");if(!fe.startsWith("[![")&&!P.startsWith("!["))return!1;const X=Z.title==null||Z.title===""?null:String(Z.title);return _(le({type:"image",src:String(Z.href??""),alt:P.replace(/^!\[/,"").replace(/\]$/,""),title:X,raw:fe.startsWith("[)return!1;const Z=e[u-2];if(Z?.type==="text"&&String(Z.content??"").endsWith("[")&&E(Z,"\\["))return!1;const fe=a[a.length-1];if(fe?.type!=="image"&&fe?.type!=="link")return!1;const P=fe,X=fe?.type==="link"&&Array.isArray(P.children)&&P.children.length===1&&P.children[0]?.type==="image"?a.pop():null,ne=X?X.children[0]:a.pop();if(!ne||ne.type!=="image")return!1;const se=e[u+1];let ce=String(X?.href??""),H=X?.title==null?null:String(X.title),U=!0;if(se?.type==="link_open"){const{node:ue,nextIndex:ge}=hd(e,u+1,s);ce=ue.href,H=ue.title,U=!0,u=ge}else{if(ce=z.slice(2),ce.includes('"')){const ue=ce.split('"');ce=String(ue[0]??"").trim(),H=ue[1]==null?null:String(ue[1]).trim()}u++}const Q=le(ne,ce,H);return Q.loading=U,_(Q),!0}function me(){const z=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&z?.type==="text"&&String(z.content??"").endsWith("[")&&E(z,"\\[")}function _e(z,Z){const fe=z.indexOf("[");if(fe===-1)return!1;let P=z.slice(0,fe);const X=z.indexOf("](",fe);if(X!==-1){const ne=e[u+2];let se=z.slice(fe+1,X);if(se.includes("[")){const xe=se.indexOf("[");P+=z.slice(0,fe+xe+1);const ie=fe+xe+1;se=z.slice(ie+1,X)}const ce=e[u+1];if(z.endsWith("](")&&ce?.type==="link_open"&&ne){const xe=e[u+4];let ie=4,we=!0;if(xe?.type==="text"){const Je=String(xe.content??"");if(Je.startsWith(")")){we=!1;const nt=Je.slice(1);if(nt){const Ve=rl(xe);Ve.content=nt,Ve.raw=nt,m()[u+4]=Ve}else ie++}else Je==="."&&ie++}I(P,Z);const je=String(ne.content??"");return s?.validateLink&&!s.validateLink(je)?k(se,se):_({type:"link",href:je,title:null,text:se,children:[{type:"text",content:se,raw:se}],loading:we}),u+=ie,!0}const H=z.indexOf(")",X),U=H!==-1?z.slice(X+2,H):"",Q=H===-1;let ue=P.match(/\*+$/);if(ue&&(P=P.replace(/\*+$/,"")),I(P,Z),ue||(ue=se.match(/^\*+/)),!d&&ue){const xe=ue[0].length;se=se.replace(/^\*+/,"").replace(/\*+$/,"");const ie=[];if(xe===1?ie.push({type:"em_open",tag:"em",nesting:1}):xe===2?ie.push({type:"strong_open",tag:"strong",nesting:1}):xe===3&&(ie.push({type:"strong_open",tag:"strong",nesting:1}),ie.push({type:"em_open",tag:"em",nesting:1})),ie.push({type:"link",href:U,title:null,text:se,children:[{type:"text",content:se,raw:se}],loading:Q}),xe===1){ie.push({type:"em_close",tag:"em",nesting:-1});const{node:we}=fd(ie,0,s);y(we)}else if(xe===2){ie.push({type:"strong_close",tag:"strong",nesting:-1});const{node:we}=nc(ie,0,void 0,s);y(we)}else if(xe===3){ie.push({type:"em_close",tag:"em",nesting:-1}),ie.push({type:"strong_close",tag:"strong",nesting:-1});const{node:we}=nc(ie,0,void 0,s);y(we)}else{const{node:we}=fd(ie,0,s);y(we)}}else s?.validateLink&&!s.validateLink(U)?k(se,se):_({type:"link",href:U,title:null,text:se,children:[{type:"text",content:se,raw:se}],loading:Q});const ge=H!==-1?z.slice(H+1):"";return ge&&($({type:"text",content:ge,raw:ge}),u--),u++,!0}return!1}function Ce(z){const Z=z.indexOf("![");if(Z===-1)return!1;const fe=z.slice(0,Z);return fe&&!c?c={type:"text",content:fe,raw:fe}:fe&&c&&(c.content+=fe),c&&(a.push(c),c=null),_(pe(z.slice(Z))),u++,!0}function de(z){if(!(z?.startsWith("[")&&n?.type==="list_item_open"))return!1;const Z=z.slice(1).match(/[^\s\]]/);if(Z===null)return u++,!0;if(Z&&/x/i.test(Z[0])){const fe=Z[0]==="x"||Z[0]==="X";return _({type:"checkbox_input",checked:fe,raw:fe?"[x]":"[ ]"}),u++,!0}return!1}return a}function MD(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){o.content=r;break}s.pop();continue}break}}function AD(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){s.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?o.content=r:s.pop())}break}}function ED(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Ca(e,t,n){const s=e[t],o=[],i=xr(n,!0);let r=t+1;for(;r<e.length&&e[r].type!=="bullet_list_close"&&e[r].type!=="ordered_list_close";)if(e[r].type==="list_item_open"){const l=[];let a=r+1;for(;a<e.length&&e[a].type!=="list_item_close";)if(e[a].type==="paragraph_open"){const c=e[a+1],u=ED(c)?rl(c):c,d=e[a-1];u!==c&&(AD(u),MD(u));const p=String(u.content??"");l.push({type:"paragraph",children:hn(u.children||[],p,d,i.options()),raw:p}),i.remember(p),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=xa(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=Ca(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=_v(e,a,i.options(),bv);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}o.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:s.type==="ordered_list_open",start:(()=>{if(s.attrs&&s.attrs.length){const l=s.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:o,raw:o.map(l=>l.raw).join(`
|
|
145
|
+
`)},r+1]}function $D(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=xr(s,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:hn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};r.push(u),l.remember(u.raw)}a+=3}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=Ca(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=xa(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Th(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:o,title:i,children:r,raw:`:::${o} ${i}
|
|
146
|
+
${r.map(c=>c.raw).join(`
|
|
147
|
+
`)}
|
|
148
|
+
:::`},a+1]}const ID=new Set(["warning","info","note","tip","danger","caution"]);function ND(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const s=n.search(/\s/),o=(s===-1?n:n.slice(0,s)).toLowerCase();return ID.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function LD(e,t,n){const s=e[t];let o="note",i="";const r=s.type.match(/^container_(\w+)_open$/);if(r){o=r[1];const d=String(s.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(o)){const p=d.slice(o.length).trim();p&&(i=p)}}else{const d=ND(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=xr(n,!0);let c=t+1;const u=new RegExp(`^container_${o}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const p=d.children||[];let m=-1;for(let v=p.length-1;v>=0;v--){const w=p[v];if(w.type==="text"&&/:+/.test(w.content)){m=v;break}}const f={type:"paragraph",children:hn((m!==-1?p.slice(0,m):p)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(f),a.remember(f.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,p]=Ca(e,c,a.options());l.push(d),a.remember(d.raw),c=p}else if(e[c].type==="blockquote_open"){const[d,p]=xa(e,c,a.options());l.push(d),a.remember(d.raw),c=p}else{const d=Th(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:o,title:i,children:l,raw:`:::${o} ${i}
|
|
149
|
+
${l.map(d=>d.raw).join(`
|
|
150
|
+
`)}
|
|
151
|
+
:::`},c+1]}const OD=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function RD(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=OD.exec(String(s.info??""));return o?$D(e,t,o,n):null}const bv={parseContainer:(e,t,n)=>LD(e,t,n),matchAdmonition:RD};function xa(e,t,n){const s=[],o=xr(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";)switch(e[i].type){case"paragraph_open":{const r=e[i+1],l={type:"paragraph",children:hn(r.children||[],String(r.content??""),void 0,o.options()),raw:String(r.content??"")};s.push(l),o.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=Ca(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=xa(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=_v(e,i,o.options(),bv);r?(s.push(r[0]),o.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:s,raw:s.map(r=>r.raw).join(`
|
|
152
|
+
`)},i+1]}function PD(e){if(e.info?.startsWith("diff"))return yv(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let s=t;n?.[1]&&(s=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:s,raw:s,loading:!o}}function DD(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=xr(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=hn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:hn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(s.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
153
|
+
`)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
|
|
154
|
+
`)},o+1]}function BD(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=xr(n,!0);let l=t+1;for(;l<e.length&&e[l].type!=="footnote_close";)if(e[l].type==="paragraph_open"){const a=e[l+1],c=a.children?[...a.children]:[];e[l+2].type==="footnote_anchor"&&c.push(e[l+2]);const u={type:"paragraph",children:hn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:o,children:i,raw:`[^${o}]: ${i.map(a=>a.raw).join(`
|
|
155
|
+
`)}`},l+1]}function FD(e,t,n){const s=e[t],o=s.attrs,i=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(s.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:hn(a.children||[],c,void 0,n),raw:c}}function HD(e,t,n){const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=fn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(o.test(c)){const u=fn(c);if(u===-1)return-1;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return-1}function Dx(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const s=fn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=hl.has(n),l=xh(o),a=(s===-1?-1:HD(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
156
|
+
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function WD(e){const t=String(e.content??""),n=e.raw==="$$"?`$$${t}$$`:String(e.raw??"");return{type:"math_block",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function UD(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,s]=t;if(!s)continue;const o=String(s).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(o);if(i)return i[1].toLowerCase()}}return"left"}function Bx(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Fx(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Bx(n)?n:void 0}function qD(e,t,n){const s=Fx(mu(t),n);if(!Bx(s))return e;const o=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:o?.filename||s?.filename,explicitFilename:o?.explicitFilename||s?.explicitFilename,marketTicker:o?.marketTicker||s?.marketTicker}}}function jD(e,t,n){let s=t+1,o=null;const i=[];let r=!1;for(;s<e.length&&e[s].type!=="table_close";)if(e[s].type==="thead_open")r=!0,s++;else if(e[s].type==="thead_close")r=!1,s++;else if(e[s].type==="tbody_open"||e[s].type==="tbody_close")s++;else if(e[s].type==="tr_open"){const a=[];let c=s+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const p=e[c].type==="th_open",m=e[c+1],f=String(m.content??""),v=UD(e[c].attrs),w=a.length,b=!p&&!r,_=b?o?.cells[w]?.raw:void 0;a.push({type:"table_cell",header:p||r,children:hn(m.children||[],f,void 0,qD(n,_,b?u:void 0)),raw:f,align:v}),b&&(u=Fx(u,mu(f))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(p=>p.raw).join("|")};r?o=d:i.push(d),s=c+1}else s++;o||(o={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:o,rows:i,loading:l&&!n?.final&&i.length===0,raw:[o,...i].map(a=>a.raw).join(`
|
|
157
|
+
`)},s+1]}function zD(){return{type:"thematic_break",raw:"---"}}let xm=null;const Tm=new WeakMap;function l_(){return xm||(xm={allowedTagSet:Mh(),customTagSet:null}),xm}function VD(e){if(!e||e.length===0)return l_();const t=Tm.get(e);if(t)return t;const n=e.map(Eo).filter(Boolean);if(!n.length){const o=l_();return Tm.set(e,o),o}const s={allowedTagSet:Mh({customHtmlTags:e}),customTagSet:new Set(n)};return Tm.set(e,s),s}function KD(e,t,n){const s=e[t],o=s.attrs;let i="";const r={};if(o){for(const[m,f]of o)if(m==="class"){const v=f.match(/(?:\s|^)vmr-container-(\S+)/);v&&(i=v[1])}else if(m.startsWith("data-")){const v=m.slice(5);try{r[v]=JSON.parse(f)}catch{r[v]=f}}}const l=[],a=xr(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const m=e[c+1];if(m){const f={type:"paragraph",children:hn(m.children||[],void 0,void 0,a.options()),raw:String(m.content??"")};l.push(f),a.remember(f.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[m,f]=Ca(e,c,a.options());l.push(m),a.remember(m.raw),c=f}else if(e[c].type==="blockquote_open"){const[m,f]=xa(e,c,a.options());l.push(m),a.remember(m.raw),c=f}else{const m=Th(e,c,a.options());m?(l.push(m[0]),a.remember(m[0].raw),c=m[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let p=`::: ${i}`;return Object.keys(r).length>0&&(p+=` ${JSON.stringify(r)}`),p+=`
|
|
158
|
+
`,l.length>0&&(p+=s.raw??l.map(m=>m.raw).join(`
|
|
159
|
+
`),p+=`
|
|
160
|
+
`),p+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:p},u?c+1:c]}function GD(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function YD(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function XD(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${Qs(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Qs(s)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=fn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(o.test(c)){const u=fn(c);if(u===-1)return null;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return null}function ZD(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${s}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n||0);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=fn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const f=c+1;return{raw:e.slice(r,f),end:f}}let u=1,d=c+1;const p=f=>{const v=e.slice(f);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(v)},m=f=>{const v=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(v)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),end:e.length};if(m(f)){const v=e.indexOf(">",f);if(v===-1)return null;if(u--,u===0){const w=v+1;return{raw:e.slice(r,w),end:w}}d=v+1;continue}if(p(f)){const v=fn(e.slice(f));if(v===-1)return null;u++,d=f+v+1;continue}d=f+1}return{raw:e.slice(r),end:e.length}}function zg(e){return Number.isFinite(e)&&e>0?e:0}function QD(e,t){const n=zg(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
|
|
161
|
+
`&&(s++,s===n))return o+1;return e.length}function Th(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[FD(e,t,n),t+3];case"code_block":return[PD(s),t+1];case"fence":return[yv(s),t+1];case"math_block":return[WD(s),t+1];case"html_block":{const o=Dx(s),i=o.tag?VD(n?.customHtmlTags):null;if(o.tag&&o.loading&&i&&!i.allowedTagSet.has(o.tag)){const r=String(s.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(o.tag&&i?.customTagSet?.has(o.tag)){const r=o.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(s.map)?QD(l,Number(s.map?.[0]??0)):0,u=ZD(l,r,Math.max(zg(a),zg(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),p=fn(d),m=p!==-1?d.slice(0,p+1):d,f=p!==-1&&/\/\s*>\s*$/.test(m),v=p===-1?null:XD(d,r,p+1),w=v?.start??-1;let b="";p!==-1&&(w!==-1&&p<w?b=d.slice(p+1,w):b=d.slice(p+1)),w===-1&&(b=YD(b,r));const _=[],g=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=g.exec(m))!==null;){const I=y[1];if(!I||I.toLowerCase()===r)continue;const E=y[2]||y[3]||y[4]||"";_.push([I,E])}const k=!n?.final&&!f&&v==null;return[{type:r,tag:r,content:GD(b),raw:String(u?.raw??o.raw??d),loading:k,attrs:_.length?_:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=jD(e,t,n);return[o,i]}case"dl_open":{const[o,i]=DD(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=BD(e,t,n);return[o,i]}case"hr":return[zD(),t+1]}return null}function _v(e,t,n,s){const o=Th(e,t,n);if(o)return o;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(s?.parseContainer)return s.parseContainer(e,t,n);break;case"container_open":if(s?.matchAdmonition){const i=s.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return KD(e,t,n)}return null}function JD(){return{type:"hardbreak",raw:`\\
|
|
162
|
+
`}}function e9(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:hn(s.children||[],o,void 0,n),raw:o}}const a_=new WeakMap;function ya(){return typeof performance<"u"?performance.now():Date.now()}function wv(e,t,n){e&&(e[t]=(e[t]??0)+n)}function Hx(e){return e.__timing}function Mm(e,t,n){return t&&wv(t,"parseMarkdownToStructureTotalMs",ya()-n),e}function c_(e,t,n){if(!n)return g_(e,t);const s=ya(),o=g_(e,t);return wv(n,"processTokensMs",ya()-s),o}function t9(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=Sa(t);return n.length?new Set(n):null}function n9(e,t){const n=e;let s=a_.get(n);s||(s=new Map,a_.set(n,s));const o=t.__markstreamFinal===!0?"final":"streaming";let i=s.get(o);i||(i={},s.set(o,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function s9(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function pd(e,t,n){for(const s of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,s);if(!o||!("value"in o))continue;const i=Object.getOwnPropertyDescriptor(t,s);i&&(!("value"in i)||i.writable===!1)||(t[s]=Zr(o.value,n))}}function Zr(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,s=t.get(n);if(s)return s;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(Zr(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Zr(l,t),Zr(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Zr(l,t));return r}if(e instanceof Date){const r=new Date(e.getTime());return t.set(n,r),r}if(e instanceof RegExp){const r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,t.set(n,r),r}if(typeof URL<"u"&&e instanceof URL){const r=new URL(e.href);return t.set(n,r),pd(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),pd(n,r,t),r}if(e instanceof Error){let r;const l=e.constructor;try{r=new l(e.message)}catch{r=new Error(e.message)}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),t.set(n,r),pd(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!s9(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),pd(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=Zr(i[r],t);return o}function Wx(e,t=!0){if(!t)return rl(e);const n=Object.create(Object.getPrototypeOf(e)),s=new WeakMap;for(const o of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,o);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,o,i);continue}const r=i.value;let l=r;o==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):o==="map"&&Array.isArray(r)?l=[...r]:o==="children"&&Array.isArray(r)?l=r.map(a=>Wx(a,t)):t&&r&&typeof r=="object"&&(l=Zr(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function u_(e,t=!0){return e.map(n=>Wx(n,t))}function Ux(e,t){const n=t,s=e.stream,o=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(o===!0||o==="auto"&&t.final!==!0)&&s?.enabled===!0&&typeof s.parse=="function"}function o9(e,t){const n=t,s=t.streamParse??"auto",o=e.stream;return t.final===!0&&s==="auto"&&n.__disableStreamParse!==!0&&o?.enabled===!0&&typeof o.reset=="function"}function i9(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function d_(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!Ux(e,s))return e.parse(t,n);const o=e.stream.parse(t,n9(e,n));if(!i9(s))return o;const i=Hx(s);if(!i)return u_(o,!0);const r=ya(),l=u_(o,!0);return wv(i,"tokenCloneMs",ya()-r),l}function Mh(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Zc;const n=new Set(Zc);for(const s of Sa(t))s&&n.add(s);return n}function r9(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:e.type==="hardbreak"?"<br>":""}function f_(e){return{type:"paragraph",children:e,raw:e.map(r9).join("")}}function h_(e,t){if(e.type!=="paragraph")return null;const n=e.children,s=Array.isArray(n)?n:[];if(s.length===0)return null;const o=t9(t);if(!o?.size)return null;let i=-1;for(let u=0;u<s.length;u++){const d=s[u];if(!o.has(String(d?.type??"").toLowerCase()))continue;const p=s.slice(0,u);if(String(d.content??"").trim()&&p.some(m=>m?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=s.slice(0,i),l=s[i];if(!l)return null;const a=[];r.length&&a.push(f_(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(f_(c)),a}function l9(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),s=/<\/html>\s*$/i.test(t);return!n||!s?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function Tc(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function a9(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Qs(t)}\s*>\s*$`,"i").test(n)}function Sv(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${Qs(s)}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=fn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(hl.has(s)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const p=f=>{const v=e.slice(f);return new RegExp(String.raw`^<\s*${Qs(s)}(?=\s|>|/)`,"i").test(v)},m=f=>{const v=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${Qs(s)}(?=\s|>)`,"i").test(v)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(m(f)){const v=fn(e.slice(f));if(v===-1)return null;u--;const w=f+v+1;if(u===0)return{raw:e.slice(r,w),start:r,end:w,closed:!0};d=w;continue}if(p(f)){const v=fn(e.slice(f));if(v===-1)return null;const w=e.slice(f,f+v+1);/\/\s*>$/.test(w)||u++,d=f+v+1;continue}d=f+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function c9(e,t){if(!t)return 0;let n=0,s=0;for(;n<e.length&&s<t.length;){if(e[n]===t[s]){n++,s++;continue}if(e[n]==="\r"||e[n]===`
|
|
163
|
+
`){n++;continue}return-1}return s===t.length?n:-1}function u9(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
164
|
+
</${t}>`}function p_(e){return e.replace(/\r\n/g,`
|
|
165
|
+
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function d9(e,t,n){return n?e.includes(n,t)?!0:p_(e.slice(Math.max(0,t))).includes(p_(n)):!1}function f9(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
166
|
+
`&&n++,n):e[n]===`
|
|
167
|
+
`?n+1:t}function m_(e){if(e.type!=="html_block"||String(e.tag??"").toLowerCase()!=="details")return!1;const t=String(e.raw??e.content??"");return/^\s*<details\b/i.test(t)}function h9(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function Cv(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Qs(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function qx(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const p9=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),m9=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function g9(e){return/\n\s*\n/.test(e)||m9.test(e)}function v9(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>p9.has(String(s?.type??"").toLowerCase()))||t.some(s=>{if(s?.type!=="html_block")return!1;const o=s;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!g9(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function y9(e,t,n,s){return e.map(o=>{if(o?.type!=="html_block")return o;const i=o,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||ux.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=fn(l);if(a===-1)return o;const c=Cv(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=Mc(u,t,qx(n,s));return v9(u,d)?{...o,children:d}:o})}function Mc(e,t,n){return e.trim()?zx(e,t,{...n,__disableStreamParse:!0}):[]}function k9(e,t,n){const s=Mc(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function b9(e,t,n){const s=Dx({content:e}),o=fn(e),i=Cv(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=k9(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function _9(e,t,n){const s=fn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=Sv(o,"summary",0);if(!i)return Mc(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...Mc(r,t,n),b9(i.raw,t,n),...Mc(l,t,n)]}function jx(e,t,n,s,o,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=Tc(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!m_(c)){r.push(c);continue}const p=String(c.raw??Tc(c)??""),m=d!==-1?d:t.indexOf(p,Math.max(0,l-p.length));if(m===-1){r.push(c);continue}let f=1,v=-1;for(let oe=a+1;oe<e.length;oe++){const le=e[oe];if(m_(le)){f++;continue}if(h9(le)&&(f--,f===0)){v=oe;break}}const w=Sv(t,"details",m),b=v===-1&&w?.closed===!0,_=b?(()=>{const oe=Cv(p,"details");return oe!==-1?p.slice(0,oe):p})():p,[g]=jx(b?[]:v===-1?e.slice(a+1):e.slice(a+1,v),t,n,s,o,m+p.length),y=_9(_,n,qx(s,o)),k=v===-1?"</details>":String(e[v].raw??Tc(e[v])??"</details>"),I=b||v!==-1&&w?.closed===!0,E=k.replace(/[\t\r\n ]+$/,""),S=I?(()=>{const oe=(w?.raw??"").lastIndexOf(E);return oe===-1?t.length:m+oe})():t.length,T=fn(p),$=b&&T!==-1?m+T+1:m+p.length,L=t.slice($,S===-1?t.length:S),R=n.parse(L,{__markstreamFinal:o}),O=n.renderer.render(R,n.options,{__markstreamFinal:o}),B=S+E.length,F=I?Math.max(S+k.length,f9(t,B)):t.length,q=I?t.slice(S,F):k,G=I?t.slice(m,F):t.slice(m),K=b&&T!==-1?p.slice(0,T+1):p;if(r.push({...c,tag:"details",attrs:xh(p.slice(0,T+1)),raw:G,content:`${K}${O}${q}`,children:[...y,...g],loading:!o&&!I}),l=I?F:t.length,v===-1&&!b)break;v!==-1&&(a=v)}return[r,l]}function w9(e,t,n){if(!n)return e;const s=e.slice();let o=0;for(let i=0;i<s.length;i++){const r=s[i],l=Tc(r),a=l?n.indexOf(l,o):-1;if(r?.type!=="html_block"){a!==-1&&(o=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(o=a+l.length);continue}const u=Sv(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),p=String(r.raw??d),m=u9(u.raw,c,u.closed),f=!t&&!u.closed,v=d!==m||p!==u.raw||!!r.loading!==f,w=fn(u.raw),b=w===-1?"":u.raw.slice(0,w+1),_=b?xh(b):[];if(r.content=m,r.raw=u.raw,r.loading=f,r.attrs=_.length?_:void 0,!v)continue;let g=c9(u.raw,p);g===-1&&(g=0);const y=i+1;for(;y<s.length;){if(u.closed&&a9(s[y],c)){s.splice(y,1);continue}const k=Tc(s[y]);if(!k)break;const I=u.raw.indexOf(k,g);if(I===-1){if(d9(n,u.end,k))break;s.splice(y,1);continue}g=I+k.length,s.splice(y,1)}}return s}function S9(e){const t=l=>l===" "||l===" "||l===`
|
|
168
|
+
`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=v=>{const w=v.charCodeAt(0);return w>=65&&w<=90||w>=97&&w<=122},u=v=>{const w=v.charCodeAt(0);return w>=48&&w<=57},d=v=>v==="!"||c(v),p=v=>c(v)||u(v)||v===":"||v==="-",m=v=>c(v)||u(v)||v==="_"||v==="."||v===":"||v==="-",f=m;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&p(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!m(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const v=l[a];if(v==='"'||v==="'"){for(a++;a<l.length&&l[a]!==v;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const w=l[a];if(t(w)||w==="<"||w===">"||w==='"'||w==="'"||w==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const p=_=>_===" "||_===" ",m=_=>{let g=0;for(;g<_.length&&p(_[g]);)g++;const y=_[g];if(y!=="`"&&y!=="~")return null;let k=g;for(;k<_.length&&_[k]===y;)k++;const I=k-g;return I<3?null:{markerChar:y,markerLen:I,rest:_.slice(k)}},f=_=>{let g=0;for(;g<_.length&&p(_[g]);)g++;let y=!1;for(;g<_.length&&_[g]===">";)for(y=!0,g++;g<_.length&&p(_[g]);)g++;return y?_.slice(g):null},v=_=>{const g=m(_);if(g)return g;const y=f(_);return y==null?null:m(y)};let w=0;const b=l.split(/\r?\n/);for(const _ of b){const g=w,y=w+_.length;if(a<g)break;const k=v(_);if(k){const I=k.markerChar,E=k.markerLen;c?I===u&&E>=d&&/^\s*$/.test(k.rest)&&(c=!1,u="",d=0):(c=!0,u=I,d=E)}if(a<=y)break;w=y+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
|
|
169
|
+
`||l==="\r",c=o[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return o}const r=o.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
170
|
+
`||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function C9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const s=f=>f===" "||f===" ",o=f=>{const v=f.charCodeAt(0);return v>=65&&v<=90||v>=97&&v<=122||v>=48&&v<=57||f==="_"||f==="-"||f===":"},i=f=>{if(!f)return!1;if(f[0]===" ")return!0;let v=0;for(let w=0;w<f.length;w++){const b=f[w];if(b===" "){if(v++,v>=4)return!0;continue}if(b===" ")return!0;break}return!1},r=f=>{let v=!1,w=!1;for(let b=0;b<f.length;b++){const _=f[b];if(_==="\\"){b++;continue}if(!w&&_==="'"){v=!v;continue}if(!v&&_==='"'){w=!w;continue}if(!v&&!w&&_===">")return b}return-1},l=f=>{let v=0;for(;v<f.length&&s(f[v]);)v++;const w=f[v];if(w!=="`"&&w!=="~")return null;let b=v;for(;b<f.length&&f[b]===w;)b++;const _=b-v;return _<3?null:{markerChar:w,markerLen:_,rest:f.slice(b)}},a=(f,v)=>{if(i(f))return-1;const w=f.replace(/^[ \t]+/,"");if(!w||w.startsWith(">")||w.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(w))return-1;let b=!1,_=0;for(;_<f.length;){const g=f[_];if(g!=="<"){s(g)||(b=!0),_++;continue}const y=r(f.slice(_));if(y===-1){b=!0,_++;continue}const k=f.slice(_,_+y+1);let I=1;for(;I<k.length&&s(k[I]);)I++;if(I>=k.length){b=!0,_++;continue}const E=k[I];if(E==="!"||E==="?"){b=!0,_+=y+1;continue}if(E==="/"){b=!0,_+=y+1;continue}const S=I;for(;I<k.length&&o(k[I]);)I++;if(I===S){b=!0,_++;continue}const T=k.slice(S,I).toLowerCase(),$=k[I];if($&&$!==" "&&$!==" "&&$!==">"&&$!=="/"){b=!0,_++;continue}const L=new RegExp(String.raw`<\s*\/\s*${T}\s*>`,"i"),R=/\/\s*>$/.test(k),O=L.test(f.slice(_+y+1)),B=L.test(e.slice(v+_+y+1)),F=/[\r\n]/.test(e.slice(v+_+y+1));if(b&&n.has(T)&&!R&&!O&&(B||F))return _;b=!0,_+=y+1}return-1};let c=!1,u="",d=0,p="",m=0;for(;m<e.length;){const f=e.indexOf(`
|
|
171
|
+
`,m),v=f!==-1,w=v&&f>m&&e[f-1]==="\r",b=v?w?f-1:f:e.length,_=e.slice(m,b),g=v?w?`\r
|
|
172
|
+
`:`
|
|
173
|
+
`:"",y=l(_);let k=_;if(!c&&!y){const I=a(_,m);if(I!==-1){const E=g||`
|
|
174
|
+
`;k=`${_.slice(0,I).replace(/[ \t]+$/,"")}${E}${E}${_.slice(I).replace(/^[ \t]+/,"")}`}}p+=k,p+=g,y&&(c?y.markerChar===u&&y.markerLen>=d&&/^\s*$/.test(y.rest)&&(c=!1,u="",d=0):(c=!0,u=y.markerChar,d=y.markerLen)),m=v?f+1:e.length}return p}function x9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const s=d=>d===" "||d===" ",o=d=>{const p=d.charCodeAt(0);return p>=65&&p<=90||p>=97&&p<=122||p>=48&&p<=57||d==="_"||d==="-"},i=d=>{let p=0;for(;p<d.length&&s(d[p]);)p++;return d.slice(p)},r=d=>{let p=!1,m=!1;for(let f=0;f<d.length;f++){const v=d[f];if(v==="\\"){f++;continue}if(!m&&v==="'"){p=!p;continue}if(!p&&v==='"'){m=!m;continue}if(!p&&!m&&v===">")return f}return-1},l=(d,p,m)=>{const f=m.toLowerCase();let v=d.indexOf("<",p);for(;v!==-1;){let w=v+1;for(;w<d.length&&s(d[w]);)w++;if(w>=d.length||d[w]!=="/"){v=d.indexOf("<",v+1);continue}for(w++;w<d.length&&s(d[w]);)w++;if(w+f.length>d.length){v=d.indexOf("<",v+1);continue}let b=!0;for(let g=0;g<f.length;g++){const y=d[w+g];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==f[g]){b=!1;break}}if(!b){v=d.indexOf("<",v+1);continue}let _=w+f.length;if(_<d.length&&o(d[_])){v=d.indexOf("<",v+1);continue}for(;_<d.length&&s(d[_]);)_++;if(_<d.length&&d[_]===">")return!0;v=d.indexOf("<",v+1)}return!1},a=d=>{let p=0;for(;p<d.length&&s(d[p]);)p++;if(p>=d.length||d[p]!=="<")return d;for(p++;p<d.length&&s(d[p]);)p++;if(p>=d.length||d[p]==="/")return d;const m=p;for(;p<d.length&&o(d[p]);)p++;if(p===m)return d;const f=d.slice(m,p).toLowerCase();if(!n.has(f))return d;const v=r(d.slice(p));if(v===-1)return d;const w=p+v;if(l(d,w+1,f))return d;const b=i(d.slice(w+1));return b?`${d.slice(0,w+1)}
|
|
175
|
+
${b}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
176
|
+
`,u);if(d===-1){c+=a(e.slice(u));break}const p=d>u&&e[d-1]==="\r",m=p?d-1:d,f=e.slice(u,m);c+=a(f),c+=p?`\r
|
|
177
|
+
`:`
|
|
178
|
+
`,u=d+1}return c}function T9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()));if(!n.size)return e;const s=p=>p===" "||p===" ",o=p=>{let m=0,f=!1,v=0;for(;m<p.length;){for(;m<p.length&&s(p[m]);)m++;if(m>=p.length||p[m]!==">")break;for(f=!0,m++;m<p.length&&s(p[m]);)m++;v=m}return f?{prefix:p.slice(0,v),content:p.slice(v)}:null},i=p=>{let m=0;for(;m<p.length&&s(p[m]);)m++;const f=p[m];if(f!=="`"&&f!=="~")return null;let v=m;for(;v<p.length&&p[v]===f;)v++;const w=v-m;return w<3?null:{markerChar:f,markerLen:w,rest:p.slice(v)}},r=Array.from(n).map(p=>new RegExp(String.raw`(<\s*\/\s*${p}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const p=e.indexOf(`
|
|
179
|
+
`,d),m=p!==-1,f=m&&p>d&&e[p-1]==="\r",v=m?f?p-1:p:e.length,w=e.slice(d,v),b=m?f?`\r
|
|
180
|
+
`:`
|
|
181
|
+
`:"",_=o(w),g=_?.prefix??"",y=_?.content??w,k=i(y);k&&(l?k.markerChar===a&&k.markerLen>=c&&/^\s*$/.test(k.rest)&&(l=!1,a="",c=0):(l=!0,a=k.markerChar,c=k.markerLen));let I=y;if(!l&&I.includes("</"))for(const E of r)I=I.replace(E,(S,T,$,L)=>{if(L.replace(/^[\t ]+/,"").startsWith("|"))return S;const R=L.slice(0,$).replace(/^[\t ]+/,"");if(R.length>0){const O=T.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",B=R.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!O||!B||O!==B)return S}return`${T}
|
|
182
|
+
|
|
183
|
+
`});if(g){const E=g+I.split(`
|
|
184
|
+
`).join(`
|
|
185
|
+
${g}`);u+=E}else u+=I;u+=b,d=m?p+1:e.length}return u}function M9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(R=>String(R??"").toLowerCase()));if(!n.size)return e;const s=R=>R===" "||R===" ",o=R=>{if(!R)return!1;if(R[0]===" ")return!0;let O=0;for(let B=0;B<R.length;B++){const F=R[B];if(F===" "){if(O++,O>=4)return!0;continue}if(F===" ")return!0;break}return!1},i=R=>{const O=R.charCodeAt(0);return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57||R==="_"||R==="-"||R===":"},r=R=>{let O=0;for(;O<R.length&&s(R[O]);)O++;return R.slice(O)},l=R=>{let O=0,B=!1,F=0;for(;O<R.length;){for(;O<R.length&&s(R[O]);)O++;if(O>=R.length||R[O]!==">")break;for(B=!0,O++;O<R.length&&s(R[O]);)O++;F=O}if(!B)return null;const q=R.slice(0,F);return{prefix:q,key:q.replace(/[ \t]+$/,""),content:R.slice(F)}},a=R=>r(R).startsWith("<"),c=R=>{for(let O=0;O<R.length;O++){const B=R[O];if(B!==" "&&B!==" ")return!1}return!0},u=R=>{if(o(R))return"";const O=r(R);if(!O.startsWith("<"))return"";let B=1;for(;B<O.length&&s(O[B]);)B++;if(B>=O.length||O[B]==="/"||O[B]==="!"||O[B]==="?")return"";const F=B;for(;B<O.length&&i(O[B]);)B++;if(B===F)return"";const q=O.slice(F,B).toLowerCase();if(!n.has(q))return"";const G=O[B];return G&&G!==" "&&G!==" "&&G!==">"&&G!=="/"?"":q},d=R=>{if(o(R))return null;const O=r(R);if(!O.startsWith("<"))return null;let B=1;for(;B<O.length&&s(O[B]);)B++;if(B>=O.length)return null;const F=O[B]==="/";if(F)for(B++;B<O.length&&s(O[B]);)B++;const q=O[B];if(!q||q==="!"||q==="?")return null;const G=B;for(;B<O.length&&i(O[B]);)B++;if(B===G)return null;const K=O.slice(G,B).toLowerCase();if(!n.has(K))return null;const oe=O[B];if(oe&&oe!==" "&&oe!==" "&&oe!==">"&&oe!=="/")return null;if(F)return{type:"close",name:K};if(/\/\s*>\s*$/.test(O))return{type:"open",name:K,complete:!0};const le=O.indexOf(">",B);if(le!==-1){const pe=O.slice(le+1);if(new RegExp(`<\\s*\\/\\s*${K}\\s*>`,"i").test(pe))return{type:"open",name:K,complete:!0}}return{type:"open",name:K,complete:!1}},p=R=>{if(o(R))return null;const O=r(R).replace(/[ \t]+$/,"");if(!O.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(O))return null;const B=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(B?.[1])return B[1].toLowerCase();const F=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!F?.[1]||!F[2])return null;const q=F[1].toLowerCase();return q===F[2].toLowerCase()?q:null};let m=!1,f="",v=0;const w=R=>{let O=0;for(;O<R.length&&s(R[O]);)O++;const B=R[O];if(B!=="`"&&B!=="~")return null;let F=O;for(;F<R.length&&R[F]===B;)F++;const q=F-O;return q<3?null:{markerChar:B,markerLen:q,rest:R.slice(F)}},b=R=>w(R),_=R=>{const O=r(R);return O?o(R)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(O):!1},g=(R,O,B)=>{let F=R,q=0;for(;F<e.length;){const G=e.indexOf(`
|
|
186
|
+
`,F),K=G!==-1,oe=K&&G>F&&e[G-1]==="\r",le=K?oe?G-1:G:e.length,pe=e.slice(F,le),be=l(pe),Be=be?.key??"";if(q>0&&O&&Be!==O)break;const He=be?.content??pe,Ne=d(He);if(Ne?.name===B){if(Ne.type==="open")Ne.complete||q++;else if(q>0&&(q--,q===0))return!1}else if(q>0&&(c(He)||_(He)))return!0;if(K)F=G+1;else break}return!1};let y="",k=0,I=!0,E=!1,S=!1,T=`
|
|
187
|
+
`;const $=[];let L="";for(;k<e.length;){const R=e.indexOf(`
|
|
188
|
+
`,k),O=R!==-1,B=O&&R>k&&e[R-1]==="\r",F=O?B?R-1:R:e.length,q=e.slice(k,F),G=O?B?`\r
|
|
189
|
+
`:`
|
|
190
|
+
`:"",K=l(q),oe=K?.key??"",le=K?.content??q,pe=b(le);pe&&(m?pe.markerChar===f&&pe.markerLen>=v&&/^\s*$/.test(pe.rest)&&(m=!1,f="",v=0):(m=!0,f=pe.markerChar,v=pe.markerLen));const be=$.length>0;if(!m&&!be){const He=u(le),Ne=!!He&&!I&&E&&S&&g(k,oe,He);He&&!I&&(!E||Ne)&&(oe&&L&&oe===L?y+=`${oe}${T}`:oe||(y+=T))}if(y+=q,y+=G,G&&(T=G),!m){const He=d(le);if(He){if(He.type==="open")He.complete||$.push(He.name);else for(let Ne=$.length-1;Ne>=0;Ne--)if($[Ne]===He.name){$.length=Ne;break}}}const Be=c(le);I=Be,E=!Be&&a(le),S=!Be&&!!p(le),L=oe,k=O?R+1:e.length}return y}function zx(e,t,n={}){const s=Hx(n),o=s?ya():0,i=!!n.final;let r=(e??"").toString().replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\n(abla|eq|ot|exists)/g,"$1\\n$2");if(o9(t,n)&&t.stream.reset(),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,w=>w.startsWith(`
|
|
191
|
+
`)?`
|
|
192
|
+
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,w=>w.startsWith(`
|
|
193
|
+
`)?`
|
|
194
|
+
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,w=>w.startsWith(`
|
|
195
|
+
`)?`
|
|
196
|
+
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
197
|
+
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,w=>w.startsWith(`
|
|
198
|
+
`)?`
|
|
199
|
+
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(w,b,_)=>`${b}${_.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,w=>w.startsWith(`
|
|
200
|
+
`)?`
|
|
201
|
+
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
202
|
+
`))),n.customHtmlTags?.length&&r.includes("<")){const w=Sa(n.customHtmlTags);if(w.length&&(r=C9(r,w),r=x9(r,w),r=M9(r,w),r=T9(r,w),r.includes("</")))for(const b of w){const _=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${b}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(_,"$1$2$2")}}i||(r=S9(r));const l=l9(r);if(l){const w=n.preTransformTokens,b=n.postTransformTokens;if(Ux(t,n)||typeof w=="function"||typeof b=="function"){const _=d_(t,r,{__markstreamFinal:i},n),g=typeof w=="function"&&w(_)||_;typeof b=="function"&&b(g)}return Mm(l,s,o)}const a=d_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return Mm([],s,o);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const p=t,m=n.validateLink??p.options?.validateLink??(typeof p.validateLink=="function"?p.validateLink:void 0),f={...n,validateLink:m,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let v=c_(d,f,s);if(u&&typeof u=="function"){const w=u(d);if(Array.isArray(w)){const b=w[0],_=b?.type;b&&typeof _=="string"?v=c_(w,void 0,s):v=w}}if(v=w9(v,i,r),v=jx(v,r,t,n,i)[0],v=y9(v,t,n,i),i){const w=new WeakSet,b=_=>{if(!_||typeof _!="object"||w.has(_))return;if(w.add(_),Array.isArray(_)){for(const y of _)b(y);return}const g=_;g.type==="html_block"&&g.loading===!0&&(g.loading=!1);for(const y of Object.values(g))b(y)};b(v)}return n.debug&&console.log("Parsed Markdown Tree Structure:",v),Mm(v,s,o)}function g_(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=xr(t);let o=0;for(;o<e.length;){const i=_v(e,o,s.options(),bv);if(i){n.push(i[0]),s.remember(i[0].raw),o=i[1];continue}const r=e[o];switch(r.type){case"paragraph_open":{const l=String(e[o+1]?.content??""),a=e9(e,o,s.options(l)),c=h_(a,t);c?n.push(...c):n.push(a),s.remember(a.raw),o+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=Ca(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=xa(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),s.remember(String(r.content??"")),o++;break}case"hardbreak":n.push(JD()),s.reset(),o++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),s.remember(l),o++;break}case"inline":{const l=String(r.content??""),a=hn(r.children||[],l,void 0,s.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=h_(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const A9=new Set([...pu,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),E9=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","s","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]),v_=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function y_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $9(e){return typeof e=="string"?e:e==null?"":String(e)}function Vx(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function or(e){return $9(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Kx(e){return or(e).replace(/`/g,"`")}function Ah(e){return String(e??"").trim().toLowerCase()}function xv(e,t="safe"){const n=Ah(e);return n?t==="escape"?!0:t==="trusted"?pu.has(n):!E9.has(n):!1}function Gx(e,t="safe"){const n=Ah(e);return n?t==="escape"?!0:t==="trusted"?pu.has(n):A9.has(n):!1}function k_(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${Kx(s)}"`).join("")}function I9(e,t){const n=e.split(",").map(s=>s.trim()).filter(Boolean);return n.length===0?!1:n.some(s=>{const o=s.split(/\s+/,1)[0]??"";return!o||ca(o,{tagName:t,attrName:"srcset"})})}function Yx(e,t,n,s){return RR.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?I9(t,s):!!(PR.has(e)&&t&&ca(t,{tagName:s,attrName:e}))}function Qr(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function Xx(e,t,n,s=!1){if(t!=="safe"||Ah(n)!=="a")return e;const o=Qr(e,"href");if(s&&(!o||!e[o])){const a=Qr(e,"target"),c=Qr(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Qr(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Qr(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function b_(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!Vx(r)||Yx(l,i,t,n)||(s[r]=i)}return Xx(s,t,n,!!Qr(e,"href"))}function Zx(e,t){const n=e.toLowerCase();return cx.has(n)?!1:y_(t,n)||y_(t,e)}function Tv(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!Vx(r)||Yx(l,i,t,n)||(s[r]=i)}return Xx(s,t,n,!!Qr(e,"href"))}function Nf(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,s]of e)n&&(t[String(n)]=s==null?"":String(s));return t}function Vg(e,t="safe",n){const s=Tv(Nf(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function N9(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const s=Number(e);if(e!==""&&!Number.isNaN(s))return s}return e}function L9(e){const t={};for(const[n,s]of Object.entries(e))t[n]=N9(s,n);return t}function __(e){return e.trim().length>0}function O9(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const s=e.indexOf("<",n);if(s===-1){if(n<e.length){const a=e.slice(n);__(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);__(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",s+1)){const a=e.indexOf("]]>",s);if(a!==-1){t.push({type:"text",content:e.slice(s,a+3)}),n=a+3;continue}break}if(e.startsWith("!",s+1)){const a=e.indexOf(">",s);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const p=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let m;for(;(m=p.exec(u))!==null;){const f=m[1],v=m[2]??m[3]??m[4]??"";f&&!f.endsWith("/")&&(d[f]=v)}}t.push({type:l||hl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function R9(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const p=e.indexOf("-->",n);if(p!==-1){n=p+3;continue}break}const s=e.indexOf("<",n);if(s===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(s>n&&t.push({type:"text",content:e.slice(n,s)}),e.startsWith("![CDATA[",s+1)){const p=e.indexOf("]]>",s);if(p!==-1){t.push({type:"text",content:e.slice(s,p+3)}),n=p+3;continue}break}if(e.startsWith("!",s+1)){const p=e.indexOf(">",s);if(p!==-1){n=p+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim();if(!i){n=o+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const p=i.slice(1).trim();t.push({type:"tag_close",tagName:p}),n=o+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const p=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let m;for(;(m=p.exec(u))!==null;){const f=m[1],v=m[2]??m[3]??m[4]??"";f&&!f.endsWith("/")&&(d[f]=v)}}t.push({type:l||hl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function P9(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${or(t)}>`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${or(s)}`:` ${or(s)}="${Kx(o)}"`).join("");return e.type==="self_closing"?`<${or(t)}${n} />`:`<${or(t)}${n}>`}function D9(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;v_.lastIndex=0;let n;for(;(n=v_.exec(e))!==null;)if(Zx(n[1],t))return!0;return!1}function ua(e,t="safe"){if(!e)return"";if(t==="escape")return or(e);const n=R9(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(or(r.content??""));continue}const l=Ah(r.tagName);if(!l)continue;if(Gx(l,t)){r.type==="tag_open"?i.push(l):r.type==="tag_close"&&i[i.length-1]===l&&i.pop();continue}if(i.length>0)continue;if(t==="safe"&&xv(l,t)){o.push(P9(r));continue}if(r.type==="self_closing"){o.push(`<${l}${k_(b_(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${k_(b_(r.attrs??{},t,l))}>`),hl.has(l)||s.push(l);continue}const a=s.lastIndexOf(l);if(a===-1)continue;for(;s.length>a+1;){const u=s.pop();u&&o.push(`</${u}>`)}const c=s.pop();c&&o.push(`</${c}>`)}for(;s.length>0;){const r=s.pop();r&&o.push(`</${r}>`)}return o.join("")}const B9=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],w_="http://www.w3.org/2000/svg",F9=new Set(["script","style","iframe","object","embed","link","meta"]),H9=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),W9=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),U9=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),q9=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function j9(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function z9(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function V9(e){const t=e.nodeName.toLowerCase();return t==="use"?j9(e):t==="image"?z9(e):t==="text"||t==="tspan"?!!e.textContent?.trim():q9.has(t)}function K9(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function G9(e,t,n){const s=e.toLowerCase(),o=t.toLowerCase(),i=String(n??"").trim();return i?(s==="use"||s==="marker"||s==="clippath"||s==="mask")&&(o==="href"||o==="xlink:href")?i.startsWith("#")?i:"":s==="a"&&(o==="href"||o==="xlink:href")?ca(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ca(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":ca(i,{tagName:s,attrName:o})?"":i:""}function Y9(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const s=e[n];if(s==='"'||s==="'"){const i=n+1,r=e.indexOf(s,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const o=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(o,n)}}function Qx(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const s=n.trim();if(/^[0-9a-f]+$/i.test(s)){const o=Number.parseInt(s,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function Jx(e){const t=Qx(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=Y9(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function S_(e){const t=Qx(e);return B9.some(n=>n.test(t))||Jx(t)}function X9(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function md(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function eT(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,s=n.tagName.toLowerCase();if(!F9.has(s)){if(s==="br"){t.push(`
|
|
203
|
+
`);return}for(const o of Array.from(n.childNodes))eT(o,t)}}function Z9(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];eT(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=md(t.getAttribute("width")),i=md(t.getAttribute("height")),r=md(t.getAttribute("x")),l=md(t.getAttribute("y")),a=e.ownerDocument.createElementNS(w_,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),s.length===1)a.textContent=s[0];else{const u=-.6*(s.length-1);for(const[d,p]of s.entries()){const m=e.ownerDocument.createElementNS(w_,"tspan");m.setAttribute("x",String(r+o/2)),m.setAttribute("dy",d===0?`${u}em`:"1.2em"),m.textContent=p,a.appendChild(m)}}t.parentNode?.replaceChild(a,t)}}function Q9(e){Z9(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!H9.has(s)){n.remove();continue}if(s==="style"&&S_(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const i of o){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&S_(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(W9.has(r)&&i.value){const l=G9(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(U9.has(r)&&i.value&&Jx(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=K9(i.value);l!==i.value&&n.setAttribute(i.name,l)}}X9(n)}}function yfe(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return Q9(n),J9(n)?null:n}catch{return null}}function J9(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const i=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let s=!1;for(const o of n){V9(o)&&(s=!0);for(const i of Array.from(o.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!s}const C_=[];function Am(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function eB(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function tB(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function x_(e=`editor-${Date.now()}`,t={}){const n=E7(t),s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const p=t.i18n;o=m=>p[m]??s[m]??m}else o=p=>s[p]??p;if(Array.isArray(t.plugin))for(const p of t.plugin){const m=p;if(Array.isArray(m)){const[f,...v]=m;typeof f=="function"&&n.use(f,...v)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const p of t.apply)try{p(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(C_.length)for(const p of C_)if(Array.isArray(p)){const[m,...f]=p;typeof m=="function"&&n.use(m,...f)}else typeof p=="function"&&n.use(p);n.use(CN),n.use(MN),n.use(_N);const i=WN,r=i.default??i;n.use(r),n.use(bN),n.use(kN),n.core.ruler.after("block","mark_fence_closed",p=>{const m=p,f=m.src,v=!!m.env?.__markstreamFinal,w=f.split(/\r?\n/);for(const b of m.tokens){if(b.type!=="fence"||!b.map||!b.markup)continue;const _=b.map[0],g=b.map[1],y=b.markup,k=y[0],I=y.length,E=w[Math.max(0,g-1)]??"";let S=0;for(;S<E.length&&(E[S]===" "||E[S]===" ");)S++;let T=0;for(;S+T<E.length&&E[S+T]===k;)T++;let $=S+T;for(;$<E.length&&(E[$]===" "||E[$]===" ");)$++;const L=v?!0:g>_+1&&T>=I&&$===E.length,R=b;R.meta=R.meta??{},R.meta.unclosed=!L,R.meta.closed=!!L}});const l=(p,m)=>{const f=p,v=f.pos;if(f.src[v]!=="~")return!1;const w=f.src[v-1],b=f.src[v+1];if(/\d/.test(w)&&/\d/.test(b)){if(!m){const _=f.push("text","",0);_.content="~"}return f.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(p,m)=>{const f=p[m],v=String(f.info??"").trim(),w=String(f.content??""),b=btoa(unescape(encodeURIComponent(w))),_=eB(v),g=Am(_),y=tB(`editor-${e}-${m}-${_}`),k=Am(o("common.copy"));return`<div class="code-block" data-code="${b}" data-lang="${g}" id="${y}">
|
|
204
|
+
<div class="code-header">
|
|
205
|
+
<span class="code-lang">${Am(_.toUpperCase())}</span>
|
|
206
|
+
<button class="copy-button" data-code="${b}">${k}</button>
|
|
207
|
+
</div>
|
|
208
|
+
<div class="code-editor"></div>
|
|
209
|
+
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=p=>{if(!p.startsWith("["))return!1;const m=c.exec(p);if(!m)return p!=="["&&!/^\[\d+$/.test(p);const f=String(m[1]??"");return p.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(f)},d=(p,m)=>{const f=p;if(f.src[f.pos]!=="[")return!1;const v=a.exec(f.src.slice(f.pos));if(!v)return!1;const w=f.src.slice(Math.max(0,f.pos-120),f.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(w))return!1;const b=f.src.slice(f.pos+v[0].length);if(b.startsWith("](")||b.startsWith("(")||u(b))return!1;if(!m){const _=v[1],g=f.push("reference","span",0);g.content=_,g.markup=v[0],g.raw=v[0]}return f.pos+=v[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(p,m)=>{const v=String(p[m].content??"");return`<span class="reference-link" data-reference-id="${v}" role="button" tabindex="0" title="Click to view reference">${v}</span>`},n}const nB="modulepreload",sB=function(e){return"/"+e},T_={},Xs=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(c=>{if(c=sB(c),c in T_)return;T_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":nB,u||(p.as="script"),p.crossOrigin="",p.href=c,a&&p.setAttribute("nonce",a),document.head.appendChild(p),u)return new Promise((m,f)=>{p.addEventListener("load",m),p.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function oB({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function tT({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:oB({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}function Pl(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function M_(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var iB=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const p=this.source.length>0,m=this.pendingChars<=0;if(this.source+=d,m){const f=A_();this.startedAt=p&&this.hasStarted?f-this.normalizedStartDelayMs:f,this.lastTick=f,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=A_();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const p=1e3/Math.max(1,this.maxCommitFps),m=Math.min(100,Math.max(0,d-this.lastTick));if(m<p){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const f=this.pendingChars,v=f>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,w=cB(f/Math.max(.001,v/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(w-this.currentCps)*.2,this.charBudget+=this.currentCps*(m/1e3),this.charBudget<1){this.ensureLoop();return}const b=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),_=aB(this.source.slice(this.visible.length),b,this.segmenter);_.text&&(this.visible+=_.text,this.charBudget=Math.max(0,this.charBudget-_.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Pl(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Pl(s,1e3,1)),this.normalizedTargetLatencyMs=Pl(o,900,1),this.normalizedCatchUpLatencyMs=Pl(i,350,1),this.normalizedCatchUpThreshold=M_(r,600),this.normalizedStartDelayMs=M_(a,80),this.maxCommitFps=Math.trunc(Pl(l,30,1)),this.maxCharsPerCommit=Math.trunc(Pl(c,80,1)),this.flushOnFinish=u,this.segmenter=lB(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function rB(e={},t){const n=new iB(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function lB(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function aB(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function A_(){return typeof performance<"u"?performance.now():Date.now()}function cB(e,t,n){return Math.min(n,Math.max(t,e))}var uB=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Kg=Symbol.for("markstream-vue:node-lifecycle"),Gg=new Map;let E_="material";const Gl=new Map,$_=new Map;let Yg=null;function dB(e){Gg.set(e.id,e)}function fB(e){return uB(this,null,function*(){var t,n,s;if(Gl.has(e.id))return(t=Gl.get(e.id))!=null?t:null;let o=$_.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(Gl.set(e.id,i),Yg?.(),i)).catch(()=>(Gl.set(e.id,null),null)),$_.set(e.id,o)),o})}const I_='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',N_='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',hB={id:"material",core:{"":N_,plain:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',text:N_,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',typescript:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',cs:I_,csharp:I_,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',powershell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>',sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>'},fallback:'<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',loadExtended:()=>Xs(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},pB=fl(0);Yg=()=>{pB.value++},dB(hB);const mB={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function nT(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=mB[n])!=null?t:n}function kfe(e){const t=nT(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function bfe(e){return(function(s){const o=Gg.get(E_);if(!o)return;const i=o.core[s];if(i)return i;const r=Gl.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!Gl.has(o.id)&&fB(o)})(nT(e))||((n=(t=Gg.get(E_))==null?void 0:t.fallback)!=null?n:"");var t,n}const _fe={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};let sT=!1;function wfe(){return sT}function Sfe(){sT=!0}var Eh=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let _o=null,Em=!1,Mv=oT;function $h(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Av(){try{const e=globalThis;return $h(e?.katex)}catch{return null}}function oT(){return Eh(null,null,function*(){const e=Av();if(e)return e;const t=yield Xs(()=>import("./katex-HP8lGamR.js"),[]);try{yield Xs(()=>import("./mhchem-KEf2LMH_.js"),__vite__mapDeps([0,1]))}catch{}return $h(t)})}function iT(){return typeof Mv=="function"}function Cfe(){var e;const t=Mv;if(!t||t===oT)return null;if(_o)return _o;const n=Av();if(n)return _o=n,_o;try{const s=t();return s&&typeof s?.then!="function"?(_o=(e=$h(s))!=null?e:s,_o):null}catch{return null}}function Ev(){return Eh(this,null,function*(){var e;const t=Av();if(t)return _o=t,_o;if(_o)return _o;if(Em)return null;const n=Mv;if(!n)return Em=!0,null;try{const s=yield n();if(s)return _o=(e=$h(s))!=null?e:s,_o}catch{}return Em=!0,null})}function rT(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Dl=null;const lT=new Map,fc=new Map;let aT=5;const tl=new Set;function gB(){if(lT.size<aT&&tl.size){const e=Array.from(tl);tl.clear();for(const t of e)try{t()}catch{}}}function vB(e,t=!0,n=2e3,s){return Eh(this,null,function*(){performance.now();const o=rT(e);if(!iT()){const l=new Error("KaTeX rendering disabled");return l.name="KaTeXDisabled",l.code="KATEX_DISABLED",Promise.reject(l)}if(Dl)return Promise.reject(Dl);const i=`${t?"d":"i"}:${o}`,r=fc.get(i);return r?Promise.resolve(r):(Dl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Dl.name="WorkerInitError",Dl.code="WORKER_INIT_ERROR",Promise.reject(Dl))})}function xfe(e,t=!0,n){const s=`${t?"d":"i"}:${rT(e)}`;if(fc.set(s,n),fc.size>200){const o=fc.keys().next().value;fc.delete(o)}}const yB="WORKER_BUSY";function kB(e=2e3,t){return lT.size<aT?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),tl.delete(r),n())};if(tl.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,tl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>gB()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),tl.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const sc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Tfe(e){return Eh(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!iT()){const v=new Error("KaTeX rendering disabled");throw v.name="KaTeXDisabled",v.code="KATEX_DISABLED",v}const a=(o=s.timeout)!=null?o:sc.timeout,c=(i=s.waitTimeout)!=null?i:sc.waitTimeout,u=(r=s.backoffMs)!=null?r:sc.backoffMs,d=(l=s.maxRetries)!=null?l:sc.maxRetries,p=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):sc.maxRetries,m=s.signal;let f=0;for(;;){if(m?.aborted){const v=new Error("Aborted");throw v.name="AbortError",v}try{return yield vB(t,n,a,m)}catch(v){if(v?.code!==yB||f>=p)throw v;if(f++,yield kB(c,m).catch(()=>{}),m?.aborted){const w=new Error("Aborted");throw w.name="AbortError",w}u>0&&(yield new Promise(w=>globalThis.setTimeout(w,u*f)))}}})}var bB=Object.defineProperty,_B=Object.defineProperties,wB=Object.getOwnPropertyDescriptors,L_=Object.getOwnPropertySymbols,SB=Object.prototype.hasOwnProperty,CB=Object.prototype.propertyIsEnumerable,O_=(e,t,n)=>t in e?bB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,et=(e,t)=>{for(var n in t||(t={}))SB.call(t,n)&&O_(e,n,t[n]);if(L_)for(var n of L_(t))CB.call(t,n)&&O_(e,n,t[n]);return e},Ct=(e,t)=>_B(e,wB(t)),dn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const xB="__global__",$m="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Xg=(()=>{const e=globalThis;if(e[$m])return e[$m];const t={scopedCustomComponents:{},revision:fl(0)};return e[$m]=t,t})(),R_=Xg.revision,TB=Symbol("markstreamCustomComponents"),MB=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function gu(e){return MB.has(String(e).trim().toLowerCase())}function AB(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Im(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([Eo(n),Eo(AB(n))]))!o||gu(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function In(e){const t=Nt(TB,null);return j(()=>{var n;return R_.value,(function(s,o={}){return R_.value,et(et(et({},Im(Xg.scopedCustomComponents[xB]||{})),Im(o)),Im((function(i){return i&&Xg.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const EB=["aria-label"],$B={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},IB={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},zt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Js=zt(Xe({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(C(),A("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(C(),A("svg",IB,[...n[1]||(n[1]=[h("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),h("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(C(),A("svg",$B,[...n[0]||(n[0]=[h("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,EB))}),[["__scopeId","data-v-be21ab83"]]);Js.install=e=>{e.component(Js.__name,Js)};const NB={class:"emoji-node"},Os=zt(Xe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(C(),A("span",NB,N(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Os.install=e=>{e.component(Os.__name,Os)};const LB=["id"],OB=["title"],eo=zt(Xe({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(C(),A("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[h("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+N(e.node.id)+"]",9,OB)],8,LB))}}),[["__scopeId","data-v-c1463a29"]]);eo.install=e=>{e.component(eo.__name,eo)};const cT=(()=>{try{return!1}catch{}return!1})();function Nm(e){cT&&console.warn(e)}function P_(e,t="safe",n){return Tv(e,t,n)}function uT(e){return L9(e)}function Lm(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function $v(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=Vg((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),Lm(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Lm(r.value)]):Object.entries(o).map(([r,l])=>[r,Lm(l)]):null,t,n);var o;if(!s)return;const i=uT(Nf(s));return Object.keys(i).length>0?i:void 0}function D_(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function oc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Om(e,t,n,s,o,i,r=!1){const l=(function(d,p){return Zx(d,p)})(e,s);if(pu.has(e.toLowerCase())||!l&&Gx(e,i))return null;if(!l&&xv(e,i))return r?[D_(e,t,!0)]:[D_(e,t),...n,`</${e}>`];const a=Tv(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],p=uT(a);return Ut(d,Ct(et({},p),{key:u}),n.length>0?n:void 0)}return Ut(e,Ct(et({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function dT(e,t){return D9(e,t)}function Lf(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const p=Om(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);oc(c.length>0?c[c.length-1].children:u,p)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const p=d.tagName.toLowerCase();let m=-1;for(let f=c.length-1;f>=0;f--)if(c[f].tagName.toLowerCase()===p){m=f;break}if(m!==-1)for(;c.length>m;){const f=c.pop(),v=Om(f.tagName,f.attrs||{},f.children,r,f.autoKey,l);c.length>0?oc(c[c.length-1].children,v):oc(u,v),f.tagName.toLowerCase()!==p&&c.length>m&&Nm(`Auto-closing unclosed tag: <${f.tagName}>`)}else Nm(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),p=Om(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?oc(c[c.length-1].children,p):oc(u,p),Nm(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(O9(e),t,n)}catch(o){return s=o,cT&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const RB=["innerHTML"],to=zt(Xe({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Nt("markstreamHtmlPolicy",void 0),s=j(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=In(()=>t.customId),i=Xe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=j(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:ua(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Lf(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!dT(l,o.value))return{mode:"html",content:ua(l,s.value)};const a=Lf(l,o.value,s.value);return a===null?{mode:"html",content:ua(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(C(),A("span",{key:0,class:$e(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[pt(M(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(C(),A("span",{key:1,class:$e(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},N(r.value.content),3)):(C(),A("span",{key:2,class:$e(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,RB))}}),[["__scopeId","data-v-d17f12b0"]]);to.install=e=>{e.component(to.__name,to)};const PB={class:"inline-code"},DB={key:0},rs=zt(Xe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=au(),s=Nt("markstreamFade",void 0),o=Nt("markstreamTextStreamState",void 0),i=Nt("markstreamStreamVersion",void 0),r=j(()=>{const _=n.fade;return _===""||_===!0||_==="true"||_!==!1&&_!=="false"&&void 0}),l=j(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=j(()=>{var _;return String((_=t.node.code)!=null?_:"")}),c=j(()=>!l.value),u=j(()=>{var _;const g=(_=n["index-key"])!=null?_:n.indexKey;return g==null||g===""?"":String(g)}),d=te(t.node.code),p=te("");let m=i?.value;const f=te(0);function v(){return d.value+p.value}function w(){p.value&&(d.value=v(),p.value="")}ze([()=>t.node.code,u,l,()=>i?.value],([_,g,y,k])=>{const I=String(_??""),E=u.value,S=k!==m;m=k;const T=tT({nextContent:I,persistedContent:E?o?.get(E):void 0,currentState:{settledContent:d.value,streamedDelta:p.value},typewriterEnabled:l.value,streamRenderVersionChanged:S});d.value=T.settledContent,p.value=T.streamedDelta,T.appended&&(f.value+=1),E&&o?.set(E,I)},{immediate:!0}),ze(l,_=>{var g;_||(g=v(),d.value=g,p.value="")});const b=j(()=>f.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(_,g)=>(C(),A("code",PB,[c.value?(C(),A(Ie,{key:0},[dt(N(a.value),1)],64)):(C(),A(Ie,{key:1},[d.value?(C(),A("span",DB,N(d.value),1)):re("",!0),p.value?(C(),A("span",{key:1,class:$e(["inline-code-stream-delta",[b.value]]),onAnimationend:w},N(p.value),35)):re("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);rs.install=e=>{e.component(rs.__name,rs)};const Zg=te(!1),B_=te(""),F_=te("top"),Ac=te(null),Ec=te(null),Qg=te(null),Jg=te(null),H_=te(null);let Od=null,Rd=null,e1=0;function fT(){Od&&(clearTimeout(Od),Od=null),Rd&&(clearTimeout(Rd),Rd=null)}let gd=!1,vd=null,W_=!1;function BB(e,t,n="top",s=!1,o,i){if(!e)return;const r=++e1;fT();const l=()=>dn(null,null,function*(){var a,c;if(yield(function(){return dn(this,null,function*(){if(!gd&&!W_&&typeof document<"u"){vd!=null||(vd=dn(null,null,function*(){const[{createApp:u,h:d},{default:p}]=yield Promise.all([Xs(()=>import("./vue.runtime.esm-bundler-z5b-tezL.js"),[]),Xs(()=>import("./Tooltip-LgIwf1MF.js"),[])]),m=document.createElement("div");m.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(m),u({setup:()=>()=>{var f;return d(p,{visible:Zg.value,"anchor-el":Ac.value,content:B_.value,placement:F_.value,id:Ec.value,originX:Qg.value,originY:Jg.value,isDark:(f=H_.value)!=null?f:void 0})}}).mount(m),gd=!0}));try{yield vd}catch(u){gd=!1,vd=null,W_=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),gd&&r===e1){Ec.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ac.value=e,B_.value=t,F_.value=n,Qg.value=(a=o?.x)!=null?a:null,Jg.value=(c=o?.y)!=null?c:null,H_.value=typeof i=="boolean"?i:null,Zg.value=!0;try{e.setAttribute("aria-describedby",Ec.value)}catch{}}});s?l():Od=setTimeout(l,80)}function FB(e=!1){e1+=1,fT();const t=()=>{if(Ac.value&&Ec.value)try{Ac.value.removeAttribute("aria-describedby")}catch{}Zg.value=!1,Ac.value=null,Ec.value=null,Qg.value=null,Jg.value=null};e?t():Rd=setTimeout(t,120)}const t1={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},n1=e=>{var t;return(t=t1[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function U_(e){return{t(t){if(e.te&&t1[t]&&!e.te(t))return n1(t);const n=e.t(t);return n===t&&t1[t]?n1(t):n}}}function HB(){const e=(function(){var t,n;try{const s=ls(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return U_(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return U_({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:n1}}function WB(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const UB=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],qB={key:1,class:"image-placeholder"},jB={key:1,class:"image-node__raw-text"},zB={key:0,class:"image-shimmer-overlay"},VB={key:1,class:"image-node__raw-text"},KB={key:2,class:"image-error"},dr=zt(Xe({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=te(!1),i=te(!1),r=te(""),l=te("primary"),a=te(null),c=au(),u=Nt(Kg,null);let d="",p=null;const m=j(()=>Rb(n.node.src)),f=j(()=>Rb(n.fallbackSrc)),v=j(()=>r.value),w=j(()=>!n.lazy),b=j(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),_=j(()=>l.value==="failed"),g=j(()=>!w.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=j(()=>WB(n,c));function k(B=y.value){B&&a.value&&u?.reportHeight(B,a.value.offsetHeight)}function I(B=y.value){B&&ut(()=>{k(B)})}function E(){p&&(clearTimeout(p),p=null)}function S(){const B=y.value;B&&d!==B&&(d&&u?.markSettled(d),E(),d=B,u?.markPending(B),typeof window<"u"&&(p=window.setTimeout(()=>{d===B&&(I(B),T())},8e3)))}function T(){return dn(this,null,function*(){const B=d;B&&(E(),d="",yield ut(),k(B),u?.markSettled(B))})}function $(){if(l.value==="primary"&&f.value&&f.value!==r.value)return l.value="fallback",r.value=f.value,o.value=!1,i.value=!1,void I();l.value="failed",i.value=!0,s("error",r.value),I()}function L(){o.value=!0,i.value=!1,s("load",v.value),I()}function R(B){B.preventDefault(),o.value&&!i.value&&s("click",[B,v.value])}const{t:O}=HB();return ze([m,f,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||m.value?(r.value=m.value,void(l.value="primary")):f.value?(r.value=f.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),ze([b,o,i,v,()=>n.lazy],([B,F,q,G,K])=>B&&G&&!q?F?(T(),void I()):K?(S(),void I()):void(F||q||S()):(T(),void I()),{flush:"post",immediate:!0}),oo(()=>{(function(){const B=d;B&&(E(),d="",u?.markSettled(B))})()}),(B,F)=>{var q,G,K,oe,le;return C(),A("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[b.value?(C(),A("img",{key:0,src:v.value,alt:String((G=(q=n.node.alt)!=null?q:n.node.title)!=null?G:""),title:String((oe=(K=n.node.title)!=null?K:n.node.alt)!=null?oe:""),class:$e(["image-node__img",{"is-loading":!w.value&&!o.value,"is-loaded":w.value||o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:w.value?"high":void 0,decoding:w.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(le=n.node.alt)!=null?le:M(O)("image.preview"),onError:$,onLoad:L,onClick:R},null,42,UB)):re("",!0),e.node.loading&&!i.value?(C(),A("span",qB,[n.usePlaceholder?ta(B.$slots,"placeholder",{key:0,node:n.node,displaySrc:v.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[F[0]||(F[0]=h("span",{class:"image-shimmer"},null,-1))],!0):(C(),A("span",jB,N(e.node.raw),1))])):re("",!0),pt(Ti,{name:"shimmer-fade"},{default:kn(()=>[g.value&&!e.node.loading?(C(),A("span",zB,[n.usePlaceholder?ta(B.$slots,"placeholder",{key:0,node:n.node,displaySrc:v.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[F[1]||(F[1]=h("span",{class:"image-shimmer"},null,-1))],!0):(C(),A("span",VB,N(e.node.raw),1))])):re("",!0)]),_:3}),_.value?(C(),A("span",KB,[ta(B.$slots,"error",{node:n.node,displaySrc:v.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[F[2]||(F[2]=h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[h("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),h("span",null,N(M(O)("image.loadError")),1)],!0)])):re("",!0)],512)}}}),[["__scopeId","data-v-373b57e2"]]);dr.install=e=>{e.component(dr.__name,dr)};const GB={key:2},oi=Xe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=In(()=>t.customId),s=Nt("markstreamHtmlPolicy",void 0),o=Nt("markstreamNestedRendererProps",void 0),i=j(()=>{var f;return(f=s?.value)!=null?f:"safe"}),r=j(()=>{var f,v;const w=(f=o?.value)!=null?f:{};return Ct(et({},w),{customId:(v=t.customId)!=null?v:w.customId,htmlPolicy:i.value})}),l=ei({loader:()=>Promise.resolve().then(()=>Dv),suspensible:!1}),a=j(()=>t.components[String(t.node.type)]),c=j(()=>!!(a.value&&n.value[t.node.type]&&!gu(String(t.node.type)))),u=j(()=>c.value?$v(t.node,i.value):void 0),d=j(()=>Array.isArray(t.node.children)&&t.node.children.length>0),p=j(()=>{var f;return String((f=t.node.content)!=null?f:"")}),m=j(()=>{var f,v;return String((v=(f=t.node.content)!=null?f:t.node.raw)!=null?v:"")});return(f,v)=>a.value&&c.value?(C(),qe(os(a.value),Kt({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:kn(()=>[d.value?(C(),qe(M(l),Kt({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):p.value?(C(),qe(M(l),Kt({key:1},r.value,{content:p.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(C(),qe(os(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(C(),A("span",GB,N(m.value),1)):re("",!0)}}),YB=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],XB={key:0,translate:"no",class:"markstream-pre__diff-code"},ZB={class:"markstream-pre__diff-number","aria-hidden":"true"},QB={class:"markstream-pre__diff-content"},JB={class:"markstream-pre__diff-content-inner"},eF={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},tF=["textContent"],ko=Xe({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=j(()=>{var S,T,$;const L=String((T=(S=t.node)==null?void 0:S.language)!=null?T:"");return String(($=String(L).split(/\s+/g)[0])!=null?$:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=j(()=>`language-${n.value}`),o=j(()=>{var S,T;return String((T=(S=t.node)==null?void 0:S.code)!=null?T:"").split(/\r\n|\n|\r/)}),i=j(()=>Array.from({length:Math.max(1,o.value.length)},(S,T)=>T+1)),r=j(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),l=j(()=>r.value&&t.diffInline===!0),a=j(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const T=`${Math.ceil(S)}px`;return{height:T,minHeight:T,maxHeight:T,overflow:"auto"}});function c(S,T="context"){const $=(function(L){return String(L??"").trim().length===0})(S);return{code:S,kind:$&&T!=="hunk"?"context":T,empty:$}}function u(S){return String(S??"").split(/\r\n|\n|\r/)}function d(S){return S.startsWith("-")&&!S.startsWith("---")}function p(S){return S.startsWith("+")&&!S.startsWith("+++")}const m=j(()=>{var S,T,$,L,R,O;const B=o.value.some(G=>d(G)||p(G));if(l.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:B?(function(K){const oe=[];let le=1,pe=1;for(const[be,Be]of K.entries())if(Be.startsWith("@@"))oe.push(Ct(et({},c(Be,"hunk")),{key:`inline-hunk-${be}`,number:""}));else if(d(Be))oe.push(Ct(et({},c(Be.slice(1),"removed")),{key:`inline-removed-${be}`,number:le++}));else if(p(Be))oe.push(Ct(et({},c(Be.slice(1),"added")),{key:`inline-added-${be}`,number:pe++}));else{const He=Be.startsWith(" ")?Be.slice(1):Be;oe.push(Ct(et({},c(He)),{key:`inline-context-${be}`,number:pe})),le++,pe++}return oe})(o.value):(function(K,oe){const le=u(K),pe=u(oe),be=[];let Be=0,He=le.length-1,Ne=pe.length-1;for(;Be<=He&&Be<=Ne&&le[Be]===pe[Be];)be.push(Ct(et({},c(pe[Be])),{key:`inline-prefix-${Be}`,number:Be+1})),Be++;const me=[];for(;He>=Be&&Ne>=Be&&le[He]===pe[Ne];)me.unshift(Ct(et({},c(pe[Ne])),{key:`inline-suffix-${Ne}`,number:Ne+1})),He--,Ne--;for(let _e=Be;_e<=He;_e++)be.push(Ct(et({},c(le[_e],"removed")),{key:`inline-removed-source-${_e}`,number:_e+1}));for(let _e=Be;_e<=Ne;_e++)be.push(Ct(et({},c(pe[_e],"added")),{key:`inline-added-source-${_e}`,number:_e+1}));return be.concat(me)})((S=t.node)==null?void 0:S.originalCode,(T=t.node)==null?void 0:T.updatedCode)}];if(!B&&((($=t.node)==null?void 0:$.originalCode)!=null||((L=t.node)==null?void 0:L.updatedCode)!=null))return[{key:"original",className:"markstream-pre__diff-pane--original",lines:u((R=t.node)==null?void 0:R.originalCode).map((G,K)=>Ct(et({},c(G,"removed")),{key:`original-${K}`,number:K+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:u((O=t.node)==null?void 0:O.updatedCode).map((G,K)=>Ct(et({},c(G,"added")),{key:`modified-${K}`,number:K+1}))}];const F=[],q=[];for(const G of o.value)if(G.startsWith("@@"))F.push(c(G,"hunk")),q.push(c(G,"hunk"));else if(G.startsWith("-")&&!G.startsWith("---"))F.push(c(G.slice(1),"removed"));else if(G.startsWith("+")&&!G.startsWith("+++"))q.push(c(G.slice(1),"added"));else{const K=G.startsWith(" ")?G.slice(1):G;F.push(c(K)),q.push(c(K))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:F.map((G,K)=>Ct(et({},G),{key:`original-${K}`,number:K+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:q.map((G,K)=>Ct(et({},G),{key:`modified-${K}`,number:K+1}))}]}),f=j(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=te(null),w=te([]);let b=null,_=null;function g(S){const T=Number.parseFloat(String(S??""));return Number.isFinite(T)&&T>0?T:0}function y(S,T){var $;if(!S)return T;const L=S.querySelector(".markstream-pre__diff-content"),R=L?.getBoundingClientRect(),O=($=R?.height)!=null?$:0;return Math.max(T,Math.ceil(O))}function k(){typeof window<"u"&&(b!=null&&window.cancelAnimationFrame(b),b=window.requestAnimationFrame(()=>{(function(){var S,T;b=null;const $=v.value;if(!$||!r.value)return void(w.value.length&&(w.value=[]));const L=(function(K){const oe=window.getComputedStyle(K),le=g(oe.getPropertyValue("--markstream-pre-diff-line-height"));if(le>0)return le;const pe=g(oe.lineHeight);return pe>0?pe:18})($),R=Array.from($.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),O=Array.from($.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),B=Math.max(R.length,O.length),F=[];for(let K=0;K<B;K++){const oe=y((S=R[K])!=null?S:null,L),le=y((T=O[K])!=null?T:null,L),pe=Math.max(L,oe,le);F.push({rowHeight:pe,originalHeight:oe,modifiedHeight:le})}var q,G;q=w.value,G=F,q.length===G.length&&q.every((K,oe)=>{const le=G[oe];return le&&Math.abs(K.rowHeight-le.rowHeight)<=.5&&Math.abs(K.originalHeight-le.originalHeight)<=.5&&Math.abs(K.modifiedHeight-le.modifiedHeight)<=.5})||(w.value=F)})()}))}function I(S){_?.disconnect(),_=null,S&&r.value&&typeof ResizeObserver<"u"&&(_=new ResizeObserver(()=>{k()}),_.observe(S))}function E(S,T){const $=w.value[S];if(!$)return;const L=T==="original"?$.originalHeight:$.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil($.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(L)}px`}}return ze(v,S=>{I(S),ut(()=>k())},{flush:"post"}),ze([r,m],()=>{I(v.value),ut(()=>k())},{flush:"post",immediate:!0}),oo(()=>{b!=null&&(window.cancelAnimationFrame(b),b=null),_?.disconnect(),_=null}),(S,T)=>(C(),A("pre",{ref_key:"preRef",ref:v,style:It(a.value),class:$e([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":r.value,"markstream-pre--diff-inline":l.value}]),"aria-busy":e.node.loading===!0,"aria-label":f.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[r.value?(C(),A("code",XB,[(C(!0),A(Ie,null,Ye(m.value,$=>(C(),A("span",{key:$.key,class:$e(["markstream-pre__diff-pane",$.className])},[(C(!0),A(Ie,null,Ye($.lines,(L,R)=>(C(),A("span",{key:L.key,class:$e(["markstream-pre__diff-line",[`markstream-pre__diff-line--${L.kind}`,{"markstream-pre__diff-line--empty":L.empty}]]),style:It(E(R,$.key))},[T[0]||(T[0]=h("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),h("span",ZB,N(L.number),1),h("span",QB,[h("span",JB,N(L.code),1)])],6))),128))],2))),128))])):(C(),A(Ie,{key:1},[t.showLineNumbers?(C(),A("span",eF,[(C(!0),A(Ie,null,Ye(i.value,$=>(C(),A("span",{key:$,class:"markstream-pre__line-number"},N($),1))),128))])):re("",!0),h("code",{translate:"no",class:"markstream-pre__code",textContent:N(e.node.code)},null,8,tF)],64))],14,YB))}});ko.install=e=>{e.component(ko.__name,ko)};const Rm=fl(!1);let q_=null;const nF={key:0},_n=zt(Xe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(q_||(q_=Ev().then(b=>{Rm.value=!!b}).catch(()=>{Rm.value=!1})),Gd(Rm)),s=au(),o=Nt("markstreamFade",void 0),i=Nt("markstreamTextStreamState",void 0),r=Nt("markstreamStreamVersion",void 0),l=j(()=>{const b=s.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),a=j(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=j(()=>{var b;const _=(b=s["index-key"])!=null?b:s.indexKey;return _==null||_===""?"":String(_)}),u=te(t.node.content),d=te("");let p=r?.value;const m=te(0);function f(){return u.value+d.value}function v(){d.value&&(u.value=f(),d.value="")}ze([()=>t.node.content,c,a,()=>r?.value],([b,_,g,y])=>{const k=String(b??""),I=c.value,E=y!==p;p=y;const S=tT({nextContent:k,persistedContent:I?i?.get(I):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:E});u.value=S.settledContent,d.value=S.streamedDelta,S.appended&&(m.value+=1),I&&i?.set(I,k)},{immediate:!0}),ze(a,b=>{var _;b||(_=f(),u.value=_,d.value="")});const w=j(()=>m.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(b,_)=>(C(),A("span",{class:$e([[M(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(C(),A("span",nF,N(u.value),1)):re("",!0),d.value?(C(),A("span",{key:1,class:$e(["text-node-stream-delta",[w.value]]),onAnimationend:v},N(d.value),35)):re("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);_n.install=e=>{e.component(_n.__name,_n)};const hT=Xe({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return Ut(ko,Ct(et({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),Pm=ei({loader:()=>dn(null,null,function*(){try{return(yield Xs(()=>import("./CodeBlockNode-B26hAEdG.js"),__vite__mapDeps([2,3,4]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),ko}}),loadingComponent:hT,delay:0,suspensible:!1}),Fo=ei(()=>dn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return Ut(_n,Ct(et({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield Ev())return(yield Xs(()=>import("./index6-CvXSHsNA.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return Ut(_n,Ct(et({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),pT=ei(()=>dn(null,null,function*(){try{if(yield Ev())return(yield Xs(()=>import("./index5-Bm0FC7PH.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return Ut(_n,Ct(et({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),bs=zt(Xe({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(C(),A("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},N(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);bs.install=e=>{e.component(bs.__name,bs)};const sF={class:"superscript-node"},Rs=zt(Xe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=In(()=>t.customId),s=j(()=>et({text:_n,inline_code:rs,link:Ss,html_inline:to,strong:_s,emphasis:Cs,footnote_reference:eo,strikethrough:ws,highlight:no,insert:Ds,subscript:Ps,emoji:Os,math_inline:Fo,reference:bs},n.value));return(o,i)=>(C(),A("sup",sF,[(C(!0),A(Ie,null,Ye(e.node.children,(r,l)=>(C(),qe(M(oi),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Rs.install=e=>{e.component(Rs.__name,Rs)};const oF={class:"subscript-node"},Ps=zt(Xe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=In(()=>t.customId),s=j(()=>et({text:_n,inline_code:rs,link:Ss,html_inline:to,strong:_s,emphasis:Cs,footnote_reference:eo,strikethrough:ws,highlight:no,insert:Ds,superscript:Rs,emoji:Os,math_inline:Fo,reference:bs},n.value));return(o,i)=>(C(),A("sub",oF,[(C(!0),A(Ie,null,Ye(e.node.children,(r,l)=>(C(),qe(M(oi),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Ps.install=e=>{e.component(Ps.__name,Ps)};const iF={class:"strong-node"},_s=zt(Xe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=In(()=>t.customId),s=j(()=>et({text:_n,inline_code:rs,link:Ss,html_inline:to,emphasis:Cs,strikethrough:ws,highlight:no,insert:Ds,subscript:Ps,superscript:Rs,emoji:Os,footnote_reference:eo,math_inline:Fo,reference:bs},n.value));return(o,i)=>(C(),A("strong",iF,[(C(!0),A(Ie,null,Ye(e.node.children,(r,l)=>(C(),qe(M(oi),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);_s.install=e=>{e.component(_s.__name,_s)};const rF={class:"strikethrough-node"},ws=zt(Xe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=In(()=>t.customId),s=j(()=>et({text:_n,inline_code:rs,link:Ss,html_inline:to,strong:_s,emphasis:Cs,highlight:no,insert:Ds,subscript:Ps,superscript:Rs,emoji:Os,footnote_reference:eo,math_inline:Fo,reference:bs},n.value));return(o,i)=>(C(),A("del",rF,[(C(!0),A(Ie,null,Ye(e.node.children,(r,l)=>(C(),qe(M(oi),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);ws.install=e=>{e.component(ws.__name,ws)};const lF=["href","title","aria-label","aria-hidden","target","rel"],aF=["aria-hidden"],cF={class:"link-text-wrapper relative inline-flex"},uF={class:"leading-[normal] link-text"},Ss=zt(Xe({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Nt("markstreamShowTooltips",void 0),s=j(()=>{const b=n?.value;return typeof b=="boolean"?b:t.showTooltip}),o=j(()=>{var b,_,g,y,k;const I=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",E=(b=t.animationOpacity)!=null?b:.35,S=Math.max(.12,Math.min(.5*E,E)),T={"--underline-height":`${(_=t.underlineHeight)!=null?_:2}px`,"--underline-bottom":I,"--underline-opacity":String(E),"--underline-rest-opacity":String(S),"--underline-duration":`${(g=t.animationDuration)!=null?g:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(k=t.animationIteration)!=null?k:"infinite"};return t.color&&(T["--link-color"]=t.color),T}),i=In(()=>t.customId),r=j(()=>et({text:_n,strong:_s,strikethrough:ws,emphasis:Cs,image:dr,html_inline:to,inline_code:rs},i.value)),l=au(),a=j(()=>{var b,_;const g=(b=t.node)==null?void 0:b.attrs;if(!g||typeof g!="object")return{};const y={};if(Array.isArray(g))for(const k of g)Array.isArray(k)&&k[0]&&(y[String(k[0])]=String((_=k[1])!=null?_:""));else for(const[k,I]of Object.entries(g))k&&I!=null&&I!==!1&&(y[k]=I===!0?"":String(I));return P_(y,"safe","a")}),c=j(()=>et(et({},l),a.value)),u=j(()=>{var b,_;return P_({href:String((_=(b=t.node)==null?void 0:b.href)!=null?_:"")},"safe","a").href}),d=j(()=>{if(!u.value)return;const b=c.value.target;return(typeof b=="string"?b.trim():String(b??"").trim())||(FR(u.value)?"_blank":void 0)}),p=j(()=>{var b;return String((b=d.value)!=null?b:"").trim().toLowerCase()==="_blank"}),m=j(()=>{if(!u.value)return;const b=c.value.rel,_=new Set((typeof b=="string"?b:String(b??"")).split(/\s+/).filter(Boolean)),g=new Set(Array.from(_).filter(y=>y.toLowerCase()!=="opener"));return p.value&&(g.add("noopener"),g.add("noreferrer")),g.size>0?Array.from(g).join(" "):void 0}),f=j(()=>{const b=et({},c.value);return delete b.title,delete b.href,delete b.target,delete b.rel,b});function v(){s.value&&FB()}const w=j(()=>{var b,_;const g=(b=t.node)==null?void 0:b.title;return typeof g=="string"&&g.trim().length>0?g:String((_=u.value)!=null?_:"")});return(b,_)=>{var g,y;return e.node.loading?(C(),A("span",Kt({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},M(l),{style:o.value}),[h("span",cF,[h("span",uF,[pt(M(_n),{class:"leading-[normal] link-text",node:{type:"text",content:String((g=e.node.text)!=null?g:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),_[1]||(_[1]=h("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,aF)):(C(),A("a",Kt({key:0,class:"link-node",href:u.value,title:s.value?"":w.value,"aria-label":`Link: ${w.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:m.value},f.value,{style:o.value,onMouseenter:_[0]||(_[0]=k=>(function(I){var E,S,T,$;if(!s.value)return;const L=I,R=L?.clientX!=null&&L?.clientY!=null?{x:L.clientX,y:L.clientY}:void 0,O=((E=t.node)==null?void 0:E.title)||((S=u.value)!=null&&S.includes("xn--")&&(($=(T=t.node)==null?void 0:T.text)!=null&&$.includes("://"))?t.node.text:u.value)||"";BB(I.currentTarget,O,"top",!1,R)})(k)),onMouseleave:v}),[(C(!0),A(Ie,null,Ye(e.node.children,(k,I)=>(C(),qe(M(oi),{key:`${e.indexKey||"emphasis"}-${I}`,components:r.value,node:k,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${I}`},null,8,["components","node","custom-id","index-key"]))),128))],16,lF))}}}),[["__scopeId","data-v-367e6ca4"]]);Ss.install=e=>{e.component(Ss.__name,Ss)};const dF={class:"insert-node"},Ds=zt(Xe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=In(()=>t.customId),s=j(()=>et({text:_n,inline_code:rs,link:Ss,html_inline:to,strong:_s,emphasis:Cs,strikethrough:ws,highlight:no,subscript:Ps,superscript:Rs,emoji:Os,footnote_reference:eo,math_inline:Fo,reference:bs},n.value));return(o,i)=>(C(),A("ins",dF,[(C(!0),A(Ie,null,Ye(e.node.children,(r,l)=>(C(),qe(M(oi),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Ds.install=e=>{e.component(Ds.__name,Ds)};const fF={class:"highlight-node"},no=zt(Xe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=In(()=>t.customId),s=j(()=>et({text:_n,inline_code:rs,link:Ss,html_inline:to,strong:_s,emphasis:Cs,strikethrough:ws,insert:Ds,subscript:Ps,superscript:Rs,emoji:Os,footnote_reference:eo,math_inline:Fo,reference:bs},n.value));return(o,i)=>(C(),A("mark",fF,[(C(!0),A(Ie,null,Ye(e.node.children,(r,l)=>(C(),qe(M(oi),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);no.install=e=>{e.component(no.__name,no)};const hF={class:"emphasis-node"},Cs=zt(Xe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=In(()=>t.customId),s=j(()=>et({text:_n,inline_code:rs,link:Ss,html_inline:to,strong:_s,strikethrough:ws,highlight:no,insert:Ds,subscript:Ps,superscript:Rs,emoji:Os,footnote_reference:eo,math_inline:Fo,reference:bs},n.value));return(o,i)=>(C(),A("em",hF,[(C(!0),A(Ie,null,Ye(e.node.children,(r,l)=>(C(),qe(M(oi),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Cs.install=e=>{e.component(Cs.__name,Cs)};const pF={class:"hard-break"},fr=zt(Xe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(C(),A("br",pF))}),[["__scopeId","data-v-50c58f70"]]);fr.install=e=>{e.component(fr.__name,fr)};const Jc=Xe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=ir({checkbox:Js,checkbox_input:Js,emoji:Os,emphasis:Cs,hardbreak:fr,highlight:no,inline_code:rs,insert:Ds,link:Ss,reference:bs,strikethrough:ws,strong:_s,subscript:Ps,superscript:Rs,text:_n}),s=In(()=>t.customId),o=j(()=>{const i=s.value;return Object.keys(i).length>0?et(et({},n),i):n});return(i,r)=>(C(!0),A(Ie,null,Ye(e.nodes,(l,a)=>(C(),qe(M(oi),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function s1(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(s1)}function Of(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(s1))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(s1)?o:null}function ka(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const mF=["cite"],gF={key:0,dir:"auto",class:"paragraph-node"},vF=["custom-id"],Pd=zt(Xe({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=In(()=>t.customId),s=j(()=>!!n.value.paragraph),o=j(()=>!!n.value.text),i=j(()=>Of(t.node.children,!s.value)),r=j(()=>t.fade!==!1||o.value?null:ka(i.value));return cn("markstreamShowTooltips",j(()=>t.showTooltips)),cn("markstreamFade",j(()=>t.fade)),(l,a)=>(C(),A("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(C(),A("p",gF,[r.value!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(r.value),9,vF)):(C(),qe(M(Jc),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(C(),qe(M(Bs),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=c=>l.$emit("copy",c))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,mF))}}),[["__scopeId","data-v-abfecebc"]]);Pd.install=e=>{e.component(Pd.__name,Pd)};const yF={class:"definition-list"},kF={class:"definition-term"},bF={class:"definition-desc"},Dd=zt(Xe({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(C(),A("dl",yF,[(C(!0),A(Ie,null,Ye(t.node.items,(o,i)=>(C(),A(Ie,{key:i},[h("dt",kF,[pt(M(Bs),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),h("dd",bF,[pt(M(Bs),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Dd.install=e=>{e.component(Dd.__name,Dd)};const _F=["href","title"],$c=zt(Xe({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(C(),A("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,_F))}}),[["__scopeId","data-v-e1eb37b6"]]);$c.install=e=>{e.component($c.__name,$c)};const wF=["id"],SF={class:"flex-1"},Bd=Xe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(C(),A("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[h("div",SF,[pt(M(Bs),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,wF))}});Bd.install=e=>{e.component(Bd.__name,Bd)};const CF=["custom-id"],o1=zt(Xe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=In(()=>t.customId),s=Nt("markstreamFade",void 0),o=j(()=>s?.value!==!1||n.value.text?null:ka(t.node.children)),i=j(()=>et({text:_n,inline_code:rs,link:Ss,image:dr,strong:_s,emphasis:Cs,strikethrough:ws,highlight:no,insert:Ds,subscript:Ps,superscript:Rs,emoji:Os,checkbox:Js,checkbox_input:Js,footnote_reference:eo,hardbreak:fr,math_inline:Fo,reference:bs},n.value));return(r,l)=>(C(),qe(os(`h${e.node.level}`),Kt({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:kn(()=>[o.value!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(o.value),9,CF)):(C(!0),A(Ie,{key:1},Ye(e.node.children,(a,c)=>(C(),qe(M(oi),{key:c,components:i.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${c}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),Rf=o1;Rf.install=e=>{e.component(o1.__name,o1)};const xF={key:0,dir:"auto",class:"paragraph-node"},TF=["custom-id"],MF={dir:"auto",class:"paragraph-node"},AF=["custom-id"],da=zt(Xe({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{}},emits:["copy"],setup(e){const t=e,n=j(()=>{var m;return(m=t.node)!=null?m:t.item}),s=In(()=>t.customId),o=j(()=>!!s.value.paragraph),i=j(()=>!!s.value.text),r=j(()=>{var m;return Of((m=n.value)==null?void 0:m.children,!o.value)}),l=j(()=>{var m;if(o.value)return null;const f=(m=n.value)==null?void 0:m.children;if(!Array.isArray(f)||f.length<2)return null;const v=f[0];if(v?.type!=="paragraph"||!Array.isArray(v.children))return null;const w=f.slice(1);if(!w.every(_=>_?.type==="list"))return null;const b=Of([v]);return b?{paragraphChildren:b,nestedLists:w}:null});function a(){return t.fade===!1&&!i.value}const c=j(()=>a()?ka(r.value):null),u=j(()=>{var m;return a()?ka((m=l.value)==null?void 0:m.paragraphChildren):null}),d=Object.freeze({}),p=j(()=>{const{value:m}=t;return typeof m=="number"&&Number.isFinite(m)?{value:m}:d});return cn("markstreamShowTooltips",j(()=>t.showTooltips)),cn("markstreamFade",j(()=>t.fade)),(m,f)=>{var v,w;return C(),A("li",Kt({class:"list-item",dir:"auto"},p.value),[r.value?(C(),A("p",xF,[c.value!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(c.value),9,TF)):(C(),qe(M(Jc),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(C(),A(Ie,{key:1},[h("p",MF,[u.value!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(u.value),9,AF)):(C(),qe(M(Jc),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(C(!0),A(Ie,null,Ye(l.value.nestedLists,(b,_)=>(C(),qe(M(Bs),{key:_,nodes:[b],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${_}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:f[0]||(f[0]=g=>m.$emit("copy",g))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade"]))),128))],64)):(C(),qe(M(Bs),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(w=(v=n.value)==null?void 0:v.children)!=null?w:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"batch-rendering":!1,onCopy:f[1]||(f[1]=b=>m.$emit("copy",b))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],16)}}}),[["__scopeId","data-v-356f1243"]]);da.install=e=>{e.component(da.__name,da)};const fa=zt(Xe({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=In(()=>e.customId),n=j(()=>t.value.list_item||da);return(s,o)=>(C(),qe(os(e.node.ordered?"ol":"ul"),{class:$e(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:kn(()=>[(C(!0),A(Ie,null,Ye(e.node.items,(i,r)=>{var l;return C(),qe(os(n.value),Kt({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-7c789f94"]]);fa.install=e=>{e.component(fa.__name,fa)};const mT=Symbol("ViewportPriority");function EF(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?te(t):t,r=o?(n=window.requestIdleCallback)!=null?n:b=>window.setTimeout(()=>b({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:b=>window.clearTimeout(b):null;let a=null,c=null;const u=new Map,d=new Set;let p=null;function m(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||(function(){if(p!=null){try{l?.(p)}catch{}p=null}})()}}function f(b){const _=u.get(b);if(_){if(!_.visible.value){_.visible.value=!0;try{_.resolve()}catch{}}try{a?.unobserve(b)}catch{}u.delete(b),d.delete(b),m()}}function v(){r&&p==null&&d.size&&(p=r(()=>{p=null;const b=d.values().next().value;b&&(d.delete(b),f(b),d.size&&v())},{timeout:1200}))}const w=(b,_)=>{const g=te(!1);let y,k=!1;const I=new Promise(T=>{y=()=>{k||(k=!0,T())}}),E=()=>{try{a?.unobserve(b)}catch{}u.delete(b),d.delete(b),m()};if(!o||!i.value)return g.value=!0,y(),{isVisible:g,whenVisible:I,destroy:E};const S=(function(T,$){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const L=(function(B,F){var q,G,K;return{root:(q=e?.(B??null))!=null?q:null,rootMargin:(G=F?.rootMargin)!=null?G:"300px",threshold:(K=F?.threshold)!=null?K:0}})(T,$);if(a&&(O=L,(R=c)&&R.root===O.root&&R.rootMargin===O.rootMargin&&R.threshold===O.threshold))return a;var R,O;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(B=>{for(const F of B)(F.isIntersecting||F.intersectionRatio>0)&&f(F.target)},{root:L.root,rootMargin:L.rootMargin,threshold:L.threshold}),c=L;for(const B of u.keys())a.observe(B);return a})(b,_);return S?(u.set(b,{resolve:y,visible:g}),S.observe(b),d.add(b),v(),{isVisible:g,whenVisible:I,destroy:E}):(g.value=!0,y(),{isVisible:g,whenVisible:I,destroy:E})};return cn(mT,w),w}function $F(){var e,t;const n=Nt(mT,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:p=>window.setTimeout(()=>p({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:p=>window.clearTimeout(p):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=p=>{const m=s.get(p);if(m){if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{o?.unobserve(p)}catch{}s.delete(p),i.delete(p),i.size||c()}},d=()=>{l&&r==null&&i.size&&(r=l(()=>{r=null;const p=i.values().next().value;p&&(i.delete(p),u(p),i.size&&d())},{timeout:1200}))};return p=>{const m=te(!1);let f,v=!1;const w=new Promise(g=>{f=()=>{v||(v=!0,g())}}),b=()=>{try{o?.unobserve(p)}catch{}s.delete(p),i.delete(p),i.size||c()},_=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(g=>{for(const y of g)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),o));return _?(s.set(p,{resolve:f,visible:m}),_.observe(p),i.add(p),d(),{isVisible:m,whenVisible:w,destroy:b}):(m.value=!0,f(),{isVisible:m,whenVisible:w,destroy:b})}}const IF={key:2,class:"html-block-node__raw"},NF=["innerHTML"],LF={key:1,class:"html-block-node__placeholder"},Ic=zt(Xe({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Nt("markstreamHtmlPolicy",void 0),s=Nt("markstreamNestedRendererProps",void 0),o=j(()=>{var I,E;return(E=(I=t.htmlPolicy)!=null?I:n?.value)!=null?E:"safe"}),i=j(()=>{var I,E;const S=(I=s?.value)!=null?I:{};return Ct(et({},S),{customId:(E=t.customId)!=null?E:S.customId,htmlPolicy:o.value})}),r=ei({loader:()=>Promise.resolve().then(()=>Dv),suspensible:!1}),l=j(()=>{const I=Vg(t.node.attrs,o.value);if(!I)return;const E=Nf(I);return Object.keys(E).length>0?E:void 0}),a=j(()=>{const I=String(t.node.tag||"").trim(),E=Vg(t.node.attrs,o.value,I);if(!E)return;const S=Nf(E);return Object.keys(S).length>0?S:void 0}),c=In(()=>t.customId),u=Xe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=te(null),p=te(typeof window>"u"),m=te(t.node.content),f=j(()=>Array.isArray(t.node.children)?t.node.children:[]),v=j(()=>String(t.node.tag||"div")),w=j(()=>{const I=v.value.trim().toLowerCase();return ux.has(I)||xv(I,o.value)}),b=j(()=>f.value.length>0&&!!t.node.tag&&!w.value),_=j(()=>{var I,E,S;if(b.value)return{mode:"structured"};if(!p.value)return{mode:"html",content:(I=m.value)!=null?I:""};const T=(E=m.value)!=null?E:t.node.content;if(!T)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:ua(T,o.value)};if(t.node.loading){const L=Lf(T,c.value,o.value);return L===null?{mode:"text",content:(S=t.node.raw)!=null?S:T}:{mode:"dynamic",nodes:L}}if(!dT(T,c.value))return{mode:"html",content:ua(T,o.value)};const $=Lf(T,c.value,o.value);return $===null?{mode:"html",content:ua(T,o.value)}:{mode:"dynamic",nodes:$}}),g=$F(),y=te(null),k=!!t.node.loading;return typeof window<"u"?(ze(d,I=>{var E,S;if((S=(E=y.value)==null?void 0:E.destroy)==null||S.call(E),y.value=null,!k)return p.value=!0,void(m.value=t.node.content);if(!I)return void(p.value=!1);const T=g(I,{rootMargin:"400px"});y.value=T,p.value=T.isVisible.value,T.whenVisible.then(()=>{p.value=!0})},{immediate:!0}),ze(()=>t.node.content,I=>{k&&!p.value||(m.value=I)})):p.value=!0,oo(()=>{var I,E;(E=(I=y.value)==null?void 0:I.destroy)==null||E.call(I),y.value=null}),(I,E)=>(C(),qe(os(b.value?v.value:"div"),Kt({ref_key:"htmlRef",ref:d,class:"html-block-node"},b.value?a.value:void 0),{default:kn(()=>[p.value?(C(),A(Ie,{key:0},[_.value.mode==="structured"?(C(),qe(M(r),Kt({key:0},i.value,{nodes:f.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):_.value.mode==="dynamic"?(C(),qe(M(u),{key:1,nodes:_.value.nodes},null,8,["nodes"])):_.value.mode==="text"?(C(),A("pre",IF,N(_.value.content),1)):(C(),A("div",Kt({key:3},l.value,{innerHTML:_.value.content}),null,16,NF))],64)):(C(),A("div",LF,[ta(I.$slots,"placeholder",{node:e.node},()=>[E[0]||(E[0]=h("span",{class:"html-block-node__placeholder-bar"},null,-1)),E[1]||(E[1]=h("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),E[2]||(E[2]=h("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Ic.install=e=>{e.component(Ic.__name,Ic)};const OF={dir:"auto",class:"paragraph-node"},RF=["custom-id"],ll=zt(Xe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=In(()=>t.customId),s=Nt("markstreamHtmlPolicy",void 0),o=Nt("markstreamFade",void 0),i=Nt("markstreamParseOptions",void 0),r=Nt("markstreamCustomMarkdownIt",void 0),l=Nt("markstreamNestedRendererProps",void 0),a=j(()=>{var S;return(S=s?.value)!=null?S:"safe"}),c=j(()=>{var S;return(S=t.parseOptions)!=null?S:i?.value}),u=j(()=>{var S;return(S=t.customMarkdownIt)!=null?S:r?.value}),d=j(()=>{var S,T;return(T=t.customHtmlTags)!=null?T:(S=l?.value)==null?void 0:S.customHtmlTags}),p=j(()=>{var S,T;const $=(S=l?.value)!=null?S:{};return Ct(et({},$),{customId:(T=t.customId)!=null?T:$.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),m=ei({loader:()=>Promise.resolve().then(()=>Dv),suspensible:!1});function f(S){var T;return S.type==="text"&&String((T=S.content)!=null?T:"").trim()===""}const v=j(()=>t.node.children.filter(S=>!f(S))),w=j(()=>v.value.length>0&&v.value.every(S=>S.type==="image"||(function(T){var $;const L=(function(R){return R.type==="link"&&Array.isArray(R.children)?R.children.filter(O=>!f(O)):[]})(T);return L.length===1&&(($=L[0])==null?void 0:$.type)==="image"})(S))),b=j(()=>new Set(Sa(d.value))),_=j(()=>{if(!w.value||v.value.length<=1)return t.node.children;const S=[];for(let T=0;T<t.node.children.length;T++){const $=t.node.children[T];if(!f($)){S.push($);continue}const L=S.length>0,R=t.node.children.slice(T+1).some(O=>!f(O));L&&R&&S.push(Ct(et({},$),{content:" ",raw:" "}))}return S}),g=j(()=>o?.value===!1&&!n.value.text),y=j(()=>g.value?ka(_.value):null);function k(S,T){return{node:S,"index-key":`${t.indexKey}-${T}`,"custom-id":t.customId,"custom-html-tags":d.value}}const I=j(()=>et({inline_code:rs,image:dr,link:Ss,hardbreak:fr,emphasis:Cs,strong:_s,strikethrough:ws,highlight:no,insert:Ds,subscript:Ps,superscript:Rs,html_inline:to,html_block:Ic,emoji:Os,checkbox:Js,math_inline:Fo,checkbox_input:Js,reference:bs,footnote_anchor:$c,footnote_reference:eo,text:_n},n.value)),E=j(()=>_.value.map((S,T)=>{var $;const L=(function(R){var O,B,F,q;if(R.type==="html_block"||R.type==="html_inline"){const G=String((O=R.tag)!=null?O:"").trim().toLowerCase()||px(R.content);if(G&&!b.value.has(G)&&mx((B=R.content)!=null?B:R.raw,G)){const K=String((q=(F=R.content)!=null?F:R.raw)!=null?q:"");return{child:{type:"text",content:K,raw:K},component:_n,isCustomComponent:!1}}}return{child:R,component:I.value[R.type],isCustomComponent:!!(n.value[R.type]&&!gu(String(R.type)))}})(S);return Ct(et({},L),{index:T,key:`${t.indexKey||"paragraph"}-${T}`,customAttrs:L.isCustomComponent?$v(L.child,a.value):void 0,hasSlotChildren:Array.isArray(L.child.children)&&L.child.children.length>0,slotContent:String(($=L.child.content)!=null?$:""),originalChild:S})}));return(S,T)=>(C(),A("p",OF,[y.value!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(y.value),9,RF)):(C(!0),A(Ie,{key:1},Ye(E.value,$=>{return C(),A(Ie,{key:$.key},[w.value&&f($.originalChild)?(C(),A(Ie,{key:0},[dt(N((L=$.originalChild,String((R=L.content)!=null?R:""))),1)],64)):$.isCustomComponent?(C(),qe(os($.component),Kt({key:1,ref_for:!0},$.customAttrs,{node:$.child,loading:$.child.loading,"index-key":$.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":p.value.isDark}),{default:kn(()=>[$.hasSlotChildren?(C(),qe(M(m),Kt({key:0,ref_for:!0},p.value,{nodes:$.child.children,"index-key":$.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):$.slotContent?(C(),qe(M(m),Kt({key:1,ref_for:!0},p.value,{content:$.slotContent,final:!$.child.loading,"index-key":`${$.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(C(),qe(os($.component),Kt({key:2,ref_for:!0},k($.child,$.index)),null,16))],64);var L,R}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);ll.install=e=>{e.component(ll.__name,ll)};const PF={class:"table-node-wrapper"},DF=["aria-busy"],BF={key:0},FF=["custom-id"],HF=["aria-label","onPointerdown"],WF=["custom-id"],UF={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Nc=zt(Xe({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=j(()=>{var b;return(b=t.node.loading)!=null&&b}),s=j(()=>{var b;return(b=t.node.rows)!=null?b:[]}),o=te(null),i=te([]);let r=null;const l=j(()=>t.node.header.cells.length),a=j(()=>i.value.some(b=>Number.isFinite(b)&&b>0)),c=j(()=>a.value?i.value.map(b=>b>0?{width:`${b}px`}:void 0):[]);cn("markstreamShowTooltips",j(()=>t.showTooltips)),cn("markstreamFade",j(()=>t.fade));const u=In(()=>t.customId),d=j(()=>!!u.value.text),p=j(()=>!!u.value.paragraph),m=new WeakMap;function f(b){const _=t.fade===!1&&!d.value,g=!p.value,y=m.get(b);if(y?.children===b.children&&y.textFastPath===_&&y.paragraphFastPath===g)return y.info;const k=Of(b.children,g,!0),I={simpleChildren:k,plainText:k&&_?ka(k):null};return m.set(b,{children:b.children,textFastPath:_,paragraphFastPath:g,info:I}),I}function v(b){if(!r)return;b.preventDefault();const _=r.startWidth+r.nextStartWidth,g=Math.min(48,Math.floor(_/2)),y=Math.max(g,Math.min(_-g,Math.round(r.startWidth+b.clientX-r.startX))),k=[...r.widths];k[r.index]=y,k[r.index+1]=_-y,i.value=k}function w(){r&&(window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",w),r=null)}return ze(l,()=>{w(),i.value=[]}),oo(w),(b,_)=>(C(),A("div",PF,[h("table",{ref_key:"tableRef",ref:o,class:$e(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(C(),A("colgroup",BF,[(C(!0),A(Ie,null,Ye(e.node.header.cells,(g,y)=>(C(),A("col",{key:y,style:It(c.value[y])},null,4))),128))])):re("",!0),h("thead",null,[h("tr",null,[(C(!0),A(Ie,null,Ye(e.node.header.cells,(g,y)=>(C(),A("th",{key:y,dir:"auto",class:$e([g.align==="right"?"text-right":g.align==="center"?"text-center":"text-left"])},[f(g).plainText!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(f(g).plainText),9,FF)):f(g).simpleChildren?(C(),qe(M(Jc),{key:1,nodes:f(g).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(C(),qe(M(Bs),{key:2,nodes:g.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:_[0]||(_[0]=k=>b.$emit("copy",k))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(C(),A("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:k=>(function(I,E){if(E.button!==0)return;const S=(function(){var L;const R=(L=o.value)==null?void 0:L.querySelectorAll("thead th");return Array.from(R??[],O=>Math.round(O.getBoundingClientRect().width))})(),T=S[I],$=S[I+1];T&&$&&(E.preventDefault(),r={index:I,startX:E.clientX,startWidth:T,nextStartWidth:$,widths:S},i.value=S,window.addEventListener("pointermove",v),window.addEventListener("pointerup",w),window.addEventListener("pointercancel",w))})(y,k)},null,40,HF)):re("",!0)],2))),128))])]),h("tbody",null,[(C(!0),A(Ie,null,Ye(s.value,(g,y)=>(C(),A("tr",{key:y},[(C(!0),A(Ie,null,Ye(g.cells,(k,I)=>(C(),A("td",{key:I,class:$e([k.align==="right"?"text-right":k.align==="center"?"text-center":"text-left"]),dir:"auto"},[f(k).plainText!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(f(k).plainText),9,WF)):f(k).simpleChildren?(C(),qe(M(Jc),{key:1,nodes:f(k).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${I}`},null,8,["nodes","custom-id","index-key"])):(C(),qe(M(Bs),{key:2,nodes:k.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:_[1]||(_[1]=E=>b.$emit("copy",E))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,DF),pt(Ti,{name:"table-node-fade"},{default:kn(()=>[n.value?(C(),A("div",UF,[ta(b.$slots,"loading",{isLoading:n.value},()=>[_[2]||(_[2]=h("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),_[3]||(_[3]=h("span",{class:"sr-only"},"Loading",-1))],!0)])):re("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Nc.install=e=>{e.component(Nc.__name,Nc)};const qF={class:"hr-node"},Fd=zt({},[["render",function(e,t){return C(),A("hr",qF)}],["__scopeId","data-v-39b2349c"]]);Fd.install=e=>{e.component(Fd.__name,Fd)};const jF={class:"unknown-node"},i1=Xe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(C(),A("div",jF,N(e.node.raw),1))}),Hd=zt(Xe({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=j(()=>`vmr-container vmr-container-${t.node.name}`),s=In(()=>t.customId),o=j(()=>et({text:_n,paragraph:ll,heading:Rf,inline_code:rs,link:Ss,image:dr,strong:_s,emphasis:Cs,strikethrough:ws,insert:Ds,subscript:Ps,superscript:Rs,checkbox:Js,checkbox_input:Js,hardbreak:fr,math_inline:Fo,reference:bs,list:fa,math_block:pT,table:Nc},s.value));return(i,r)=>(C(),A("div",Kt({class:n.value},e.node.attrs),[(C(!0),A(Ie,null,Ye(e.node.children,(l,a)=>{return C(),qe(os((c=l.type,o.value[c]||i1)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);Hd.install=e=>{e.component(Hd.__name,Hd)};const zF=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],j_=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function VF(e){if(e<=255)return zF[e];let t=0,n=j_.length-1;for(;t<=n;){const s=t+n>>1,o=j_[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const KF=/[ \t\n\r\f]+/g,GF=/[\t\n\r\f]| {2,}|^ | $/;let Dm=null;const YF=new RegExp("\\p{Script=Arabic}","u"),Ih=new RegExp("\\p{M}","u"),gT=new RegExp("\\p{Nd}","u");function z_(e){return YF.test(e)}function V_(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function Mi(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(V_(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(V_(n))return!0}}return!1}const XF=new Set([" "," ","","\uFEFF"]);function ZF(e){return Mi(e)}function r1(e){return!(function(t){const n=Pf(t);return n!==null&&(Iv.has(n)||ul.has(n))})(e)&&!(function(t){const n=Pf(t);return n!==null&&XF.has(n)})(e)}const Iv=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Nh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Nv=new Set(["'","’"]),ul=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),QF=new Set([":",".","،","؛"]),JF=new Set(["၏"]),eH=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function tH(e){if(Lv(e))return!0;let t=!1;for(const n of e)if(ul.has(n))t=!0;else if(!t||!Ih.test(n))return!1;return t}function nH(e){for(const t of e)if(!Iv.has(t)&&!ul.has(t))return!1;return e.length>0}function sH(e){if(Lv(e))return!0;for(const t of e)if(!Nh.has(t)&&!Nv.has(t)&&!Ih.test(t))return!1;return e.length>0}function Lv(e){let t=!1;for(const n of e)if(n!=="\\"&&!Ih.test(n)){if(!(Nh.has(n)||ul.has(n)||Nv.has(n)))return!1;t=!0}return t}function vT(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function Pf(e){if(e.length===0)return null;const t=vT(e,e.length);return e.slice(t)}function oH(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Ih.test(s))n--;else{if(!Nh.has(s)&&!Nv.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function iH(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function K_(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function G_(e,t){return e&&t!==null&&QF.has(t)}function rH(e){const t=Pf(e);return t!==null&&JF.has(t)}function lH(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function l1(e){let t=e.length;for(;t>0;){const n=vT(e,t),s=e.slice(n,t);if(eH.has(s))return!0;if(!ul.has(s))return!1;t=n}return!1}function aH(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
210
|
+
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const cH=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function vo(e){return e.length===1?e[0]:e.join("")}function uH(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),vo(n)}function dH(e,t,n,s){if(!cH.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=aH(u,s),p=d==="text"&&t;i===null||d!==i||p!==a?(i!==null&&o.push({text:vo(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=p,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&o.push({text:vo(r),isWordLike:a,kind:i,start:l}),o}function Bm(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const fH=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function hH(e,t){const n=e.texts[t];return!!n.startsWith("www.")||fH.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function pH(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const mH=new Set([":","-","/","×",",",".","+","–","—"]),Y_=/^[A-Za-z0-9_]+[,:;]*$/,X_=/[,:;]+$/;function Z_(e){for(const t of e)if(gT.test(t))return!0;return!1}function Wd(e){if(e.length===0)return!1;for(const t of e)if(!gT.test(t)&&!mH.has(t))return!1;return!0}function Q_(e,t,n){var s,o,i;const r=(Dm===null&&(Dm=new Intl.Segmenter(void 0,{granularity:"word"})),Dm);let l=0;const a=[],c=[],u=[],d=[],p=[],m=[],f=[],v=[],w=[],b=[],_=[],g=[];for(const S of r.segment(e))for(const T of dH(S.segment,(s=S.isWordLike)!=null&&s,S.index,n)){let $=function(){m[K]!==null&&(c[K]=[K_(a,m,f,K)],m[K]=null),c[K].push(T.text),u[K]=u[K]||T.isWordLike,v[K]=v[K]||O,w[K]=w[K]||B,b[K]=q,_[K]=G,g[K]=G_(w[K],F)};const L=T.kind==="text",R=iH(T.text,T.isWordLike,T.kind),O=Mi(T.text),B=z_(T.text),F=Pf(T.text),q=l1(T.text),G=rH(T.text),K=l-1;t.carryCJKAfterClosingQuote&&L&&l>0&&d[K]==="text"&&O&&v[K]&&b[K]||L&&l>0&&d[K]==="text"&&nH(T.text)&&v[K]||L&&l>0&&d[K]==="text"&&_[K]?$():L&&l>0&&d[K]==="text"&&T.isWordLike&&B&&g[K]?($(),u[K]=!0):R!==null&&l>0&&d[K]==="text"&&m[K]===R?f[K]=((o=f[K])!=null?o:1)+1:L&&!T.isWordLike&&l>0&&d[K]==="text"&&(tH(T.text)||T.text==="-"&&u[K])?$():(a[l]=T.text,c[l]=[T.text],u[l]=T.isWordLike,d[l]=T.kind,p[l]=T.start,m[l]=R,f[l]=R===null?0:1,v[l]=O,w[l]=B,b[l]=q,_[l]=G,g[l]=G_(B,F),l++)}for(let S=0;S<l;S++)m[S]===null?a[S]=vo(c[S]):a[S]=K_(a,m,f,S);for(let S=1;S<l;S++)d[S]==="text"&&!u[S]&&Lv(a[S])&&d[S-1]==="text"&&(a[S-1]+=a[S],u[S-1]=u[S-1]||u[S],a[S]="");const y=Array.from({length:l},()=>null);let k=-1;for(let S=l-1;S>=0;S--){const T=a[S];if(T.length!==0){if(d[S]==="text"&&!u[S]&&sH(T)&&k>=0&&d[k]==="text"){const $=(i=y[k])!=null?i:[];$.push(T),y[k]=$,p[k]=p[S],a[S]="";continue}k=S}}for(let S=0;S<l;S++){const T=y[S];T!=null&&(a[S]=uH(T,a[S]))}let I=0;for(let S=0;S<l;S++){const T=a[S];T.length!==0&&(I!==S&&(a[I]=T,u[I]=u[S],d[I]=d[S],p[I]=p[S]),I++)}a.length=I,u.length=I,d.length=I,p.length=I;const E=(function(S){const T=S.texts.slice(),$=S.isWordLike.slice(),L=S.kinds.slice(),R=S.starts.slice();for(let O=0;O<T.length-1;O++){if(L[O]!=="text"||L[O+1]!=="text"||!Mi(T[O])||!Mi(T[O+1]))continue;const B=oH(T[O]);B!==null&&(T[O]=B.head,T[O+1]=B.tail+T[O+1],R[O+1]=R[O]+B.head.length)}return{len:T.length,texts:T,isWordLike:$,kinds:L,starts:R}})((function(S){const T=[],$=[],L=[],R=[];for(let O=0;O<S.len;O++){const B=S.texts[O],F=S.kinds[O],q=S.isWordLike[O];if(F==="text"&&q&&Y_.test(B)){const G=[B];let K=X_.test(B),oe=O+1;for(;K&&oe<S.len&&S.kinds[oe]==="text"&&S.isWordLike[oe]&&Y_.test(S.texts[oe]);){const le=S.texts[oe];G.push(le),K=X_.test(le),oe++}T.push(vo(G)),$.push(!0),L.push("text"),R.push(S.starts[O]),O=oe-1;continue}T.push(B),$.push(q),L.push(F),R.push(S.starts[O])}return{len:T.length,texts:T,isWordLike:$,kinds:L,starts:R}})((function(S){const T=[],$=[],L=[],R=[];for(let O=0;O<S.len;O++){const B=S.texts[O];if(S.kinds[O]==="text"&&B.includes("-")){const F=B.split("-");let q=F.length>1;for(let G=0;G<F.length;G++){const K=F[G];if(!q)break;K.length!==0&&Z_(K)&&Wd(K)||(q=!1)}if(q){let G=0;for(let K=0;K<F.length;K++){const oe=F[K],le=K<F.length-1?`${oe}-`:oe;T.push(le),$.push(!0),L.push("text"),R.push(S.starts[O]+G),G+=le.length}continue}}T.push(B),$.push(S.isWordLike[O]),L.push(S.kinds[O]),R.push(S.starts[O])}return{len:T.length,texts:T,isWordLike:$,kinds:L,starts:R}})((function(S){const T=[],$=[],L=[],R=[];for(let O=0;O<S.len;O++){const B=S.texts[O],F=S.kinds[O];if(F==="text"&&Wd(B)&&Z_(B)){const q=[B];let G=O+1;for(;G<S.len&&S.kinds[G]==="text"&&Wd(S.texts[G]);)q.push(S.texts[G]),G++;T.push(vo(q)),$.push(!0),L.push("text"),R.push(S.starts[O]),O=G-1;continue}T.push(B),$.push(S.isWordLike[O]),L.push(F),R.push(S.starts[O])}return{len:T.length,texts:T,isWordLike:$,kinds:L,starts:R}})((function(S){const T=[],$=[],L=[],R=[];for(let O=0;O<S.len;O++){const B=S.texts[O];if(T.push(B),$.push(S.isWordLike[O]),L.push(S.kinds[O]),R.push(S.starts[O]),!pH(B))continue;const F=O+1;if(F>=S.len||Bm(S.kinds[F]))continue;const q=[],G=S.starts[F];let K=F;for(;K<S.len&&!Bm(S.kinds[K]);)q.push(S.texts[K]),K++;q.length>0&&(T.push(vo(q)),$.push(!0),L.push("text"),R.push(G),O=K-1)}return{len:T.length,texts:T,isWordLike:$,kinds:L,starts:R}})((function(S){const T=S.texts.slice(),$=S.isWordLike.slice(),L=S.kinds.slice(),R=S.starts.slice();for(let B=0;B<S.len;B++){if(L[B]!=="text"||!hH(S,B))continue;const F=[T[B]];let q=B+1;for(;q<S.len&&!Bm(L[q]);){F.push(T[q]),$[B]=!0;const G=T[q].includes("?");if(L[q]="text",T[q]="",q++,G)break}T[B]=vo(F)}let O=0;for(let B=0;B<T.length;B++){const F=T[B];F.length!==0&&(O!==B&&(T[O]=F,$[O]=$[B],L[O]=L[B],R[O]=R[B]),O++)}return T.length=O,$.length=O,L.length=O,R.length=O,{len:O,texts:T,isWordLike:$,kinds:L,starts:R}})((function(S){const T=[],$=[],L=[],R=[];let O=0;for(;O<S.len;){const B=[S.texts[O]];let F=S.isWordLike[O],q=S.kinds[O],G=S.starts[O];if(q==="glue"){const K=[B[0]],oe=G;for(O++;O<S.len&&S.kinds[O]==="glue";)K.push(S.texts[O]),O++;const le=vo(K);if(!(O<S.len&&S.kinds[O]==="text")){T.push(le),$.push(!1),L.push("glue"),R.push(oe);continue}B[0]=le,B.push(S.texts[O]),F=S.isWordLike[O],q="text",G=oe,O++}else O++;if(q==="text")for(;O<S.len&&S.kinds[O]==="glue";){const K=[];for(;O<S.len&&S.kinds[O]==="glue";)K.push(S.texts[O]),O++;const oe=vo(K);O<S.len&&S.kinds[O]==="text"?(B.push(oe,S.texts[O]),F=F||S.isWordLike[O],O++):B.push(oe)}T.push(vo(B)),$.push(F),L.push(q),R.push(G)}return{len:T.length,texts:T,isWordLike:$,kinds:L,starts:R}})({len:I,texts:a,isWordLike:u,kinds:d,starts:p})))))));for(let S=0;S<E.len-1;S++){const T=lH(E.texts[S]);T!==null&&(E.kinds[S]!=="space"&&E.kinds[S]!=="preserved-space"||E.kinds[S+1]!=="text"||!z_(E.texts[S+1])||(E.texts[S]=T.space,E.isWordLike[S]=!1,E.kinds[S]=E.kinds[S]==="preserved-space"?"preserved-space":"space",E.texts[S+1]=T.marks+E.texts[S+1],E.starts[S+1]=E.starts[S]+T.space.length))}return E}function gH(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let Bl=null;const J_=new Map;let Fl=null;const vH=new RegExp("\\p{Emoji_Presentation}","u"),yH=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Fm=null;const ew=new Map;function a1(){if(Bl!==null)return Bl;if(typeof OffscreenCanvas<"u")return Bl=new OffscreenCanvas(1,1).getContext("2d"),Bl;if(typeof document<"u")return Bl=document.createElement("canvas").getContext("2d"),Bl;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Xi(e,t){let n=t.get(e);return n===void 0&&(n={width:a1().measureText(e).width,containsCJK:Mi(e)},t.set(e,n)),n}function Lh(){if(Fl!==null)return Fl;if(typeof navigator>"u")return Fl={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Fl;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Fl={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Fl}function yT(){return Fm===null&&(Fm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Fm}function kH(e){return vH.test(e)||e.includes("️")}function Kr(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=yT();for(const a of l.segment(i))kH(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function bH(e,t){for(;t<e.widths.length;){const n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function _H(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function tw(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+Lh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,p=-1,m=0;function f(y=u,k=d,I=a){l++,a=0,c=!1,p=-1,m=0}function v(y,k){c=!0,u=y+1,d=0,a=k}function w(y,k,I){c=!0,u=y,d=k+1,a=I}function b(y,k){c?(a+=k,u=y+1,d=0):v(y,k)}function _(y,k){const I=i[y];for(let E=k;E<I.length;E++){const S=I[E];c?a+S>r?(f(),w(y,E,S)):(a+=S,u=y,d=E+1):w(y,E,S)}c&&u===y&&d===I.length&&(u=y+1,d=0)}let g=0;for(;g<s.length&&(c||(g=bH(e,g),!(g>=s.length)));){const y=s[g],k=o[g],I=k==="space"||k==="preserved-space"||k==="tab"||k==="zero-width-break"||k==="soft-hyphen";if(c)if(a+y>r){if(I){b(g,y),f(g+1,0,a-y),g++;continue}if(p>=0){if(u>p||u===p&&d>0){f();continue}f(p,0,m);continue}if(y>t&&i[g]!==null){f(),_(g,0),g++;continue}f()}else b(g,y),I&&(p=g+1,m=a-y),g++;else y>t&&i[g]!==null?_(g,0):v(g,y),I&&(p=g+1,m=a-y),g++}return c&&f(),l}let Hm=null;function wH(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,p,m){s=[d],o=p,i=m,r=l1(d),l=Nh.has(d)}function u(d,p){s.push(d),i=i||p;const m=l1(d);r=d.length===1&&ul.has(d)&&r||m,l=!1}for(const d of(Hm===null&&(Hm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Hm).segment(e)){const p=d.segment,m=Mi(p);s.length!==0?l||Iv.has(p)||ul.has(p)||t.carryCJKAfterClosingQuote&&m&&r?u(p,m):i||m?(a(),c(p,d.index,m)):u(p,m):c(p,d.index,m)}return a(),n}function SH(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=Mi(e[0].text),i=r1(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=Mi(a.text),u=r1(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function CH(e,t,n,s){const o=Lh(),{cache:i,emojiCorrection:r}=(function(E,S){a1().font=E;const T=(function(R){let O=J_.get(R);return O||(O=new Map,J_.set(R,O)),O})(E),$=(function(R){const O=R.match(/(\d+(?:\.\d+)?)\s*px/);return O?parseFloat(O[1]):16})(E),L=S?(function(R,O){let B=ew.get(R);if(B!==void 0)return B;const F=a1();F.font=R;const q=F.measureText("😀").width;if(B=0,q>O+.5&&typeof document<"u"&&document.body!==null){const G=document.createElement("span");G.style.font=R,G.style.display="inline-block",G.style.visibility="hidden",G.style.position="absolute",G.textContent="😀",document.body.appendChild(G);const K=G.getBoundingClientRect().width;document.body.removeChild(G),q-K>.5&&(B=q-K)}return ew.set(R,B),B})(E,$):0;return{cache:T,fontSize:$,emojiCorrection:L}})(t,(l=e.normalized,yH.test(l)));var l;const a=Kr("-",Xi("-",i),r),c=8*Kr(" ",Xi(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],p=[],m=[];let f=e.chunks.length<=1;const v=null,w=[],b=n?[]:null,_=Array.from({length:e.len});function g(E,S,T,$,L,R,O){L!=="text"&&L!=="space"&&L!=="zero-width-break"&&(f=!1),u.push(S),d.push(T),p.push($),m.push(L),w.push(O),b!==null&&b.push(E)}function y(E,S,T,$,L){const R=Xi(E,i),O=Kr(E,R,r),B=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:O,F=S==="space"||S==="zero-width-break"?0:O;if(L&&$&&E.length>1){let q="sum-graphemes";Wd(E)?q="pair-context":o.preferPrefixWidthsForBreakableRuns&&(q="segment-prefixes");const G=(function(K,oe,le,pe,be){if(oe.breakableFitAdvances!==void 0)return oe.breakableFitAdvances;const Be=yT(),He=[];for(const Ce of Be.segment(K))He.push(Ce.segment);if(He.length<=1)return oe.breakableFitAdvances=null,oe.breakableFitAdvances;if(be==="sum-graphemes"){const Ce=[];for(const de of He){const z=Xi(de,le);Ce.push(Kr(de,z,pe))}return oe.breakableFitAdvances=Ce,oe.breakableFitAdvances}if(be==="pair-context"||He.length>96){const Ce=[];let de=null,z=0;for(const Z of He){const fe=Kr(Z,Xi(Z,le),pe);if(de===null)Ce.push(fe);else{const P=de+Z,X=Xi(P,le);Ce.push(Kr(P,X,pe)-z)}de=Z,z=fe}return oe.breakableFitAdvances=Ce,oe.breakableFitAdvances}const Ne=[];let me="",_e=0;for(const Ce of He){me+=Ce;const de=Kr(me,Xi(me,le),pe);Ne.push(de-_e),_e=de}return oe.breakableFitAdvances=Ne,oe.breakableFitAdvances})(E,R,i,r,q);return void g(E,O,B,F,S,T,G)}g(E,O,B,F,S,T,null)}for(let E=0;E<e.len;E++){_[E]=u.length;const S=e.texts[E],T=e.isWordLike[E],$=e.kinds[E],L=e.starts[E];if($==="soft-hyphen"){g(S,0,a,a,$,L,null);continue}if($==="hard-break"){g(S,0,0,0,$,L,null);continue}if($==="tab"){g(S,0,0,0,$,L,null);continue}const R=Xi(S,i);if($==="text"&&R.containsCJK){const O=wH(S,o),B=s==="keep-all"?SH(O):O;for(let F=0;F<B.length;F++){const q=B[F];y(q.text,"text",L+q.start,T,s==="keep-all"||!Mi(q.text))}continue}y(S,$,L,T,!0)}const k=(function(E,S,T){const $=[];for(let L=0;L<E.length;L++){const R=E[L],O=R.startSegmentIndex<S.length?S[R.startSegmentIndex]:T,B=R.endSegmentIndex<S.length?S[R.endSegmentIndex]:T,F=R.consumedEndSegmentIndex<S.length?S[R.consumedEndSegmentIndex]:T;$.push({startSegmentIndex:O,endSegmentIndex:B,consumedEndSegmentIndex:F})}return $})(e.chunks,_,u.length),I=v===null?null:(function(E,S){const T=(function(L){const R=L.length;if(R===0)return null;const O=new Array(R);let B=!1;for(let le=0;le<R;){const pe=L.charCodeAt(le);let be=pe,Be=1;if(pe>=55296&&pe<=56319&&le+1<R){const Ne=L.charCodeAt(le+1);Ne>=56320&&Ne<=57343&&(be=Ne-56320+(pe-55296<<10)+65536,Be=2)}const He=VF(be);He!=="R"&&He!=="AL"&&He!=="AN"||(B=!0);for(let Ne=0;Ne<Be;Ne++)O[le+Ne]=He;le+=Be}if(!B)return null;let F=0;for(let le=0;le<R;le++){const pe=O[le];if(pe==="L"){F=0;break}if(pe==="R"||pe==="AL"){F=1;break}}const q=new Int8Array(R);for(let le=0;le<R;le++)q[le]=F;const G=1&F?"R":"L",K=G;let oe=K;for(let le=0;le<R;le++)O[le]==="NSM"?O[le]=oe:oe=O[le];oe=K;for(let le=0;le<R;le++){const pe=O[le];pe==="EN"?O[le]=oe==="AL"?"AN":"EN":pe!=="R"&&pe!=="L"&&pe!=="AL"||(oe=pe)}for(let le=0;le<R;le++)O[le]==="AL"&&(O[le]="R");for(let le=1;le<R-1;le++)O[le]==="ES"&&O[le-1]==="EN"&&O[le+1]==="EN"&&(O[le]="EN"),O[le]!=="CS"||O[le-1]!=="EN"&&O[le-1]!=="AN"||O[le+1]!==O[le-1]||(O[le]=O[le-1]);for(let le=0;le<R;le++){if(O[le]!=="EN")continue;let pe;for(pe=le-1;pe>=0&&O[pe]==="ET";pe--)O[pe]="EN";for(pe=le+1;pe<R&&O[pe]==="ET";pe++)O[pe]="EN"}for(let le=0;le<R;le++){const pe=O[le];pe!=="WS"&&pe!=="ES"&&pe!=="ET"&&pe!=="CS"||(O[le]="ON")}oe=K;for(let le=0;le<R;le++){const pe=O[le];pe==="EN"?O[le]=oe==="L"?"L":"EN":pe!=="R"&&pe!=="L"||(oe=pe)}for(let le=0;le<R;le++){if(O[le]!=="ON")continue;let pe=le+1;for(;pe<R&&O[pe]==="ON";)pe++;const be=(le>0?O[le-1]:K)!=="L"?"R":"L";if(be===((pe<R?O[pe]:K)!=="L"?"R":"L"))for(let Be=le;Be<pe;Be++)O[Be]=be;le=pe-1}for(let le=0;le<R;le++)O[le]==="ON"&&(O[le]=G);for(let le=0;le<R;le++){const pe=O[le];1&q[le]?pe!=="L"&&pe!=="AN"&&pe!=="EN"||q[le]++:pe==="R"?q[le]++:pe!=="AN"&&pe!=="EN"||(q[le]+=2)}return q})(E);if(T===null)return null;const $=new Int8Array(S.length);for(let L=0;L<S.length;L++)$[L]=T[S[L]];return $})(e.normalized,v);return b!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:f,segLevels:I,breakableFitAdvances:w,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:k,segments:b}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:f,segLevels:I,breakableFitAdvances:w,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:k}}function xH(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return CH((function(c,u,d="normal",p="normal"){const m=(function(w){const b=w??"normal";return b==="pre-wrap"?{mode:b,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:b,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),f=m.mode==="pre-wrap"?(function(w){return/[\r\f]/.test(w)?w.replace(/\r\n/g,`
|
|
211
|
+
`).replace(/[\r\f]/g,`
|
|
212
|
+
`):w.replace(/\r\n/g,`
|
|
213
|
+
`)})(c):(function(w){if(!GF.test(w))return w;let b=w.replace(KF," ");return b.charCodeAt(0)===32&&(b=b.slice(1)),b.length>0&&b.charCodeAt(b.length-1)===32&&(b=b.slice(0,-1)),b})(c);if(f.length===0)return{normalized:f,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const v=p==="keep-all"?(function(w){if(w.len<=1)return w;const b=[],_=[],g=[],y=[];let k=null,I=!1,E=0,S=!1,T=!1;function $(){k!==null&&(b.push(vo(k)),_.push(I),g.push("text"),y.push(E),k=null)}for(let L=0;L<w.len;L++){const R=w.texts[L],O=w.kinds[L],B=w.isWordLike[L],F=w.starts[L];if(O==="text"){const q=ZF(R),G=r1(R);if(k!==null&&S&&T){k.push(R),I=I||B,S=S||q,T=G;continue}$(),k=[R],I=B,E=F,S=q,T=G;continue}$(),b.push(R),_.push(B),g.push(O),y.push(F)}return $(),{len:b.length,texts:b,isWordLike:_,kinds:g,starts:y}})(Q_(f,u,m)):Q_(f,u,m);return et({normalized:f,chunks:gH(v,m)},v)})(s,Lh(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const Wm="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Rn=(()=>{const e=globalThis;if(e[Wm])return e[Wm];const t={configs:{},controllers:{},revision:fl(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Wm]=t,t})();let ic=null;const nw=Rn.revision;function sw(e){var t;return e&&(t=Rn.configs[e])!=null?t:null}function ow(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function TH(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Um(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!TH(i))return null;i.type==="text"?o+=String((t=i.content)!=null?t:""):i.type==="emoji"?o+=String((s=(n=i.name)!=null?n:i.raw)!=null?s:""):i.type==="hardbreak"&&(o+=`
|
|
214
|
+
`)}return o.length>0?o:null}function qm(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(ic!=null)return ic;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return ic=!!((i=r.getContext)!=null&&i.call(r,"2d")),ic}catch{return ic=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Rn.blockEstimateCache.get(r);if(l)return Rn.blockEstimateCache.delete(r),Rn.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(m,f,v){const w=`${v}\0${f}\0${m}`,b=Rn.preparedCache.get(w);if(b)return Rn.preparedCache.delete(w),Rn.preparedCache.set(w,b),b.prepared;const _=xH(m,f,{whiteSpace:v});for(Rn.preparedCache.set(w,{prepared:_});Rn.preparedCache.size>240;){const g=Rn.preparedCache.keys().next().value;if(!g)break;Rn.preparedCache.delete(g)}return _})(e,n.font,a),u=(function(m,f,v){const w=(function(b,_){return b.simpleLineWalkFastPath?tw(b,_):(function(g,y){if(g.simpleLineWalkFastPath)return tw(g,y);const{widths:k,lineEndFitAdvances:I,lineEndPaintAdvances:E,kinds:S,breakableFitAdvances:T,discretionaryHyphenWidth:$,tabStopAdvance:L,chunks:R}=g;if(k.length===0||R.length===0)return 0;const O=Lh(),B=O.lineFitEpsilon,F=y+B;let q=0,G=0,K=!1,oe=0,le=0,pe=-1,be=0,Be=0,He=null;function Ne(){pe=-1,be=0,Be=0,He=null}function me(X=oe,ne=le,se=G){q++,G=0,K=!1,Ne()}function _e(X,ne){K=!0,oe=X+1,le=0,G=ne}function Ce(X,ne,se){K=!0,oe=X,le=ne+1,G=se}function de(X,ne){K?(G+=ne,oe=X+1,le=0):_e(X,ne)}function z(X,ne,se,ce){if(!ne)return;const H=X==="tab"?0:I[se],U=X==="tab"?ce:E[se];pe=se+1,be=G-ce+H,Be=G-ce+U,He=X}function Z(X,ne){const se=T[X];for(let ce=ne;ce<se.length;ce++){const H=se[ce];K?G+H>F?(me(),Ce(X,ce,H)):(G+=H,oe=X,le=ce+1):Ce(X,ce,H)}K&&oe===X&&le===se.length&&(oe=X+1,le=0)}function fe(X){if(He!=="soft-hyphen")return!1;const ne=T[X];if(ne==null)return!1;const{fitCount:se,fittedWidth:ce}=(function(H,U,Q,ue,ge){let xe=0,ie=U;for(;xe<H.length;){const we=ie+H[xe];if((xe+1<H.length?we+ge:we)>Q+ue)break;ie=we,xe++}return{fitCount:xe,fittedWidth:ie}})(ne,G,y,B,$);return se!==0&&(G=ce,oe=X,le=se,Ne(),se===ne.length?(oe=X+1,le=0,!0):(me(X,se,ce+$),Z(X,se),!0))}function P(X){q++,Ne()}for(let X=0;X<R.length;X++){const ne=R[X];if(ne.startSegmentIndex===ne.endSegmentIndex){P();continue}K=!1,G=0,ne.startSegmentIndex,oe=ne.startSegmentIndex,le=0,Ne();let se=ne.startSegmentIndex;for(;se<ne.endSegmentIndex;){const ce=S[se],H=ce==="space"||ce==="preserved-space"||ce==="tab"||ce==="zero-width-break"||ce==="soft-hyphen",U=ce==="tab"?_H(G,L):k[se];if(ce!=="soft-hyphen")if(K){if(G+U>F){const Q=G+(ce==="tab"?0:I[se]),ue=G+(ce==="tab"?U:E[se]);if(He==="soft-hyphen"&&O.preferEarlySoftHyphenBreak&&be<=F){me(pe,0,Be);continue}if(He==="soft-hyphen"&&fe(se)){se++;continue}if(H&&Q<=F){de(se,U),me(se+1,0,ue),se++;continue}if(pe>=0&&be<=F){if(oe>pe||oe===pe&&le>0){me();continue}const ge=pe;me(ge,0,Be),se=ge;continue}if(U>y&&T[se]!==null){me(),Z(se,0),se++;continue}me();continue}de(se,U),z(ce,H,se,U),se++}else U>y&&T[se]!==null?Z(se,0):_e(se,U),z(ce,H,se,U),se++;else K&&(oe=se+1,le=0,pe=se+1,be=G+$,Be=G+$,He=ce),se++}if(K){const ce=pe===ne.consumedEndSegmentIndex?Be:G;me(ne.consumedEndSegmentIndex,0,ce)}}return q})(b,_)})(m,f);return{lineCount:w,height:w*v}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),p=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Rn.blockEstimateCache.set(r,{height:p,contentHeight:Math.round(d)});Rn.blockEstimateCache.size>4e3;){const m=Rn.blockEstimateCache.keys().next().value;if(!m)break;Rn.blockEstimateCache.delete(m)}return{kind:"simple-text",height:p,contentHeight:Math.round(d)}}catch{return null}}function kT(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Um(e.children);return i&&n.paragraph?qm(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Um(e.children),l=n.headings[i];return r&&l?qm(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=Um((o=i[0])==null?void 0:o.children);return r?qm(r,t,n.listItem):null}if(e.type==="list"){const i=Array.isArray(e.items)?e.items:[];if(!i.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of i){const a=kT(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function yd(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function MH(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function jm(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=ow(s.lineHeight,1.5*ow(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:MH(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}function Df(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function AH(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function bT(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=AH(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function _T(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function wT(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function ST(e,t=360,n=500){return wT(e,t,n)}function CT(e,t=360,n=500){return wT(e,t,n)}function iw(e,t,n,s){var o;const i=(function(p){return Math.max(0,Math.ceil(p.scrollHeight||0)-Math.ceil(p.clientHeight||0))})(e),r=(function(p,m){return Number.isFinite(p)?Math.min(Math.max(0,p),m):0})(n,i);if(!s.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const p of a){e.scrollTop=p;const m=s.getNormalizedScrollTop(e,t,!1),f=Math.abs(m-r);f<u&&(u=f,c=p)}e.scrollTop=c;const d=(o=s.epsilonPx)!=null?o:2;Math.abs(s.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const xT=Symbol("MarkstreamMathBlockMinHeightCache");function Mfe(){return Nt(xT,null)}const EH=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],$H=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],IH=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),TT=["raw","content","code","originalCode","updatedCode"],rw=new WeakMap,lw=new WeakMap;let NH=1;function Lo(){return typeof performance<"u"?performance.now():Date.now()}function aw(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function wo(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=rw.get(t);return n||(n=NH++,rw.set(t,n)),String(n)}function cw(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:wo(t),customMarkdownIt:wo(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:wo(e.validateLink),preTransformTokens:wo(e.preTransformTokens),postTransformTokens:wo(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function uw(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
215
|
+
`,t-1)+1;return e.slice(n,t).trim()}function dw(e){const t=MT(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function MT(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function AT(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Ov(e){const t=String(e??"");return`${t.length}:${AT(t)}`}function c1(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?Ov(r):`${r.length}:${AT(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${wo(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${wo(s)}`;const i=wo(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>c1(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(c=>`${c}:${c1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Bf(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function ET(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Bf(s)?br(s,t,n+1):ET(s,t,n+1)).join(",")}`:Bf(e)?br(e,t,n):c1(e,t,n)}function LH(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!TT.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${Ov(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${wo(o)}`:IH.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${ET(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${wo(o)}`:""}).filter(Boolean).join(";")}function OH(e){return TT.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Ov(n)}`:""}).filter(Boolean).join(";")}function br(e,t=new WeakMap,n=0){const s=lw.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${wo(o)}`;const r=wo(o);t.set(o,r);const l=(function(a,c,u){const d=a,p=Array.isArray(d.children)?d.children:[],m=p.length?p.slice(0,200).map(f=>br(f,c,u+1)).join("|"):"";return[a.type,OH(d),LH(d,c,u),p.length,m].join(":")})(e,t,n);return lw.set(o,l),l}function $T(e,t){return br(e)===br(t)}function Rv(e,t,n){const s=Lo(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Lo()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function fw(e,t,n){return Rv(t,n,()=>br(e))}function IT(e,t,n){return fw(e,n,"stabilizeSignatureMs")===fw(t,n,"stabilizeSignatureMs")}function zm(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function hw(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function RH(e,t){return e.length===t.length&&e===t}function Pv(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const s=e,o=t,i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const p=s[d],m=o[d];if(typeof p!=typeof m)return!1;if(typeof p!="string"){if(typeof p!="number"&&typeof p!="boolean"&&p!=null)return null;if(!Object.is(p,m))return!1}else if(typeof m!="string"||!RH(p,m))return!1}const l=Object.prototype.hasOwnProperty.call(s,"children");if(l!==Object.prototype.hasOwnProperty.call(o,"children"))return!1;if(!l)return!0;const a=s.children,c=o.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],p=c[u];if(!Bf(d)||!Bf(p))return null;const m=Pv(d,p,n+1);if(m==null)return null;if(!m)return!1}return!0}function PH(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=Pv(e,t);return n??$T(e,t)}function DH(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return Rv(n,"stabilizeSignatureMs",()=>{s=Pv(e,t)}),s??IT(e,t,n)}function BH(e,t){const n={};for(const s of EH){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function FH(e,t){var n;const s=x_(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:j(()=>!1),r=te(t.renderContent.value);let l,a=[],c="",u="",d="",p=0,m=0,f=Lo();function v(){l&&(clearTimeout(l),l=void 0)}function w(){v();const T=t.renderContent.value;r.value!==T&&(r.value=T),f=Lo()}ze([t.renderContent,t.effectiveFinal,i],([T,$,L])=>{r.value!==T&&(!L||$||(function(R,O){if(!R&&O||O.length<=80||O.length<R.length||!O.startsWith(R))return!0;const B=O.slice(R.length);return!!B&&(!!dw(uw(O))||!(!B.includes(`
|
|
216
|
+
|
|
217
|
+
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(B))||B.endsWith(`
|
|
218
|
+
`)&&!(function(F){const q=uw(F);if(dw(q))return!1;const G=MT(q);return G.length>=2&&G.some(K=>K.trim())})(O))})(r.value,T)?w():(function(){if(m+=1,l)return;const R=Math.max(0,(function(O){const B=O.parseCoalesceMs;return typeof B=="number"&&Number.isFinite(B)&&B>=0?B:80})(e)-(Lo()-f));R<=0?w():l=setTimeout(w,R)})())},{flush:"sync",immediate:!0}),A1(v);const b=j(()=>{var T,$,L,R;return UR(e.customHtmlTags,(T=e.parseOptions)==null?void 0:T.customHtmlTags,(R=(L=($=t.customComponentsMap)==null?void 0:$.value)!=null?L:{},Object.entries(R).map(([O,B])=>{const F=Eo(O);return B==null||!F||gu(F)||cx.has(F)||pu.has(F)?"":F}).filter(Boolean)))}),_=j(()=>{const{key:T,tags:$}=qR(b.value);if(!T)return s;const L=o.get(T);if(L)return L;const R=x_(t.instanceMsgId,{customHtmlTags:$});return o.set(T,R),R}),g=j(()=>{const T=_.value;return e.customMarkdownIt?e.customMarkdownIt(T):T}),y=j(()=>{var T,$;const L=(T=e.parseOptions)!=null?T:{},R=t.effectiveFinal.value,O=b.value,B=R!=null,F=O.length>0;return B||F||L.streamParse==null?et(et(Ct(et({},L),{streamParse:($=L.streamParse)==null||$}),B?{final:R}:{}),F?{customHtmlTags:O}:{}):L}),k=j(()=>{var T;return new Set(((T=y.value.customHtmlTags)!=null?T:[]).map($=>String($).trim().toLowerCase()).filter(Boolean))}),I=j(()=>cw(y.value,g.value,e.customMarkdownIt,{includeFinal:!0})),E=j(()=>cw(y.value,g.value,e.customMarkdownIt,{includeFinal:!1}));ze([I,E],([T,$],[L,R])=>{L&&(T===L&&$===R||(w(),$!==R&&(a=[],d="")))},{flush:"sync"});const S=j(()=>{var T,$,L,R,O,B,F,q;if((T=e.nodes)!=null&&T.length)return a=[],d="",ir(e.nodes.slice());const G=r.value;if(!G)return a=[],d="",[];const K=t.debugPerformanceEnabled.value,oe=K?Lo():0,le=g.value,pe=I.value,be=E.value;c&&pe!==c&&(function(ne){var se,ce;(ce=(se=ne.stream)==null?void 0:se.reset)==null||ce.call(se)})(le),u&&be!==u&&(a=[],d="");const Be=a.length>0&&G.startsWith(d)&&be===u,He=K?aw(le):null,Ne=K?{}:void 0,me=Ne?Ct(et({},y.value),{__timing:Ne}):y.value,_e=zx(G,le,me),Ce=K?Lo():0,de=K?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let z,Z=K?zm(_e.length):void 0,fe=0,P=0;if(Be){const ne=K?Lo():0;if(de){const se=(function(ce,H,U){if(!H.length)return{nodes:ce,metrics:zm(ce.length)};const Q=(function(xe,ie,we){const je=Math.min(xe.length,ie.length);for(let Je=0;Je<je;Je++)if(!DH(ie[Je],xe[Je],we))return Je;return xe.length===ie.length?-1:je})(ce,H,U);if(Q<0)return{nodes:H,metrics:{reusedNodeCount:ce.length,dirtyStartIndex:Q,stablePrefixNodeCount:ce.length,dirtyTailNodeCount:0}};const ue=ce.slice();let ge=Q;for(let xe=0;xe<Q;xe++)ue[xe]=H[xe];for(let xe=Q;xe<ce.length;xe++){const ie=H[xe],we=ce[xe];ie&&IT(ie,we,U)&&(ue[xe]=ie,ge+=1)}return{nodes:ue,metrics:{reusedNodeCount:ge,dirtyStartIndex:Q,stablePrefixNodeCount:Q,dirtyTailNodeCount:hw(Q,ce,H)}}})(_e,a,de);z=se.nodes,Z=se.metrics}else{const se=(function(ce,H){if(!H.length)return{nodes:ce,metrics:zm(ce.length)};const U=(function(ge,xe){const ie=Math.min(ge.length,xe.length);for(let we=0;we<ie;we++)if(!PH(xe[we],ge[we]))return we;return ge.length===xe.length?-1:ie})(ce,H);if(U<0)return{nodes:H,metrics:{reusedNodeCount:ce.length,dirtyStartIndex:U,stablePrefixNodeCount:ce.length,dirtyTailNodeCount:0}};const Q=ce.slice();let ue=U;for(let ge=0;ge<U;ge++)Q[ge]=H[ge];for(let ge=U;ge<ce.length;ge++){const xe=H[ge],ie=ce[ge];xe&&$T(xe,ie)&&(Q[ge]=xe,ue+=1)}return{nodes:Q,metrics:{reusedNodeCount:ue,dirtyStartIndex:U,stablePrefixNodeCount:U,dirtyTailNodeCount:hw(U,ce,H)}}})(_e,a);z=se.nodes,Z=se.metrics}fe=K?Lo()-ne:0,P=Z?.dirtyStartIndex==null||Z.dirtyStartIndex<0?z.length:Z.dirtyStartIndex}else z=_e;de?(function(ne,se,ce=0){for(let H=Math.max(0,ce);H<ne.length;H++)Rv(se,"primeSignatureMs",()=>br(ne[H]))})(z,de,P):(function(ne,se=0){for(let ce=Math.max(0,se);ce<ne.length;ce++)br(ne[ce])})(z,P);const X=K?Lo()-Ce:0;if(p+=1,d=G,c=pe,u=be,a=z,K){const ne=aw(le),se=typeof ne?.total=="number"&&ne.total>(($=He?.total)!=null?$:0);t.logPerf(se?"parse(stream)":"parse(sync)",et(et(et({rendererId:t.instanceMsgId,ms:Math.round(Lo()-oe),nodes:z.length,contentLength:G.length,parseCommitCount:p,parseCoalescedCount:m,nodeReuseMs:X,signatureMs:(L=de?.signatureMs)!=null?L:0,stabilizeSignatureMs:(R=de?.stabilizeSignatureMs)!=null?R:0,primeSignatureMs:(O=de?.primeSignatureMs)!=null?O:0,signatureCallCount:(B=de?.signatureCallCount)!=null?B:0,stabilizeSignatureCallCount:(F=de?.stabilizeSignatureCallCount)!=null?F:0,primeSignatureCallCount:(q=de?.primeSignatureCallCount)!=null?q:0,stabilizeMs:fe},Z??{}),Ne?Object.fromEntries($H.map(ce=>{var H;return[ce,(H=Ne[ce])!=null?H:0]})):{}),ne?{streamMode:ne.lastMode,streamDelta:BH(ne,He),streamStats:ne}:{}))}return ir(z)});return{effectiveCustomHtmlTags:b,effectiveCustomHtmlTagsSet:k,mdBase:_,mdInstance:g,mergedParseOptions:y,parsedNodes:S}}function HH(e){const{isClient:t}=e,n=te(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(p,m){if((v=(f=e.shouldTrackVisibleNodeIndices)==null?void 0:f.call(e))!=null&&!v)return;var f,v;const w=n.value,b=w.has(p);if(m){if(b)return;const g=new Set(w);return g.add(p),void(n.value=g)}if(!b)return;const _=new Set(w);_.delete(p),n.value=_})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[p,m]of o.entries())p<c||(m(),o.delete(p));for(const[p,m]of s.entries())p<c||(m.destroy(),s.delete(p),r(p),(u=e.onNodeVisibilityCleaned)==null||u.call(e,p));for(const p of Array.from(i.keys()))p<c||r(p);if(!n.value.size)return;const d=new Set;for(const p of n.value)p<c&&d.add(p);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function WH(e={}){const t=te(""),n=te(""),s=te(!1),o=rB(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=j(()=>Math.max(0,t.value.length-n.value.length)),a=j(()=>l.value===0),c=j(()=>s.value&&a.value);return M1()&&A1(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const pw=/auto|scroll|overlay/i;function UH(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return pw.test(t)||pw.test(n)}function qH(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const jH=Xe({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=j(()=>{var n,s;return CT((s=Df(e.estimatedPreviewHeightPx))!=null?s:_T(String((n=e.node.code)!=null?n:"")))});return()=>Ut("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?Ut("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[Ut("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Ut("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Ut("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Ut("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>Ut("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,Ut("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Ut("div",{class:"absolute inset-0"},[Ut("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),zH=Xe({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=j(()=>{var n,s;return ST((s=Df(e.estimatedPreviewHeightPx))!=null?s:bT(String((n=e.node.code)!=null?n:"")))});return()=>Ut("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?Ut("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[Ut("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Ut("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Ut("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>Ut("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Ut("span",{class:"action-icon block"})])))]):null,Ut("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Ut("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}),VH=["data-custom-id"],KH={class:"m-0 p-0"},GH=["data-probe"],YH=["data-node-index","data-node-type"],NT=zt(Xe(Ct(et({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:320,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},r=j(()=>{return(x=s.mode)==="chat"||x==="minimal"||x==="docs"?x:"docs";var x}),l=j(()=>s.renderCodeBlocksAsPre===!0?"pre":s.codeRenderer==="pre"||s.codeRenderer==="shiki"||s.codeRenderer==="monaco"?s.codeRenderer:s.renderCodeBlocksAsPre===!1||r.value==="docs"?"monaco":"pre"),a=j(()=>i[r.value]),c=j(()=>{var x;return(x=s.showTooltips)!=null?x:a.value.showTooltips}),u=j(()=>{var x;return(x=s.fade)!=null?x:a.value.fade}),d=j(()=>{var x;return(x=s.batchRendering)!=null?x:a.value.batchRendering}),p=j(()=>{var x;return(x=s.initialRenderBatchSize)!=null?x:a.value.initialRenderBatchSize}),m=j(()=>{var x;return(x=s.renderBatchSize)!=null?x:a.value.renderBatchSize}),f=j(()=>{var x;return(x=s.renderBatchDelay)!=null?x:a.value.renderBatchDelay}),v=j(()=>{var x;return(x=s.renderBatchBudgetMs)!=null?x:a.value.renderBatchBudgetMs}),w=j(()=>{var x;return(x=s.renderBatchIdleTimeoutMs)!=null?x:a.value.renderBatchIdleTimeoutMs}),b=j(()=>{var x;return(x=s.deferNodesUntilVisible)!=null?x:a.value.deferNodesUntilVisible}),_=j(()=>{var x;return(x=s.maxLiveNodes)!=null?x:a.value.maxLiveNodes}),g=j(()=>{var x;return(x=s.liveNodeBuffer)!=null?x:a.value.liveNodeBuffer}),y=j(()=>{var x;return(x=s.nodeVirtual)!=null?x:a.value.nodeVirtual}),k={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return s.parseOptions},get customMarkdownIt(){return s.customMarkdownIt},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return s.customHtmlTags},get mode(){return s.mode},get htmlPolicy(){return s.htmlPolicy},get viewportPriority(){return s.viewportPriority},get codeBlockStream(){return s.codeBlockStream},get codeBlockDarkTheme(){return s.codeBlockDarkTheme},get codeBlockLightTheme(){return s.codeBlockLightTheme},get codeBlockMonacoOptions(){return s.codeBlockMonacoOptions},get codeRenderer(){return s.codeRenderer},get renderCodeBlocksAsPre(){return s.renderCodeBlocksAsPre},get codeBlockMinWidth(){return s.codeBlockMinWidth},get codeBlockMaxWidth(){return s.codeBlockMaxWidth},get codeBlockProps(){return s.codeBlockProps},get mermaidProps(){return s.mermaidProps},get d2Props(){return s.d2Props},get infographicProps(){return s.infographicProps},get showTooltips(){return c.value},get themes(){return s.themes},get isDark(){return s.isDark},get customId(){return s.customId},get indexKey(){return s.indexKey},get typewriter(){return s.typewriter},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return s.smoothStreamingOptions},get parseCoalesceMs(){return s.parseCoalesceMs},get fade(){return u.value},get batchRendering(){return d.value},get initialRenderBatchSize(){return p.value},get renderBatchSize(){return m.value},get renderBatchDelay(){return f.value},get renderBatchBudgetMs(){return v.value},get renderBatchIdleTimeoutMs(){return w.value},get deferNodesUntilVisible(){return b.value},get maxLiveNodes(){return _.value},get liveNodeBuffer(){return g.value},get nodeVirtual(){return y.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function I(x){o("height-change",x)}function E(x){o("virtual-state-change",x)}function S(x){o("anchor-change",x)}const T=te(),$=te(null),L=te(null),R=te(null),O=Ys({1:null,2:null,3:null,4:null,5:null,6:null}),B=te(!1),F=new Map,q=te(0),G=te(0),K=te({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function oe(){var x,D;if(((x=s.virtualScroll)==null?void 0:x.enabled)!==!0)return null;const V=(D=s.virtualScroll)==null?void 0:D.scrollRoot;return le(typeof V=="function"?V():V)}function le(x){return x?typeof HTMLElement<"u"&&x instanceof HTMLElement?x:typeof x=="object"&&"value"in x?le(x.value):typeof x=="object"&&"$el"in x?le(x.$el):null:null}const{isClient:pe,renderAsFragment:be,debugPerformanceEnabled:Be,resolvedShowTooltips:He,resolvedHtmlPolicy:Ne,inheritedSmoothStreaming:me,ownsTypewriterCursor:_e}=(function(x){const D=typeof window<"u",V=au(),Y=Nt("markstreamHtmlPolicy",void 0),J=Nt("markstreamTypewriterCursor",void 0),he=Nt("markstreamSmoothStreaming",void 0),ye=j(()=>x.renderAsFragment===!0),ke=j(()=>!!(x.debugPerformance&&D&&typeof console<"u")),Le=j(()=>{var Oe;if(typeof x.showTooltips=="boolean")return x.showTooltips;const Me=(Oe=V.showTooltips)!=null?Oe:V["show-tooltips"];return Me===""||Me===!0||Me==="true"||Me!==!1&&Me!=="false"&&void 0}),Se=j(()=>{var Oe,Me;return(Me=(Oe=x.htmlPolicy)!=null?Oe:Y?.value)!=null?Me:"safe"}),Pe=j(()=>J?.value!==!0);return{isClient:D,renderAsFragment:ye,debugPerformanceEnabled:ke,resolvedShowTooltips:Le,resolvedHtmlPolicy:Se,inheritedSmoothStreaming:he,inheritedTypewriterCursor:J,ownsTypewriterCursor:Pe}})(k),{resolveViewportRoot:Ce,resolveScrollContainer:de,isReverseFlexScrollRoot:z,getNormalizedScrollTop:Z,getOffsetTopWithinRoot:fe}=(function(x,D){function V(){var ke,Le;return(Le=(ke=D.scrollRoot)==null?void 0:ke.call(D))!=null?Le:null}function Y(ke){if(typeof window>"u")return null;const Le=V();if(Le)return Le;const Se=ke??x.value;if(!Se)return null;const Pe=Se.ownerDocument||document,Oe=Pe.scrollingElement||Pe.documentElement;let Me=Se;for(;Me&&Me!==Pe.body&&Me!==Oe;){if(UH(window.getComputedStyle(Me))&&qH(Me))return Me;Me=Me.parentElement}return null}function J(ke){if(!D.isClient)return!1;try{const Le=window.getComputedStyle(ke);return!!(Le.display||"").toLowerCase().includes("flex")&&(Le.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function he(ke,Le,Se){var Pe,Oe;if(Se)return ye(Le);const Me=ke.scrollTop;if(!J(ke))return Me;const Re=Me<0?-Me:Me;return Math.max(0,((Pe=ke.scrollHeight)!=null?Pe:0)-((Oe=ke.clientHeight)!=null?Oe:0))-Re}function ye(ke){var Le,Se,Pe,Oe,Me;const Re=Number((Le=ke.scrollingElement)==null?void 0:Le.scrollTop),Ue=Number((Pe=(Se=ke.documentElement)==null?void 0:Se.scrollTop)!=null?Pe:0),We=Number((Me=(Oe=ke.body)==null?void 0:Oe.scrollTop)!=null?Me:0);return Math.max(0,Number.isFinite(Re)?Re:0,Number.isFinite(Ue)?Ue:0,Number.isFinite(We)?We:0)}return{resolveViewportRoot:Y,resolveScrollContainer:function(ke){var Le,Se,Pe,Oe;const Me=V();if(Me)return Me;const Re=Y((Le=ke??x.value)!=null?Le:null);if(Re)return Re;const Ue=(Oe=(Pe=ke?.ownerDocument)!=null?Pe:(Se=x.value)==null?void 0:Se.ownerDocument)!=null?Oe:typeof document<"u"?document:null;return Ue?.scrollingElement||Ue?.documentElement||null},isReverseFlexScrollRoot:J,getNormalizedScrollTop:he,getOffsetTopWithinRoot:function(ke,Le){const Se=Le.ownerDocument||ke.ownerDocument||document;if((function(Re,Ue){return Re===Ue.documentElement||Re===Ue.body||Re===Ue.scrollingElement})(Le,Se))return ke.getBoundingClientRect().top+ye(Se);const Pe=Le.getBoundingClientRect(),Oe=ke.getBoundingClientRect(),Me=he(Le,Se,!1);return Oe.top-Pe.top+Me}}})(T,{isClient:pe,scrollRoot:oe});cn("markstreamShowTooltips",He),cn("markstreamHtmlPolicy",Ne),cn("markstreamTypewriter",j(()=>s.typewriter!==!1)),cn("markstreamFade",j(()=>k.fade!==!1)),cn("markstreamTypewriterCursor",j(()=>!0)),cn("markstreamTextStreamState",F),cn("markstreamStreamVersion",q),cn("markstreamParseOptions",j(()=>s.parseOptions)),cn("markstreamCustomMarkdownIt",j(()=>s.customMarkdownIt));const{smoothStreamingEnabled:P,renderContent:X,effectiveFinal:ne}=(function(x,D){const V=WH(x.smoothStreamingOptions),Y=j(()=>{var Se,Pe,Oe;return x.smoothStreaming!==!1&&!((Se=x.nodes)!=null&&Se.length)&&(x.smoothStreaming===!0||!((Pe=D.inheritedSmoothStreaming)!=null&&Pe.value))&&(x.smoothStreaming===!0||x.typewriter===!0||((Oe=x.maxLiveNodes)!=null?Oe:0)<=0)}),J=te(!D.isClient||x.smoothStreaming===!0);Jt(()=>{J.value=!0});const he=j(()=>J.value&&Y.value),ye=j(()=>{var Se;return he.value?V.visible.value:(Se=x.content)!=null?Se:""}),ke=j(()=>{var Se,Pe;const Oe=(Se=x.parseOptions)!=null?Se:{};return(Pe=x.final)!=null?Pe:Oe.final}),Le=j(()=>{const Se=ke.value;return he.value&&Se!=null?!!Se&&V.caughtUp.value:Se});return ze([()=>x.content,()=>x.nodes,he,ke],([Se,Pe,Oe,Me])=>{if(Pe?.length)return void V.reset("");const Re=Se??"";if(!Oe)return V.reset(Re),void(Me&&V.finish({flush:!0}));const Ue=V.source.value;Re?Re===Ue||(Re.startsWith(Ue)?V.enqueue(Re.slice(Ue.length)):V.reset(Re)):V.reset(""),Me&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:Y,smoothStreamingEnabled:he,renderContent:ye,requestedFinal:ke,effectiveFinal:Le}})(k,{isClient:pe,inheritedSmoothStreaming:me});cn("markstreamSmoothStreaming",P);const se=te(!1);let ce="",H=!1,U=null;function Q(){pe&&U!=null&&(window.clearTimeout(U),U=null)}function ue(){se.value=!1,Q()}function ge(x,D){if(!Be.value)return;const V=(function(){if(!Be.value)return null;const Y=Je(xe),J=Je(ie),he=Math.max(je,J);if(Y<=0&&he<=0)return null;const ye={total:Y,maxPerFrame:he,byLabel:(ke=xe,Object.fromEntries(Array.from(ke.entries()).sort((Le,Se)=>Se[1]-Le[1]||Le[0].localeCompare(Se[0]))))};var ke;return xe.clear(),ie.clear(),je=0,ye})();console.info(`[markstream-vue][perf] ${x}`,V?Ct(et({},D),{layoutReads:V}):D)}ze([X,()=>s.nodes,ne],([x,D,V])=>{const Y=x??"";return D?.length||V===!0?(ue(),ce=Y,void(H=!0)):H?(ce&&Y.length>ce.length&&Y.startsWith(ce)?(se.value=!0,pe&&(Q(),U=window.setTimeout(()=>{var J;U=null,ne.value===!0||(J=s.nodes)!=null&&J.length||(Ml(),se.value=!1,ui())},1200))):(Y.length<ce.length||!Y.startsWith(ce))&&ue(),void(ce=Y)):(ce=Y,void(H=!0))},{flush:"sync",immediate:!0});const xe=new Map,ie=new Map;let we=!1,je=0;function Je(x){let D=0;for(const V of x.values())D+=V;return D}function nt(){je=Math.max(je,Je(ie)),ie.clear(),we=!1}function Ve(x,D){return(function(V){var Y,J;Be.value&&(xe.set(V,((Y=xe.get(V))!=null?Y:0)+1),ie.set(V,((J=ie.get(V))!=null?J:0)+1),we||(we=!0,pe&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(nt):typeof queueMicrotask!="function"?setTimeout(nt,0):queueMicrotask(nt)))})(x),D()}const ft=s.customId?`renderer-${s.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,xt=(function(x){const D=new Map;return{scope:x,cache:D,clear:()=>D.clear()}})(ft),Zt=j(()=>`${ft}:${q.value}`);cn(xT,xt);const Ht=In(()=>s.customId),{effectiveCustomHtmlTagsSet:Nn,mergedParseOptions:xn,parsedNodes:Ke}=FH(s,{instanceMsgId:ft,renderContent:X,effectiveFinal:ne,smoothStreamingEnabled:P,debugPerformanceEnabled:Be,customComponentsMap:Ht,logPerf:ge});ze(Ke,()=>{xt.clear(),q.value+=1},{immediate:!0});const en=j(()=>({customId:s.customId,customHtmlTags:xn.value.customHtmlTags,parseOptions:s.parseOptions,customMarkdownIt:s.customMarkdownIt,htmlPolicy:Ne.value,viewportPriority:s.viewportPriority,mode:r.value,codeRenderer:l.value,codeBlockStream:k.codeBlockStream,codeBlockDarkTheme:s.codeBlockDarkTheme,codeBlockLightTheme:s.codeBlockLightTheme,codeBlockMonacoOptions:s.codeBlockMonacoOptions,renderCodeBlocksAsPre:k.renderCodeBlocksAsPre,codeBlockMinWidth:s.codeBlockMinWidth,codeBlockMaxWidth:s.codeBlockMaxWidth,codeBlockProps:s.codeBlockProps,mermaidProps:s.mermaidProps,d2Props:s.d2Props,infographicProps:s.infographicProps,showTooltips:He.value,themes:s.themes,isDark:s.isDark,typewriter:s.typewriter,smoothStreamingOptions:s.smoothStreamingOptions,parseCoalesceMs:s.parseCoalesceMs,fade:k.fade}));cn("markstreamNestedRendererProps",en);const Hs=j(()=>Ke.value),qn=j(()=>Ke.value.length),Bn=te(null),Ws=te(null),Us=te(null),qs=te(null),Ho=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),$o=!Ho&&s.customId?sw(s.customId):null,ro=j(()=>$o?(nw.value,sw(s.customId)):null),Ln=j(()=>{var x;return!!(pe&&!be.value&&s.customId&&!Ho&&((x=ro.value)!=null&&x.enabled))}),on=j(()=>{var x;return!!(!be.value&&((x=s.virtualScroll)!=null&&x.enabled))}),Zn=te(!1);Jt(()=>{Zn.value=!0});const wt=j(()=>!!(pe&&on.value));cn("markstreamHostScrollManaged",wt);const as=j(()=>!!(Zn.value&&wt.value)),Vt=j(()=>Ln.value||wt.value),lo=j(()=>Ln.value||as.value),ri=j(()=>{var x;return Vt.value&&((x=ro.value)==null?void 0:x.textEstimation)!==!1}),Wo=j(()=>{var x;return Vt.value&&((x=ro.value)==null?void 0:x.codeBlockEstimation)!==!1});function cs(){const x=G.value||Ve("getMeasuredContainerWidth.clientWidth",()=>{var D;return((D=T.value)==null?void 0:D.clientWidth)||0});return Number.isFinite(x)&&x>0?x:0}const xs=j(()=>{const x=cs();return x>0?Math.max(1,Math.round(x)):640}),Ts=j(()=>{var x;return Math.max(1,(x=k.maxLiveNodes)!=null?x:320)}),gt=j(()=>{var x;return!be.value&&k.nodeVirtual!==!1&&!(((x=k.maxLiveNodes)!=null?x:0)<=0)&&(k.nodeVirtual===!0?Ke.value.length>0:Ke.value.length>Ts.value)}),Ms=j(()=>gt.value||Ln.value||wt.value),pn=j(()=>s.viewportPriority!==!1&&!B.value),us=EF(x=>{var D;return Ce((D=x??T.value)!=null?D:null)},pn),{requestFrame:tn,cancelFrame:ln,hasIdleCallback:Ee,isTestEnv:ve}=(function(x){const D=x.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,V=x.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,Y=x.isClient&&typeof window.requestIdleCallback=="function",J=(function(){var he;if(typeof globalThis>"u"||!("process"in globalThis))return;const ye=(he=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:he.value;return ye?.env})();return{requestFrame:D,cancelFrame:V,hasIdleCallback:Y,isTestEnv:J?.NODE_ENV==="test"}})({isClient:pe}),{resolvedBatchSize:ee,resolvedInitialBatch:Ae,batchingEnabled:Fe,incrementalRenderingActive:tt,renderedCount:yt,previousRenderContext:Pt,adaptiveBatchSize:mn,previousBatchConfig:Qn}=(function(x,D){var V;const Y=j(()=>{var Oe;const Me=Math.trunc((Oe=x.renderBatchSize)!=null?Oe:80);return Number.isFinite(Me)?Math.max(0,Me):0}),J=j(()=>{var Oe;const Me=Math.trunc((Oe=x.initialRenderBatchSize)!=null?Oe:Y.value);return Number.isFinite(Me)?Math.max(0,Me):Y.value}),he=j(()=>!D.renderAsFragment.value&&x.batchRendering!==!1&&Y.value>0&&D.isClient&&!D.isTestEnv),ye=te(0),ke=te({key:x.indexKey,total:0}),Le=te(Math.max(1,Y.value||1)),Se=j(()=>{var Oe;return he.value&&((Oe=x.maxLiveNodes)!=null?Oe:0)<=0}),Pe=te({batchSize:Y.value,initial:J.value,delay:(V=x.renderBatchDelay)!=null?V:16,enabled:Se.value});return{resolvedBatchSize:Y,resolvedInitialBatch:J,batchingEnabled:he,incrementalRenderingActive:Se,renderedCount:ye,previousRenderContext:ke,adaptiveBatchSize:Le,previousBatchConfig:Pe}})(k,{isClient:pe,isTestEnv:ve,renderAsFragment:be}),gn=new Map,ao=new Map,Ri=new WeakMap;let co=null;const Ar=new WeakMap,ds=new Map,bu=te(0),Xh=j(()=>(bu.value,Array.from(gn.entries()).sort((x,D)=>x[0]-D[0]))),Er=te(null),fs=te(null);let li=null,Aa=0,$r=null;const{activeRestoreAnchor:Pi,getRelativeScrollTopWithinContainer:Zh,setRelativeScrollTopWithinContainer:_u,resolveAnchorOffset:Ea,clearRestoreReconcile:gl,scheduleRestoreReconcile:De,captureRestoreAnchor:ae,restoreAnchor:Te,getAnchorDrift:Et}=(function(x){const{isClient:D,containerRef:V,parsedNodeCount:Y,requestFrame:J,cancelFrame:he,resolveScrollContainer:ye,getNormalizedScrollTop:ke,getOffsetTopWithinRoot:Le,isReverseFlexScrollRoot:Se,estimateIndexForOffset:Pe,estimateHeightRange:Oe,getFallbackNodeHeight:Me,clamp:Re}=x,Ue=te(null);let We=null,rt=[];function Qe(){const lt=ye(),kt=V.value;if(!lt||!kt)return null;const bt=lt.ownerDocument||kt.ownerDocument||document;if(lt===bt.documentElement||lt===bt.body||lt===bt.scrollingElement){const Lt=kt.getBoundingClientRect();return Math.max(0,-Lt.top)}return Math.max(0,ke(lt,bt,!1)-Le(kt,lt))}function Ze(lt){var kt;const bt=ye(),Lt=V.value;if(!bt||!Lt)return;const ms=Math.max(0,lt),gs=bt.ownerDocument||Lt.ownerDocument||document,Io=gs.defaultView||(typeof window<"u"?window:null);if(bt===gs.documentElement||bt===gs.body||bt===gs.scrollingElement){const Ui=ke(bt,gs,!0)+Lt.getBoundingClientRect().top;return void((kt=Io?.scrollTo)==null||kt.call(Io,0,Math.max(0,Ui+ms)))}iw(bt,gs,Le(Lt,bt)+ms,{isReverseFlexScrollRoot:Ui=>{var qi;return(qi=Se?.(Ui))!=null&&qi},getNormalizedScrollTop:ke})}function at(lt){const kt=Y.value,bt=Re(lt.nodeIndex,0,Math.max(0,kt-1));return Oe(0,bt)+Math.max(0,lt.offsetWithinNodePx)}function ct(){if(We!=null&&(he?.(We),We=null),D)for(const lt of rt)window.clearTimeout(lt);rt=[]}function ht(lt){const kt=at(lt),bt=Qe();bt!=null&&Math.abs(bt-kt)<=.5||Ze(kt)}return{activeRestoreAnchor:Ue,getRelativeScrollTopWithinContainer:Qe,setRelativeScrollTopWithinContainer:Ze,resolveAnchorOffset:at,clearRestoreReconcile:ct,applyRestoreAnchor:ht,scheduleRestoreReconcile:function(){Ue.value&&D&&We==null&&(We=J?J(()=>{We=null,Ue.value&&ht(Ue.value)}):null,We==null&&Ue.value&&ht(Ue.value))},captureRestoreAnchor:function(){const lt=Qe(),kt=Y.value;if(lt==null||kt<=0)return null;const bt=Re(Pe(lt+1),0,kt-1),Lt=Oe(0,bt),ms=Me(bt);return{nodeIndex:bt,offsetWithinNodePx:Re(lt-Lt,0,Math.max(0,ms-1))}},restoreAnchor:function(lt){const kt=Y.value;if(Ue.value={nodeIndex:Re(lt.nodeIndex,0,Math.max(0,kt-1)),offsetWithinNodePx:Math.max(0,lt.offsetWithinNodePx)},ct(),ht(Ue.value),D)for(const bt of[0,120,280,480])rt.push(window.setTimeout(()=>{Ue.value&&ht(Ue.value)},bt))},getAnchorDrift:function(lt){const kt=Qe();return kt==null?null:kt-at(lt)}}})({isClient:pe,containerRef:T,parsedNodeCount:qn,requestFrame:tn,cancelFrame:ln,resolveScrollContainer:()=>Er.value||de(),getNormalizedScrollTop:Z,getOffsetTopWithinRoot:fe,isReverseFlexScrollRoot:z,estimateIndexForOffset:Pp,estimateHeightRange:Wi,getFallbackNodeHeight:Iu,clamp:zn}),{nodeHeights:hs,heightStats:ps,heightTreeSize:$a,heightSumTree:Qh,heightKnownTree:Jh,averageNodeHeight:Uo,resetHeightMeasurements:F3,pruneHeightMeasurements:H3,rebuildHeightTrees:wu,recordNodeHeight:W3,removeNodeHeights:U3,exportHeightCache:q3,importHeightCache:j3,fenwickRangeSum:Su}=(function(x={}){const D=Ys({}),V=Ys({total:0,count:0}),Y=te(0),J=te([]),he=te([]);function ye(){for(const Me of Object.keys(D))delete D[Number(Me)];V.total=0,V.count=0,Y.value=0,J.value=[],he.value=[]}function ke(Me,Re,Ue){for(let We=Re+1;We<Me.length;We+=We&-We)Me[We]+=Ue}function Le(Me,Re){let Ue=0;for(let We=Re+1;We>0;We-=We&-We)Ue+=Me[We];return Ue}function Se(Me){Y.value=Me;const Re=new Array(Me+1).fill(0),Ue=new Array(Me+1).fill(0);for(const[We,rt]of Object.entries(D)){const Qe=Number(We),Ze=Number(rt);!Number.isFinite(Qe)||Qe<0||Qe>=Me||!Number.isFinite(Ze)||Ze<=0||(ke(Re,Qe,Ze),ke(Ue,Qe,1))}J.value=Re,he.value=Ue}function Pe(Me){if(!Number.isInteger(Me)||Me<0)return!1;const Re=D[Me];if(!Number.isFinite(Re)||Re<=0)return!1;if(delete D[Me],V.total=Math.max(0,V.total-Re),V.count=Math.max(0,V.count-1),Y.value>Me){const Ue=J.value,We=he.value;Ue.length&&We.length&&(ke(Ue,Me,-Re),ke(We,Me,-1))}return!0}const Oe=j(()=>V.count>0?Math.max(12,V.total/V.count):32);return{nodeHeights:D,heightStats:V,heightTreeSize:Y,heightSumTree:J,heightKnownTree:he,averageNodeHeight:Oe,resetHeightMeasurements:ye,pruneHeightMeasurements:function(Me){if(Me<=0)return void ye();let Re=0,Ue=0;for(const[We,rt]of Object.entries(D)){const Qe=Number(We),Ze=Number(rt);!Number.isFinite(Qe)||Qe<0||Qe>=Me||!Number.isFinite(Ze)||Ze<=0?delete D[Qe]:(Re+=Ze,Ue++)}V.total=Re,V.count=Ue},rebuildHeightTrees:Se,recordNodeHeight:function(Me,Re,Ue={}){(function(We,rt,Qe={}){var Ze;if(!Number.isFinite(rt)||rt<=0)return!1;const at=D[We];if(at&&(Qe.allowShrink===!1&&rt<at||Math.abs(rt-at)<=1))return!1;if(D[We]=rt,at?V.total+=rt-at:(V.total+=rt,V.count++),Y.value>We){const ct=J.value,ht=he.value;if(ct.length&&ht.length)if(at){const lt=rt-at;lt!==0&&ke(ct,We,lt)}else ke(ct,We,rt),ke(ht,We,1)}Qe.notify!==!1&&((Ze=x.onHeightRecorded)==null||Ze.call(x))})(Me,Re,Ct(et({},Ue),{notify:!0}))},removeNodeHeight:function(Me,Re={}){var Ue;const We=Pe(Me);return We&&Re.notify!==!1&&((Ue=x.onHeightRecorded)==null||Ue.call(x)),We},removeNodeHeights:function(Me,Re={}){var Ue;let We=0;for(const rt of Me)Pe(Number(rt))&&We++;return We>0&&Re.notify!==!1&&((Ue=x.onHeightRecorded)==null||Ue.call(x)),We},exportHeightCache:function(){return Object.entries(D).map(([Me,Re])=>({index:Number(Me),height:Number(Re)})).filter(Me=>Number.isFinite(Me.index)&&Me.index>=0&&Number.isFinite(Me.height)&&Me.height>0).sort((Me,Re)=>Me.index-Re.index)},importHeightCache:function(Me,Re={}){var Ue;if(!Array.isArray(Me))return;const We=Y.value;let rt=!1;if(Re.mode!=="merge"){const Qe=Object.keys(D);if(Qe.length>0){for(const Ze of Qe)delete D[Number(Ze)];rt=!0}}for(const Qe of Me){const Ze=Number(Qe.index),at=Number(Qe.height);if(!Number.isInteger(Ze)||Ze<0||We>0&&Ze>=We||!Number.isFinite(at)||at<=0)continue;const ct=D[Ze];ct&&Math.abs(ct-at)<=1||(D[Ze]=at,rt=!0)}rt&&((function(){let Qe=0,Ze=0;const at=Y.value;for(const[ct,ht]of Object.entries(D)){const lt=Number(ct),kt=Number(ht);!Number.isFinite(lt)||lt<0||at>0&<>=at||!Number.isFinite(kt)||kt<=0?delete D[lt]:(Qe+=kt,Ze++)}V.total=Qe,V.count=Ze})(),We>0&&Se(We),(Ue=x.onHeightRecorded)==null||Ue.call(x))},fenwickRangeSum:function(Me,Re,Ue){if(Ue<=Re)return 0;const We=Le(Me,Ue-1);return Re<=0?We:We-Le(Me,Re-1)}}})({onHeightRecorded:()=>{fo(),wt.value&&Va(),Pi.value&&De(),fs.value&&Cl(),nn("node-resize")}});function Cu(){F3(),ds.clear()}function t0(x){!Number.isInteger(x)||x<0||x>=Ke.value.length||ds.set(x,Ra(x))}function n0(x,D,V={}){const Y=hs[x];W3(x,D,V);const J=hs[x];J&&J>0?t0(x):Y&&ds.delete(x)}function s0(x,D){const V=Ve("getNodeLayoutHeight.slot.offsetHeight",()=>{var Y,J;return(J=(Y=gn.get(x))==null?void 0:Y.offsetHeight)!=null?J:0});return V>0?V:Ve("getNodeLayoutHeight.content.offsetHeight",()=>D.offsetHeight)}function o0(x,D={}){j3(x,D),Mp()}const Di=j(()=>{var x;return!be.value&&k.deferNodesUntilVisible!==!1&&!(((x=k.maxLiveNodes)!=null?x:0)<=0)&&!gt.value&&!(Ke.value.length>900)&&pn.value}),i0=j(()=>!!us&&(Di.value||gt.value)),r0=j(()=>gt.value||wt.value),{liveNodeBufferResolved:Ia,focusIndex:uo,liveRange:jn,updateLiveRange:Ir}=(function(x,D){const{parsedNodeCount:V,virtualizationEnabled:Y,maxLiveNodesResolved:J,clamp:he}=D,ye=j(()=>{var Se;return Math.max(0,(Se=x.liveNodeBuffer)!=null?Se:60)}),ke=te(0),Le=Ys({start:0,end:0});return{liveNodeBufferResolved:ye,focusIndex:ke,liveRange:Le,updateLiveRange:function(){const Se=V.value;if(!Y.value||Se===0)return Le.start=0,void(Le.end=Se);const Pe=Math.min(J.value,Se),Oe=ye.value,Me=he(ke.value-Oe,0,Math.max(0,Se-Pe));Le.start=Me,Le.end=Math.min(Se,Me+Pe)}}})(k,{parsedNodeCount:qn,virtualizationEnabled:gt,maxLiveNodesResolved:Ts,clamp:zn}),qo=new Map,Nr=new Map,Bi=new Map,xu=[],ai=new Map,Fi=new Set,l0=te(0);let ep=!1;const a0=j(()=>(l0.value,Fi.size)),js=new Map,jo=new Map,c0=te(0),tp=j(()=>{c0.value;let x=0;for(const D of js.values())x+=Math.max(0,D);return x});let zs=null,np=!0,u0=[0],d0="";function fo(){np=!0}const Tu=j(()=>{if(!gt.value)return Ke.value.length;const x=Ia.value,D=Math.max(jn.end+x,Ae.value),V=Math.min(Ke.value.length,D);return Math.max(yt.value,V)});function Mu(){ep||(ep=!0,queueMicrotask(()=>{ep=!1,l0.value+=1}))}function f0(x,D,V="node-resize"){if(!pe||typeof window>"u")return null;const Y=window.setTimeout(()=>{Fi.delete(Y)&&Mu();try{D()}finally{nn(V)}},Math.max(0,x));return Fi.add(Y),Mu(),Y}function Au(x){pe&&x!=null&&(Fi.delete(x)&&Mu(),window.clearTimeout(x))}function h0(){if(pe&&typeof window<"u")for(const x of Fi)window.clearTimeout(x);Fi.size&&(Fi.clear(),Mu()),xu.length=0,Bi.clear()}function z3(x){var D,V;return(V=(D=qs.value)==null?void 0:D[x])!=null?V:null}const{cancelScheduledFocusSync:sp,scheduleFocusSync:zo}=(function(x){const{isClient:D,containerRef:V,virtualizationEnabled:Y,requestFrame:J,cancelFrame:he,syncFocusToScroll:ye}=x;let ke=null;function Le(){var Pe,Oe,Me;return(Me=(Oe=(Pe=V.value)==null?void 0:Pe.ownerDocument)==null?void 0:Oe.defaultView)!=null?Me:typeof window<"u"?window:null}function Se(){if(!ke)return;const Pe=Le();ke.viaTimeout?Pe?Pe.clearTimeout(ke.id):clearTimeout(ke.id):he?.(ke.id),ke=null}return{cancelScheduledFocusSync:Se,scheduleFocusSync:function(Pe={}){if(!Y.value)return;if(!D)return void ye(!0);if(Pe.immediate)return Se(),void ye(!0);if(ke)return;const Oe=()=>{ke=null,ye()};if(J)return void(ke={id:J(Oe),viaTimeout:!1});const Me=Le();ke={id:Me?Me.setTimeout(Oe,16):setTimeout(Oe,16),viaTimeout:!0}}}})({isClient:pe,containerRef:T,virtualizationEnabled:gt,requestFrame:tn,cancelFrame:ln,syncFocusToScroll:function(x=!1){var D;if(!gt.value)return;const V=Er.value||de();if(!V)return;const Y=V.ownerDocument||((D=T.value)==null?void 0:D.ownerDocument)||document,J=Y?.defaultView||(typeof window<"u"?window:null),he=V===Y?.documentElement||V===Y?.body,ye=Ke.value.length;if(!he&&ye>0&&z(V)){const Ue=Ve("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),We=Ve("syncFocusToScroll.scrollTop",()=>V.scrollTop),rt=We<0?-We:We,Qe=(function(at){var ct,ht;const lt=Ke.value;if(!lt.length)return 0;if(at<=0)return Math.max(0,lt.length-1);if(Vt.value){const bt=(ct=ap()[lt.length])!=null?ct:0;return _0(Math.max(0,bt-at))}if($a.value===lt.length){const bt=Wi(0,lt.length);return Pp(Math.max(0,bt-at))}let kt=at;for(let bt=lt.length-1;bt>=0;bt--){const Lt=(ht=hs[bt])!=null?ht:Uo.value;if(kt<=Lt)return bt;kt-=Lt}return 0})(Math.max(0,rt)+.5*Math.max(0,Ue)),Ze=zn(Qe,0,Math.max(0,ye-1));return void((x||Math.abs(Ze-uo.value)>1)&&(uo.value=Ze,Ir()))}const ke=he?null:Ve("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),Le=he?0:ke.top,Se=he?Ve("syncFocusToScroll.viewport.clientHeight",()=>{var Ue,We;return(We=(Ue=J?.innerHeight)!=null?Ue:V.clientHeight)!=null?We:0}):ke.bottom,Pe=Xh.value;let Oe=null,Me=null;for(const[Ue,We]of Pe){if(!We)continue;const rt=Ve("syncFocusToScroll.slot.getBoundingClientRect",()=>We.getBoundingClientRect());rt.bottom<=Le||rt.top>=Se||(Oe==null&&(Oe=Ue),Me=Ue)}if(Oe==null||Me==null){const Ue=T.value;if(!Ue)return;const We=he?{top:0}:Ve("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),rt=Ve("syncFocusToScroll.fallback.scrollTop",()=>Z(V,Y,he)),Qe=he?(()=>{const ct=Ve("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Ue.getBoundingClientRect()),ht=(he?0:We.top)-ct.top;return Math.max(0,ht)})():(()=>{const ct=fe(Ue,V);return Math.max(0,rt-ct)})(),Ze=he?Ve("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var ct,ht,lt,kt;return(kt=(lt=(ht=J?.innerHeight)!=null?ht:(ct=Y?.documentElement)==null?void 0:ct.clientHeight)!=null?lt:V.clientHeight)!=null?kt:0}):Ve("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),at=Pp(Qe+.5*Math.max(0,Ze));return uo.value=zn(at,0,Math.max(0,Ke.value.length-1)),void Ir()}const Re=Math.round((Oe+Me)/2);!x&&Math.abs(Re-uo.value)<=1||(uo.value=zn(Re,0,Math.max(0,Ke.value.length-1)),Ir())}}),{visibleNodeIndices:op,nodeVisibilityHandles:vl,nodeVisibilityWatchStops:Eu,nodeVisibilityFallbackTimers:p0,clearVisibilityFallback:$u,markNodeVisible:Hi,cleanupNodeVisibility:V3,destroyNodeVisibilityState:ip}=HH({isClient:pe,shouldTrackVisibleNodeIndices:()=>Di.value,shouldCleanupNodeVisibility:()=>gt.value,onNodeMarkedVisible:x=>{gt.value?zo():uo.value=zn(x,0,Math.max(0,Ke.value.length-1))},onNodeVisibilityCleaned:x=>{gn.delete(x)&&q0()}}),{cleanupScrollListener:m0,setupScrollListener:K3}=(function(x){const{isClient:D,virtualizationEnabled:V,listenerEnabled:Y,scrollRootElement:J,resolveScrollContainer:he,scheduleFocusSync:ye,onScroll:ke}=x;let Le=null,Se=null;function Pe(){Le&&(Le(),Le=null),Se=null,J.value=null}function Oe(Me){const Re=x.getScrollTop?x.getScrollTop(Me):Me.scrollTop;return Math.max(0,Number.isFinite(Re)?Math.abs(Re):0)}return{cleanupScrollListener:Pe,setupScrollListener:function(){if(!D)return;if(!((Me=Y?.value)!=null?Me:V.value))return void Pe();var Me;const Re=he();if(!Re)return void Pe();if(J.value===Re&&Le)return;Pe(),Se=Oe(Re);const Ue=()=>{if(ke?.(),V.value){const We=(function(rt){const Qe=Oe(rt),Ze=Se;Se=Qe;const at=Math.max(480,.75*(rt.clientHeight||0));return Ze==null?Qe>at?{immediate:!0}:void 0:Math.abs(Qe-Ze)>at?{immediate:!0}:void 0})(Re);We?ye(We):ye()}};Re.addEventListener("scroll",Ue,{passive:!0}),J.value=Re,Le=()=>{Re.removeEventListener("scroll",Ue)}}}})({isClient:pe,virtualizationEnabled:gt,listenerEnabled:r0,scrollRootElement:Er,resolveScrollContainer:de,scheduleFocusSync:zo,onScroll:function(){const x=fs.value;if(!x)return;const D=Oa();if(!D||(function(Y){if(Ha()>=Aa)return $r=null,!1;const J=$r;if(J==null)return!0;const he=Math.abs(Y.scrollTop-J)<=2;return he||($r=null),he})(D))return;const V=$0(D);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,x.distanceFromBottomPx))>32)&&Sl("restore"):Sl("restore")},getScrollTop:x=>{var D;const V=x.ownerDocument||((D=T.value)==null?void 0:D.ownerDocument)||document,Y=x===V.documentElement||x===V.body||x===V.scrollingElement;return Ve("scrollListener.getScrollTop",()=>Z(x,V,Y))}});function zn(x,D,V){return Math.min(Math.max(x,D),V)}function rp(x){return x?.firstElementChild}function g0(x,D){var V;return x?(V=x.matches)!=null&&V.call(x,D)?x:x.querySelector(D):null}function v0(){if(!Vt.value)return void(G.value=0);const x=Ve("updateExperimentContainerWidth.clientWidth",()=>{var D,V;return(V=(D=T.value)==null?void 0:D.clientWidth)!=null?V:0});G.value=x>0?x:0}let Na=null;function lp(){Na?.disconnect(),Na=null}const y0=ei({loader:()=>dn(null,null,function*(){return(yield Xs(()=>import("./index8-RFRS9KOv.js"),__vite__mapDeps([5,4]))).default}),loadingComponent:hT,delay:0,suspensible:!1});function k0(x){return x===y0}const b0=j(()=>l.value==="pre"?ko:l.value==="shiki"?y0:Pm),Lr=j(()=>{const x=Ke.value;if(!x.length||!Vt.value)return x.map(()=>null);const D=G.value||Ve("estimatedNodeHeights.clientWidth",()=>{var V;return((V=T.value)==null?void 0:V.clientWidth)||0});return!Number.isFinite(D)||D<=0?x.map(()=>null):x.map((V,Y)=>{const J=hs[Y],he=typeof J=="number"&&J>0;if(ri.value&&!he){const ke=kT(V,D,K.value);if(ke)return ke}if(Wo.value&&V.type==="code_block"){const ke=(function(Le){if(Le.type!=="code_block")return null;const Se=Z0(Le,Bu(Le));return k0(Se)?"markdown":Se===ko?"pre":Se===b0.value||Se===Pm?"monaco":null})(V);if(ke==="monaco"||ke==="markdown"||ke==="pre")return(function(Le,Se){var Pe;if(!Le||Le.type!=="code_block")return null;const Oe=Se.rendererKind,Me=Se.showHeader!==!1,Re=(function(Ze){var at,ct,ht,lt;return Ze.diff?Math.max(yd(String((at=Ze.originalCode)!=null?at:"")),yd(String((ct=Ze.updatedCode)!=null?ct:"")),yd(String((ht=Ze.code)!=null?ht:""))):yd(String((lt=Ze.code)!=null?lt:""))})(Le),Ue=!!Le.diff;let We=0,rt=500;if(Oe==="monaco"){const Ze=(Pe=Se.monacoOptions)!=null?Pe:{},at=(function(ht,lt){const kt=typeof ht?.fontSize=="number"&&ht.fontSize>0?ht.fontSize:lt?13:12;return typeof ht?.lineHeight=="number"&&ht.lineHeight>0?ht.lineHeight:lt?30:Math.round(1.5*kt)})(Ze,Ue),ct=(function(ht,lt){var kt,bt;if(!lt)return 0;const Lt=typeof((kt=ht?.padding)==null?void 0:kt.top)=="number"?ht.padding.top:10,ms=typeof((bt=ht?.padding)==null?void 0:bt.bottom)=="number"?ht.padding.bottom:22;return Math.max(0,Lt)+Math.max(0,ms)})(Ze,Ue);rt=typeof Ze.MAX_HEIGHT=="number"&&Ze.MAX_HEIGHT>0?Ze.MAX_HEIGHT:500,We=Math.round(Ue?Re*at+ct:Re*(at+1.5))}else Oe==="markdown"?We=Math.round(21*Re+32):(We=Math.round(21*Re+32),rt=Number.POSITIVE_INFINITY);const Qe=Math.max(1,Math.min(We,rt));return{kind:"code-block",height:Math.round(Qe+(Me?40:0)),contentHeight:Qe,rendererKind:Oe}})(V,{rendererKind:ke,monacoOptions:s.codeBlockMonacoOptions,showHeader:((ye=s.codeBlockProps)==null?void 0:ye.showHeader)!==!1})}var ye;return null})});function Iu(x){var D;const V=hs[x];if(Number.isFinite(V)&&V>0)return V;const Y=(D=Lr.value[x])==null?void 0:D.height;return Number.isFinite(Y)&&Y>0?Y:Math.max(Uo.value,(function(J){var he,ye,ke,Le,Se,Pe,Oe,Me,Re,Ue,We,rt,Qe;const Ze=Ke.value[J];if(!Ze||typeof Ze!="object")return 32;const at=String((he=Ze.type)!=null?he:""),ct=cs()||640;switch(at){case"heading":return 44;case"paragraph":return yl(String((ke=(ye=Ze.raw)!=null?ye:Ze.content)!=null?ke:""),ct,34);case"list":{const ht=Array.isArray(Ze.items)?Ze.items.length:1;return Math.max(48,30*ht+12)}case"list_item":return yl(String((Se=(Le=Ze.raw)!=null?Le:Ze.content)!=null?Se:""),ct,34);case"blockquote":return yl(String((Oe=(Pe=Ze.raw)!=null?Pe:Ze.content)!=null?Oe:""),ct,56);case"table":{const ht=Array.isArray(Ze.rows)?Ze.rows.length:Array.isArray(Ze.children)?Ze.children.length:3;return Math.max(120,38*ht+48)}case"code_block":return yl(String((Re=(Me=Ze.code)!=null?Me:Ze.raw)!=null?Re:""),ct,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return yl(String((We=(Ue=Ze.raw)!=null?Ue:Ze.content)!=null?We:""),ct,96);case"thematic_break":return 24;default:return yl(String((Qe=(rt=Ze.raw)!=null?rt:Ze.content)!=null?Qe:""),ct,40)}})(x))}function yl(x,D,V,Y=22){const J=String(x??"");if(!J)return V;const he=Math.max(18,Math.floor(Math.max(320,D)/8)),ye=J.split(/\r?\n/).length,ke=Math.ceil(J.length/he),Le=Math.max(1,ye,ke);return Math.max(V,Math.ceil(Le*Y+12))}function La(x){const D=Number(x);return!Number.isFinite(D)||D<=0?-1:Math.round(D/32)}function ap(){var x,D;const V=Ke.value.length,Y=La(G.value||Ve("getFallbackHeightPrefix.clientWidth",()=>{var ke;return((ke=T.value)==null?void 0:ke.clientWidth)||0})),J=((x=s.virtualScroll)==null?void 0:x.measurementKey)==null?"":String(s.virtualScroll.measurementKey),he=[V,ps.count,Math.round(ps.total),Math.round(100*Uo.value),J,Y,Vt.value?1:0,nw.value,q.value].join(":");if(!np&&d0===he)return u0;const ye=new Array(V+1);ye[0]=0;for(let ke=0;ke<V;ke++)ye[ke+1]=ye[ke]+(Vt.value?Iu(ke):(D=hs[ke])!=null?D:Uo.value);return u0=ye,d0=he,np=!1,ye}function _0(x){var D,V;const Y=Ke.value.length;if(Y<=0||x<=0)return 0;const J=ap();if(x>=((D=J[Y])!=null?D:0))return Y-1;let he=0,ye=Y-1,ke=Y-1;for(;he<=ye;){const Le=he+ye>>1;((V=J[Le+1])!=null?V:0)>=x?(ke=Le,ye=Le-1):he=Le+1}return ke}function Wi(x,D){var V,Y;if(x>=D)return 0;if(Vt.value)return(function(ye,ke){var Le,Se;const Pe=Ke.value.length,Oe=zn(Math.trunc(ye),0,Pe),Me=zn(Math.trunc(ke),Oe,Pe);if(Oe>=Me)return 0;const Re=ap();return((Le=Re[Me])!=null?Le:0)-((Se=Re[Oe])!=null?Se:0)})(x,D);if($a.value!==Ke.value.length){let ye=0;for(let ke=x;ke<D;ke++)ye+=(V=hs[ke])!=null?V:Uo.value;return ye}const J=Qh.value,he=Jh.value;if(!J.length||!he.length){let ye=0;for(let ke=x;ke<D;ke++)ye+=(Y=hs[ke])!=null?Y:Uo.value;return ye}return Su(J,x,D)+(D-x-Su(he,x,D))*Uo.value}ze(()=>Ke.value.length,x=>{fo(),x<=0?Cu():(x<$a.value&&H3(x),x!==$a.value&&wu(x))},{immediate:!0});const G3=j(()=>{if(!gt.value)return Ke.value.map((Y,J)=>({node:Y,index:J}));const x=Ke.value.length,D=zn(jn.start,0,x),V=zn(jn.end,D,x);return Ke.value.slice(D,V).map((Y,J)=>({node:Y,index:D+J}))}),cp=j(()=>gt.value?Wi(0,Math.min(jn.start,Ke.value.length)):0),up=j(()=>{if(!gt.value)return 0;const x=Ke.value.length;return Wi(Math.min(jn.end,x),x)});function w0(){if(!Vt.value)return 0;let x=0;const D=Lr.value;for(let V=0;V<D.length;V++){if(!D[V])continue;const Y=hs[V];Number.isFinite(Y)&&Y>0||x++}return x}function S0(){const x=Ke.value.length;return{totalNodes:x,measuredCount:ps.count,estimatedCount:w0(),averageNodeHeight:Uo.value,topSpacerHeight:cp.value,bottomSpacerHeight:up.value,estimatedTotalHeight:Wi(0,x),width:Or()}}function Y3(){const x=Ke.value,D=S0();return Ct(et({},D),{probe:{paragraphReady:!!K.value.paragraph,listItemReady:!!K.value.listItem,listWrapperOverhead:K.value.listWrapperOverhead,headingReadyLevels:Object.entries(K.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:x.map((V,Y)=>{var J,he,ye,ke,Le,Se,Pe,Oe,Me;return{index:Y,type:V.type,estimateKind:(he=(J=Lr.value[Y])==null?void 0:J.kind)!=null?he:null,rendererKind:(ke=(ye=Lr.value[Y])==null?void 0:ye.rendererKind)!=null?ke:null,estimatedHeight:(Se=(Le=Lr.value[Y])==null?void 0:Le.height)!=null?Se:null,estimatedContentHeight:(Oe=(Pe=Lr.value[Y])==null?void 0:Pe.contentHeight)!=null?Oe:null,measuredHeight:(Me=hs[Y])!=null?Me:null}})})}function dp(){return s.indexKey!=null?String(s.indexKey):on.value?`virtual-${an()}`:"markdown-renderer"}function C0(x){const D=String(x),V=`${dp()}-`;if(!D.startsWith(V))return null;const Y=D.slice(V.length).match(/^(\d+)(?:$|-)/);if(!Y)return null;const J=Number(Y[1]);return!Number.isInteger(J)||J<0||J>=Ke.value.length?null:J}function an(){var x,D,V;const Y=(x=s.virtualScroll)==null?void 0:x.sessionKey;return String(Y!=null&&Y!==""?Y:(V=(D=s.indexKey)!=null?D:s.customId)!=null?V:ft)}function On(){var x;const D=(x=s.virtualScroll)==null?void 0:x.threadKey;return D==null||D===""?void 0:String(D)}function fp(x){var D;return(x??"")===((D=On())!=null?D:"")}function X3(){var x;const D=(x=s.virtualScroll)==null?void 0:x.measurementKey;return D==null?"":String(D)}function Z3(){const x=l.value,D=x==="monaco"?s.codeBlockMonacoOptions:void 0,V=s.codeBlockProps;return[s.isDark?"dark":"light",x==="monaco"?"code-rich":x==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",Fn(s.codeBlockMinWidth),Fn(s.codeBlockMaxWidth),Fn(D?.fontSize),Fn(D?.lineHeight),Fn(D?.fontFamily),Fn(D?.tabSize),Fn(D?.MAX_HEIGHT),Fn(D?.wordWrap),Fn(D?.wrappingIndent),Fn(D?.padding),Fn(V?.showHeader),Fn(V?.showCopyButton),Fn(V?.showExpandButton),Fn(V?.showPreviewButton),Fn(V?.showCollapseButton),Fn(V?.showFontSizeButtons)].join("\0")}function ci(){return[X3(),Z3()].join("\0")}function Or(){return cs()}const Nu=j(()=>La(Or())),Vs=j(()=>[ci(),Nu.value].join("\0")),Q3=j(()=>{var x;return on.value?["virtual",(x=On())!=null?x:"",an(),Vs.value].join("\0"):s.indexKey});function kl(){c0.value+=1}function hp(x){return!(!x||!Number.isInteger(x.index)||x.index<0||x.index>=Ke.value.length||x.sessionKey!==an()||x.threadKey!==On()||x.layoutEpochKey!==Vs.value)}function x0(x){const D=String(x),V=jo.get(D);return V?hp(V)?V.index:null:C0(D)}function T0(x="async-node"){(js.size||jo.size)&&(js.clear(),jo.clear(),kl(),nn(x))}const bl=Nt(Kg,null),pp={reportHeight(x,D){if(!wt.value)return;const V=x0(x);if(V==null)return;const Y=qo.get(V);if(!Y)return;const J=Number(D),he=s0(V,Y);n0(V,Number.isFinite(J)&&J>0?Math.max(J,he||0):he)},markPending(x){if(!wt.value)return;const D=C0(x);D!=null&&(function(V,Y){var J;const he=jo.get(V);if(he&&hp(he))return js.set(V,Math.max(0,(J=js.get(V))!=null?J:0)+1),kl(),void nn("async-node");js.set(V,1),jo.set(V,(function(ye){return{index:ye,sessionKey:an(),threadKey:On(),layoutEpochKey:Vs.value}})(Y)),kl(),nn("async-node")})(String(x),D)},markSettled(x){if(!wt.value)return;const D=String(x),V=x0(x);(V!=null||(function(Y){return js.has(String(Y))})(D))&&(function(Y){var J;const he=(J=js.get(Y))!=null?J:0;return!(he<=0||(he<=1?(js.delete(Y),jo.delete(Y)):js.set(Y,he-1),kl(),he===1&&nn("async-node"),0))})(D)&&V!=null&&ui()}};function J3(){let x=0;for(const D of qo.values())x+=Ve("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=D?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,x))}cn(Kg,{reportHeight(x,D){pp.reportHeight(x,D),bl?.reportHeight(x,D)},markPending(x){pp.markPending(x),bl?.markPending(x)},markSettled(x){pp.markSettled(x),bl?.markSettled(x)}});let mp,gp=null,_l=null;function Lu(x){return x!==!1&&x!=null&&x!==""}function M0(){return gt.value?(function(){if(!gt.value)return!0;const x=Ke.value.length,D=zn(jn.start,0,x),V=zn(jn.end,D,x);if(D>=V)return!0;for(let Y=D;Y<V;Y++)if(!gn.has(Y)||Dp(Y)&&!qo.has(Y))return!1;return!0})():yt.value>=Tu.value}function vp(){return ne.value===!0&&!se.value&&tp.value===0&&Fi.size===0&&ai.size===0&&zs==null&&M0()}function A0(){var x,D;if(((x=s.virtualScroll)==null?void 0:x.settleMode)!=="manual"||gp===an()&&mp===On())return!0;const V=(D=s.virtualScroll)==null?void 0:D.settledToken;return!!Lu(V)&&_l===Ka(V)}function yp(){return vp()&&A0()}function eM(x,D){return D.totalNodes<=0?x==="final"?"final":"estimate":D.measuredCount>=D.totalNodes?x==="final"?"final":"measured":D.measuredCount>0||D.estimatedCount>0?"mixed":"estimate"}function Rr(x="manual",D){const V=S0(),Y=(function(J){return J||(ne.value!==!0?Ke.value.length>0?"streaming":"estimating":!M0()||ai.size>0||zs!=null?"measuring":yp()?"settled":"settling")})(D);return{sessionKey:an(),threadKey:On(),phase:Y,nodeCount:V.totalNodes,liveRange:{start:jn.start,end:jn.end},renderedCount:yt.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:J3(),totalHeight:E0(),width:V.width,final:ne.value===!0,stable:yp(),confidence:eM(Y,V),reason:x}}function Oa(){const x=Er.value||de(),D=T.value;if(!x||!D)return null;const V=x.ownerDocument||D.ownerDocument||document,Y=x===V.documentElement||x===V.body||x===V.scrollingElement,J=Ve("getScrollBox.scrollTop",()=>Z(x,V,Y)),he=Ve("getScrollBox.scrollHeight",()=>{var ke,Le,Se,Pe,Oe;return Y?Math.max((Le=(ke=V.documentElement)==null?void 0:ke.scrollHeight)!=null?Le:0,(Pe=(Se=V.body)==null?void 0:Se.scrollHeight)!=null?Pe:0,(Oe=x.scrollHeight)!=null?Oe:0):x.scrollHeight}),ye=Ve("getScrollBox.clientHeight",()=>{var ke;return Y?((ke=V.documentElement)==null?void 0:ke.clientHeight)||x.clientHeight||0:x.clientHeight});return{root:x,doc:V,isViewportRoot:Y,scrollTop:J,scrollHeight:he,clientHeight:ye}}function E0(){const x=Ke.value.length,D=Math.max(0,Wi(0,x)),V=Ve("getRendererLogicalHeight.offsetHeight",()=>{var J,he;return(he=(J=T.value)==null?void 0:J.offsetHeight)!=null?he:0}),Y=Math.max(0,V>0?V:Ve("getRendererLogicalHeight.scrollHeight",()=>{var J,he;return(he=(J=T.value)==null?void 0:J.scrollHeight)!=null?he:0}));return x<=0?Math.ceil(V):gt.value?D>0?Math.max(1,Math.ceil(D),(function(){let J=cp.value+up.value;for(const he of gn.values())he&&(J+=Math.max(0,Ve("getVirtualizedDomLogicalHeight.offsetHeight",()=>he.offsetHeight||0)));return Math.ceil(Math.max(0,J))})(),(function(J,he){return J<=0||he<=0?0:he<=J+Math.max(512,.05*J)?Math.ceil(he):0})(D,Y)):Math.max(1,Math.ceil(Y)):wt.value?D>0||ps.count>0||w0()>0?(tt.value&&yt.value,Math.max(1,Math.ceil(Y),Math.ceil(D))):Math.ceil(Y):Math.max(1,Math.ceil(Y),Math.ceil(D))}function $0(x){const D=T.value;if(!D)return null;const V=Ve("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>D.getBoundingClientRect());return(function(J){return J.isViewportRoot?J.clientHeight:Ve("getViewportBottomInRoot.getBoundingClientRect",()=>J.root.getBoundingClientRect().bottom)})(x)-V.bottom}function tM(x={}){const D=x.requireViewport!==!1,V=(function(he=64){const ye=Oa(),ke=T.value;if(!ye||!ke)return!1;const Le=(function(Pe){if(Pe.isViewportRoot)return{top:0,bottom:Pe.clientHeight};const Oe=Ve("getVirtualViewportRect.getBoundingClientRect",()=>Pe.root.getBoundingClientRect());return{top:Oe.top,bottom:Oe.bottom}})(ye),Se=Ve("isRendererNearVirtualViewport.getBoundingClientRect",()=>ke.getBoundingClientRect());return Se.bottom>=Le.top-he&&Se.top<=Le.bottom+he})();if(D&&!V)return null;const Y=(function(){const he=Oa(),ye=T.value;if(!he||!ye||Math.max(0,he.scrollHeight-he.scrollTop-he.clientHeight)>64)return null;const ke=$0(he);return ke==null?null:ke>=-8&&ke<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,ke)}:null})();if(Y)return{anchor:Y,captured:!0};const J=ae();if(J)return{anchor:{type:"node",nodeIndex:J.nodeIndex,offsetWithinNodePx:J.offsetWithinNodePx},captured:V};if(x.allowFallback===!0){const he=(function(){const ye=Ke.value.length;return ye<=0?null:{type:"node",nodeIndex:zn(uo.value,0,Math.max(0,ye-1)),offsetWithinNodePx:0}})();return he?{anchor:he,captured:!1}:null}return null}function kp(x){let D=2166136261;for(let V=0;V<x.length;V++)D^=x.charCodeAt(V),D=Math.imul(D,16777619);return(D>>>0).toString(36)}function nM(x,D){let V=x;for(let Y=0;Y<D.length;Y++)V^=D.charCodeAt(Y),V=Math.imul(V,16777619);return V^=31,V=Math.imul(V,16777619),V}const sM=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Ou(x,D=new WeakSet,V=0){if(x==null||typeof x=="number"||typeof x=="boolean")return String(x);if(typeof x=="string")return`s:${(function(Y){const J=Y.length>8192?`${Y.slice(0,8192)}...${Y.length}`:Y;return`${Y.length}:${kp(J)}`})(x)}`;if(typeof x=="function")return"fn";if(typeof x!="object")return typeof x;if(D.has(x))return"cycle";if(V>=6)return"max-depth";D.add(x);try{if(Array.isArray(x)){if(x.length<=160){const Se=[];for(let Pe=0;Pe<x.length;Pe++)Se.push(Ou(x[Pe],D,V+1));return`a:${x.length}:${Se.join(",")}`}const he=[],ye=[],ke=Math.max(0,x.length-32);let Le=2166136261;for(let Se=0;Se<x.length;Se++){const Pe=Ou(x[Se],D,V+1);Le=nM(Le,Pe),Se<32&&he.push(Pe),Se>=ke&&ye.push(Pe)}return[`a:${x.length}`,`h=${he.join(",")}`,`t=${ye.join(",")}`,`all=${(Le>>>0).toString(36)}`].join(":")}const Y=x,J=Object.keys(Y).filter(he=>{const ye=Y[he];return he!=="parent"&&he!=="el"&&he!=="component"&&(ye==null||typeof ye=="string"||typeof ye=="number"||typeof ye=="boolean"||sM.has(he))}).sort();return`o:${J.length}:${J.map(he=>`${he}=${Ou(Y[he],D,V+1)}`).join(";")}`}finally{D.delete(x)}}let I0=-1,bp="";function Ra(x){const D=Ke.value[x];return D?kp(Ou(D)):""}function _p(){const x=q.value;if(I0===x)return bp;let D=2166136261;for(let V=0;V<Ke.value.length;V++){const Y=Ra(V);for(let J=0;J<Y.length;J++)D^=Y.charCodeAt(J),D=Math.imul(D,16777619)}return bp=(D>>>0).toString(36),I0=x,bp}function wl(x,D={}){var V;const Y=D.includeHeightCache===!0,J=(V=D.includeContentHash)!=null?V:Y,he=Y?(function(ke){const Le=(function(){var We,rt;const Qe=Number((rt=(We=s.virtualScroll)==null?void 0:We.heightCacheLimit)!=null?rt:5e3);return!Number.isFinite(Qe)||Qe<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(Qe))})();if(!Number.isFinite(Le)||ke.length<=Le)return ke;const Se=new Map,Pe=We=>{!We||Se.size>=Le||Se.set(We.index,We)},Oe=Ke.value.length,Me=zn(jn.start-2*Ia.value,0,Oe),Re=zn(jn.end+2*Ia.value,Me,Oe);for(const We of ke)We.index>=Me&&We.index<Re&&Pe(We);const Ue=Math.max(1,Math.ceil(ke.length/Le));for(let We=0;We<ke.length&&Se.size<Le;We+=Ue)Pe(ke[We]);for(let We=ke.length-1;We>=0&&Se.size<Le;We-=Ue)Pe(ke[We]);return Array.from(Se.values()).sort((We,rt)=>We.index-rt.index).slice(0,Le)})(q3().map(ke=>{var Le;const Se=Ke.value[ke.index];return Se?Ct(et({},ke),{nodeType:String((Le=Se.type)!=null?Le:""),signature:Ra(ke.index)}):null}).filter(ke=>!!ke)):[],ye=tM({allowFallback:D.allowAnchorFallback===!0,requireViewport:D.requireViewport});return ye||he.length||D.includeEmptyState===!0?Ct(et({sessionKey:x.sessionKey,threadKey:x.threadKey},ye?{anchor:ye.anchor,anchorCaptured:ye.captured}:{anchorCaptured:!1}),{metrics:x,width:x.width,contentHash:J?_p():void 0,measurementKey:ci()||void 0,heightCache:he.length?he:void 0}):null}function wp(x){var D,V;const Y=Oa();if(!Y)return;const J=(function(ke){const Le=T.value;if(!Le)return null;const Se=fe(Le,ke.root),Pe=Ke.value.length,Oe=Ve("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Le.offsetHeight||0),Me=Math.max(0,Oe>0?Oe:Pe>0?Ve("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Le.scrollHeight||0):0),Re=E0();return Se+Math.max(Me,Re)})(Y);if(J==null)return;const he=Math.max(0,x.distanceFromBottomPx),ye=Math.max(0,J-Y.clientHeight-he);(function(ke){Aa=Ha()+120,$r=ke})(ye),Y.isViewportRoot?(V=(D=Y.doc.defaultView)==null?void 0:D.scrollTo)==null||V.call(D,0,ye):iw(Y.root,Y.doc,ye,{isReverseFlexScrollRoot:z,getNormalizedScrollTop:Z})}const Sp=[];function N0(){if(pe)for(li!=null&&(ln?.(li),li=null);Sp.length;){const x=Sp.pop();x!=null&&window.clearTimeout(x)}}function Sl(x){const D=!!fs.value;fs.value=null,Aa=0,$r=null,N0(),D&&x&&nn(x)}function Cl(){if(!fs.value||!pe||li!=null)return;const x=()=>{li=null;const D=fs.value;D&&wp(D)};li=tn?tn(x):null,li==null&&x()}function L0(x,D={}){const V=Ke.value.length;return V<=0?[]:x.filter(Y=>!(!Number.isInteger(Y.index)||Y.index<0||Y.index>=V)&&!(!Number.isFinite(Y.height)||Y.height<=0)&&!(D.requireSignature&&!Y.signature)&&!(D.requireCompatibilityMetadata&&!Y.nodeType&&!Y.signature)&&(function(J){var he;const ye=Ke.value[J.index];return!(!ye||J.nodeType&&J.nodeType!==String((he=ye.type)!=null?he:"")||J.signature&&J.signature!==Ra(J.index))})(Y))}function O0(x){const D=La(Or()),V=La(x);return D!==-1&&V!==-1&&D===V}function Cp(x){var D;const V=Number(x?.width);if(Number.isFinite(V)&&V>0)return V;const Y=Number((D=x?.metrics)==null?void 0:D.width);return Number.isFinite(Y)&&Y>0?Y:null}function R0(x){var D;return x.sessionKey===an()&&!!fp(x.threadKey)&&((D=x.measurementKey)!=null?D:"")===ci()&&!!O0(Cp(x))&&!!(function(V){const Y=V.heightCache;return!!Y?.length&&(P0(V)?Y.some(J=>!!(J.nodeType||J.signature)):Y.some(J=>!!J.signature))})(x)}function P0(x){return!!(x.contentHash&&x.contentHash===_p())}function oM(x){return!P0(x)}let Pr=null,Dr=null,Ru=null,Pa=null,Da=null;function xp(x){var D;const V=x.map(J=>{var he,ye;return[J.index,Math.round(10*J.height),(he=J.nodeType)!=null?he:"",(ye=J.signature)!=null?ye:""].join("")}).join(""),Y=La(Or());return[(D=On())!=null?D:"",an(),ci(),Ke.value.length,Y,x.length,kp(V)].join(":")}function D0(x=(D=>(D=s.virtualScroll)==null?void 0:D.heightCache)()){if(!wt.value||!x?.length||Ke.value.length<=0||!O0((D=s.virtualScroll)==null?void 0:D.heightCacheWidth))return!1;var D;const V=L0(x,{requireSignature:!0});if(!V.length)return!1;const Y=xp(V);return Y===Pr?(Dr="standalone",!0):(o0(V,{mode:"merge"}),fo(),Pr=Y,Dr="standalone",Ua(),nn("restore"),!0)}function Tp(x,D={}){var V,Y,J;if(!wt.value||!x||x.sessionKey!==an()||!fp(x.threadKey)||Ke.value.length<=0)return!1;const he=!!((V=x.heightCache)!=null&&V.length)&&!Pu(),ye=!x.anchor||x.anchorCaptured===!1&&D.allowUncapturedAnchor!==!0?null:x.anchor,ke=D.restoreAnchor===!0&&!!ye&&!Pu()&&Number(Cp(x))>0;let Le=!1;if((Y=x.heightCache)!=null&&Y.length&&R0(x)){const Pe=L0(x.heightCache,{requireCompatibilityMetadata:!x.contentHash,requireSignature:oM(x)});Pe.length&&(o0(Pe,{mode:"merge"}),fo(),Pr=xp(Pe),Dr="restore",Ua(),Le=!0)}if(he||ke)return!1;if(!D.restoreAnchor||!ye)return Le&&nn("restore"),!0;const Se=(function(Pe,Oe){var Me;const Re=Pe.anchor,Ue=Re?Re.type==="bottom"?`bottom:${Math.round(Re.distanceFromBottomPx)}`:`node:${Re.nodeIndex}:${Math.round(Re.offsetWithinNodePx)}`:"none";return[(Me=On())!=null?Me:"",an(),ci(),Nu.value,Oe,Ue].join(":")})(x,(J=D.restoreToken)!=null?J:"imperative");return Ru===Se?(Le&&nn("restore"),!0):(Ru=Se,(function(Pe){const Oe=()=>{if(Pe.type==="node")return Sl(),void Te({nodeIndex:Pe.nodeIndex,offsetWithinNodePx:Pe.offsetWithinNodePx});if(gl(),Pi.value=null,fs.value=Pe,N0(),wp(Pe),pe)for(const Me of[0,120,280,480])Sp.push(window.setTimeout(()=>{const Re=fs.value;Re&&wp(Re)},Me))};(function(Me){if(!gt.value)return!1;const Re=Ke.value.length;return!(Re<=0||(uo.value=Me.type==="node"?zn(Me.nodeIndex,0,Re-1):Re-1,Ir(),0))})(Pe)?ut(Oe):Oe()})(ye),nn("restore"),!0)}function Pu(){const x=Or();return Number.isFinite(x)&&x>0}function B0(x){var D;return x.sessionKey===an()&&!!fp(x.threadKey)&&(Ke.value.length<=0||!(!((D=x.heightCache)!=null&&D.length)||Pu())||!(!(x.anchor&&Number(Cp(x))>0)||Pu()))}function Mp(){ds.clear();for(const x of Object.keys(hs)){const D=Number(x);Number.isInteger(D)&&D>=0&&D<Ke.value.length&&t0(D)}}function Ba(){zs!=null&&(ln?.(zs),zs=null),Bp()}function F0(){return!pe||ve?Promise.resolve():new Promise(x=>{let D=!1,V=null;const Y=()=>{D||(D=!0,V!=null&&window.clearTimeout(V),x())};if(tn)return tn(Y),void(V=window.setTimeout(Y,50));V=window.setTimeout(Y,0)})}function Ap(x,D=On(),V=Vs.value){return an()===x&&On()===D&&Vs.value===V}function Ep(){return dn(this,arguments,function*(x={}){var D,V,Y,J,he;const ye=an(),ke=On(),Le=Vs.value,Se=(D=x.frames)!=null?D:2,Pe=(V=x.timeoutMs)!=null?V:120,Oe=(Y=x.reason)!=null?Y:"manual",Me=x.expectedSettledTokenKey,Re=x.flushPendingTimers===!0,Ue=Rr(Oe),We=()=>Ct(et({},Ue),{phase:Ue.final?"settling":Ue.phase,stable:!1,confidence:Ue.confidence==="final"?"mixed":Ue.confidence,reason:Oe}),rt=()=>Ap(ye,ke,Le)&&(Me==null||Wa()===Me);for(let ct=0;ct<Se;ct++){if(yield ut(),!rt()||(yield F0(),!rt()))return We();ui(),Ba()}if(yield(function(ct){return!pe||ct<=0?Promise.resolve():new Promise(ht=>window.setTimeout(ht,ct))})(Pe),!rt()||(Re&&h0(),ui(),Ba(),!rt()))return We();const Qe=vp();Qe&&(gp=ye,mp=ke,((J=s.virtualScroll)==null?void 0:J.settleMode)==="manual"&&Me!=null&&Lu((he=s.virtualScroll)==null?void 0:he.settledToken)&&Wa()===Me&&(_l=Ka(s.virtualScroll.settledToken)));const Ze=rt()&&Qe&&A0(),at=Rr(Oe,Ze?"final":void 0);return Op(at,!0),at})}let $p="content",Br=null,Fr=null,Ip=0,Fa=null,xl=null,Np=null,Lp=null;function Ha(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function H0(x){var D,V;const Y=Fa;if(!Y)return!0;const J=(V=(D=s.virtualScroll)==null?void 0:D.heightDiffThresholdPx)!=null?V:1;return Math.abs(x.totalHeight-Y.totalHeight)>J||x.sessionKey!==Y.sessionKey||x.phase!==Y.phase||x.stable!==Y.stable||x.final!==Y.final||x.threadKey!==Y.threadKey||x.nodeCount!==Y.nodeCount||x.measuredCount!==Y.measuredCount||x.width!==Y.width}function Fn(x){if(x==null)return"";if(typeof x=="string"||typeof x=="number"||typeof x=="boolean")return String(x);try{return JSON.stringify(x)}catch{return String(x)}}function Wa(x=(D=>(D=s.virtualScroll)==null?void 0:D.settledToken)()){return Fn(x)}function W0(x,D){var V,Y;return[x,D.sessionKey,(V=D.threadKey)!=null?V:"",ci(),_p(),Fn((Y=s.virtualScroll)==null?void 0:Y.settledToken),Math.round(D.totalHeight),Math.round(D.width)].join("\0")}function Ua(){Np=null,Lp=null,xl=null}function iM(x){const D=x.heightCache;return D?.length?xp(D):""}function qa(x){var D,V,Y;const J=x.metrics,he=x.anchor?(ye=x.anchor).type==="bottom"?`bottom:${Math.round(ye.distanceFromBottomPx)}`:`node:${ye.nodeIndex}:${Math.round(ye.offsetWithinNodePx)}`:"none";var ye;return[x.sessionKey,(D=x.threadKey)!=null?D:"",(V=x.measurementKey)!=null?V:ci(),(Y=x.contentHash)!=null?Y:"",iM(x),he,x.anchorCaptured?1:0,J.liveRange.start,J.liveRange.end,J.renderedCount,J.nodeCount,Math.round(J.totalHeight),Math.round(J.width),J.phase,J.stable?1:0].join("\0")}function Op(x,D=!1){if(!wt.value||(function(ye=!1){return!ye&&on.value&&!as.value})(D))return;const V=D||H0(x),Y=(function(ye,ke=!1){return ke||ye.stable||ye.phase==="final"?{state:wl(ye,{includeHeightCache:!0})}:{state:wl(ye)}})(x,D),J=Y.state,he=!!(J&&(V||(function(ye,ke=!1){return!!ke||qa(ye)!==xl})(J,D)));if(V&&(I(x),Fa=x,Ip=Ha()),J&&he&&(E(J),J.anchor&&S(J.anchor),xl=qa(J)),x.stable){const ye=W0("settled",x);if(ye!==Np){Np=ye;const ke=wl(x,{includeHeightCache:!0});ke&&(E(ke),xl=qa(ke)),(function(Le){o("render-settled",Le)})(x)}}if(x.phase==="final"){const ye=W0("final",x);if(ye!==Lp){Lp=ye;const ke=wl(x,{includeHeightCache:!0});ke&&(E(ke),xl=qa(ke)),(function(Le){o("render-final",Le)})(x)}}}function Rp(){Br!=null&&(ln?.(Br),Br=null),Fr!=null&&pe&&(window.clearTimeout(Fr),Fr=null)}function U0(){Br=null,Fr=null,(function(x){if(ai.size>0||zs!=null)return!0;switch(x){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})($p)&&(ui(),Ba()),Op(Rr($p))}function nn(x){var D,V;if(!wt.value||($p=x,Br!=null||Fr!=null))return;const Y=Math.max(0,(V=(D=s.virtualScroll)==null?void 0:D.emitIntervalMs)!=null?V:32),J=Math.max(0,Y-(Ha()-Ip)),he=()=>{Fr=null,Br=tn?tn(U0):null,Br==null&&U0()};pe&&J>0?Fr=window.setTimeout(he,J):he()}function Pp(x){var D;if(x<=0)return 0;const V=Ke.value;if(Vt.value)return _0(x);if($a.value===V.length&&Qh.value.length&&Jh.value.length){const J=Uo.value,he=Qh.value,ye=Jh.value,ke=Oe=>Oe<=0?0:Su(he,0,Oe)+(Oe-Su(ye,0,Oe))*J;let Le=0,Se=V.length-1,Pe=V.length-1;for(;Le<=Se;){const Oe=Le+Se>>1;ke(Oe+1)>=x?(Pe=Oe,Se=Oe-1):Le=Oe+1}return Pe}let Y=x;for(let J=0;J<V.length;J++){const he=(D=hs[J])!=null?D:Uo.value;if(Y<=he)return J;Y-=he}return Math.max(0,V.length-1)}function q0(){bu.value+=1}function Dp(x){return!(tt.value&&x>=yt.value)&&(!Di.value||x<Ae.value||op.value.has(x))}function Tl(x){const D=Eu.get(x);D&&(D(),Eu.delete(x));const V=vl.get(x);V&&(V.destroy(),vl.delete(x)),$u(x)}function j0(x,D){let V=!1;if(D){const he=gn.get(x);gn.set(x,D),he!==D&&(V=!0)}else gn.delete(x)&&(V=!0);if(V&&q0(),D||$u(x),!i0.value||!us||!gt.value&&Di.value&&!B.value&&vl.size>=640&&(B.value||(B.value=!0,ip()),!i0.value||!us))return Tl(x),void(D&&Hi(x,!0));if(x<Ae.value&&!gt.value||op.value.has(x))return Tl(x),void Hi(x,!0);if(!D)return void Tl(x);Tl(x);const Y=us(D,{rootMargin:"400px"});if(!Y)return;vl.set(x,Y),Hi(x,Y.isVisible.value),Di.value&&(function(he){if(!pe||!Di.value)return;$u(he);const ye=he%17*23,ke=window.setTimeout(()=>{if(p0.delete(he),!Di.value||op.value.has(he))return;const Le=gn.get(he);if(!Le)return;const Se=de(Le),Pe=Le.ownerDocument||document,Oe=Pe.defaultView||window,Me=!Se||Se===Pe.documentElement||Se===Pe.body,Re=!Me&&Se?Ve("nodeVisibilityFallback.root.getBoundingClientRect",()=>Se.getBoundingClientRect()):null,Ue=Me?0:Re.top,We=Me?Ve("nodeVisibilityFallback.clientHeight",()=>{var Qe,Ze;return(Ze=(Qe=Oe.innerHeight)!=null?Qe:Se?.clientHeight)!=null?Ze:0}):Re.bottom,rt=Ve("nodeVisibilityFallback.node.getBoundingClientRect",()=>Le.getBoundingClientRect());rt.bottom>=Ue-500&&rt.top<=We+500&&Hi(he,!0)},1800+ye);p0.set(he,ke)})(x);let J=null;J=ze(()=>Y.isVisible.value,he=>{if(he){$u(x),Hi(x,!0),J?.(),Eu.delete(x),vl.get(x)===Y&&vl.delete(x);try{Y.destroy()}catch{}}},{immediate:!0}),Eu.set(x,J),gt.value&&zo()}function Bp(){zs=null;for(const[x,D]of ai)ai.delete(x),qo.get(x)===D.el&&Nr.get(x)===D.version&&n0(x,D.height,{allowShrink:D.allowShrink})}function Ml(){zs!=null&&(ln?.(zs),zs=null),ai.clear()}function Du(x,D){(function(V,Y,J){var he;if(!Number.isFinite(J)||J<=0||qo.get(V)!==Y)return;const ye=Nr.get(V);if(ye==null)return;const ke=Ke.value[V],Le=se.value&&ne.value!==!0&&!((he=s.nodes)!=null&&he.length)&&V>=Ke.value.length-2,Se=!(ke?.loading===!0||Le),Pe=ai.get(V),Oe=Pe?Pe.allowShrink&&Se:Se,Me=Pe&&!Oe?Math.max(Pe.height,J):J;ai.set(V,{height:Me,allowShrink:Oe,version:ye,el:Y}),zs==null&&(zs=tn?tn(Bp):null,zs==null&&Bp())})(x,D,s0(x,D))}function ui(){for(const[x,D]of qo)D&&Du(x,D)}function z0(){co?.disconnect(),co=null,ao.clear()}function Fp(){for(;xu.length;)Au(xu.pop())}ze(as,x=>{x&&nn("content")},{flush:"post"}),t({getVirtualMetrics:Rr,captureVirtualState:function(x={}){var D;return wl(Rr("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:x.allowFallbackAnchor===!0,requireViewport:x.requireViewport===!0,includeEmptyState:(D=x.includeEmptyState)==null||D})},restoreVirtualState:function(x,D={}){const V=D.restoreAnchor===!0,Y=D.restoreToken==null?"imperative":String(D.restoreToken);Pa=x,Da={restoreAnchor:V,restoreToken:Y,allowUncapturedAnchor:D.allowUncapturedAnchor===!0},!Tp(x,{restoreAnchor:V,restoreToken:Y,allowUncapturedAnchor:D.allowUncapturedAnchor===!0})&&B0(x)||(Pa=null,Da=null)},forceMeasure:function(x="manual"){return dn(this,null,function*(){yield ut(),yield F0(),ui(),Ba(),yield ut();const D=Rr(x);return Op(D,!0),D})},settle:Ep,scrollToNode:function(x,D="start"){Sl(),gl();const V=Ke.value.length;if(V<=0)return;const Y=zn(x,0,V-1),J=()=>{var he;const ye=Ea({nodeIndex:Y,offsetWithinNodePx:0}),ke=Iu(Y),Le=Oa(),Se=(he=Le?.clientHeight)!=null?he:0,Pe=Zh();let Oe=ye;if(D==="center")Oe=ye-Se/2+ke/2;else if(D==="end")Oe=ye-Se+ke;else if(D==="nearest"&&Pe!=null){if(ye>=Pe&&ye+ke<=Pe+Se)return;Oe=ye<Pe?ye:ye-Se+ke}_u(Math.max(0,Oe)),zo({immediate:!0}),gt.value&&(uo.value=Y,Ir())};if(gt.value)return uo.value=Y,Ir(),void ut(J);J()}}),ze(()=>Ms.value,x=>{if(!x){z0();for(const D of Bi.values())for(const V of D)Au(V);Bi.clear(),Nr.clear(),Fp(),Ml()}},{immediate:!0}),ze(ne,x=>{x&&(function(){if(pe&&ne.value&&qo.size){Fp();for(const D of[80,240,640]){const V=f0(D,()=>{for(const[Y,J]of qo)J&&Du(Y,J)},"final");V!=null&&xu.push(V)}}})(),nn(x?"final":"content")}),ze([()=>Ke.value.length,()=>yt.value],()=>{fs.value&&Cl(),nn("content")},{flush:"post",immediate:!0}),ze([()=>jn.start,()=>jn.end],()=>{nn("batch")},{flush:"post"});const{cleanupBatchScheduler:rM}=(function(x){const{props:D,isClient:V,isTestEnv:Y,parsedNodesIdentity:J,parsedNodeCount:he,desiredRenderedCount:ye,datasetKey:ke,batchingEnabled:Le,incrementalRenderingActive:Se,resolvedBatchSize:Pe,resolvedInitialBatch:Oe,renderedCount:Me,adaptiveBatchSize:Re,previousRenderContext:Ue,previousBatchConfig:We,requestFrame:rt,cancelFrame:Qe,hasIdleCallback:Ze,cleanupNodeVisibility:at,onDatasetKeyChanged:ct,onDatasetChanged:ht}=x;let lt=null,kt=null,bt=!1,Lt=null,ms=null,gs=0,Io=!1,Ui=!1;const qi=new Set,Wr=new Set;function oy(){if(V){lt!=null&&(Qe?.(lt),lt=null),kt!=null&&(window.clearTimeout(kt),kt=null),ms!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(ms),ms=null),gs+=1;for(const Jn of qi)Qe?.(Jn);qi.clear();for(const Jn of Wr)window.clearTimeout(Jn);Wr.clear(),bt=!1,Lt=null,Io=!1,Ui=!1}}function ju(){return typeof performance<"u"?performance.now():Date.now()}function iy(Jn){(function(di){var ji;if(!Se.value)return;const fi=Math.max(2,(ji=D.renderBatchBudgetMs)!=null?ji:6),hi=Math.max(1,Pe.value||1),No=Math.max(1,Math.floor(hi/4));di>1.2*fi?Re.value=Math.max(No,Math.floor(.7*Re.value)):di<.5*fi&&Re.value<hi&&(Re.value=Math.min(hi,Math.ceil(1.2*Re.value)))})(Jn),Io=!1;const As=Ui||Me.value<ye.value;Ui=!1,As&&ay()}function ry(Jn,As={}){var di,ji;if(!Se.value)return;const fi=ye.value;if(Me.value>=fi)return;const hi=Math.max(1,Jn),No=()=>{const $l=ju();let Il=0;lt=null,kt=null,ms=null,bt=!1;const Nl=Lt??hi;Lt=null;const Vp=ju();Me.value=Math.min(fi,Me.value+Nl),at(Me.value),Il=ju()-Vp,(function(Kp,cy){if(!V)return void iy(cy);Io=!0;const uy=++gs;ut().then(()=>{var dy;if(uy!==gs)return;const TM=ju(),MM=Math.max(cy,TM-Kp),fy=()=>{uy===gs&&iy(MM)};if(rt){let py=!1,pi=null;const my=()=>{py||(py=!0,fy())},zu=rt(()=>{qi.delete(zu),pi!=null&&(window.clearTimeout(pi),Wr.delete(pi),pi=null),my()});return qi.add(zu),pi=window.setTimeout(()=>{pi!=null&&Wr.delete(pi),pi=null,Qe?.(zu),qi.delete(zu),my()},Math.max(32,(dy=D.renderBatchIdleTimeoutMs)!=null?dy:120)),void Wr.add(pi)}const hy=window.setTimeout(()=>{Wr.delete(hy),fy()},0);Wr.add(hy)})})($l,Il)};if(!V||As.immediate)return void No();const zi=Math.max(0,(di=D.renderBatchDelay)!=null?di:16);if(Lt=Lt!=null?Math.max(Lt,hi):hi,!bt){if(bt=!0,!Y&&Ze&&window.requestIdleCallback){const $l=Math.max(0,(ji=D.renderBatchIdleTimeoutMs)!=null?ji:120);return void(ms=window.requestIdleCallback(()=>No(),{timeout:$l}))}rt&&!Y?lt=rt(()=>{zi!==0?kt=window.setTimeout(()=>No(),zi):No()}):kt=window.setTimeout(()=>No(),zi)}}function ly(Jn,As={}){Io?Ui=!0:Jn==null?ay():ry(Jn,As)}function ay(){Se.value&&ry(Le.value?Math.max(1,Math.round(Re.value)):Math.max(1,Pe.value))}return ze([J,he,ke,Se,Pe,Oe,()=>D.renderBatchDelay],()=>{var Jn;const As=he.value,di=Ue.value,ji=ke.value,fi=!Object.is(ji,di.key),hi=As!==di.total,No=fi||hi;Ue.value={key:ji,total:As};const zi=We.value,$l=(Jn=D.renderBatchDelay)!=null?Jn:16,Il=zi.batchSize!==Pe.value||zi.initial!==Oe.value||zi.delay!==$l||zi.enabled!==Se.value;We.value={batchSize:Pe.value,initial:Oe.value,delay:$l,enabled:Se.value},fi&&ct(As),(No||Il||!Se.value)&&oy(),(No||Il)&&(Re.value=Math.max(1,Pe.value||1)),No&&ht();const Nl=ye.value;if(!As)return Me.value=0,void at(0);if(!Se.value)return Me.value=Nl,void at(Me.value);const Vp=fi||di.total===0;Me.value=Vp||Il?Math.min(Nl,Oe.value):Math.min(Me.value,Nl);const Kp=Math.max(1,Oe.value||Pe.value||As);Me.value<Nl?ly(Kp,{immediate:!V}):at(Me.value)},{immediate:!0}),ze(ye,(Jn,As)=>{Se.value&&(typeof As=="number"&&Jn<=As||Jn>Me.value&&ly())}),{cleanupBatchScheduler:oy}})({props:k,isClient:pe,isTestEnv:ve,parsedNodesIdentity:Hs,parsedNodeCount:qn,desiredRenderedCount:Tu,datasetKey:Q3,batchingEnabled:Fe,incrementalRenderingActive:tt,resolvedBatchSize:ee,resolvedInitialBatch:Ae,renderedCount:yt,adaptiveBatchSize:mn,previousRenderContext:Pt,previousBatchConfig:Qn,requestFrame:tn,cancelFrame:ln,hasIdleCallback:Ee,cleanupNodeVisibility:V3,onDatasetKeyChanged:x=>{Ml(),Cu(),fo(),Ua(),x>0&&wu(x)},onDatasetChanged:()=>{gt.value&&zo({immediate:!0})}});ze([r0,gt,()=>T.value,()=>oe()],([x,D])=>{if(!x)return m0(),void sp();K3(),D?zo({immediate:!0}):sp()},{flush:"post",immediate:!0}),ze([()=>Ke.value.length,()=>gt.value],x=>dn(null,[x],function*([D,V]){V&&D&&pe&&(yield ut(),zo({immediate:!0}))}),{flush:"post"}),ze(Vt,x=>{x&&(function(){var D;if(Bn.value&&Ws.value&&Us.value&&((D=qs.value)!=null&&D[1]))return;const V=ir({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),Y=ir({type:"list_item",children:[V],raw:"- Probe paragraph text"}),J=ir({type:"list",ordered:!1,items:[Y],raw:"- Probe paragraph text"});Bn.value=V,Ws.value=Y,Us.value=J;const he={1:null,2:null,3:null,4:null,5:null,6:null};for(let ye=1;ye<=6;ye++)he[ye]=ir({type:"heading",level:ye,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ye)} Probe heading`});qs.value=he})()},{immediate:!0}),ze([()=>T.value,Vt],()=>{if(!Vt.value)return lp(),void(G.value=0);v0(),lp(),Vt.value&&T.value&&typeof ResizeObserver<"u"&&(Na=new ResizeObserver(()=>{v0(),Pi.value&&De(),fs.value&&Cl(),nn("resize")}),Na.observe(T.value))},{immediate:!0}),ze([Vt,xs,Vs],()=>dn(null,null,function*(){if(!Vt.value)return K.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void fo();yield ut(),(function(){if(!Vt.value||typeof window>"u")return K.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void fo();const x={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},D=g0(rp($.value),".paragraph-node");x.paragraph=jm($.value,D,"pre-wrap");const V=rp(L.value),Y=V?.querySelector(".paragraph-node");x.listItem=jm(L.value,Y,"pre-wrap");const J=Ve("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ye,ke;return(ke=(ye=R.value)==null?void 0:ye.offsetHeight)!=null?ke:0}),he=Ve("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ye,ke;return(ke=(ye=L.value)==null?void 0:ye.offsetHeight)!=null?ke:0});x.listWrapperOverhead=Math.max(0,J-he);for(let ye=1;ye<=6;ye++){const ke=g0(rp(O[ye]),`h${ye}`);x.headings[ye]=jm(O[ye],ke,"pre-wrap")}K.value=x,fo()})()}),{flush:"post",immediate:!0}),ze(()=>Ke.value.length,()=>{gt.value&&zo({immediate:!0})}),ze([Vt,G],()=>{fo(),gt.value&&zo({immediate:!0}),Pi.value&&De(),fs.value&&Cl(),nn("resize")},{immediate:!1}),ze(()=>Di.value,x=>{if(x)for(const[D,V]of gn)j0(D,V);else{ip();for(const[D,V]of gn)V&&Hi(D,!0)}},{immediate:!1}),ze([()=>s.viewportPriority,()=>Ke.value.length],([x,D])=>{x!==!1?B.value&&D<=200&&(B.value=!1):B.value=!1}),ze(()=>yt.value,()=>{gt.value&&zo({immediate:!0})}),ze([uo,Ts,Ia,()=>Ke.value.length,gt],()=>{Ir()},{immediate:!0});let ja=null,za=!1,Al=null;function Va(){ja=null,gp=null,mp=void 0,_l=null,Ua()}function Hp(){Ml(),Cu(),fo(),ds.clear();const x=Ke.value.length;x>0&&wu(x),Mp()}function Wp(){Rp(),h0(),Fa=null,Pr=null,Dr=null,Ru=null,Pa=null,Da=null,za=!1,Va(),T0("restore"),gl(),Sl()}function Ka(x){var D;return[(D=On())!=null?D:"",an(),ci(),Nu.value,Wa(x),Ke.value.length,Math.round(Wi(0,Ke.value.length)),Math.round(Or()),ps.count,Math.round(ps.total)].join(":")}function V0(){return dn(this,null,function*(){var x,D,V,Y;const J=(x=s.virtualScroll)==null?void 0:x.settledToken,he=Wa(J),ye=an(),ke=On(),Le=Vs.value;if(wt.value&&((D=s.virtualScroll)==null?void 0:D.settleMode)==="manual"&&Lu(J))if(vp()){if(Ka(J)!==_l&&!za){za=!0;try{const Se=yield Ep({reason:"manual",expectedSettledTokenKey:he}),Pe=Wa()===he;Ap(ye,ke,Le)&&Se.sessionKey===ye&&Se.threadKey===ke&&Pe&&Se.stable&&Se.phase==="final"&&(_l=Ka((V=s.virtualScroll)==null?void 0:V.settledToken))}finally{za=!1,yield ut();const Se=(Y=s.virtualScroll)==null?void 0:Y.settledToken,Pe=Lu(Se)?Ka(Se):"";Ap(ye,ke,Le)&&Pe&&_l!==Pe&&V0()}}}else nn("manual")})}ze(wt,(x,D)=>{if(x!==D){if(!x)return Wp(),void Rp();Wp(),Hp(),Al=Vs.value,nn("content")}},{flush:"post"}),ze([wt,Vs],([x,D])=>{x?Al!=null?Al!==D&&(Al=D,(function(V="resize"){Ml(),Cu(),fo(),ds.clear();const Y=Ke.value.length;Y>0&&wu(Y),Mp(),Pr=null,Dr=null,Ru=null,Fa=null,za=!1,Va(),D0(),ut(()=>{ui(),Pi.value&&De(),fs.value&&Cl(),nn(V)})})("resize")):Al=D:Al=null},{flush:"post",immediate:!0}),ze([wt,()=>an(),()=>On()],([x])=>{x&&(Wp(),Hp(),T0("content"),nn("content"))}),ze([wt,()=>an(),()=>On(),Vs,()=>Ke.value.length],([x])=>{x&&(function(D="async-node"){let V=!1;for(const[Y,J]of Array.from(jo.entries()))hp(J)||(jo.delete(Y),js.delete(Y),V=!0);V&&(kl(),nn(D))})("async-node")},{flush:"post"}),ze([wt,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.sessionKey},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>s.indexKey,()=>q.value],([x])=>{x&&(Ua(),(function(D="content"){if(!wt.value)return;const V=[],Y=Ke.value.length;for(const J of Array.from(ds.keys())){if(J>=Y){V.push(J);continue}const he=Ra(J),ye=ds.get(J);ye!=null&&ye!==he&&V.push(J),ds.set(J,he)}for(const J of Array.from(ds.keys()))J>=Y&&ds.delete(J);V.length&&((function(J,he={}){const ye=Array.from(J,Number);U3(ye,he)>0&&(function(Le){for(const Se of Le)ds.delete(Se)})(ye)})(V,{notify:!1}),fo(),Va(),Pi.value&&De(),fs.value&&Cl(),nn(D))})("content"))},{flush:"post",immediate:!0}),ze([wt,()=>Ke.value.length,()=>an(),()=>On()],([x,D,V,Y],[J,he,ye,ke])=>{x&&J&&V===ye&&Y===ke&&D!==he&&Va()},{flush:"post"}),ze([wt,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.heightCache},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.heightCacheWidth},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>Ke.value.length,()=>an(),G],()=>{D0()},{flush:"post",immediate:!0}),ze([wt,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreAnchor},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>Ke.value.length,()=>an(),G],x=>dn(null,[x],function*([D,V]){if(!D||!V)return;yield ut();const Y=(function(){var J;const he=(J=s.virtualScroll)==null?void 0:J.restoreAnchor;return he==null||he===!1?null:he===!0?"true":String(he)})();Tp(V,{restoreAnchor:Y!=null,restoreToken:Y??void 0})}),{flush:"post",immediate:!0}),ze([wt,G,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey}],([x])=>{var D;if(!x)return;const V=(D=s.virtualScroll)==null?void 0:D.restoreState;V&&Pr&&Dr==="restore"&&(R0(V)||(Hp(),Pr=null,Dr=null,nn("resize")))},{flush:"post"}),ze([wt,()=>Ke.value.length,()=>an(),G],x=>dn(null,[x],function*([D]){var V;const Y=Pa,J=Da;D&&Y&&(yield ut(),!Tp(Y,{restoreAnchor:J?.restoreAnchor===!0,restoreToken:(V=J?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:J?.allowUncapturedAnchor===!0})&&B0(Y)||(Pa=null,Da=null))}),{flush:"post",immediate:!0}),ze([wt,ne,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settleMode},()=>an(),()=>On(),Vs,tp,a0,()=>yt.value,Tu,()=>ps.count,()=>ps.total],([x,D,V])=>{if(!x||D!==!0||V==="manual"||!yp())return;const Y=(function(){var J;const he=Ke.value.length;return[(J=On())!=null?J:"",an(),ci(),Nu.value,he,Math.round(Wi(0,he)),Math.round(Or()),ps.count,Math.round(ps.total)].join(":")})();ja!==Y&&(ja=Y,Ep({reason:"final"}).then(J=>{J.stable||ja!==Y||(ja=null)}))},{flush:"post",immediate:!0}),ze([wt,ne,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settleMode},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settledToken},()=>an(),()=>On(),Vs,tp,a0,()=>yt.value,Tu,()=>Ke.value.length,()=>ps.count,()=>ps.total],()=>{V0()},{flush:"post",immediate:!0}),ze([()=>Ke.value.length,gt,Ts,Ia,()=>jn.start,()=>jn.end],([x,D,V,Y,J,he])=>{Be.value&&ge("virtualization",{nodes:x,virtualization:D,maxLiveNodes:V,buffer:Y,focusIndex:uo.value,scroll:D?(()=>{const ye=Er.value||de();return ye?{reverse:z(ye),scrollTop:Math.round(ye.scrollTop),scrollTopAbs:Math.round(Math.abs(ye.scrollTop)),scrollHeight:Math.round(ye.scrollHeight),clientHeight:Math.round(ye.clientHeight)}:null})():null,liveRange:{start:J,end:he},rendered:yt.value})}),ze([()=>s.customId],([x],D,V)=>{if(!x||Ho)return;const Y=(function(J,he){return J?(Rn.controllers[J]=he,()=>{Rn.controllers[J]===he&&delete Rn.controllers[J]}):()=>{}})(x,{captureRestoreAnchor:ae,restoreAnchor:Te,getAnchorDrift:Et,getReport:Y3});V(()=>{Y()})},{immediate:!0}),oo(()=>{(function(){if(wt.value)try{ui(),Ba();const x=Rr("manual");H0(x)&&(I(x),Fa=x,Ip=Ha());const D=wl(x,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});D&&(E(D),D.anchor&&S(D.anchor),xl=qa(D))}catch{}})(),rM(),ip(),Q(),z0();for(const x of Bi.values())for(const D of x)Au(D);Bi.clear(),Nr.clear(),ds.clear(),Fp(),Ml(),lp(),gl(),Sl(),Rp(),m0(),sp()});const lM=ei({loader:()=>dn(null,null,function*(){try{return(yield Xs(()=>import("./index11-zgOWkVRq.js"),__vite__mapDeps([6,3]))).default}catch(x){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',x),ko}}),loadingComponent:zH,delay:0}),aM=ei({loader:()=>dn(null,null,function*(){try{return(yield Xs(()=>import("./index10-ba-WIDTg.js"),[])).default}catch(x){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',x),ko}}),loadingComponent:jH,delay:0}),cM=ei(()=>dn(null,null,function*(){try{return(yield Xs(()=>import("./index7-wMYBQdIV.js"),[])).default}catch(x){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',x),ko}})),K0={text:_n,paragraph:ll,heading:Rf,code_block:Pm,list:fa,list_item:da,blockquote:Pd,table:Nc,definition_list:Dd,footnote:Bd,footnote_reference:eo,footnote_anchor:$c,admonition:Ud,vmr_container:Hd,hardbreak:fr,link:Ss,image:dr,thematic_break:Fd,math_inline:Fo,math_block:pT,strong:_s,emphasis:Cs,strikethrough:ws,highlight:no,insert:Ds,subscript:Ps,superscript:Rs,emoji:Os,checkbox:Js,checkbox_input:Js,inline_code:rs,html_inline:to,reference:bs,html_block:Ic},uM=j(()=>dp()),G0=j(()=>et(et({stream:k.codeBlockStream,darkTheme:s.codeBlockDarkTheme,lightTheme:s.codeBlockLightTheme,monacoOptions:s.codeBlockMonacoOptions,themes:s.themes,minWidth:s.codeBlockMinWidth,maxWidth:s.codeBlockMaxWidth},typeof He.value=="boolean"?{showTooltips:He.value}:{}),s.codeBlockProps||{}));function Y0(x){return typeof x=="boolean"?x:void 0}const dM=j(()=>{const x=s.codeBlockProps||{},D={},V=Y0(x.showLineNumbers);V!==void 0&&(D.showLineNumbers=V);const Y=Y0(x.diffInline);Y!==void 0&&(D.diffInline=Y);const J=(function(he){const ye=Number(he);return Number.isFinite(ye)&&ye>0?ye:void 0})(x.reservedHeightPx);return J!==void 0&&(D.reservedHeightPx=J),D}),fM=j(()=>{const x=s.codeBlockProps||{};return et(et({stream:k.codeBlockStream,darkTheme:s.codeBlockDarkTheme,lightTheme:s.codeBlockLightTheme,themes:s.themes,minWidth:s.codeBlockMinWidth,maxWidth:s.codeBlockMaxWidth},typeof He.value=="boolean"?{showTooltips:He.value}:{}),x)}),hM=j(()=>et({},s.mermaidProps||{})),pM=j(()=>et({},s.d2Props||{})),mM=j(()=>et({},s.infographicProps||{})),Ga=j(()=>({typewriter:s.typewriter,fade:k.fade,customHtmlTags:xn.value.customHtmlTags})),gM=j(()=>et(et({},Ga.value),typeof He.value=="boolean"?{showTooltip:He.value}:{})),vM=j(()=>et(et({},Ga.value),typeof He.value=="boolean"?{showTooltips:He.value}:{})),yM=j(()=>et(et({},Ga.value),typeof He.value=="boolean"?{showTooltips:He.value}:{})),kM=j(()=>et(et({},Ga.value),typeof He.value=="boolean"?{showTooltips:He.value}:{}));function bM(x){return Array.isArray(x.children)&&x.children.length>0}const Up=j(()=>G3.value.map(x=>{var D,V,Y,J,he,ye,ke,Le;let Se=(function(Qe){var Ze,at,ct,ht,lt,kt,bt;if(Qe.type!=="code_block")return Qe;const Lt=Qe,ms=[String((Ze=Lt.language)!=null?Ze:""),String((at=Lt.loading)!=null?at:""),String((ct=Lt.diff)!=null?ct:""),String((ht=Lt.code)!=null?ht:""),String((lt=Lt.originalCode)!=null?lt:""),String((kt=Lt.updatedCode)!=null?kt:""),String((bt=Lt.raw)!=null?bt:"")].join("\0"),gs=Ar.get(Lt);if(gs&&gs.signature===ms)return gs.node;const Io=et({},Lt);return Ar.set(Lt,{signature:ms,node:Io}),Io})(x.node);const Pe=Bu(Se);let Oe=Z0(Se,Pe);if((Se.type==="html_block"||Se.type==="html_inline")&&Oe===K0[Se.type]){const Qe=Se,Ze=String((D=Qe.tag)!=null?D:"").trim().toLowerCase()||px(Qe.content);if(Ze){const at=Ht.value[Ze];if(Nn.value.has(Ze)&&at)Oe=at,Se=Ct(et({},Qe),{type:Ze,tag:Ze,content:zR(Qe.content,Ze)});else if(mx((V=Qe.content)!=null?V:Qe.raw,Ze)){const ct=String((J=(Y=Qe.content)!=null?Y:Qe.raw)!=null?J:"");Se.type==="html_inline"?(Oe=_n,Se={type:"text",content:ct,raw:ct}):(Oe=ll,Se={type:"paragraph",children:[{type:"text",content:ct,raw:ct}],raw:ct})}}}const Me=X0(Se,Pe,Oe);let Re=et({},(function(Qe,Ze,at){const ct=Ze??Bu(Qe);return at&&X0(Qe,ct,at)?dM.value:Qe.type==="code_block"&&(function(ht){return!!(ht&&ht===Ht.value.code_block)})(at)?G0.value:Qe.type==="code_block"&&k0(at)?fM.value:ct==="mermaid"?hM.value:ct==="infographic"?mM.value:ct==="d2"||ct==="d2lang"?pM.value:Qe.type==="link"?gM.value:Qe.type==="list"?vM.value:Qe.type==="blockquote"?yM.value:Qe.type==="table"?kM.value:Qe.type==="code_block"?G0.value:Ga.value})(Se,Pe,Oe));const Ue=Lr.value[x.index];Se.type==="code_block"&&Ue?.kind==="code-block"&&(Re=Ct(et({},Re),Me?{reservedHeightPx:(he=Ue.height)!=null?he:Ue.contentHeight}:{estimatedHeightPx:Ue.height,estimatedContentHeightPx:Ue.contentHeight})),Me||Se.type!=="code_block"||Pe!=="mermaid"||Df(Re.estimatedPreviewHeightPx)!=null||(Re=Ct(et({},Re),{estimatedPreviewHeightPx:ST(bT(String((ye=Se.code)!=null?ye:"")))})),Me||Se.type!=="code_block"||Pe!=="infographic"||Df(Re.estimatedPreviewHeightPx)!=null||(Re=Ct(et({},Re),{estimatedPreviewHeightPx:CT(_T(String((ke=Se.code)!=null?ke:"")))})),Se.type==="math_block"&&(Re=Ct(et({},Re),{cacheScope:Zt.value}));const We=(function(Qe,Ze){const at=String(Qe.type);return!gu(at)&&Ht.value[at]===Ze})(Se,Oe),rt=We?$v(Se,Ne.value):void 0;return Ct(et({},x),{node:Se,component:Oe,bindings:Re,customBindings:et(et({},rt??{}),Re),rendersCustomNode:We,hasSlotChildren:bM(Se),slotContent:String((Le=Se.content)!=null?Le:""),isCodeBlock:Se.type==="code_block",indexKey:`${uM.value}-${x.index}`})}));function Bu(x){var D;return x?.type==="code_block"?String((D=x.language)!=null?D:"").trim().toLowerCase():""}function X0(x,D,V){return x.type==="code_block"&&l.value==="pre"&&!(function(Y){return!!(Y&&Ht.value[Y])})(D)&&V===ko}function Z0(x,D){if(!x)return i1;const V=Ht.value,Y=V[String(x.type)];if(x.type==="code_block"){const J=D??Bu(x),he=J?V[J]:void 0;return he||(l.value==="pre"?V.code_block||ko:J==="mermaid"?V.mermaid||lM:J==="infographic"?V.infographic||aM:J==="d2"||J==="d2lang"?V.d2||cM:Y||V.code_block||b0.value)}return Y||K0[String(x.type)]||i1}function qp(x){o("click",x)}function _M(x){var D;(D=x.target)!=null&&D.closest("[data-node-index]")&&o("mouseover",x)}function wM(x){var D;(D=x.target)!=null&&D.closest("[data-node-index]")&&o("mouseout",x)}function Q0(x){o("mouseover",x)}function J0(x){o("mouseout",x)}const Hr=te(null),Vo=te(!1);let Ya,El=null,jp=0,Fu=0,Hu=0;const ey=["code_block","admonition","table","math_block","html_block","image","thematic_break"],SM=new Set(ey),ty=[".typewriter-cursor",".height-estimation-probes",...ey.map(x=>`[data-node-type="${x}"]`),"script","style"].join(",");function ny(x){if(!x||typeof x!="object")return!1;const D=x.type;return typeof D=="string"&&SM.has(D)}function Wu(x){var D,V;if(!x||typeof x!="object")return 0;const Y=x,J=(V=(D=Y.raw)!=null?D:Y.content)!=null?V:Y.code;if(typeof J=="string")return J.length;const he=Y.children;if(Array.isArray(he))return he.reduce((ke,Le)=>ke+Wu(Le),0);const ye=Y.items;return Array.isArray(ye)?ye.reduce((ke,Le)=>ke+Wu(Le),0):0}function Uu(){Ya&&(clearTimeout(Ya),Ya=void 0)}function sy(){jp+=1,El!=null&&(ln?.(El),El=null)}function qu(){sy(),Hr.value&&(Hr.value.style.visibility="hidden")}function CM(x){var D;if(x.nodeType!==Node.TEXT_NODE||!((D=x.textContent)!=null?D:"").trim())return!1;const V=x.parentElement;return!!V&&!V.closest(ty)}function xM(x){let D=x.lastChild;for(;D;){if(CM(D))return D;if(D.nodeType===Node.ELEMENT_NODE){const V=D;if(!V.matches(ty)&&V.lastChild){D=V.lastChild;continue}}for(;D&&D!==x&&!D.previousSibling;)D=D.parentNode;if(!D||D===x)break;D=D.previousSibling}return null}function zp(){if(!pe||!Vo.value||El!=null)return;const x=jp,D=()=>{El=null,x===jp&&(function(){var V,Y;if(!(pe&&Vo.value&&T.value&&Hr.value))return;const J=T.value,he=Hr.value;he.style.visibility="hidden";const ye=(function(){const Oe=Up.value;for(let Me=Oe.length-1;Me>=0;Me--){const Re=Oe[Me];if(!Re||ny(Re.node)||!Dp(Re.index))continue;const Ue=gn.get(Re.index);if(!Ue)continue;const We=xM(Ue);if(We)return We}return null})();if(!ye)return;let ke=0,Le=0,Se=20,Pe=!1;if(ye?.textContent){const Oe=ye.textContent.length,Me=document.createRange();Me.setStart(ye,Math.max(0,Oe-1)),Me.setEnd(ye,Oe);const Re=typeof Me.getClientRects=="function"?Me.getClientRects():void 0,Ue=(Y=Re?.[Re.length-1])!=null?Y:(V=ye.parentElement)==null?void 0:V.getBoundingClientRect();if(Ue){const We=Ve("typewriterCursor.root.getBoundingClientRect",()=>J.getBoundingClientRect());ke=Ue.right-We.left+J.scrollLeft,Le=Ue.top-We.top+J.scrollTop,Se=Ue.height||Se,Pe=!0}Me.detach()}Pe&&(he.style.transform=`translate(${Math.max(0,ke)}px, ${Math.max(0,Le)}px)`,he.style.height=`${Se}px`,he.style.visibility="visible")})()};tn?El=tn(D):D()}return ze([X,()=>s.content,()=>s.nodes,()=>s.typewriter,ne],()=>dn(null,null,function*(){var x,D;if(!pe||be.value||!_e.value)return;if(ne.value)return Vo.value=!1,Uu(),void qu();if((x=s.nodes)!=null&&x.length)return Vo.value=!1,Uu(),qu(),Fu=((D=s.content)!=null?D:"").length,void(Hu=X.value.length);const V=(function(){var ke,Le;return(ke=s.nodes)!=null&&ke.length?s.nodes.reduce((Se,Pe)=>Se+Wu(Pe),0):((Le=s.content)!=null?Le:"").length})(),Y=(function(){var ke;return(ke=s.nodes)!=null&&ke.length?s.nodes.reduce((Le,Se)=>Le+Wu(Se),0):X.value.length})(),J=!ny(Ke.value[Ke.value.length-1]),he=V>Fu,ye=Y>Hu;if(s.typewriter===!1||!J||!he&&!ye)return s.typewriter!==!1&&J||(Vo.value=!1,qu()),Fu=V,void(Hu=Y);Fu=V,Hu=Y,Vo.value=!0,Hr.value&&(Hr.value.style.visibility="hidden"),Uu(),yield ut(),zp(),Ya=setTimeout(()=>{Ya=void 0,Vo.value=!1},3e3)}),{flush:"post",immediate:!0}),ze(Vo,x=>dn(null,null,function*(){x?(yield ut(),zp()):qu()}),{flush:"post"}),ze([()=>yt.value,()=>jn.start,()=>jn.end],()=>dn(null,null,function*(){pe&&!be.value&&_e.value&&Vo.value&&(yield ut(),zp())}),{flush:"post"}),oo(()=>{Uu(),sy(),xt.clear()}),(x,D)=>{const V=QA("NodeRenderer",!0);return M(be)?(C(!0),A(Ie,{key:0},Ye(Up.value,Y=>(C(),A(Ie,{key:Y.index},[Y.rendersCustomNode?(C(),qe(os(Y.component),Kt({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":s.customId,"is-dark":s.isDark,onClick:qp,onMouseover:Q0,onMouseout:J0,onCopy:D[0]||(D[0]=J=>o("copy",J)),onHandleArtifactClick:D[1]||(D[1]=J=>o("handleArtifactClick",J))}),{default:kn(()=>[Y.hasSlotChildren?(C(),qe(V,Kt({key:0,ref_for:!0},en.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(C(),qe(V,Kt({key:1,ref_for:!0},en.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),qe(os(Y.component),Kt({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":s.customId,"is-dark":s.isDark,onClick:qp,onMouseover:Q0,onMouseout:J0,onCopy:D[2]||(D[2]=J=>o("copy",J)),onHandleArtifactClick:D[3]||(D[3]=J=>o("handleArtifactClick",J))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(C(),A("div",{key:1,ref_key:"containerRef",ref:T,class:$e(["markstream-vue markdown-renderer",[{dark:s.isDark},{virtualized:gt.value},{"virtual-scroll-coordinated":as.value}]]),"data-custom-id":s.customId,onClick:qp,onMouseover:_M,onMouseout:wM},[lo.value||gt.value?(C(),A(Ie,{key:0},[lo.value?(C(),A("div",{key:0,class:"height-estimation-probes",style:It({width:`${xs.value}px`}),"aria-hidden":"true"},[h("div",{ref_key:"paragraphProbeWrapperRef",ref:$,class:"node-content","data-probe":"paragraph"},[pt(M(ll),{node:Bn.value,"index-key":"probe-paragraph"},null,8,["node"])],512),h("div",{ref_key:"listItemProbeWrapperRef",ref:L,class:"node-content","data-probe":"list-item"},[h("ul",KH,[pt(M(da),{node:Ws.value,"index-key":"probe-list-item"},null,8,["node"])])],512),h("div",{ref_key:"listProbeWrapperRef",ref:R,class:"node-content","data-probe":"list"},[pt(M(fa),{node:Us.value,"index-key":"probe-list"},null,8,["node"])],512),(C(),A(Ie,null,Ye(6,Y=>h("div",{key:`probe-heading-${Y}`,ref_for:!0,ref:J=>(function(he,ye){he<1||he>6||(O[he]=ye)})(Y,J),class:"node-content","data-probe":`heading-${Y}`},[pt(M(Rf),{node:z3(Y),"index-key":`probe-heading-${Y}`},null,8,["node","index-key"])],8,GH)),64))],4)):re("",!0),gt.value?(C(),A("div",{key:1,class:"node-spacer",style:It({height:`${cp.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],64)):re("",!0),(C(!0),A(Ie,null,Ye(Up.value,Y=>(C(),A("div",{key:Y.index,ref_for:!0,ref:J=>j0(Y.index,J),class:"node-slot","data-node-index":Y.index,"data-node-type":Y.node.type},[Dp(Y.index)?(C(),A("div",{key:0,ref_for:!0,ref:J=>(function(he,ye){var ke;ye||(function(Oe){const Me=`${dp()}-${Oe}`;let Re=!1;for(const Ue of Array.from(js.keys())){const We=jo.get(Ue);(We?.index===Oe||Ue===Me||Ue.startsWith(`${Me}-`))&&(js.delete(Ue),jo.delete(Ue),Re=!0)}Re&&(kl(),nn("async-node"))})(he),ai.delete(he),(function(Oe){var Me;const Re=((Me=Nr.get(Oe))!=null?Me:0)+1;Nr.set(Oe,Re)})(he);const Le=Bi.get(he);if(Le){for(const Oe of Le)Au(Oe);Bi.delete(he)}if((function(Oe){const Me=ao.get(Oe);Me&&(co?.unobserve(Me),Ri.delete(Me),ao.delete(Oe))})(he),!ye||!Ms.value)return qo.delete(he),void Nr.delete(he);qo.set(he,ye);const Se=()=>{Du(he,ye)};queueMicrotask(Se);const Pe=(co||typeof ResizeObserver>"u"||(co=new ResizeObserver(Oe=>{if(Oe.length)for(const Me of Oe){const Re=Ri.get(Me.target),Ue=ao.get(Re??-1);Re!=null&&Ue&&Du(Re,Ue)}else ui()})),co);if(Pe&&(ao.set(he,ye),Ri.set(ye,he),Pe.observe(ye)),typeof window<"u"){const Oe=((ke=Ke.value[he])==null?void 0:ke.type)==="code_block"?[16,80,240,800]:ne.value?[80]:[];if(Oe.length){const Me=Oe.map(Re=>f0(Re,Se,"node-resize")).filter(Re=>Re!=null);Me.length&&Bi.set(he,Me)}}})(Y.index,J),class:"node-content"},[Y.isCodeBlock?Y.rendersCustomNode?(C(),qe(os(Y.component),Kt({key:1,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":s.customId,"is-dark":s.isDark,onCopy:D[8]||(D[8]=J=>o("copy",J)),onHandleArtifactClick:D[9]||(D[9]=J=>o("handleArtifactClick",J))}),{default:kn(()=>[Y.hasSlotChildren?(C(),qe(V,Kt({key:0,ref_for:!0},en.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(C(),qe(V,Kt({key:1,ref_for:!0},en.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),qe(os(Y.component),Kt({key:2,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":s.customId,"is-dark":s.isDark,onCopy:D[10]||(D[10]=J=>o("copy",J)),onHandleArtifactClick:D[11]||(D[11]=J=>o("handleArtifactClick",J))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(C(),qe(Ti,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:kn(()=>[Y.rendersCustomNode?(C(),qe(os(Y.component),Kt({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":s.customId,"is-dark":s.isDark,onCopy:D[4]||(D[4]=J=>o("copy",J)),onHandleArtifactClick:D[5]||(D[5]=J=>o("handleArtifactClick",J))}),{default:kn(()=>[Y.hasSlotChildren?(C(),qe(V,Kt({key:0,ref_for:!0},en.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(C(),qe(V,Kt({key:1,ref_for:!0},en.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),qe(os(Y.component),Kt({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":s.customId,"is-dark":s.isDark,onCopy:D[6]||(D[6]=J=>o("copy",J)),onHandleArtifactClick:D[7]||(D[7]=J=>o("handleArtifactClick",J))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(C(),A("div",{key:1,class:"node-placeholder",style:It({height:`${Iu(Y.index)}px`})},null,4))],8,YH))),128)),Vo.value?(C(),A("span",{key:1,ref_key:"typewriterCursorRef",ref:Hr,class:"typewriter-cursor","aria-hidden":"true"},null,512)):re("",!0),gt.value?(C(),A("div",{key:2,class:"node-spacer",style:It({height:`${up.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],42,VH))}}})),[["__scopeId","data-v-661c7a50"]]),Bs=NT;Bs.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Bs.__name,Bs.name].filter(n=>!!n));for(const n of t)e.component(n,NT)};const Dv=Object.freeze(Object.defineProperty({__proto__:null,default:Bs},Symbol.toStringTag,{value:"Module"})),XH={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},ZH={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},QH={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},JH={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},eW={class:"admonition-title"},tW=["aria-expanded","aria-controls"],nW=["id"],Ud=zt(Xe({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=j(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=te(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(C(),A("div",{class:$e(["admonition",[`admonition-${s.node.kind}`]])},[h("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(C(),A("svg",XH,[...u[1]||(u[1]=[h("circle",{cx:"12",cy:"12",r:"10"},null,-1),h("path",{d:"M12 16v-4"},null,-1),h("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(C(),A("svg",ZH,[...u[2]||(u[2]=[h("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),h("path",{d:"M9 18h6"},null,-1),h("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(C(),A("svg",QH,[...u[3]||(u[3]=[h("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),h("path",{d:"M12 9v4"},null,-1),h("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(C(),A("svg",JH,[...u[4]||(u[4]=[h("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),h("path",{d:"M12 8v4"},null,-1),h("path",{d:"M12 16h.01"},null,-1)])])):re("",!0),h("span",eW,N(i.value),1),s.node.collapsible?(C(),A("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(C(),A("svg",{style:It({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[h("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,tW)):re("",!0)]),At(h("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[pt(M(Bs),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,nW),[[Ro,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Ud.install=e=>{e.component(Ud.__name,Ud)};const LT=()=>Xs(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let kd=null,sW=LT;function Afe(){return dn(this,null,function*(){if(kd)return kd;const e=sW;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===LT?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(kd=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),kd):null})}function Efe(){return!1}function $fe(){return dn(this,null,function*(){return null})}const bd=te(!1);let mw=!1;function Vm(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function oW(){return!mw&&typeof window<"u"&&typeof document<"u"&&(mw=!0,bd.value=Vm(),new MutationObserver(()=>{bd.value=Vm()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{bd.value=Vm()})),bd}const OT=["cjs","css","csv","gif","htm","html","jpeg","jpg","js","json","jsx","log","md","mjs","pdf","png","scss","svg","ts","tsx","txt","vue","webp","xml","yaml","yml"],iW=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),u1=[...OT].sort((e,t)=>t.length-e.length).join("|"),Km=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${u1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${u1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),RT=/[),.;!?,。;!?)]+$/;function rW(e){const t=e.toLowerCase();return OT.some(n=>t.endsWith(`.${n}`))}function lW(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${u1}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function aW(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace(RT,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=iW.has(i),a=rW(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function cW(e,t={}){const n=[];Km.lastIndex=0;let s;for(;(s=Km.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace(RT,""),u=a.length-c.length;a=c;const d=aW(a,t);if(!d)continue;const p=s.index+r,m=p+a.length;n.push({...d,start:p,end:m,text:a}),u>0&&(Km.lastIndex-=u)}return n}const uW=12e4,dW=6e4,fW=32,hW=3e4,gw=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function pW(e){let t=0,n=0,s=0;gw.lastIndex=0;let o;for(;(o=gw.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=uW||n>=dW||t>=fW||s>=hW?"pre":"shiki",codeFenceCount:t,codeChars:n}}const mW={key:1,class:"diff-wrap"},gW={class:"diff-bar"},vW=["title","onClick"],yW={class:"diff-pre"},kW="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",vw="github-light",yw="github-dark",bW=Xe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){const{t}=_t(),n=Nt("resolveImage"),s=te(null),o=e,i=j(()=>!o.streaming),r=j(()=>lW(o.text??"")),l=j(()=>o.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:pW(o.text??"")),a=oW(),c=j(()=>!o.streaming),u=Ys(new Map),d=new Set,p=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,m=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function f(O){return!/^(https?:|data:|blob:)/i.test(O)}function v(O){if(!n)return;const B=[];for(const F of[p,m]){F.lastIndex=0;let q;for(;(q=F.exec(O))!==null;)B.push(q[2]??"")}for(const F of B)!F||!f(F)||u.has(F)||d.has(F)||(d.add(F),n(F).then(q=>{u.set(F,q!==F?q:"")}).catch(()=>{u.set(F,"")}).finally(()=>{d.delete(F)}))}function w(O){if(!n)return O;const B=F=>{if(!f(F))return null;const q=u.get(F);return q===void 0?kW:q===""?null:q};return O.replace(p,(F,q,G,K)=>{const oe=B(G);return oe===null?F:`${q}${oe}${K}`}).replace(m,(F,q,G,K)=>{const oe=B(G);return oe===null?F:`${q}${oe}${K}`})}ze(()=>o.text,O=>v(O??""),{immediate:!0});function b(){if(!s.value||!o.openFile||o.streaming)return;const O=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),B=[];let F=O.nextNode();for(;F;){const q=F,G=q.parentElement;G&&!G.closest("a, pre, .md-file-link")&&q.data.trim().length>0&&B.push(q),F=O.nextNode()}for(const q of B){const G=cW(q.data,{aliases:r.value});if(G.length===0||!q.parentNode)continue;const K=document.createDocumentFragment();let oe=0;for(const le of G){le.start>oe&&K.append(document.createTextNode(q.data.slice(oe,le.start)));const pe=document.createElement("button");pe.type="button",pe.className="md-file-link",pe.textContent=le.text,pe.title=le.line?`${le.path}:${le.line}`:le.path,pe.addEventListener("click",be=>{be.preventDefault(),be.stopPropagation(),o.openFile?.({path:le.path,line:le.line})}),K.append(pe),oe=le.end}oe<q.data.length&&K.append(document.createTextNode(q.data.slice(oe))),q.parentNode.replaceChild(K,q)}}function _(O){return!(!O||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(O))}function g(O){let B=O.length;for(const F of["#","?"]){const q=O.indexOf(F);q!==-1&&q<B&&(B=q)}return O.slice(0,B)}function y(){if(!s.value||!o.openFile||o.streaming)return;const O=s.value.querySelectorAll("a[href]");for(const B of O){if(B.dataset.mdLinkHandled==="true")continue;const F=B.getAttribute("href")??"";_(F)&&(B.dataset.mdLinkHandled="true",B.addEventListener("click",q=>{q.preventDefault(),q.stopPropagation(),o.openFile?.({path:g(F)})}))}}function k(){ut().then(()=>{b(),y()})}ze(()=>o.text,k),ze(()=>o.streaming,k);let I=null;Jt(()=>{k(),s.value&&(I=new MutationObserver(k),I.observe(s.value,{childList:!0,subtree:!0}))}),qt(()=>{I?.disconnect()});const E={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},S=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,T=j(()=>{const O=w(o.text??""),B=[];let F=0;S.lastIndex=0;let q;for(;(q=S.exec(O))!==null;){const K=q[1]??"",oe=O.slice(F,q.index)+(K||"");oe.trim()&&B.push({kind:"md",text:oe}),B.push({kind:"diff",code:q[2]??""}),F=S.lastIndex}const G=O.slice(F);return(G.trim()||B.length===0)&&B.push({kind:"md",text:G}),B});function $(O){return O.split(`
|
|
219
|
+
`).map(B=>/^\+(?!\+\+)/.test(B)?{cls:"diff-add",text:B}:/^-(?!--)/.test(B)?{cls:"diff-del",text:B}:B.startsWith("@@")?{cls:"diff-hunk",text:B}:{cls:"diff-ctx",text:B})}const L=te(null);function R(O,B){navigator.clipboard.writeText(O).then(()=>{L.value=B,setTimeout(()=>{L.value=null},1400)}).catch(()=>{})}return(O,B)=>(C(),A("div",{ref_key:"mdRef",ref:s,class:"md"},[(C(!0),A(Ie,null,Ye(T.value,(F,q)=>(C(),A(Ie,{key:q},[F.kind==="md"?(C(),qe(M(Bs),{key:0,content:F.text,mode:"chat","code-renderer":l.value.codeRenderer,"is-dark":M(a),"code-block-light-theme":vw,"code-block-dark-theme":yw,themes:[vw,yw],"code-block-props":E,final:i.value,"smooth-streaming":e.streaming,"batch-rendering":c.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(C(),A("div",mW,[h("div",gW,[B[0]||(B[0]=h("span",{class:"diff-lang"},"diff",-1)),h("button",{class:"diff-copy",title:M(t)("filePreview.copyCode"),onClick:G=>R(F.code,q)},N(L.value===q?"✓":"⧉"),9,vW)]),h("pre",yW,[h("code",null,[(C(!0),A(Ie,null,Ye($(F.code),(G,K)=>(C(),A("span",{key:K,class:$e(G.cls)},N(G.text),3))),128))])])]))],64))),128))],512))}}),Ff=vt(bW,[["__scopeId","data-v-9786e921"]]),_W={class:"tc-anim"},wW={class:"prev-anim"},SW={class:"prev"},CW=Xe({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=j(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=j(()=>n.foldable&&o.value.length>1),r=j(()=>n.streaming||!i.value),l=j(()=>o.value.pop()??""),a=te(null);return Jt(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),ze(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||ut(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(C(),A("div",{class:$e(["think",{mob:e.mobile}])},[i.value?(C(),A("div",{key:0,class:$e(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[h("div",_W,[h("pre",{ref_key:"bodyEl",ref:a,class:"tc"},N(e.text),513)]),h("div",wW,[h("span",SW,N(l.value),1)])],2)):(C(),A("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},N(e.text),513))],2))}}),kw=vt(CW,[["__scopeId","data-v-67632248"]]),xW={class:"activity-notice",role:"status"},TW={class:"an-moon","aria-hidden":"true"},MW={class:"an-label"},AW=120,EW=Xe({__name:"ActivityNotice",props:{label:{}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"],n=te(0);let s=null;return Jt(()=>{s=setInterval(()=>{n.value=(n.value+1)%t.length},AW)}),qt(()=>{s&&(clearInterval(s),s=null)}),(o,i)=>(C(),A("div",xW,[h("span",TW,N(t[n.value]),1),h("span",MW,N(e.label),1)]))}}),bw=vt(EW,[["__scopeId","data-v-bca6ec2b"]]),$W=["disabled"],IW={class:"agent-main"},NW={class:"agent-title-row"},LW={class:"agent-name"},OW={key:0,class:"agent-type"},RW={class:"agent-phase"},PW={key:0,class:"agent-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},DW=Xe({__name:"AgentCard",props:{member:{},compact:{type:Boolean}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=j(()=>(n.member.outputLines??[]).map(u=>u.trimEnd()).filter(u=>u.length>0).slice(-8)),i=j(()=>o.value.at(-1)),r=j(()=>n.member.phase==="queued"||n.member.phase==="working"||n.member.phase==="suspended"),l=j(()=>!!(n.member.summary||n.member.suspendedReason||n.member.prompt||o.value.length>0));function a(u){switch(u){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function c(){l.value&&s("open",n.member.id)}return(u,d)=>(C(),A("div",{class:$e(["agent-card",[`phase-${e.member.phase}`,{compact:e.compact}]])},[h("button",{class:"agent-head",type:"button",disabled:!l.value,onClick:c},[d[1]||(d[1]=h("span",{class:"agent-dot","aria-hidden":"true"},null,-1)),h("span",IW,[h("span",NW,[h("span",LW,N(e.member.name),1),e.member.subagentType?(C(),A("span",OW,N(e.member.subagentType),1)):re("",!0),r.value?(C(),A("span",{key:1,class:$e(["agent-live",{empty:!i.value}])},N(i.value),3)):re("",!0)])]),h("span",RW,N(a(e.member.phase)),1),l.value?(C(),A("svg",PW,[...d[0]||(d[0]=[h("path",{d:"M6 4l4 4-4 4"},null,-1)])])):re("",!0)],8,$W)],2))}}),d1=vt(DW,[["__scopeId","data-v-41bb2d23"]]),BW={class:"agent-group"},FW={class:"group-count"},HW={key:0,class:"group-live"},WW={key:0,class:"group-body"},UW=Xe({__name:"AgentGroup",props:{members:{}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=te(!0),i=j(()=>n.members.filter(l=>l.phase==="completed"||l.phase==="failed").length),r=j(()=>n.members.filter(l=>l.phase==="queued"||l.phase==="working"||l.phase==="suspended").length);return(l,a)=>(C(),A("section",BW,[h("button",{class:"group-head",type:"button",onClick:a[0]||(a[0]=c=>o.value=!o.value)},[a[3]||(a[3]=h("span",{class:"group-title"},"Agents",-1)),h("span",FW,N(i.value)+"/"+N(e.members.length),1),r.value>0?(C(),A("span",HW,N(r.value)+" running",1)):re("",!0),(C(),A("svg",{class:$e(["group-chevron",{open:o.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...a[2]||(a[2]=[h("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),o.value?(C(),A("div",WW,[(C(!0),A(Ie,null,Ye(e.members,c=>(C(),qe(d1,{key:c.id,member:c,compact:"",onOpen:a[1]||(a[1]=u=>s("open",u))},null,8,["member"]))),128))])):re("",!0)]))}}),_w=vt(UW,[["__scopeId","data-v-644d434d"]]),qW=["aria-label"],jW=120,zW=60,VW=Xe({__name:"MoonSpinner",props:{fast:{type:Boolean},label:{default:"Working…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*jW}ms`,"--moon-frame-fast-delay":`${s*zW}ms`}}return(s,o)=>(C(),A("span",{class:$e(["moon-spin",{"moon-spin--fast":e.fast}]),"aria-label":e.label,role:"img"},[(C(),A(Ie,null,Ye(t,(i,r)=>h("span",{key:i,class:"moon-frame",style:It(n(r)),"aria-hidden":"true"},N(i),5)),64))],10,qW))}}),f1=vt(VW,[["__scopeId","data-v-e7ccbb9a"]]);function KW(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}const GW={key:0,class:"chat"},YW={key:0,class:"chat-loading"},XW={class:"chat-loading-text"},ZW={key:1,class:"chat-empty"},QW={key:1,class:"top-sentinel-text"},JW=["data-turn-id"],eU={key:0,class:"u-imgs"},tU=["src"],nU=["src","alt"],sU={key:1,class:"skill-act"},oU={class:"skill-act-head"},iU={key:0,class:"skill-act-args"},rU={key:2,class:"u-text"},lU={key:0,class:"u-meta"},aU=["data-tooltip","onClick"],cU={class:"u-edit-text"},uU=["onClick"],dU=["onClick"],fU=["data-turn-id"],hU=["onClick"],pU={class:"cd-view"},mU={key:1,class:"cd-label"},gU=["data-turn-id"],vU={key:1,class:"msg"},yU={key:2,class:"tool-stack"},kU={key:0,class:"a-msg-ft"},bU=["title"],_U=["onClick"],wU={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},SU={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},CU={class:"a-cpbtn-text"},xU={key:4,class:"sending-placeholder"},TU={key:1,class:"term"},MU={key:0,class:"chat-loading"},AU={class:"chat-loading-text"},EU={key:1,class:"chat-empty"},$U={key:1,class:"top-sentinel-text"},IU=["data-turn-id"],NU=["onClick"],LU={class:"cd-view"},OU={key:1,class:"cd-label"},RU=["data-turn-id"],PU={class:"no"},DU={class:"tx"},BU={class:"role-row"},FU=["onClick"],HU={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},WU={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},UU={class:"cpbtn-text"},qU=["title"],jU={key:0,class:"u-text"},zU={key:0,class:"skill-act"},VU={class:"skill-act-head"},KU={key:0,class:"skill-act-args"},GU={key:2,class:"tool-stack"},YU=["data-tooltip","onClick"],XU={class:"u-edit-text"},ZU=["onClick"],QU={key:4,class:"ln sending-line"},JU={class:"tx"},eq=Xe({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},bubble:{type:Boolean,default:!1},mobile:{type:Boolean,default:!1},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","editMessage","loadOlderMessages"],setup(e,{expose:t,emit:n}){const{t:s}=_t();qt(()=>{le!==null&&(clearTimeout(le),le=null),L!==null&&(clearTimeout(L),L=null),y!==null&&(clearTimeout(y),y=null)});const o=e,i=j(()=>o.bubble||o.mobile),r=te(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(de=>{de[0]?.isIntersecting&&o.hasMoreMessages&&!o.loadingMore&&!o.loadingMoreError&&!o.sessionLoading&&!o.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}Jt(a),qt(()=>{l?.disconnect(),l=null}),ze(()=>[o.hasMoreMessages,o.loadingMore,o.loadingMoreError],()=>{ut().then(a)});const c=j(()=>{if(!o.running||o.turns.length===0)return null;const de=o.turns.at(-1);return de.role==="assistant"?de.id:null}),u=j(()=>o.sending||o.running),d=n,p=j(()=>{for(let de=o.turns.length-1;de>=0;de--)if(o.turns[de].role==="user")return o.turns[de].id;return null});function m(de){return de.role==="user"&&de.id===p.value&&!o.running&&!o.sending&&!de.skillActivation}function f(de){return de>=1e6?`${(de/1e6).toFixed(1)}M`:de>=1e3?`${(de/1e3).toFixed(1)}k`:String(de)}function v(de){if(de<1e3)return`${de}ms`;if(de<6e4)return`${(de/1e3).toFixed(1)}s`;const z=Math.floor(de/6e4),Z=(de%6e4/1e3).toFixed(1);return`${z}m${Z}s`}function w(de){const z=de.compaction,Z=z?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof z?.tokensBefore=="number"&&typeof z?.tokensAfter=="number"?Z+s("conversation.compactedTokens",{before:f(z.tokensBefore),after:f(z.tokensAfter)}):Z}const b=te(null),_=te(null),g=te(null);let y=null;const k=te(new Set);function I(de){return k.value.has(de)}function E(de){const z=new Set(k.value);z.has(de)?z.delete(de):z.add(de),k.value=z}function S(de,z){if(I(z)){const Z=new Date(de);if(Number.isNaN(Z.getTime()))return de;const fe=P=>String(P).padStart(2,"0");return`${Z.getFullYear()}-${fe(Z.getMonth()+1)}-${fe(Z.getDate())} ${fe(Z.getHours())}:${fe(Z.getMinutes())}`}return KW(de,s("conversation.yesterday"))}function T(de){g.value===null&&(_.value=null,g.value=de.id,y=setTimeout(()=>{y=null,d("editMessage",de.text),g.value=null},240))}const $=te(!1);let L=null;function R(de){return be(de).flatMap(z=>z.kind==="text"&&z.text?[z.text]:[]).join(`
|
|
220
|
+
|
|
221
|
+
`)}function O(de){const z=[];for(const Z of be(de))if(Z.kind==="thinking"&&Z.thinking)z.push(`> **Thinking**
|
|
222
|
+
> ${Z.thinking.split(`
|
|
223
|
+
`).join(`
|
|
224
|
+
> `)}`);else if(Z.kind==="text"&&Z.text)z.push(Z.text);else if(Z.kind==="tool"&&Z.tool.output&&Z.tool.output.length>0){const fe=Z.tool.output.join(`
|
|
225
|
+
`);z.push(`\`\`\`
|
|
226
|
+
[${Z.tool.name}]
|
|
227
|
+
${fe}
|
|
228
|
+
\`\`\``)}else Z.kind==="agent"?z.push(`**Agent** ${Z.member.name} (${Z.member.phase})`):Z.kind==="agentGroup"&&z.push(`**Agents**
|
|
229
|
+
|
|
230
|
+
${Z.members.map(fe=>`- ${fe.name}: ${fe.phase}`).join(`
|
|
231
|
+
`)}`);return z.join(`
|
|
232
|
+
|
|
233
|
+
`)}function B(){if(o.turns.length===0)return;const de=[];for(const Z of o.turns){if(Z.role==="compaction")continue;const fe=Z.role==="user"?"User":"Assistant",P=O(Z);P.trim()&&de.push(`**${fe}**
|
|
234
|
+
|
|
235
|
+
${P}`)}const z=de.join(`
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
`);navigator.clipboard.writeText(z).then(()=>{$.value=!0,d("copyConversationCopied"),L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,$.value=!1},2e3)}).catch(()=>{})}function F(de){const z=[];for(let Z=de;Z>=0;Z--){const fe=o.turns[Z];if(!fe||fe.role!=="assistant")break;z.unshift(fe)}return z}function q(de){return F(de).map(z=>R(z)).filter(Boolean).join(`
|
|
240
|
+
|
|
241
|
+
`)}function G(){for(let de=o.turns.length-1;de>=0;de-=1)if(o.turns[de]?.role==="assistant")return q(de);return""}function K(){const de=G();de.trim()&&navigator.clipboard.writeText(de).then(()=>{$.value=!0,d("copyConversationCopied"),L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,$.value=!1},2e3)}).catch(()=>{})}t({copyConversation:B,copyFinalSummary:K});function oe(de){const z=o.turns[de];if(!z||z.role!=="assistant")return!1;const Z=o.turns[de+1];return!Z||Z.role!=="assistant"}let le=null;function pe(de){const z=o.turns[de];if(!z)return;const Z=q(de);Z.trim()&&navigator.clipboard.writeText(Z).then(()=>{b.value=z.id,le!==null&&clearTimeout(le),le=setTimeout(()=>{le=null,b.value=null},1400)}).catch(()=>{})}function be(de){if(de.blocks)return de.blocks;const z=[];de.thinking&&z.push({kind:"thinking",thinking:de.thinking}),de.text&&z.push({kind:"text",text:de.text});for(const Z of de.tools??[])z.push({kind:"tool",tool:Z});return z}function Be(de){return!(de.tool.status==="ok"&&de.tool.media)}function He(de,z){return z<=1?"single":de===0?"first":de===z-1?"last":"middle"}function Ne(de){const z=be(de),Z=[];let fe=[];const P=()=>{if(fe.length===1){const[X]=fe;X&&Z.push({kind:"tool",tool:X.tool,sourceIndex:X.sourceIndex})}else fe.length>1&&Z.push({kind:"tool-stack",tools:fe});fe=[]};return z.forEach((X,ne)=>{if(X.kind==="tool"){if(Be(X)){fe.push({tool:X.tool,sourceIndex:ne});return}P(),Z.push({kind:"tool",tool:X.tool,sourceIndex:ne});return}P(),X.kind==="thinking"?Z.push({kind:"thinking",thinking:X.thinking,sourceIndex:ne}):X.kind==="text"?Z.push({kind:"text",text:X.text,sourceIndex:ne}):X.kind==="agent"?Z.push({kind:"agent",member:X.member,sourceIndex:ne}):Z.push({kind:"agentGroup",members:X.members,sourceIndex:ne})}),P(),Z}function me(de,z){return de.id!==c.value?!1:z.sourceIndex===be(de).length-1}function _e(de){return de.tool.id||`tool-${de.sourceIndex}`}function Ce(de,z){return de.kind==="tool-stack"?`tool-stack-${de.tools[0]?.sourceIndex??z}`:de.kind==="tool"?_e({tool:de.tool,sourceIndex:de.sourceIndex}):de.kind==="agent"?`agent-${de.member.id}-${de.sourceIndex}`:de.kind==="agentGroup"?`agent-group-${de.members[0]?.id??de.sourceIndex}`:`${de.kind}-${de.sourceIndex}`}return(de,z)=>i.value?(C(),A("div",GW,[e.sessionLoading?(C(),A("div",YW,[z[10]||(z[10]=h("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),h("span",XW,N(M(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(C(),A("div",ZW)):re("",!0),e.hasMoreMessages||e.loadingMore?(C(),A("div",{key:2,ref_key:"topSentinelRef",ref:r,class:$e(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(C(),A("span",QW,[z[11]||(z[11]=h("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),dt(" "+N(M(s)("conversation.loadingOlder")),1)])):(C(),A("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:z[0]||(z[0]=Z=>d("loadOlderMessages"))},N(M(s)("conversation.loadOlder")),1))],2)):re("",!0),(C(!0),A(Ie,null,Ye(e.turns,(Z,fe)=>(C(),A(Ie,{key:Z.id},[Z.role==="user"?(C(),A(Ie,{key:0},[h("div",{class:$e(["u-bub turn-anchor",{undoing:g.value===Z.id}]),"data-turn-id":Z.id},[Z.images&&Z.images.length>0?(C(),A("div",eU,[(C(!0),A(Ie,null,Ye(Z.images,(P,X)=>(C(),A(Ie,{key:X},[P.kind==="video"?(C(),A("video",{key:0,class:"u-img",src:P.url,controls:"",playsinline:"",preload:"metadata"},null,8,tU)):(C(),A("img",{key:1,class:"u-img",src:P.url,alt:P.alt||"",loading:"lazy"},null,8,nU))],64))),128))])):re("",!0),Z.skillActivation?(C(),A("div",sU,[h("div",oU,[z[12]||(z[12]=h("span",{class:"skill-act-arrow"},"▶",-1)),h("span",null,N(M(s)("conversation.activatedSkill",{name:Z.skillActivation.name})),1)]),Z.skillActivation.args?(C(),A("div",iU,N(Z.skillActivation.args),1)):re("",!0)])):(C(),A("div",rU,N(Z.text),1))],10,JW),Z.createdAt||m(Z)?(C(),A("div",lU,[m(Z)?(C(),A("div",{key:0,class:$e(["u-edit-wrap",{undoing:g.value===Z.id}])},[_.value!==Z.id?(C(),A("button",{key:0,type:"button",class:"u-edit","data-tooltip":M(s)("conversation.undoTooltip"),onClick:P=>_.value=Z.id},[h("span",cU,N(M(s)("conversation.undo")),1),z[13]||(z[13]=h("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),h("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1))],8,aU)):(C(),A("div",{key:1,class:"u-edit-confirm",onClick:z[2]||(z[2]=Ge(()=>{},["stop"]))},[h("span",null,N(M(s)("conversation.undoConfirm")),1),h("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ge(P=>T(Z),["stop"])},N(M(s)("conversation.confirm")),9,uU),h("button",{type:"button",class:"u-edit-confirm-btn",onClick:z[1]||(z[1]=Ge(P=>_.value=null,["stop"]))},N(M(s)("conversation.cancel")),1)]))],2)):re("",!0),Z.createdAt?(C(),A("button",{key:1,type:"button",class:"u-time",onClick:Ge(P=>E(Z.id),["stop"])},N(S(Z.createdAt,Z.id)),9,dU)):re("",!0)])):re("",!0)],64)):Z.role==="compaction"?(C(),A("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":Z.id,role:"separator"},[z[14]||(z[14]=h("span",{class:"cd-line","aria-hidden":"true"},null,-1)),Z.text?(C(),A("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:P=>d("openCompaction",{turnId:Z.id})},[h("span",null,N(w(Z)),1),h("span",pU,N(M(s)("conversation.viewSummary")),1)],8,hU)):(C(),A("span",mU,N(w(Z)),1)),z[15]||(z[15]=h("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,fU)):(C(),A("div",{key:2,class:"a-msg turn-anchor","data-turn-id":Z.id},[(C(!0),A(Ie,null,Ye(Ne(Z),(P,X)=>(C(),A(Ie,{key:Ce(P,X)},[P.kind==="thinking"?(C(),qe(kw,{key:0,text:P.thinking,mobile:i.value,streaming:me(Z,P),onOpen:ne=>d("openThinking",{turnId:Z.id,blockIndex:P.sourceIndex})},null,8,["text","mobile","streaming","onOpen"])):P.kind==="text"&&P.text?(C(),A("div",vU,[pt(Ff,{text:P.text,streaming:me(Z,P),"open-file":ne=>d("openFile",ne)},null,8,["text","streaming","open-file"])])):P.kind==="tool-stack"?(C(),A("div",yU,[(C(!0),A(Ie,null,Ye(P.tools,(ne,se)=>(C(),qe(id,{key:_e(ne),tool:ne.tool,mobile:i.value,"stack-position":He(se,P.tools.length),onOpenMedia:z[3]||(z[3]=ce=>d("openMedia",ce))},null,8,["tool","mobile","stack-position"]))),128))])):P.kind==="agent"?(C(),qe(d1,{key:3,member:P.member,onOpen:ne=>d("openAgent",{turnId:Z.id,blockIndex:P.sourceIndex,memberId:ne})},null,8,["member","onOpen"])):P.kind==="agentGroup"?(C(),qe(_w,{key:4,members:P.members,onOpen:ne=>d("openAgent",{turnId:Z.id,blockIndex:P.sourceIndex,memberId:ne})},null,8,["members","onOpen"])):P.kind==="tool"?(C(),qe(id,{key:5,tool:P.tool,mobile:i.value,onOpenMedia:z[4]||(z[4]=ne=>d("openMedia",ne))},null,8,["tool","mobile"])):re("",!0)],64))),128)),Z.id!==c.value&&oe(fe)&&(q(fe).trim().length>0||Z.durationMs!==void 0)?(C(),A("div",kU,[Z.durationMs!==void 0?(C(),A("span",{key:0,class:"a-duration",title:`${Z.durationMs} ms`},N(v(Z.durationMs)),9,bU)):re("",!0),q(fe).trim().length>0?(C(),A("button",{key:1,class:"a-cpbtn",tabindex:"-1",onClick:P=>pe(fe)},[b.value!==Z.id?(C(),A("svg",wU,[...z[16]||(z[16]=[h("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),h("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(C(),A("svg",SU,[...z[17]||(z[17]=[h("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),h("span",CU,N(M(s)("filePreview.copy")),1)],8,_U)):re("",!0)])):re("",!0)],8,gU))],64))),128)),e.compaction?(C(),qe(bw,{key:3,label:M(s)("conversation.compacting")},null,8,["label"])):re("",!0),u.value?(C(),A("div",xU,[pt(f1,{fast:e.fastMoon},null,8,["fast"])])):re("",!0)])):(C(),A("div",TU,[e.sessionLoading?(C(),A("div",MU,[z[18]||(z[18]=h("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),h("span",AU,N(M(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(C(),A("div",EU)):re("",!0),e.hasMoreMessages||e.loadingMore?(C(),A("div",{key:2,ref_key:"topSentinelRef",ref:r,class:$e(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(C(),A("span",$U,[z[19]||(z[19]=h("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),dt(" "+N(M(s)("conversation.loadingOlder")),1)])):(C(),A("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:z[5]||(z[5]=Z=>d("loadOlderMessages"))},N(M(s)("conversation.loadOlder")),1))],2)):re("",!0),(C(!0),A(Ie,null,Ye(e.turns,(Z,fe)=>(C(),A(Ie,{key:Z.id},[Z.role==="compaction"?(C(),A("div",{key:0,class:"compact-divider turn-anchor","data-turn-id":Z.id,role:"separator"},[z[20]||(z[20]=h("span",{class:"cd-line","aria-hidden":"true"},null,-1)),Z.text?(C(),A("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:P=>d("openCompaction",{turnId:Z.id})},[h("span",null,N(w(Z)),1),h("span",LU,N(M(s)("conversation.viewSummary")),1)],8,NU)):(C(),A("span",OU,N(w(Z)),1)),z[21]||(z[21]=h("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,IU)):(C(),A("div",{key:1,class:$e(["ln turn-anchor",[Z.role==="user"?"userline":"ai",{undoing:g.value===Z.id}]]),"data-turn-id":Z.id},[h("span",PU,N(Z.no),1),h("div",DU,[h("div",BU,[Z.role==="user"?(C(),A(Ie,{key:0},[z[22]||(z[22]=h("span",{class:"pr"},"user@kimi",-1)),z[23]||(z[23]=h("span",{class:"who"}," $ ",-1))],64)):(C(),A(Ie,{key:1},[z[24]||(z[24]=h("span",{class:"pr"},"kimi",-1)),z[25]||(z[25]=h("span",{class:"who"}," > ",-1))],64)),Z.id!==c.value&&oe(fe)&&q(fe).trim().length>0?(C(),A("button",{key:2,class:"cpbtn",onClick:P=>pe(fe),tabindex:"-1"},[b.value!==Z.id?(C(),A("svg",HU,[...z[26]||(z[26]=[h("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),h("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(C(),A("svg",WU,[...z[27]||(z[27]=[h("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),h("span",UU,N(M(s)("filePreview.copy")),1)],8,FU)):re("",!0),Z.durationMs!==void 0&&Z.role==="assistant"?(C(),A("span",{key:3,class:"turn-duration",title:`${Z.durationMs} ms`},N(v(Z.durationMs)),9,qU)):re("",!0)]),Z.role==="user"?(C(),A("div",jU,[Z.skillActivation?(C(),A("div",zU,[h("div",VU,[z[28]||(z[28]=h("span",{class:"skill-act-arrow"},"▶",-1)),h("span",null,N(M(s)("conversation.activatedSkill",{name:Z.skillActivation.name})),1)]),Z.skillActivation.args?(C(),A("div",KU,N(Z.skillActivation.args),1)):re("",!0)])):(C(),A(Ie,{key:1},[dt(N(Z.text),1)],64))])):(C(!0),A(Ie,{key:1},Ye(Ne(Z),(P,X)=>(C(),A(Ie,{key:Ce(P,X)},[P.kind==="thinking"?(C(),qe(kw,{key:0,text:P.thinking,streaming:me(Z,P),onOpen:ne=>d("openThinking",{turnId:Z.id,blockIndex:P.sourceIndex})},null,8,["text","streaming","onOpen"])):P.kind==="text"&&P.text?(C(),qe(Ff,{key:1,text:P.text,streaming:me(Z,P),"open-file":ne=>d("openFile",ne)},null,8,["text","streaming","open-file"])):P.kind==="tool-stack"?(C(),A("div",GU,[(C(!0),A(Ie,null,Ye(P.tools,(ne,se)=>(C(),qe(id,{key:_e(ne),tool:ne.tool,"stack-position":He(se,P.tools.length),onOpenMedia:z[6]||(z[6]=ce=>d("openMedia",ce))},null,8,["tool","stack-position"]))),128))])):P.kind==="agent"?(C(),qe(d1,{key:3,member:P.member,onOpen:ne=>d("openAgent",{turnId:Z.id,blockIndex:P.sourceIndex,memberId:ne})},null,8,["member","onOpen"])):P.kind==="agentGroup"?(C(),qe(_w,{key:4,members:P.members,onOpen:ne=>d("openAgent",{turnId:Z.id,blockIndex:P.sourceIndex,memberId:ne})},null,8,["members","onOpen"])):P.kind==="tool"?(C(),qe(id,{key:5,tool:P.tool,onOpenMedia:z[7]||(z[7]=ne=>d("openMedia",ne))},null,8,["tool"])):re("",!0)],64))),128))]),Z.role==="user"&&m(Z)?(C(),A("div",{key:0,class:$e(["u-edit-wrap ln-edit-wrap",{undoing:g.value===Z.id}])},[_.value!==Z.id?(C(),A("button",{key:0,type:"button",class:"u-edit","data-tooltip":M(s)("conversation.undoTooltip"),onClick:P=>_.value=Z.id},[z[29]||(z[29]=h("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),h("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1)),h("span",XU,N(M(s)("conversation.undo")),1)],8,YU)):(C(),A("div",{key:1,class:"u-edit-confirm",onClick:z[9]||(z[9]=Ge(()=>{},["stop"]))},[h("span",null,N(M(s)("conversation.undoConfirm")),1),h("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ge(P=>T(Z),["stop"])},N(M(s)("conversation.confirm")),9,ZU),h("button",{type:"button",class:"u-edit-confirm-btn",onClick:z[8]||(z[8]=Ge(P=>_.value=null,["stop"]))},N(M(s)("conversation.cancel")),1)]))],2)):re("",!0)],10,RU))],64))),128)),e.compaction?(C(),qe(bw,{key:3,label:M(s)("conversation.compacting")},null,8,["label"])):re("",!0),u.value?(C(),A("div",QU,[z[31]||(z[31]=h("span",{class:"no"},"—",-1)),h("div",JU,[z[30]||(z[30]=h("div",{class:"role-row"},[h("span",{class:"pr"},"kimi"),h("span",{class:"who"}," > ")],-1)),pt(f1,{fast:e.fastMoon,label:"Sending…"},null,8,["fast"])])])):re("",!0)]))}}),PT=vt(eq,[["__scopeId","data-v-5479dea1"]]),tq={class:"chat-header"},nq={class:"ch-id"},sq={key:0,class:"ch-ws"},oq={key:1,class:"ch-sep"},iq=["onKeydown"],rq=["title"],lq=["title","aria-label","aria-expanded"],aq=["title"],cq=["title"],uq={key:0,class:"ch-pill ch-sync-pill"},dq={key:0,class:"ch-ahead"},fq={key:1,class:"ch-behind"},hq={key:1,class:"ch-pill ch-diff-pill"},pq={key:0,class:"ch-add"},mq={key:1,class:"ch-del"},gq=["title"],vq=Xe({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=j(()=>s.ahead??0),r=j(()=>s.behind??0),l=j(()=>s.gitDiffStats?.totalAdditions??0),a=j(()=>s.gitDiffStats?.totalDeletions??0),c=j(()=>l.value>0||a.value>0),u=te(!1),d=te(null),p=te(null),m=te({});function f(G){const K=G.target;p.value?.contains(K)||d.value?.contains(K)||b()}function v(){b()}async function w(G){if(G.stopPropagation(),u.value){b();return}u.value=!0,document.addEventListener("mousedown",f),document.addEventListener("scroll",v,!0),window.addEventListener("resize",v),await ut();const K=d.value,oe=p.value;if(!K||!oe)return;const le=K.getBoundingClientRect(),pe=4,be=8,Be=oe.offsetWidth,He=oe.offsetHeight;let Ne=le.bottom+pe;Ne+He>window.innerHeight-be&&(Ne=Math.max(be,le.top-He-pe));let me=le.left;me+Be>window.innerWidth-be&&(me=Math.max(be,le.right-Be)),m.value={top:`${Math.round(Ne)}px`,left:`${Math.round(me)}px`}}function b(){u.value=!1,F(),document.removeEventListener("mousedown",f),document.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}qt(()=>{document.removeEventListener("mousedown",f),document.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)});function _(){o("copyAll"),b()}function g(){o("copyFinalSummary"),b()}const y=te(!1);function k(){s.sessionId&&navigator.clipboard.writeText(s.sessionId).then(()=>{y.value=!0,setTimeout(()=>{y.value=!1},1200)}).catch(()=>{})}const I=te(!1),E=te(""),S=te(null);async function T(){if(b(),!!s.sessionId){I.value=!0,E.value=s.sessionTitle??"",await ut();try{S.value?.focus(),S.value?.select()}catch{}}}function $(){const G=E.value.trim();G&&s.sessionId&&G!==(s.sessionTitle??"").trim()&&o("renameSession",s.sessionId,G),I.value=!1}function L(){I.value=!1}function R(){s.sessionId&&(b(),o("forkSession",s.sessionId))}const O=te(!1);let B;function F(){clearTimeout(B),O.value=!1}function q(){if(s.sessionId){if(O.value){o("archiveSession",s.sessionId),b();return}O.value=!0,B=setTimeout(()=>{O.value=!1},2500)}}return(G,K)=>(C(),A("header",tq,[h("div",nq,[e.workspaceName?(C(),A("span",sq,N(e.workspaceName),1)):re("",!0),e.workspaceName&&e.sessionTitle?(C(),A("span",oq,"/")):re("",!0),I.value?At((C(),A("input",{key:2,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":K[0]||(K[0]=oe=>E.value=oe),class:"ch-rename",type:"text",onKeydown:[So(Ge($,["stop"]),["enter"]),So(Ge(L,["stop"]),["esc"])],onBlur:$,onClick:K[1]||(K[1]=Ge(()=>{},["stop"]))},null,40,iq)),[[bn,E.value]]):e.sessionTitle?(C(),A("span",{key:3,class:"ch-ses",title:e.sessionTitle},N(e.sessionTitle),9,rq)):re("",!0)]),h("button",{ref_key:"kebabRef",ref:d,type:"button",class:$e(["ch-act ch-act-more",{open:u.value}]),title:M(n)("header.options"),"aria-label":M(n)("header.options"),"aria-expanded":u.value,"aria-haspopup":"menu",onClick:K[2]||(K[2]=Ge(oe=>w(oe),["stop"]))},[...K[6]||(K[6]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"3",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"13",cy:"8",r:"1.3"})],-1)])],10,lq),u.value?(C(),A("div",{key:0,ref_key:"menuRef",ref:p,class:"ch-menu",style:It(m.value),onClick:K[3]||(K[3]=Ge(()=>{},["stop"]))},[h("button",{type:"button",class:"chm-item",onClick:Ge(_,["stop"])},N(e.copied?M(n)("header.copied"):M(n)("header.copyAll")),1),h("button",{type:"button",class:"chm-item",onClick:Ge(g,["stop"])},N(M(n)("header.copyFinalSummary")),1),e.sessionId?(C(),A(Ie,{key:0},[K[7]||(K[7]=h("div",{class:"chm-divider"},null,-1)),h("button",{type:"button",class:"chm-item",onClick:Ge(k,["stop"])},[h("span",null,N(y.value?M(n)("header.copied"):M(n)("header.copySessionId")),1)]),h("button",{type:"button",class:"chm-item",onClick:Ge(T,["stop"])},N(M(n)("header.renameSession")),1),h("button",{type:"button",class:"chm-item",onClick:Ge(R,["stop"])},N(M(n)("header.forkSession")),1),h("button",{type:"button",class:"chm-item del",onClick:Ge(q,["stop"])},N(O.value?M(n)("header.confirmArchive"):M(n)("header.archiveSession")),1)],64)):re("",!0)],4)):re("",!0),K[9]||(K[9]=h("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(C(),A("button",{key:1,type:"button",class:"ch-git",title:M(n)("header.gitTooltip"),onClick:K[4]||(K[4]=oe=>o("openChanges"))},[h("span",{class:$e(["ch-branch",{"ch-detached":!e.branch}]),title:e.branch||M(n)("header.detached")},N(e.branch||M(n)("header.detached")),11,cq),i.value>0||r.value>0?(C(),A("span",uq,[i.value>0?(C(),A("span",dq,"↑"+N(i.value),1)):re("",!0),r.value>0?(C(),A("span",fq,"↓"+N(r.value),1)):re("",!0)])):re("",!0),c.value?(C(),A("span",hq,[l.value>0?(C(),A("span",pq,"+"+N(l.value),1)):re("",!0),a.value>0?(C(),A("span",mq,"-"+N(a.value),1)):re("",!0)])):re("",!0)],8,aq)):re("",!0),e.pr?(C(),A("button",{key:2,type:"button",class:$e(["ch-pill ch-pr",`pr-${e.pr.state}`]),title:M(n)("header.openPr"),onClick:K[5]||(K[5]=oe=>e.pr&&o("openPr",e.pr.url))},[K[8]||(K[8]=mr('<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-bb5e949f><circle cx="5" cy="6" r="3" data-v-bb5e949f></circle><path d="M5 9v12" data-v-bb5e949f></path><circle cx="19" cy="18" r="3" data-v-bb5e949f></circle><path d="m15 9-3-3 3-3" data-v-bb5e949f></path><path d="M12 6h5a2 2 0 0 1 2 2v7" data-v-bb5e949f></path></svg>',1)),h("span",null,"PR #"+N(e.pr.number)+" · "+N(e.pr.state),1)],10,gq)):re("",!0)]))}}),yq=vt(vq,[["__scopeId","data-v-bb5e949f"]]),kq={key:0,class:"slash-menu",role:"listbox"},bq=["aria-selected","onMouseenter","onMousedown"],_q={class:"slash-name"},wq={class:"slash-desc"},Sq=Xe({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te([]);return ze(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(C(),A("div",kq,[(C(!0),A(Ie,null,Ye(e.items,(a,c)=>(C(),A("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:$e(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:Ge(u=>o("select",a),["prevent"])},[h("span",_q,N(a.name),1),h("span",wq,N(a.isSkill?a.desc:M(n)(a.desc)),1)],42,bq))),128))])):re("",!0)}}),Cq=vt(Sq,[["__scopeId","data-v-94bf2ae6"]]),xq={class:"mention-menu",role:"listbox"},Tq={key:0,class:"mention-state dim"},Mq={key:1,class:"mention-state dim"},Aq=["aria-selected","onMouseenter","onMousedown"],Eq=["innerHTML"],$q={class:"mention-name"},Iq={class:"mention-path"},Nq='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',Lq='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><polyline points="5.5,5 2.5,8 5.5,11"/><polyline points="10.5,5 13.5,8 10.5,11"/></svg>',Oq='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><line x1="6" y1="8" x2="11" y2="8"/><line x1="6" y1="10.5" x2="11" y2="10.5"/></svg>',Rq='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="3" width="12" height="10" rx="1"/><circle cx="5.5" cy="6.5" r="1.1"/><path d="M3 12l3.5-3.5L9 11l2-2 3 3"/></svg>',ww='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><polyline points="9,1.5 9,4.5 12,4.5"/></svg>',Pq=Xe({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),r=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),l=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function a(c){const u=c.path;if(u.endsWith("/"))return Nq;const d=c.name||u.split("/").pop()||u,p=d.lastIndexOf("."),m=p>0?d.slice(p+1).toLowerCase():"";return m?i.has(m)?Lq:r.has(m)?Oq:l.has(m)?Rq:ww:ww}return(c,u)=>(C(),A("div",xq,[n.loading?(C(),A("div",Tq,N(M(o)("mention.searching")),1)):n.items.length===0?(C(),A("div",Mq,N(M(o)("mention.noMatch")),1)):(C(!0),A(Ie,{key:2},Ye(n.items,(d,p)=>(C(),A("div",{key:d.path,class:$e(["mention-item",{active:p===n.activeIndex}]),role:"option","aria-selected":p===n.activeIndex,onMouseenter:m=>s("hover",p),onMousedown:Ge(m=>s("select",d),["prevent"])},[h("span",{class:"mention-icon",innerHTML:a(d),"aria-hidden":"true"},null,8,Eq),h("span",$q,N(d.name),1),h("span",Iq,N(d.path),1)],42,Aq))),128))]))}}),Dq=vt(Pq,[["__scopeId","data-v-13371515"]]),DT=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/sessions",desc:"commands.sessions.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/provider",desc:"commands.provider.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/permission",desc:"commands.permission.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/status",desc:"commands.status.desc"}];function Bq(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}function Sw(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...DT,...t]}function Fq(e,t=DT){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((s,o)=>{const i=s.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:s,index:o,score:r}}).filter(({score:s})=>s>0).sort((s,o)=>s.score!==o.score?o.score-s.score:s.index-o.index).map(({item:s})=>s)}function BT(e){if(e===void 0)return"toggle";const t=e.capabilities??[];return t.includes("always_thinking")?"always-on":t.includes("thinking")||e.adaptiveThinking===!0?"toggle":"unsupported"}function FT(e,t){switch(BT(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const Hq={key:0,class:"att-strip"},Wq=["title","onClick"],Uq=["src"],qq=["src","alt"],jq={key:2,class:"att-video-badge","aria-hidden":"true"},zq={class:"att-name"},Vq=["aria-label"],Kq=["title"],Gq=["title","onClick"],Yq={class:"att-lightbox-card"},Xq=["title"],Zq=["src"],Qq=["src","alt"],Jq={class:"att-lightbox-name"},ej={class:"composer-card"},tj={class:"cin-wrap"},nj={class:"input-row"},sj=["placeholder"],oj=["aria-label","title"],ij={class:"toolbar-left"},rj=["title"],lj=["title","onKeydown"],aj=["onClick"],cj={class:"pd-check"},uj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},dj={class:"pd-info"},fj={class:"pd-desc"},hj=["title"],pj={class:"mode-label"},mj={key:0,class:"mode-tag"},gj={key:1,class:"mode-tag"},vj={key:2,class:"mode-tag"},yj={class:"mode-row-name"},kj={class:"mode-row-name"},bj={class:"mode-row-name"},_j={key:0,class:"mode-row-actions"},wj={class:"toolbar-right"},Sj=["title"],Cj={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},xj=["stroke-dasharray","stroke-dashoffset"],Tj={class:"ctx-num"},Mj=["title","onKeydown"],Aj={key:0,class:"think-suffix"},Ej={key:0,class:"md-section"},$j=["onClick"],Ij={class:"md-check"},Nj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Lj={class:"md-name"},Oj={class:"md-provider"},Rj={key:1,class:"md-divider"},Pj={key:2,class:"md-section"},Dj=["onClick"],Bj={class:"md-check"},Fj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Hj={class:"md-name"},Wj={key:0,class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},Uj={key:3,class:"md-divider"},qj=["disabled"],jj={class:"md-check"},zj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Vj={class:"md-name"},Kj={key:0,class:"md-note"},Gj={key:1,class:"md-note"},Yj={class:"md-name"},Xj=Xe({__name:"Composer",props:{running:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=j(()=>s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=_t();function l(ee){return Sn(Dk(ee))??""}function a(ee,Ae){const Fe=Dk(ee);Ae?wn(Fe,Ae):uu(Fe)}const c=te(l(s.sessionId)),u=te(null);function d(){const ee=u.value;ee&&ee.style.removeProperty("height")}ze(c,ee=>{ut(d),a(s.sessionId,ee)}),ze(()=>s.sessionId,(ee,Ae)=>{ee!==Ae&&(a(Ae,c.value),c.value=l(ee),ut(d))});const p=te([]);let m=-1,f="";function v(ee){const Ae=ee.trim();m=-1,Ae&&p.value[p.value.length-1]!==Ae&&(p.value=[...p.value,Ae])}function w(){const ee=u.value;if(!ee)return!1;const Ae=ee.selectionStart??0;return ee.value.lastIndexOf(`
|
|
242
|
+
`,Ae-1)===-1}function b(ee){c.value=ee,ut(()=>{const Ae=u.value;if(!Ae)return;d();const Fe=ee.length;Ae.setSelectionRange(Fe,Fe)})}function _(){if(p.value.length!==0){if(m===-1)f=c.value,m=p.value.length-1;else if(m>0)m-=1;else return;b(p.value[m])}}function g(){m!==-1&&(m<p.value.length-1?(m+=1,b(p.value[m])):(m=-1,b(f)))}const y=te(!1),k=te([]),I=te(0);function E(){const ee=c.value;ee.startsWith("/")&&!ee.includes(" ")?(k.value=Fq(ee,Sw(s.skills)),I.value=0,y.value=k.value.length>0):y.value=!1}function S(ee){if(y.value=!1,ee.acceptsInput){c.value=`${ee.name} `,ut(()=>{const Ae=u.value;if(!Ae)return;const Fe=c.value.length;Ae.setSelectionRange(Fe,Fe),Ae.focus(),d()});return}c.value="",i("command",ee.name)}const T=te(!1),$=te([]),L=te(0),R=te(!1);let O=null;function B(){const ee=c.value,Ae=u.value?.selectionStart??ee.length;let Fe=Ae-1;for(;Fe>=0&&!/\s/.test(ee[Fe]);)Fe--;Fe++;const tt=ee.slice(Fe,Ae);return tt.startsWith("@")?{token:tt.slice(1),start:Fe,end:Ae}:null}function F(){const ee=B();if(!ee||!s.searchFiles){T.value=!1;return}const Ae=ee.token;O!==null&&clearTimeout(O),O=setTimeout(async()=>{R.value=!0,T.value=!0,L.value=0;try{const Fe=await s.searchFiles(Ae);$.value=Fe}catch{$.value=[]}finally{R.value=!1}},200)}function q(ee){const Ae=B();if(!Ae)return;const Fe=c.value;c.value=Fe.slice(0,Ae.start)+ee.path+Fe.slice(Ae.end),T.value=!1,ut(()=>{const tt=u.value;if(!tt)return;const yt=Ae.start+ee.path.length;tt.setSelectionRange(yt,yt),tt.focus(),d()})}function G(){m=-1,E(),F()}const K=te([]),oe=te(null),le=te(null),pe=te(!1);let be=0;function Be(){return`att_${++be}`}function He(ee){try{URL.revokeObjectURL(ee.previewUrl)}catch{}}function Ne(ee){return ee.startsWith("image/")?"image":ee.startsWith("video/")?"video":null}async function me(ee){if(!s.uploadImage)return;const Ae=ee.map(Fe=>({file:Fe,kind:Ne(Fe.type)})).filter(Fe=>Fe.kind!==null);if(Ae.length!==0)for(const{file:Fe,kind:tt}of Ae){const yt=Be(),Pt=URL.createObjectURL(Fe),mn={localId:yt,name:Fe.name,kind:tt,previewUrl:Pt,uploading:!0};K.value=[...K.value,mn],s.uploadImage(Fe,Fe.name).then(Qn=>{K.value=K.value.map(gn=>gn.localId===yt?{...gn,uploading:!1,fileId:Qn?.fileId,error:Qn===null}:gn)}).catch(()=>{K.value=K.value.map(Qn=>Qn.localId===yt?{...Qn,uploading:!1,error:!0}:Qn)})}}function _e(ee){const Ae=K.value.find(Fe=>Fe.localId===ee);oe.value?.localId===ee&&(oe.value=null),Ae&&He(Ae),K.value=K.value.filter(Fe=>Fe.localId!==ee)}function Ce(ee){oe.value=ee}function de(){oe.value=null}function z(){le.value?.click()}function Z(ee){const Ae=ee.target,Fe=Array.from(Ae.files??[]);me(Fe),Ae.value=""}function fe(ee){if(!s.uploadImage)return;const Ae=ee.clipboardData;if(!Ae)return;const Fe=[],tt=new Set,yt=(Pt,mn)=>{const Qn=`${Pt.size}:${Pt.type}:${mn}`;if(tt.has(Qn))return;tt.add(Qn);const gn=Pt.type.split("/")[1]??"png",ao=mn.includes(".")?mn:`paste-${Date.now()}.${gn}`;Fe.push(Pt instanceof File?Pt:new File([Pt],ao,{type:Pt.type}))};for(const Pt of Array.from(Ae.items))if(Pt.kind==="file"&&Ne(Pt.type)){const mn=Pt.getAsFile();mn&&yt(mn,mn.name||`paste-${Date.now()}.${Pt.type.split("/")[1]??"png"}`)}for(const Pt of Array.from(Ae.files))Ne(Pt.type)&&yt(Pt,Pt.name);Fe.length!==0&&(ee.preventDefault(),me(Fe))}function P(ee){!s.uploadImage||!Array.from(ee.dataTransfer?.items??[]).some(Fe=>Fe.kind==="file")||(ee.preventDefault(),pe.value=!0)}function X(){pe.value=!1}function ne(ee){if(pe.value=!1,!s.uploadImage)return;ee.preventDefault();const Ae=Array.from(ee.dataTransfer?.files??[]);me(Ae)}Jt(()=>{document.addEventListener("paste",fe),c.value&&ut(d)}),qt(()=>{document.removeEventListener("paste",fe),document.removeEventListener("mousedown",Wo);for(const ee of K.value)He(ee);oe.value=null,ue()});function se(ee){c.value=ee,ut(()=>{const Ae=u.value;if(!Ae)return;Ae.focus();const Fe=ee.length;Ae.setSelectionRange(Fe,Fe),d()})}t({loadForEdit:se});function ce(){const ee=c.value.trim();if(K.value.some(tt=>tt.uploading))return;const Ae=K.value.filter(tt=>!tt.uploading&&!tt.error&&tt.fileId);if(!ee&&Ae.length===0)return;if(ee){const tt=Bq(ee),yt=tt?Sw(s.skills).some(Pt=>Pt.name===tt.cmd):!1;if(tt&&yt){c.value="",y.value=!1,i("command",tt.arg?`${tt.cmd} ${tt.arg}`:tt.cmd);return}}const Fe={text:ee,attachments:Ae.map(tt=>({fileId:tt.fileId,kind:tt.kind}))};oe.value=null;for(const tt of K.value)He(tt);K.value=[],v(ee),c.value="",y.value=!1,T.value=!1,i("submit",Fe)}function H(){if(!s.running||K.value.some(tt=>tt.uploading))return;const ee=c.value.trim(),Ae=K.value.filter(tt=>!tt.uploading&&!tt.error&&tt.fileId);if(!ee&&Ae.length===0&&s.queued.length===0)return;const Fe={text:ee,attachments:Ae.map(tt=>({fileId:tt.fileId,kind:tt.kind}))};for(const tt of K.value)He(tt);K.value=[],v(ee),c.value="",y.value=!1,T.value=!1,i("steer",Fe)}let U=!1,Q=null;function ue(){Q!==null&&(clearTimeout(Q),Q=null)}function ge(){ue(),U=!0}function xe(){ue(),Q=setTimeout(()=>{Q=null,U=!1},0)}function ie(ee){return U||ee.isComposing||ee.keyCode===229}function we(ee){if(!ie(ee)){if(ee.key==="Escape"){if(nt.value){ee.preventDefault(),Zt();return}if(Ve.value){ee.preventDefault(),Nn();return}}if(y.value){if(ee.key==="ArrowDown"){ee.preventDefault(),I.value=(I.value+1)%k.value.length;return}if(ee.key==="ArrowUp"){ee.preventDefault(),I.value=(I.value-1+k.value.length)%k.value.length;return}if(ee.key==="Enter"||ee.key==="Tab"){ee.preventDefault();const Ae=k.value[I.value];Ae&&S(Ae);return}if(ee.key==="Escape"){ee.preventDefault(),y.value=!1;return}}if(T.value&&!R.value){if(ee.key==="ArrowDown"){ee.preventDefault(),L.value=(L.value+1)%Math.max(1,$.value.length);return}if(ee.key==="ArrowUp"){ee.preventDefault(),L.value=(L.value-1+Math.max(1,$.value.length))%Math.max(1,$.value.length);return}if(ee.key==="Enter"||ee.key==="Tab"){ee.preventDefault();const Ae=$.value[L.value];Ae&&q(Ae);return}if(ee.key==="Escape"){ee.preventDefault(),T.value=!1;return}}if(ee.key==="s"&&(ee.ctrlKey||ee.metaKey)&&!ee.shiftKey&&!ee.altKey){s.running&&(ee.preventDefault(),H());return}if(!y.value&&!T.value&&!ee.shiftKey&&!ee.altKey&&!ee.metaKey&&!ee.ctrlKey){const Ae=m!==-1;if(ee.key==="ArrowUp"&&p.value.length>0&&(Ae||w())){ee.preventDefault(),_();return}if(ee.key==="ArrowDown"&&Ae){ee.preventDefault(),g();return}}ee.key==="Enter"&&!ee.shiftKey&&(ee.preventDefault(),ce())}}const je=j(()=>s.running?r("composer.interrupt"):r("composer.send")),Je=j(()=>!!s.uploadImage),nt=te(!1),Ve=te(!1),ft=te(null);function xt(){nt.value=!nt.value,nt.value?(Ve.value=!1,document.addEventListener("click",xn,!0)):document.removeEventListener("click",xn,!0)}function Zt(){nt.value=!1,Ve.value||document.removeEventListener("click",xn,!0)}function Ht(){Ve.value=!Ve.value,Ve.value?(nt.value=!1,document.addEventListener("click",xn,!0)):document.removeEventListener("click",xn,!0)}function Nn(){Ve.value=!1,nt.value||document.removeEventListener("click",xn,!0)}function xn(ee){ft.value&&!ft.value.contains(ee.target)&&(Zt(),Nn())}qt(()=>{document.removeEventListener("click",xn,!0)});const Ke=ee=>`${Math.round(ee/1e3)}k`,en=j(()=>{const ee=s.status?.ctxMax??0;return ee<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/ee*100)))}),Hs=j(()=>{const ee=(s.status?.ctxUsed??0).toLocaleString(),Ae=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:ee,max:Ae,pct:en.value})}),qn=j(()=>en.value>=80),Bn=j(()=>{const ee=s.status?.modelId??s.status?.model??"";return s.models?.find(Ae=>Ae.id===ee||Ae.model===ee||Ae.displayName===s.status?.model)}),Ws=j(()=>BT(Bn.value)),Us=j(()=>Ws.value==="toggle"),qs=j(()=>Ws.value==="always-on"?!0:Ws.value==="unsupported"?!1:(s.thinking??"off")!=="off");function Ho(){Us.value&&i("setThinking",qs.value?"off":"high")}const $o=j(()=>s.planMode===!0),ro=j(()=>s.swarmMode===!0),Ln=j(()=>s.activationBadges?.goal!==null),on=j(()=>Ln.value||s.goalMode===!0),Zn=te(!1),wt=te(null),as=te(null),Vt=te({}),lo=j(()=>$o.value||ro.value||on.value);function ri(){Zn.value=!1,document.removeEventListener("mousedown",Wo)}function Wo(ee){const Ae=ee.target;wt.value?.contains(Ae)||as.value?.contains(Ae)||ri()}function cs(){if(Zn.value){ri();return}const ee=wt.value?.getBoundingClientRect();ee&&(Vt.value={left:`${Math.round(ee.left)}px`,bottom:`${Math.round(window.innerHeight-ee.top+8)}px`}),Zn.value=!0,setTimeout(()=>document.addEventListener("mousedown",Wo),0)}const xs=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--warn)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--err)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}];function Ts(ee){i("setPermission",ee),Nn()}const gt=j(()=>xs.find(ee=>ee.mode===s.status?.permission)),Ms=j(()=>gt.value?r(gt.value.labelKey):""),pn=j(()=>Bn.value?.provider??""),us=j(()=>!pn.value||!s.models?.length?[]:s.models.filter(ee=>ee.provider===pn.value)),tn=j(()=>new Set(s.starredIds??[]));function ln(ee){return tn.value.has(ee)}const Ee=j(()=>s.models?.length?s.models.filter(ee=>ln(ee.id)&&ee.provider!==pn.value):[]);function ve(ee){i("selectModel",ee),Zt()}return(ee,Ae)=>(C(),A("div",{class:$e(["composer",{"drag-over":pe.value}]),onDragover:P,onDragleave:X,onDrop:ne},[K.value.length>0?(C(),A("div",Hq,[(C(!0),A(Ie,null,Ye(K.value,Fe=>(C(),A("div",{key:Fe.localId,class:$e(["att-chip",{"att-error":Fe.error}])},[h("button",{type:"button",class:"att-preview",title:M(r)("composer.previewAttachment",{name:Fe.name}),onClick:tt=>Ce(Fe)},[Fe.kind==="video"?(C(),A("video",{key:0,class:"att-thumb",src:Fe.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,Uq)):(C(),A("img",{key:1,class:"att-thumb",src:Fe.previewUrl,alt:Fe.name},null,8,qq)),Fe.kind==="video"?(C(),A("span",jq,[...Ae[14]||(Ae[14]=[h("svg",{viewBox:"0 0 16 16",width:"9",height:"9",fill:"currentColor"},[h("path",{d:"M5 3.5v9l7-4.5z"})],-1)])])):re("",!0)],8,Wq),h("span",zq,N(Fe.name),1),Fe.uploading?(C(),A("span",{key:0,class:"att-spinner","aria-label":M(r)("composer.uploading")},[...Ae[15]||(Ae[15]=[h("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[h("circle",{cx:"8",cy:"8",r:"6","stroke-opacity":"0.25"}),h("path",{d:"M8 2 A6 6 0 0 1 14 8","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"0.8s",repeatCount:"indefinite"})])],-1)])],8,Vq)):Fe.error?(C(),A("span",{key:1,class:"att-err-icon",title:M(r)("composer.uploadFailed")},[...Ae[16]||(Ae[16]=[h("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[h("circle",{cx:"6",cy:"6",r:"5"}),h("line",{x1:"6",y1:"3.5",x2:"6",y2:"6.5"}),h("circle",{cx:"6",cy:"8.5",r:"0.5",fill:"currentColor"})],-1)])],8,Kq)):re("",!0),h("button",{class:"att-rm",title:M(r)("composer.removeNamed",{name:Fe.name}),onClick:tt=>_e(Fe.localId)},[...Ae[17]||(Ae[17]=[h("svg",{viewBox:"0 0 12 12",width:"9",height:"9",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,Gq)],2))),128))])):re("",!0),oe.value?(C(),A("div",{key:1,class:"att-lightbox",onClick:Ge(de,["self"])},[h("div",Yq,[h("button",{type:"button",class:"att-lightbox-close",title:M(r)("model.close"),onClick:de},"✕",8,Xq),oe.value.kind==="video"?(C(),A("video",{key:0,class:"att-lightbox-media",src:oe.value.previewUrl,controls:"",playsinline:""},null,8,Zq)):(C(),A("img",{key:1,class:"att-lightbox-media",src:oe.value.previewUrl,alt:oe.value.name},null,8,Qq)),h("div",Jq,N(oe.value.name),1)])])):re("",!0),h("div",ej,[h("div",tj,[y.value?(C(),qe(Cq,{key:0,items:k.value,"active-index":I.value,onSelect:S,onHover:Ae[0]||(Ae[0]=Fe=>I.value=Fe)},null,8,["items","active-index"])):re("",!0),T.value?(C(),qe(Dq,{key:1,items:$.value,"active-index":L.value,loading:R.value,onSelect:q,onHover:Ae[1]||(Ae[1]=Fe=>L.value=Fe)},null,8,["items","active-index","loading"])):re("",!0),h("div",nj,[At(h("textarea",{ref_key:"textareaRef",ref:u,"onUpdate:modelValue":Ae[2]||(Ae[2]=Fe=>c.value=Fe),class:"ph",placeholder:o.value,rows:"1",onKeydown:we,onCompositionstart:ge,onCompositionend:xe,onInput:G},null,40,sj),[[bn,c.value]]),h("button",{class:$e(["send",{aborting:e.running}]),"aria-label":je.value,title:e.running?M(r)("composer.interruptTitle"):je.value,onClick:Ae[3]||(Ae[3]=Fe=>e.running?i("interrupt"):ce())},[(C(),A("svg",{class:$e(["send-icon",{hidden:e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...Ae[18]||(Ae[18]=[h("path",{d:"M8 3l6 5.5M8 3L2 8.5M8 3v10"},null,-1)])],2)),(C(),A("svg",{class:$e(["send-icon",{hidden:!e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[...Ae[19]||(Ae[19]=[h("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1.5"},null,-1)])],2))],10,oj)])]),Je.value?(C(),A("input",{key:0,ref_key:"fileInputRef",ref:le,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:Z},null,544)):re("",!0),h("div",{ref_key:"toolbarRef",ref:ft,class:"toolbar"},[h("div",ij,[Je.value?(C(),A("button",{key:0,class:"attach-btn",title:M(r)("composer.attachImage"),type:"button",onClick:z},[...Ae[20]||(Ae[20]=[h("svg",{class:"attach-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},[h("path",{d:"M8 3v10M3 8h10"})],-1)])],8,rj)):re("",!0),e.status?(C(),A("span",{key:1,class:$e(["perm-pill",["perm-"+e.status.permission,{open:Ve.value}]]),role:"button",tabindex:"0",title:M(r)("status.permissionTooltip"),onClick:Ge(Ht,["stop"]),onKeydown:[So(Ht,["enter"]),So(Ge(Ht,["prevent"]),["space"])]},N(Ms.value),43,lj)):re("",!0),Ve.value&&e.status?(C(),A("div",{key:2,class:"perm-dropdown",role:"menu",onClick:Ae[4]||(Ae[4]=Ge(()=>{},["stop"]))},[(C(),A(Ie,null,Ye(xs,Fe=>h("button",{key:Fe.mode,class:$e(["pd-row",{"is-current":Fe.mode===e.status.permission}]),role:"menuitem",onClick:tt=>Ts(Fe.mode)},[h("span",cj,[Fe.mode===e.status.permission?(C(),A("svg",uj,[...Ae[21]||(Ae[21]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):re("",!0)]),h("span",dj,[h("span",{class:"pd-name",style:It({color:Fe.color})},N(M(r)(Fe.labelKey)),5),h("span",fj,N(M(r)(Fe.descKey)),1)])],10,aj)),64))])):re("",!0),e.status?(C(),A("div",{key:3,ref_key:"modesRef",ref:wt,class:"modes"},[h("button",{type:"button",class:$e(["mode-pill",{on:lo.value}]),title:M(r)("status.modesTooltip"),onClick:Ge(cs,["stop"])},[h("span",pj,N(M(r)("status.modesLabel")),1),$o.value?(C(),A("span",mj,N(M(r)("status.planLabel")),1)):re("",!0),ro.value?(C(),A("span",gj,N(M(r)("status.swarmLabel")),1)):re("",!0),on.value?(C(),A("span",vj,N(M(r)("status.goalLabel")),1)):re("",!0)],10,hj),Zn.value?(C(),A("div",{key:0,ref_key:"modesMenuRef",ref:as,class:"modes-menu",style:It(Vt.value)},[h("button",{type:"button",class:$e(["mode-row",{on:$o.value}]),onClick:Ae[5]||(Ae[5]=Fe=>i("togglePlan"))},[h("span",yj,N(M(r)("status.planLabel")),1),h("span",{class:$e(["mode-switch",{on:$o.value}])},[...Ae[22]||(Ae[22]=[h("span",{class:"mode-knob"},null,-1)])],2)],2),h("button",{type:"button",class:$e(["mode-row",{on:ro.value}]),onClick:Ae[6]||(Ae[6]=Fe=>i("toggleSwarm"))},[h("span",kj,N(M(r)("status.swarmLabel")),1),h("span",{class:$e(["mode-switch",{on:ro.value}])},[...Ae[23]||(Ae[23]=[h("span",{class:"mode-knob"},null,-1)])],2)],2),h("div",{class:$e(["mode-row mode-row-goal",{on:Ln.value||s.goalMode}])},[h("button",{type:"button",class:"mode-row-main",onClick:Ae[7]||(Ae[7]=Fe=>Ln.value?i("controlGoal","cancel"):i("toggleGoal"))},[h("span",bj,N(M(r)("status.goalLabel")),1),Ln.value?re("",!0):(C(),A("span",{key:0,class:$e(["mode-switch",{on:s.goalMode}])},[...Ae[24]||(Ae[24]=[h("span",{class:"mode-knob"},null,-1)])],2))]),Ln.value?(C(),A("div",_j,[h("button",{type:"button",class:"mode-row-action",onClick:Ae[8]||(Ae[8]=Fe=>i("controlGoal","pause"))},N(M(r)("status.goalPause")),1),h("button",{type:"button",class:"mode-row-action",onClick:Ae[9]||(Ae[9]=Fe=>i("controlGoal","resume"))},N(M(r)("status.goalResume")),1)])):re("",!0)],2)],4)):re("",!0)],512)):re("",!0)]),h("div",wj,[qn.value?(C(),A("button",{key:0,class:"compact-chip",onClick:Ae[10]||(Ae[10]=Ge(Fe=>i("compact"),["stop"]))},"/compact")):re("",!0),e.status&&!e.hideContext?(C(),A("span",{key:1,class:"ctx-group",title:Hs.value},[(C(),A("svg",Cj,[Ae[25]||(Ae[25]=h("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5"},null,-1)),h("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${2*Math.PI*7}`,"stroke-dashoffset":`${2*Math.PI*7*(1-en.value/100)}`},null,8,xj)])),h("span",Tj,N(Ke(e.status.ctxUsed))+"/"+N(Ke(e.status.ctxMax)),1)],8,Sj)):re("",!0),e.status?(C(),A("span",{key:2,class:$e(["model-pill",{open:nt.value}]),role:"button",tabindex:"0",title:M(r)("status.modelTooltip"),onClick:Ge(xt,["stop"]),onKeydown:[So(xt,["enter"]),So(Ge(xt,["prevent"]),["space"])]},[h("b",null,N(e.status.model),1),qs.value?(C(),A("span",Aj,N(M(r)("composer.thinkingSuffix")),1)):re("",!0),Ae[26]||(Ae[26]=h("svg",{class:"cv",viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M4 6l4 4 4-4"})],-1))],42,Mj)):re("",!0)]),nt.value&&e.status?(C(),A("div",{key:0,class:"model-dropdown",role:"menu",onClick:Ae[13]||(Ae[13]=Ge(()=>{},["stop"]))},[Ee.value.length>0?(C(),A("div",Ej,N(M(r)("status.starredModels")),1)):re("",!0),(C(!0),A(Ie,null,Ye(Ee.value,Fe=>(C(),A("button",{key:Fe.id,class:$e(["md-row",{"is-current":Fe.id===e.status.modelId}]),role:"menuitem",onClick:tt=>ve(Fe.id)},[h("span",Ij,[Fe.id===e.status.model||Fe.model===e.status.model||Fe.displayName===e.status.model?(C(),A("svg",Nj,[...Ae[27]||(Ae[27]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):re("",!0)]),h("span",Lj,N(Fe.displayName??Fe.model),1),h("span",Oj,N(Fe.provider),1),Ae[28]||(Ae[28]=h("svg",{class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},[h("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})],-1))],10,$j))),128)),Ee.value.length>0?(C(),A("div",Rj)):re("",!0),us.value.length>0?(C(),A("div",Pj,N(pn.value),1)):re("",!0),(C(!0),A(Ie,null,Ye(us.value,Fe=>(C(),A("button",{key:Fe.id,class:$e(["md-row",{"is-current":Fe.id===e.status.modelId}]),role:"menuitem",onClick:tt=>ve(Fe.id)},[h("span",Bj,[Fe.id===e.status.model||Fe.model===e.status.model||Fe.displayName===e.status.model?(C(),A("svg",Fj,[...Ae[29]||(Ae[29]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):re("",!0)]),h("span",Hj,N(Fe.displayName??Fe.model),1),ln(Fe.id)?(C(),A("svg",Wj,[...Ae[30]||(Ae[30]=[h("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,-1)])])):re("",!0)],10,Dj))),128)),us.value.length>0?(C(),A("div",Uj)):re("",!0),h("button",{class:$e(["md-row md-row-toggle",{"is-on":qs.value,"is-disabled":!Us.value}]),role:"menuitem",disabled:!Us.value,onClick:Ae[11]||(Ae[11]=Fe=>Ho())},[h("span",jj,[qs.value?(C(),A("svg",zj,[...Ae[31]||(Ae[31]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):re("",!0)]),h("span",Vj,N(M(r)("status.thinkingLabel")),1),Ws.value==="always-on"?(C(),A("span",Kj,N(M(r)("status.planOn")),1)):Ws.value==="unsupported"?(C(),A("span",Gj,N(M(r)("status.modeNotSupported")),1)):re("",!0)],10,qj),Ae[32]||(Ae[32]=h("div",{class:"md-divider"},null,-1)),h("button",{class:"md-row md-row-more",role:"menuitem",onClick:Ae[12]||(Ae[12]=Fe=>{Zt(),i("pickModel")})},[h("span",Yj,N(M(r)("status.moreModels")),1)])])):re("",!0)],512)])],34))}}),HT=vt(Xj,[["__scopeId","data-v-ca19a6c6"]]),Zj=["id"],Qj={class:"swarm-head"},Jj={class:"swarm-count"},ez={class:"swarm-grid"},tz={class:"member-top"},nz={class:"member-name"},sz={class:"member-phase"},oz={class:"member-mid"},iz={class:"member-bar"},rz={key:0,class:"member-type"},lz={key:0,class:"member-bottom"},az=Xe({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=j(()=>t.group.members.length),s=j(()=>t.group.counts.completed+t.group.counts.failed);function o(l){switch(l){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function i(l){switch(l.phase){case"queued":return"......";case"working":return":::...";case"suspended":return"::....";case"completed":return"::::::";case"failed":return"!!...."}}function r(l){return l.outputLines?.map(a=>a.trimEnd()).filter(Boolean).at(-1)}return(l,a)=>(C(),A("section",{class:"swarm-card",id:`swarm-${e.group.id}`},[h("header",Qj,[a[0]||(a[0]=h("div",{class:"swarm-title"},[h("span",{class:"swarm-mark","aria-hidden":"true"}),h("span",null,"Swarm")],-1)),h("div",Jj,N(s.value)+"/"+N(n.value),1)]),h("div",ez,[(C(!0),A(Ie,null,Ye(e.group.members,c=>(C(),A("article",{key:c.id,class:$e(["swarm-member",`phase-${c.phase}`])},[h("div",tz,[h("span",nz,N(c.name),1),h("span",sz,N(o(c.phase)),1)]),h("div",oz,[h("span",iz,N(i(c)),1),c.subagentType?(C(),A("span",rz,N(c.subagentType),1)):re("",!0)]),c.suspendedReason||r(c)||c.summary?(C(),A("div",lz,N(c.suspendedReason||r(c)||c.summary),1)):re("",!0)],2))),128))])],8,Zj))}}),cz=vt(az,[["__scopeId","data-v-6ae42022"]]),uz={class:"goal-progress","aria-hidden":"true"},dz={key:0,class:"goal-body"},fz={class:"goal-full"},hz={key:0,class:"goal-criterion"},pz={class:"goal-stats"},mz={key:0},gz={class:"goal-actions"},vz=Xe({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=te(!1);ze(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=j(()=>{const a=n.goal.budget.tokenBudget;return!a||a<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/a*100)))});function l(a){const c=Math.max(0,Math.round(a/1e3)),u=Math.floor(c/60),d=c%60;return u<=0?`${d}s`:u<60?`${u}m ${d}s`:`${Math.floor(u/60)}h ${u%60}m`}return(a,c)=>(C(),A("section",{class:$e(["goal-strip",{expanded:i.value}])},[h("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[5]||(c[5]=h("span",{class:"goal-kicker"},"Goal",-1)),h("span",{class:$e(["goal-objective",{"expanded-hidden":i.value}])},N(e.goal.objective),3),h("span",{class:$e(["goal-status",`status-${e.goal.status}`])},N(e.goal.status),3),h("span",uz,[h("span",{class:"goal-progress-fill",style:It({width:`${r.value}%`})},null,4)]),(C(),A("svg",{class:$e(["goal-chevron",{open:i.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...c[4]||(c[4]=[h("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),i.value?(C(),A("div",dz,[h("div",fz,N(e.goal.objective),1),e.goal.completionCriterion?(C(),A("div",hz,[c[6]||(c[6]=h("span",null,"Done when",-1)),h("p",null,N(e.goal.completionCriterion),1)])):re("",!0),h("div",pz,[h("span",null,N(e.goal.turnsUsed)+" turns",1),h("span",null,N(e.goal.tokensUsed.toLocaleString())+" tokens",1),h("span",null,N(l(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(C(),A("span",mz,N(r.value)+"% token budget",1)):re("",!0)]),h("div",gz,[e.goal.status!=="paused"?(C(),A("button",{key:0,type:"button",class:"goal-action",onClick:c[1]||(c[1]=Ge(u=>s("controlGoal","pause"),["stop"]))},N(M(o)("status.goalPause")),1)):re("",!0),e.goal.status==="paused"?(C(),A("button",{key:1,type:"button",class:"goal-action primary",onClick:c[2]||(c[2]=Ge(u=>s("controlGoal","resume"),["stop"]))},N(M(o)("status.goalResume")),1)):re("",!0),h("button",{type:"button",class:"goal-action danger",onClick:c[3]||(c[3]=Ge(u=>s("controlGoal","cancel"),["stop"]))},N(M(o)("status.goalCancel")),1)])])):re("",!0)],2))}}),yz=vt(vz,[["__scopeId","data-v-bca1710c"]]),kz={class:"qh"},bz={class:"qtitle"},_z={class:"qstep"},wz=["disabled"],Sz=["disabled"],Cz={key:1,class:"qmin-peek"},xz=["title","aria-label"],Tz={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},Mz={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},Az={key:0,class:"qbody"},Ez={key:0,class:"qheader-chip"},$z={class:"qtext"},Iz={class:"qopts"},Nz=["onClick"],Lz={class:"qopt-key"},Oz={class:"qopt-glyph"},Rz={key:0,class:"chk"},Pz={key:1,class:"rad"},Dz={class:"qopt-text"},Bz={class:"qopt-label"},Fz={key:0,class:"qopt-desc"},Hz={class:"qopt-glyph"},Wz={key:0,class:"chk"},Uz={key:1,class:"rad"},qz={class:"qopt-label"},jz=["placeholder"],zz={key:1,class:"qfooter"},Vz=["disabled"],Kz=Xe({__name:"QuestionCard",props:{question:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=_t(),o=t,i=te(0),r=te(!1),l=j(()=>n.question.questions[i.value]),a=j(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}const d=te({});function p(S){return S.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${S.label} ${S.description??""}`.toLowerCase())}function m(){const S={...d.value};let T=!1;for(const $ of n.question.questions){if(S[$.id])continue;const L=$.options.filter(p);L.length!==0&&(S[$.id]=$.multiSelect?{kind:"multi",optionIds:L.map(R=>R.id)}:{kind:"single",optionId:L[0].id},T=!0)}T&&(d.value=S)}ze(()=>n.question.questionId,()=>{i.value=0,r.value=!1,d.value={},w.value={}}),ze(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),m()},{immediate:!0,deep:!0});function f(S,T){const $=d.value[S];if($&&$.kind==="single"&&$.optionId===T){const L={...d.value};delete L[S],d.value=L}else d.value={...d.value,[S]:{kind:"single",optionId:T}}}function v(S,T){const $=d.value[S],L=$&&($.kind==="multi"||$.kind==="multiWithOther")?$.kind==="multi"?[...$.optionIds]:[...$.optionIds]:[],R=L.indexOf(T);R>=0?L.splice(R,1):L.push(T);const O=d.value[S],B=O&&O.kind==="multiWithOther"?O.otherText:"";B?d.value={...d.value,[S]:{kind:"multiWithOther",optionIds:L,otherText:B}}:d.value={...d.value,[S]:{kind:"multi",optionIds:L}}}const w=te({});function b(S){const T=n.question.questions.find(L=>L.id===S),$=w.value[S]??"";if(T.multiSelect){const L=d.value[S],R=L&&(L.kind==="multi"||L.kind==="multiWithOther")?L.kind==="multi"?[...L.optionIds]:[...L.optionIds]:[];d.value={...d.value,[S]:{kind:"multiWithOther",optionIds:R,otherText:$}}}else d.value={...d.value,[S]:{kind:"other",text:$}}}function _(S,T){const $=d.value[S];return $?$.kind==="single"?$.optionId===T:$.kind==="multi"||$.kind==="multiWithOther"?$.optionIds.includes(T):!1:!1}function g(S){const T=d.value[S];return!!(T&&(T.kind==="other"||T.kind==="multiWithOther"))}function y(){return n.question.questions.every(S=>{const T=d.value[S.id];return T?T.kind==="multi"?T.optionIds.length>0:T.kind==="multiWithOther"?T.optionIds.length>0||T.otherText.trim().length>0:T.kind==="other"?T.text.trim().length>0:!0:!1})}function k(){if(!y())return;const S={answers:d.value,method:"click"};o("answer",n.question.questionId,S)}function I(){o("dismiss",n.question.questionId)}function E(S){const T=(document.activeElement?.tagName??"").toLowerCase();if(T==="input"||T==="textarea"||r.value&&S.key!=="Escape")return;if(S.key==="Escape"){S.preventDefault(),I();return}if(S.key==="Enter"){S.preventDefault(),k();return}const $=parseInt(S.key,10);if(!isNaN($)&&$>=1&&$<=9){S.preventDefault();const L=l.value,R=$-1,O=L.options[R];O&&(L.multiSelect?v(L.id,O.id):f(L.id,O.id))}}return Jt(()=>document.addEventListener("keydown",E)),qt(()=>document.removeEventListener("keydown",E)),(S,T)=>(C(),A("div",{class:$e(["qcard",{minimized:r.value}])},[h("div",kz,[h("span",bz,N(M(s)("question.title")),1),a.value>1&&!r.value?(C(),A(Ie,{key:0},[h("span",_z,N(M(s)("question.step",{current:i.value+1,total:a.value})),1),h("button",{class:"qnav",disabled:i.value===0,onClick:c},N(M(s)("question.prev")),9,wz),h("button",{class:"qnav",disabled:i.value===a.value-1,onClick:u},N(M(s)("question.next")),9,Sz)],64)):re("",!0),r.value?(C(),A("span",Cz,N(l.value.question),1)):re("",!0),h("button",{class:"qmin",title:r.value?M(s)("question.expand"):M(s)("question.minimize"),"aria-label":r.value?M(s)("question.expand"):M(s)("question.minimize"),onClick:T[0]||(T[0]=$=>r.value=!r.value)},[r.value?(C(),A("svg",Tz,[...T[4]||(T[4]=[h("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(C(),A("svg",Mz,[...T[5]||(T[5]=[h("path",{d:"M3 8h10"},null,-1)])]))],8,xz)]),r.value?re("",!0):(C(),A("div",Az,[l.value.header?(C(),A("div",Ez,N(l.value.header),1)):re("",!0),h("div",$z,N(l.value.question),1),l.value.body?(C(),qe(Ff,{key:1,text:l.value.body,class:"qmdbody"},null,8,["text"])):re("",!0),h("div",Iz,[(C(!0),A(Ie,null,Ye(l.value.options,($,L)=>(C(),A("label",{key:$.id,class:$e(["qopt",{selected:_(l.value.id,$.id)}]),onClick:Ge(R=>l.value.multiSelect?v(l.value.id,$.id):f(l.value.id,$.id),["prevent"])},[h("span",Lz,N(L+1),1),h("span",Oz,[l.value.multiSelect?(C(),A("span",Rz,N(_(l.value.id,$.id)?"■":"□"),1)):(C(),A("span",Pz,N(_(l.value.id,$.id)?"●":"○"),1))]),h("span",Dz,[h("span",Bz,N($.label),1),$.description?(C(),A("span",Fz,N($.description),1)):re("",!0)])],10,Nz))),128)),l.value.allowOther?(C(),A("label",{key:0,class:$e(["qopt",{selected:g(l.value.id)}]),onClick:Ge(()=>{},["prevent"])},[T[6]||(T[6]=h("span",{class:"qopt-key"},null,-1)),h("span",Hz,[l.value.multiSelect?(C(),A("span",Wz,N(g(l.value.id)?"■":"□"),1)):(C(),A("span",Uz,N(g(l.value.id)?"●":"○"),1))]),h("span",qz,N(l.value.otherLabel??M(s)("question.otherDefault")),1),At(h("input",{"onUpdate:modelValue":T[1]||(T[1]=$=>w.value[l.value.id]=$),class:"other-input",type:"text",placeholder:l.value.otherLabel??M(s)("question.otherDefault"),onInput:T[2]||(T[2]=$=>b(l.value.id)),onFocus:T[3]||(T[3]=$=>b(l.value.id))},null,40,jz),[[bn,w.value[l.value.id]]])],2)):re("",!0)])])),r.value?re("",!0):(C(),A("div",zz,[h("button",{class:"qbtn pri",disabled:!y(),onClick:k},N(M(s)("question.submit")),9,Vz),h("button",{class:"qbtn",onClick:I},N(M(s)("question.dismiss")),1)]))],2))}}),Gz=vt(Kz,[["__scopeId","data-v-e5fa2cb7"]]),Yz={class:"ah"},Xz={class:"akind"},Zz={class:"apath"},Qz={key:0,class:"abadge"},Jz={key:1,class:"aw"},eV=["title","aria-label"],tV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},nV={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},sV={key:0,class:"diff"},oV={class:"dg"},iV={class:"dc"},rV={key:1,class:"body-shell"},lV={class:"shell-cmd"},aV={key:0,class:"shell-cwd"},cV={key:1,class:"shell-danger"},uV={key:2,class:"body-file"},dV={class:"file-bar"},fV={class:"file-lang"},hV={class:"file-content"},pV={class:"file-ln"},mV={class:"file-text"},gV={key:3,class:"body-chip"},vV={class:"chip-label"},yV={class:"chip-value"},kV={key:0,class:"chip-detail"},bV={key:4,class:"body-chip"},_V={key:0,class:"chip-label"},wV={class:"chip-value"},SV={key:5,class:"body-chip"},CV={class:"chip-label"},xV={class:"chip-value"},TV={key:0,class:"chip-detail"},MV={key:6,class:"body-chip"},AV={class:"chip-label"},EV={class:"chip-value"},$V={key:0,class:"chip-detail"},IV={key:7,class:"body-todo"},NV={class:"todo-glyph"},LV={key:8,class:"body-generic"},OV={class:"gen-text"},RV={key:9,class:"feedback-wrap"},PV=["placeholder"],DV={class:"feedback-hint"},BV={class:"abtn"},FV=Xe({__name:"ApprovalCard",props:{block:{},agentName:{}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=te(!1),r=["shell","diff","file","fileop","url","search","invocation","todo","generic"];function l(){const g=r.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${g}`)}const a=te(!1),c=te(""),u=te(null);function d(){a.value=!0,c.value="",setTimeout(()=>u.value?.focus(),0)}function p(){const g=c.value.trim();s("decide",{decision:"rejected",feedback:g||void 0}),a.value=!1,c.value=""}function m(){a.value=!1,c.value=""}function f(g){g.key==="Enter"&&!g.shiftKey?(g.preventDefault(),p()):g.key==="Escape"&&(g.preventDefault(),m())}function v(){s("decide",{decision:"approved"})}function w(){s("decide",{decision:"approved",scope:"session"})}function b(){s("decide",{decision:"rejected"})}function _(g){const y=(document.activeElement?.tagName??"").toLowerCase();y==="input"||y==="textarea"||i.value||(g.key==="1"?(g.preventDefault(),v()):g.key==="2"?(g.preventDefault(),w()):g.key==="3"?(g.preventDefault(),b()):g.key==="4"&&(g.preventDefault(),d()))}return Jt(()=>document.addEventListener("keydown",_)),qt(()=>document.removeEventListener("keydown",_)),(g,y)=>(C(),A("div",{class:$e(["appr",{minimized:i.value}])},[h("div",Yz,[h("span",Xz,N(l()),1),h("span",Zz,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(C(),A(Ie,{key:0},[dt(N(e.block.path),1)],64)):e.block.kind==="shell"?(C(),A(Ie,{key:1},[dt(N(e.block.command),1)],64)):e.block.kind==="url"?(C(),A(Ie,{key:2},[dt(N(e.block.url),1)],64)):e.block.kind==="search"?(C(),A(Ie,{key:3},[dt(N(e.block.query),1)],64)):e.block.kind==="invocation"?(C(),A(Ie,{key:4},[dt(N(e.block.name),1)],64)):e.block.kind==="generic"?(C(),A(Ie,{key:5},[dt(N(e.block.summary),1)],64)):re("",!0)]),e.agentName&&!i.value?(C(),A("span",Qz,N(M(o)("approval.subagentBadge",{name:e.agentName})),1)):re("",!0),i.value?re("",!0):(C(),A("span",Jz,N(M(o)("approval.required")),1)),h("button",{class:"amin",title:i.value?M(o)("question.expand"):M(o)("question.minimize"),"aria-label":i.value?M(o)("question.expand"):M(o)("question.minimize"),onClick:y[0]||(y[0]=k=>i.value=!i.value)},[i.value?(C(),A("svg",tV,[...y[2]||(y[2]=[h("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(C(),A("svg",nV,[...y[3]||(y[3]=[h("path",{d:"M3 8h10"},null,-1)])]))],8,eV)]),i.value?re("",!0):(C(),A(Ie,{key:0},[e.block.kind==="diff"?(C(),A("div",sV,[(C(!0),A(Ie,null,Ye(e.block.diff,(k,I)=>(C(),A("div",{key:I,class:$e(["dl",k.kind==="add"?"add":k.kind==="rem"?"del":""])},[h("span",oV,N(k.gutter),1),h("span",iV,N(k.text),1)],2))),128))])):e.block.kind==="shell"?(C(),A("div",rV,[h("div",lV,[y[4]||(y[4]=h("span",{class:"shell-dollar"},"$",-1)),dt(" "+N(e.block.command),1)]),e.block.cwd?(C(),A("div",aV,"cwd: "+N(e.block.cwd),1)):re("",!0),e.block.danger?(C(),A("div",cV,N(M(o)("approval.danger",{detail:e.block.danger})),1)):re("",!0)])):e.block.kind==="file"?(C(),A("div",uV,[h("div",dV,[h("span",fV,N(e.block.language??""),1)]),h("div",hV,[(C(!0),A(Ie,null,Ye(e.block.content.split(`
|
|
243
|
+
`),(k,I)=>(C(),A("div",{key:I,class:"file-line"},[h("span",pV,N(I+1),1),h("span",mV,N(k),1)]))),128))])])):e.block.kind==="fileop"?(C(),A("div",gV,[h("span",vV,N(e.block.op),1),h("span",yV,N(e.block.path),1),e.block.detail?(C(),A("span",kV,N(e.block.detail),1)):re("",!0)])):e.block.kind==="url"?(C(),A("div",bV,[e.block.method?(C(),A("span",_V,N(e.block.method),1)):re("",!0),h("span",wV,N(e.block.url),1)])):e.block.kind==="search"?(C(),A("div",SV,[h("span",CV,N(M(o)("approval.searchQueryLabel")),1),h("span",xV,N(e.block.query),1),e.block.scope?(C(),A("span",TV,N(M(o)("approval.searchScope",{scope:e.block.scope})),1)):re("",!0)])):e.block.kind==="invocation"?(C(),A("div",MV,[h("span",AV,N(e.block.kind2),1),h("span",EV,N(e.block.name),1),e.block.description?(C(),A("span",$V,N(e.block.description),1)):re("",!0)])):e.block.kind==="todo"?(C(),A("div",IV,[(C(!0),A(Ie,null,Ye(e.block.items,(k,I)=>(C(),A("div",{key:I,class:"todo-item"},[h("span",NV,N(k.status==="done"||k.status==="completed"?"✓":"○"),1),h("span",{class:$e(["todo-title",{"todo-done":k.status==="done"||k.status==="completed"}])},N(k.title),3)]))),128))])):(C(),A("div",LV,[h("span",OV,N(e.block.summary),1)])),a.value?(C(),A("div",RV,[At(h("textarea",{ref_key:"feedbackRef",ref:u,"onUpdate:modelValue":y[1]||(y[1]=k=>c.value=k),class:"feedback-ta",placeholder:M(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:f},null,40,PV),[[bn,c.value]]),h("div",DV,N(M(o)("approval.feedbackHint")),1)])):re("",!0),h("div",BV,[h("div",{class:"kbtn pri",onClick:v},[dt(N(M(o)("approval.approve")),1),y[5]||(y[5]=h("span",{class:"k"},"[1]",-1))]),h("div",{class:"kbtn",onClick:w},[dt(N(M(o)("approval.approveSession")),1),y[6]||(y[6]=h("span",{class:"k"},"[2]",-1))]),h("div",{class:"kbtn",onClick:b},[dt(N(M(o)("approval.reject")),1),y[7]||(y[7]=h("span",{class:"k"},"[3]",-1))]),h("div",{class:"kbtn",onClick:d},[dt(N(M(o)("approval.feedback")),1),y[8]||(y[8]=h("span",{class:"k"},"[4]",-1))])])],64))],2))}}),HV=vt(FV,[["__scopeId","data-v-01d528a6"]]),WV={class:"taskspane"},UV={class:"tp-head"},qV={class:"tp-title"},jV={class:"tp-count"},zV={class:"tp-list"},VV={key:0,class:"tp-empty"},KV=["role","onClick"],GV={class:"tp-name"},YV={class:"tp-kind"},XV={class:"tp-time"},ZV=["onClick"],QV={key:0,class:"tp-detail"},JV={key:0,class:"tp-codebox"},eK=["onClick"],tK={class:"tp-pre"},nK={class:"tp-cmd"},sK={key:1,class:"tp-codebox"},oK=["onClick"],iK={class:"tp-pre"},rK=Xe({__name:"TasksPane",props:{tasks:{}},emits:["cancel"],setup(e,{emit:t}){const n=t,{t:s}=_t(),o=Ys(new Set),i=Ys(new Set),r=Ys(new Set);function l(f){return!!(f.output&&f.output.length>0||f.meta)}function a(f){l(f)&&(o.has(f.id)?o.delete(f.id):o.add(f.id))}function c(f){switch(f){case"run":return"●";case"done":return"✓";case"fail":return"✗";default:return"○"}}function u(f){switch(f){case"run":return"s-run";case"done":return"s-done";case"fail":return"s-fail";default:return"s-pending"}}async function d(f,v,w){try{await navigator.clipboard.writeText(f),w.add(v),setTimeout(()=>w.delete(v),1500)}catch{}}async function p(f){f.meta&&await d(f.meta,f.id,i)}async function m(f){const v=f.output?.join(`
|
|
244
|
+
`)??"";v&&await d(v,f.id,r)}return(f,v)=>(C(),A("div",WV,[h("div",UV,[h("span",qV,N(M(s)("tasks.tag")),1),h("span",jV,N(e.tasks.length),1)]),h("div",zV,[e.tasks.length===0?(C(),A("div",VV,N(M(s)("tasks.emptyTasks")),1)):(C(!0),A(Ie,{key:1},Ye(e.tasks,w=>(C(),A("div",{key:w.id,class:$e(["tp-row",{done:w.state==="done",fail:w.state==="fail",expandable:l(w)}])},[h("div",{class:"tp-main",role:l(w)?"button":void 0,onClick:b=>a(w)},[h("span",{class:$e(["tp-glyph",u(w.state)])},N(c(w.state)),3),h("span",GV,N(w.name),1),h("span",YV,N(w.kind),1),h("span",XV,N(w.timing),1),w.state==="run"?(C(),A("button",{key:0,class:"tp-stop",onClick:Ge(b=>n("cancel",w.id),["stop"])},N(M(s)("tasks.stop")),9,ZV)):re("",!0),l(w)?(C(),A("svg",{key:1,class:$e(["tp-chevron",{open:o.has(w.id)}]),viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...v[0]||(v[0]=[h("path",{d:"M6 4l4 4-4 4"},null,-1)])],2)):re("",!0)],8,KV),o.has(w.id)&&l(w)?(C(),A("div",QV,[w.meta?(C(),A("div",JV,[h("button",{class:$e(["tp-copy",{copied:i.has(w.id)}]),onClick:Ge(b=>p(w),["stop"])},N(i.has(w.id)?"已复制":"复制"),11,eK),h("pre",tK,[h("code",null,[h("span",nK,N(w.meta),1)])])])):re("",!0),w.output&&w.output.length>0?(C(),A("div",sK,[h("button",{class:$e(["tp-copy",{copied:r.has(w.id)}]),onClick:Ge(b=>m(w),["stop"])},N(r.has(w.id)?"已复制":"复制"),11,oK),h("pre",iK,[h("code",null,[v[1]||(v[1]=dt(`
|
|
245
|
+
`,-1)),(C(!0),A(Ie,null,Ye(w.output,(b,_)=>(C(),A("span",{key:_,class:"tp-line"},N(b),1))),128)),v[2]||(v[2]=dt(`
|
|
246
|
+
`,-1))])])])):re("",!0)])):re("",!0)],2))),128))])]))}}),Cw=vt(rK,[["__scopeId","data-v-99eb3f76"]]),lK={class:"tc-title"},aK={key:0,class:"tc-count"},cK={key:0,class:"tc-list"},uK={key:0,class:"tc-empty"},dK={class:"tc-name"},fK=Xe({__name:"TodoCard",props:{todos:{},inline:{type:Boolean}},setup(e){const t=e,{t:n}=_t(),s=te(!1),o=j(()=>!t.inline),i=j(()=>t.inline||!s.value);function r(){o.value&&(s.value=!s.value)}const l=j(()=>t.todos.filter(c=>c.status==="done").length);function a(c){return c==="done"?"done":c==="in_progress"?"in_progress":"pending"}return(c,u)=>(C(),A("div",{class:$e(["todo-card",{"tab-mode":e.inline}])},[(C(),qe(os(o.value?"button":"div"),{class:$e(["tc-head",{static:!o.value}]),type:o.value?"button":void 0,onClick:r},{default:kn(()=>[u[1]||(u[1]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.4","aria-hidden":"true"},[h("polyline",{points:"2,4.5 3.5,6 5.5,3"}),h("polyline",{points:"2,11 3.5,12.5 5.5,9.5"}),h("line",{x1:"8",y1:"4.5",x2:"14",y2:"4.5"}),h("line",{x1:"8",y1:"11",x2:"14",y2:"11"})],-1)),h("span",lK,N(M(n)("tasks.todoTag")),1),e.todos.length>0?(C(),A("span",aK,N(l.value)+"/"+N(e.todos.length),1)):re("",!0),o.value&&e.todos.length>0?(C(),A("svg",{key:1,class:$e(["tc-chev",{open:!s.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...u[0]||(u[0]=[h("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2)):re("",!0)]),_:1},8,["class","type"])),i.value?(C(),A("div",cK,[e.todos.length===0?(C(),A("div",uK,N(M(n)("tasks.emptyTodo")),1)):re("",!0),(C(!0),A(Ie,null,Ye(e.todos,(d,p)=>(C(),A("div",{key:p,class:$e(["tc-row",`s-${d.status}`])},[h("span",{class:$e(["tc-glyph",`g-${a(d.status)}`])},null,2),h("span",dK,N(d.title),1)],2))),128))])):re("",!0)],2))}}),hK=vt(fK,[["__scopeId","data-v-aa76ea4d"]]),pK={key:0,class:"queue-head"},mK={class:"queue-label"},gK=["title"],vK={class:"queue-list"},yK=["disabled","title","onClick"],kK={key:0,class:"queue-img",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},bK=["title","onClick"],_K=Xe({__name:"QueuePane",props:{queued:{},running:{type:Boolean},inline:{type:Boolean}},emits:["steer","unqueue","editQueued"],setup(e,{emit:t}){const n=t,{t:s}=_t();function o(i,r){r.attachmentCount>0||n("editQueued",i)}return(i,r)=>(C(),A("div",{class:$e(["queue-pane",{"tab-mode":e.inline}])},[e.inline?re("",!0):(C(),A("div",pK,[h("span",mK,N(M(s)("composer.queueLabel"))+" · "+N(e.queued.length),1),e.running?(C(),A("button",{key:0,class:"queue-steer",type:"button",title:M(s)("composer.steerTitle"),onClick:r[0]||(r[0]=l=>n("steer"))},N(M(s)("composer.steerNow")),9,gK)):re("",!0)])),h("div",vK,[(C(!0),A(Ie,null,Ye(e.queued,(l,a)=>(C(),A("div",{key:a,class:"queue-item"},[h("button",{class:"queue-text",type:"button",disabled:l.attachmentCount>0,title:l.attachmentCount>0?M(s)("composer.queuedHasImage",{n:l.attachmentCount}):M(s)("composer.editQueued"),onClick:c=>o(a,l)},[l.attachmentCount>0?(C(),A("svg",kK,[...r[1]||(r[1]=[h("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},null,-1),h("circle",{cx:"5.5",cy:"6.5",r:"1.2"},null,-1),h("path",{d:"M2.5 12l3.5-3.5 2.5 2.5 3-3 2 2"},null,-1)])])):re("",!0),h("span",{class:$e(["queue-text-inner",{placeholder:!l.text}])},N(l.text||M(s)("composer.queuedImageOnly",{n:l.attachmentCount})),3)],8,yK),h("button",{class:"queue-rm",title:M(s)("composer.remove"),onClick:c=>n("unqueue",a)},[...r[2]||(r[2]=[h("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,bK)]))),128))])],2))}}),wK=vt(_K,[["__scopeId","data-v-32b1ed3b"]]),SK={class:"dock-work-head"},CK={key:0,class:"dock-work-tab static"},xK={key:1,class:"dock-work-tab static"},TK={key:2,class:"dock-work-tab static"},MK={key:3,class:"dock-work-tab static"},AK=["title"],EK={class:"dock-work-body"},$K=["aria-pressed"],IK={class:"dw-count"},NK=["aria-pressed"],LK={class:"dw-count"},OK=["aria-pressed"],RK={class:"dw-count"},PK=["aria-pressed"],DK={class:"dw-count"},BK=Xe({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},pendingApproval:{},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:i}=_t(),r=te(null),l=te(null),a=te(null);function c(p){r.value?.loadForEdit(p)}function u(p){const m=s.queued?.[p]?.text??"";m&&c(m),o("editQueued",p)}function d(p){if(!s.dockPanel)return;const m=p.target;m&&(l.value?.contains(m)||a.value?.contains(m)||o("close-dock-panel"))}return ze(()=>s.dockPanel,p=>{typeof document>"u"||(document.removeEventListener("mousedown",d,!0),p&&document.addEventListener("mousedown",d,!0))},{immediate:!0}),qt(()=>{typeof document<"u"&&document.removeEventListener("mousedown",d,!0)}),t({loadForEdit:c}),(p,m)=>(C(),A("div",{class:$e(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:m[31]||(m[31]=Ge(()=>{},["stop"]))},[pt(Ti,{name:"dock-panel"},{default:kn(()=>[e.dockPanel?(C(),A("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:m[5]||(m[5]=Ge(()=>{},["stop"]))},[h("div",SK,[e.dockPanel==="bash"?(C(),A("span",CK,N(M(i)("tasks.dockBash"))+" · "+N(e.bashRunning)+" "+N(M(i)("tasks.running")),1)):e.dockPanel==="subagent"?(C(),A("span",xK,N(M(i)("tasks.dockSubagent"))+" · "+N(e.subagentRunning)+" "+N(M(i)("tasks.running")),1)):e.dockPanel==="todos"?(C(),A("span",TK,N(M(i)("tasks.dockTodos"))+" · "+N(e.todoDoneCount)+"/"+N(e.todos?.length??0),1)):e.dockPanel==="queue"?(C(),A("span",MK,N(M(i)("tasks.dockQueue"))+" · "+N(e.queued?.length??0),1)):re("",!0),e.dockPanel==="queue"&&e.running?(C(),A("button",{key:4,type:"button",class:"dock-queue-steer",title:M(i)("composer.steerTitle"),onClick:m[0]||(m[0]=f=>o("steer",{text:"",attachments:[]}))},N(M(i)("composer.steerNow")),9,AK)):re("",!0)]),h("div",EK,[e.dockPanel==="bash"?(C(),qe(Cw,{key:0,tasks:e.bashTasks,onCancel:m[1]||(m[1]=f=>o("cancelTask",f))},null,8,["tasks"])):e.dockPanel==="subagent"?(C(),qe(Cw,{key:1,tasks:e.subagentTasks,onCancel:m[2]||(m[2]=f=>o("cancelTask",f))},null,8,["tasks"])):e.dockPanel==="todos"?(C(),qe(hK,{key:2,todos:e.todos??[],inline:""},null,8,["todos"])):(C(),qe(wK,{key:3,queued:e.queued??[],running:e.running,inline:"",onSteer:m[3]||(m[3]=f=>o("steer",{text:"",attachments:[]})),onUnqueue:m[4]||(m[4]=f=>o("unqueue",f)),onEditQueued:u},null,8,["queued","running"]))])],512)):re("",!0)]),_:1}),e.goal?(C(),qe(yz,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:m[6]||(m[6]=f=>o("controlGoal",f))},null,8,["goal","force-expanded"])):re("",!0),e.hasDockWork?(C(),A("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(C(),A("button",{key:0,type:"button",class:$e(["dock-work-chip",{on:e.dockPanel==="bash"}]),"aria-pressed":e.dockPanel==="bash",onClick:m[7]||(m[7]=f=>o("toggle-dock-panel","bash"))},[m[34]||(m[34]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[h("circle",{cx:"8",cy:"8",r:"5.5"}),h("path",{d:"M8 4.5V8l2.5 1.5"})],-1)),h("span",null,N(M(i)("tasks.dockBash")),1),h("span",IK,[m[32]||(m[32]=dt("(",-1)),h("b",null,N(e.bashTasks.length),1),m[33]||(m[33]=dt(")",-1))])],10,$K)):re("",!0),e.subagentTasks.length>0?(C(),A("button",{key:1,type:"button",class:$e(["dock-work-chip",{on:e.dockPanel==="subagent"}]),"aria-pressed":e.dockPanel==="subagent",onClick:m[8]||(m[8]=f=>o("toggle-dock-panel","subagent"))},[m[37]||(m[37]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z"})],-1)),h("span",null,N(M(i)("tasks.dockSubagent")),1),h("span",LK,[m[35]||(m[35]=dt("(",-1)),h("b",null,N(e.subagentTasks.length),1),m[36]||(m[36]=dt(")",-1))])],10,NK)):re("",!0),(e.todos?.length??0)>0?(C(),A("button",{key:2,type:"button",class:$e(["dock-work-chip",{on:e.dockPanel==="todos"}]),"aria-pressed":e.dockPanel==="todos",onClick:m[9]||(m[9]=f=>o("toggle-dock-panel","todos"))},[m[40]||(m[40]=mr('<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" data-v-8dab8b74><path d="M3 4.5l1.5 1.5L7 3.5" data-v-8dab8b74></path><path d="M8.5 5h4" data-v-8dab8b74></path><path d="M3 11l1.5 1.5L7 10" data-v-8dab8b74></path><path d="M8.5 11.5h4" data-v-8dab8b74></path></svg>',1)),h("span",null,N(M(i)("tasks.dockTodos")),1),h("span",RK,[m[38]||(m[38]=dt("(",-1)),h("b",null,N(e.todoDoneCount)+"/"+N(e.todos?.length??0),1),m[39]||(m[39]=dt(")",-1))])],10,OK)):re("",!0),(e.queued?.length??0)>0?(C(),A("button",{key:3,type:"button",class:$e(["dock-work-chip",{on:e.dockPanel==="queue"}]),"aria-pressed":e.dockPanel==="queue",onClick:m[10]||(m[10]=f=>o("toggle-dock-panel","queue"))},[m[43]||(m[43]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[h("path",{d:"M2 4l6 4 6-4"}),h("rect",{x:"2",y:"4",width:"12",height:"8",rx:"1.5"})],-1)),h("span",null,N(M(i)("tasks.dockQueue")),1),h("span",DK,[m[41]||(m[41]=dt("(",-1)),h("b",null,N(e.queued?.length??0),1),m[42]||(m[42]=dt(")",-1))])],10,PK)):re("",!0)],512)):re("",!0),e.pendingQuestion?(C(),qe(Gz,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,onAnswer:m[11]||(m[11]=(f,v)=>o("answer",f,v)),onDismiss:m[12]||(m[12]=f=>o("dismiss",f))},null,8,["question"])):e.pendingApproval?(C(),qe(HV,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,onDecide:m[13]||(m[13]=f=>o("approval",e.pendingApproval.approvalId,f))},null,8,["block","agent-name"])):(C(),qe(HT,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:m[14]||(m[14]=f=>o("submit",f)),onSteer:m[15]||(m[15]=f=>o("steer",f)),onCommand:m[16]||(m[16]=f=>o("command",f)),onInterrupt:m[17]||(m[17]=f=>o("interrupt")),onSetPermission:m[18]||(m[18]=f=>o("setPermission",f)),onSetThinking:m[19]||(m[19]=f=>o("setThinking",f)),onTogglePlan:m[20]||(m[20]=f=>o("togglePlan")),onToggleSwarm:m[21]||(m[21]=f=>o("toggleSwarm")),onToggleGoal:m[22]||(m[22]=f=>o("toggleGoal")),onOpenBtw:m[23]||(m[23]=f=>o("openBtw")),onCreateGoal:m[24]||(m[24]=f=>o("createGoal",f)),onControlGoal:m[25]||(m[25]=f=>o("controlGoal",f)),onFocusGoal:m[26]||(m[26]=f=>o("focusGoal")),onFocusSwarm:m[27]||(m[27]=f=>o("focusSwarm")),onCompact:m[28]||(m[28]=f=>o("compact")),onPickModel:m[29]||(m[29]=f=>o("pickModel")),onSelectModel:m[30]||(m[30]=f=>o("selectModel",f))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]))],2))}}),FK=vt(BK,[["__scopeId","data-v-8dab8b74"]]),HK=5;function WK(e,t,n,s=HK){if(n||e.length<=s)return e;const o=e.slice(0,s);if(t&&!o.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(o[s-1]=i)}return o}const UK=["aria-label"],qK={class:"toc-track"},jK=["aria-label","onMouseenter","onClick"],zK={class:"toc-no"},VK={class:"chat-layout"},KK={class:"empty-hint"},GK={class:"empty-hint-title"},YK={class:"empty-hint-text"},XK={key:0,class:"ws-pick"},ZK=["title"],QK={class:"ws-pick-name"},JK={key:1,class:"ws-pick-menu"},eG=["onClick"],tG={class:"ws-pick-item-name"},nG={class:"ws-pick-item-path"},sG={key:0,class:"swarm-stack"},oG=["aria-label"],iG={key:0,class:"abort-toast",role:"status","aria-live":"polite"},rG={class:"abort-toast-text"},_d=10,lG=56,aG=420,xw=80,cG=1e3,uG=3e3,dG=Xe({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},swarms:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},modern:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},betaToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=te(!1),r=te(!1),l=j(()=>s.workspaces?.find(ve=>ve.id===s.activeWorkspaceId)?.name??s.workspaceName??""),a=j(()=>(s.workspaces?.length??0)>0),c=j(()=>WK(s.workspaces??[],s.activeWorkspaceId,r.value)),u=j(()=>(s.workspaces?.length??0)-c.value.length);ze(i,Ee=>{Ee||(r.value=!1)});const d=j(()=>s.swarms?.filter(Ee=>Ee.members.some(ve=>ve.phase!=="completed"&&ve.phase!=="failed"))??[]);function p(Ee){i.value=!1,Ee!==s.activeWorkspaceId&&o("selectWorkspace",Ee)}const{t:m}=_t();uu(jt.contentAlign);const f=te(null),v=te(null),w=te(null),b=te(!1),_=te(0);let g=null;function y(Ee){(w.value??v.value)?.loadForEdit(Ee)}function k(){b.value=!0,g!==null&&clearTimeout(g),g=setTimeout(()=>{g=null,b.value=!1},2e3)}function I(){_.value++}function E(){ut(()=>{P.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const S=j(()=>s.mobile===!0||s.modern===!0),T=j(()=>s.tasks.filter(Ee=>Ee.kind!=="subagent")),$=j(()=>s.tasks.filter(Ee=>Ee.kind==="subagent")),L=j(()=>T.value.filter(Ee=>Ee.state==="run").length),R=j(()=>$.value.filter(Ee=>Ee.state==="run").length),O=j(()=>(s.todos??[]).filter(Ee=>Ee.status==="done").length),B=j(()=>s.tasks.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),F=te(null),q=j(()=>s.gitInfo?s.changes?.length??0:0);function G(Ee){F.value=F.value===Ee?null:Ee}function K(){F.value=null}ze(B,Ee=>{Ee||K()});function oe(Ee){if(Ee.role==="compaction")return m("conversation.compactedPlain");if(Ee.role==="user"){if(Ee.skillActivation)return`/${Ee.skillActivation.name}`;const ee=Ee.text.trim().replaceAll(/\s+/g," ");return ee.length>0?ee:"user"}const ve=(Ee.text||Ee.thinking||"").trim().replaceAll(/\s+/g," ");return ve.length>0?ve:(Ee.tools?.length??0)>0?`${Ee.tools.length} tools`:"kimi"}const le=j(()=>s.turns.map((Ee,ve)=>({id:Ee.id,role:Ee.role,no:Ee.no||ve+1,title:oe(Ee)})));function pe(Ee){return Ee.role==="compaction"?20:Ee.role==="user"?(Ee.text?.length??0)+(Ee.skillActivation?20:0):(Ee.text?.length??0)+(Ee.thinking?.length??0)+(Ee.tools?.reduce((ve,ee)=>ve+ee.name.length+(ee.arg?.length??0)+(ee.output?.join("").length??0),0)??0)}const be=j(()=>{const Ee=le.value,ve=Ee.map(Ae=>{const Fe=s.turns.find(tt=>tt.id===Ae.id);return Fe?pe(Fe):_d}),ee=ve.reduce((Ae,Fe)=>Ae+Fe,0)||Ee.length*_d;return Ee.map((Ae,Fe)=>{const tt=ve[Fe]??_d,yt=ee>0?tt/ee:0,Pt=Math.max(_d,Math.min(lG,yt*aG));return{id:Ae.id,height:Math.round(Pt)}})}),Be=j(()=>be.value.reduce((Ee,ve)=>Ee+ve.height,0)+(le.value.length-1)*4),He=te(null),Ne=te(null),me=te({visible:!1,text:"",top:0});function _e(){const Ee=P.value;if(!Ee)return;const ve=Ee.querySelectorAll(".turn-anchor[data-turn-id]");if(ve.length===0)return;const ee=Ee.getBoundingClientRect(),Ae=ee.height/2;let Fe=null,tt=1/0;ve.forEach(ao=>{const Ri=ao.getBoundingClientRect(),co=Ri.top-ee.top,Ar=Math.abs(co+Ri.height/2-Ae);Ar<tt&&(tt=Ar,Fe=ao.dataset.turnId??null)}),He.value=Fe;const yt=Ee.scrollHeight-Ee.clientHeight,Pt=yt>0?Ee.scrollTop/yt:0,mn=Be.value,Qn=Pt*mn,gn=Ee.scrollHeight>0?Ee.clientHeight/Ee.scrollHeight*mn:mn;Ne.value={top:Math.max(0,Qn),height:Math.max(8,Math.min(gn,mn-Qn))}}function Ce(Ee,ve){const ee=ve.currentTarget;ee&&(me.value={visible:!0,text:Ee,top:ee.offsetTop})}function de(){me.value.visible=!1}const z=j(()=>!s.mobile&&!s.sessionLoading&&le.value.length>1),Z=j(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),fe=j(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),P=te(null),X=te(null),ne=te(0),se=te(0),ce=j(()=>({"--panes-scrollbar-width":`${ne.value}px`}));function H(Ee){return Ee instanceof HTMLElement?Ee:Ee&&"$el"in Ee&&Ee.$el instanceof HTMLElement?Ee.$el:null}function U(){const Ee=P.value;ne.value=Ee?Math.max(0,Ee.offsetWidth-Ee.clientWidth):0,se.value=X.value?.offsetHeight??0}function Q(Ee){const ve=H(Ee);P.value=ve,ve&&xs()}function ue(Ee){const ve=H(Ee);X.value=ve??null,Ee&&"loadForEdit"in Ee&&typeof Ee.loadForEdit=="function"?w.value={loadForEdit:Ee.loadForEdit.bind(Ee)}:w.value=null,cs()}const ge=te(!0),xe=te(!1);function ie(){const Ee=P.value;return Ee?Ee.scrollHeight-Ee.scrollTop-Ee.clientHeight:0}let we=0,je=0,Je=0,nt=0,Ve=0;function ft(){return Date.now()<je}function xt(){const Ee=P.value;if(!Ee)return;const ve=Ee.scrollTop;if(performance.now()-Je<100){we=ve;return}const ee=ie();if(ft()){ge.value=!0,xe.value=!1,we=ve;return}ve<we-1&&ee>1?ge.value=!1:ee<=xw&&ve>we+1&&(ge.value=!0,xe.value=!1),we=ve,_e()}function Zt(Ee=!1){const ve=P.value;ve&&(Ee&&typeof ve.scrollTo=="function"?(Je=performance.now(),ve.scrollTo({top:ve.scrollHeight,behavior:"smooth"})):ve.scrollTop=ve.scrollHeight,we=ve.scrollTop,ge.value=!0,xe.value=!1)}function Ht(Ee,ve){const ee=Ee.querySelectorAll(".turn-anchor");for(const Ae of ee)if(Ae.offsetTop>=ve){const Fe=Ae.dataset.turnId;if(Fe)return{id:Fe,top:Ae.offsetTop}}return null}async function Nn(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||!s.hasMoreMessages)return;const Ee=s.sessionId,ve=P.value,ee=ve?.scrollTop??0,Ae=ve?.scrollHeight??0,Fe=ve?Ht(ve,ee):null;lo.value=!0;try{await s.loadOlderMessages(Ee),await ut()}finally{lo.value=!1}if(s.sessionId!==Ee)return;const tt=P.value;if(!tt)return;let yt=0;if(Fe){const Pt=tt.querySelector(`.turn-anchor[data-turn-id="${xn(Fe.id)}"]`);Pt&&(yt=Pt.offsetTop-Fe.top)}yt===0&&(yt=tt.scrollHeight-Ae),tt.scrollTop=ee+yt}function xn(Ee){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ee):Ee.replaceAll(/["\\]/g,"\\$&")}function Ke(Ee){const ve=P.value;if(!ve)return;const ee=ve.querySelector(`.turn-anchor[data-turn-id="${xn(Ee)}"]`);ee&&(ge.value=!1,xe.value=ie()>xw,ee.scrollIntoView({behavior:"smooth",block:"center"}))}function en(){const Ee=P.value;if(!Ee)return"none";const ve=Ee.firstElementChild,ee=ve instanceof HTMLElement?ve.offsetHeight:0,Ae=X.value?.offsetHeight??0;return`${Ee.scrollHeight}:${Ee.clientHeight}:${ee}:${Ae}`}function Hs(Ee){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ee):setTimeout(Ee,16)}function qn(Ee){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ee):clearTimeout(Ee)}function Bn(Ee=36){if(!ge.value&&!ft())return;const ve=++Ve;let ee="",Ae=0,Fe=0;nt&&(qn(nt),nt=0);const tt=()=>{if(nt=0,ve!==Ve||!ge.value&&!ft())return;Zt(!1);const yt=en();Ae=yt===ee?Ae+1:0,ee=yt,Fe++,Ae<3&&Fe<Ee&&(nt=Hs(tt))};nt=Hs(tt)}function Ws(Ee,ve){return Ee!==void 0&&Ee.length>0&&ve.length>=Ee.length&&Ee.firstId!==ve.firstId&&Ee.lastId===ve.lastId&&Ee.lastTextLen===ve.lastTextLen&&Ee.lastThinkingLen===ve.lastThinkingLen&&Ee.lastToolsLen===ve.lastToolsLen&&Ee.approvalIds===ve.approvalIds}const Us=j(()=>{const Ee=(s.approvals??[]).map(tt=>tt.approvalId).join(","),ve=s.turns,ee=ve.at(-1),Ae=ee?.thinking?.length??0,Fe=ee?.tools?.reduce((tt,yt)=>tt+yt.name.length+(yt.arg?.length??0)+(yt.output?.join("").length??0),0)??0;return{length:ve.length,firstId:ve[0]?.id??"",lastId:ee?.id??"",lastTextLen:ee?.text.length??0,lastThinkingLen:Ae,lastToolsLen:Fe,approvalIds:Ee}});ze(Us,async(Ee,ve)=>{if(lo.value&&Ws(ve,Ee)){_e();return}await ut(),ge.value||ft()?Zt(!1):xe.value=!0,_e()}),ze(X,()=>{cs()}),ze(()=>s.mobile,async()=>{await ut(),U()}),ze(()=>s.fileReloadKey,async()=>{ge.value=!0,we=0,await ut(),Bn(),_e()}),ze(()=>s.sessionLoading,async(Ee,ve)=>{Ee||!ve||(ge.value=!0,await ut(),Bn(),_e())}),ze(()=>s.running,async(Ee,ve)=>{Ee||!ve||!ge.value&&!ft()||(await ut(),Bn(48),_e())});function qs(){ge.value=!0,xe.value=!1,je=Date.now()+cG,ut(()=>{Zt(!1),Bn(16)})}function Ho(Ee){qs(),o("submit",Ee)}function $o(Ee,ve){qs(),o("answer",Ee,ve)}function ro(Ee,ve){!Ee||!ve||o("approval",Ee,ve)}let Ln=null,on=null,Zn=null,wt=null,as=0,Vt=!1;const lo=te(!1);function ri(Ee){if(lo.value||(Vt=Vt||Ee,as))return;as=(typeof requestAnimationFrame=="function"?requestAnimationFrame:ee=>setTimeout(ee,16))(()=>{as=0;const ee=Vt;Vt=!1,ge.value||ft()?Zt(!1):ee&&(xe.value=!0)})}function Wo(){if(!on)return;const Ee=P.value?.firstElementChild??null;Ee!==Zn&&(Zn&&on.unobserve(Zn),Zn=Ee,Ee&&on.observe(Ee))}function cs(){if(!on)return;const Ee=X.value;Ee!==wt&&(wt&&on.unobserve(wt),wt=Ee,Ee&&on.observe(Ee))}function xs(){const Ee=P.value;U(),Ln&&(Ln.disconnect(),Ee&&Ln.observe(Ee,{childList:!0,subtree:!0,characterData:!0})),on&&(on.disconnect(),Zn=null,wt=null,Ee&&on.observe(Ee),Wo(),cs())}function Ts(){Wo(),ri(!0)}function gt(){typeof document>"u"||document.visibilityState==="visible"&&ge.value&&Bn()}const Ms=te(!1);let pn=null;function us(){Ms.value=!0,pn!==null&&clearTimeout(pn),pn=setTimeout(()=>{Ms.value=!1},uG)}function tn(){us(),o("interrupt")}function ln(Ee){Ee.key==="Escape"&&(s.running||s.sending)&&(Ee.preventDefault(),tn())}return Jt(()=>{ut(()=>{typeof MutationObserver=="function"&&(Ln=new MutationObserver(Ts)),typeof ResizeObserver=="function"&&(on=new ResizeObserver(()=>{U(),ri(!1)})),xs(),Bn(48),_e(),typeof document<"u"&&(document.addEventListener("visibilitychange",gt),document.addEventListener("keydown",ln))})}),qt(()=>{Ln&&Ln.disconnect(),on&&on.disconnect(),as&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(as),nt&&qn(nt),pn!==null&&clearTimeout(pn),g!==null&&(clearTimeout(g),g=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",gt),document.removeEventListener("keydown",ln))}),t({loadComposerForEdit:y}),(Ee,ve)=>(C(),A("section",{class:$e(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(C(),qe(yq,{key:0,"session-id":e.sessionId,"workspace-name":e.workspaceName,"workspace-root":e.workspaceRoot,"session-title":e.sessionTitle,branch:e.gitInfo?.branch,ahead:e.gitInfo?.ahead,behind:e.gitInfo?.behind,"changes-count":q.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:b.value,onOpenChanges:ve[0]||(ve[0]=ee=>o("openChanges")),onCopyAll:ve[1]||(ve[1]=ee=>f.value?.copyConversation()),onCopyFinalSummary:ve[2]||(ve[2]=ee=>f.value?.copyFinalSummary()),onOpenPr:ve[3]||(ve[3]=ee=>e.pr&&o("openPr",e.pr.url)),onRenameSession:ve[4]||(ve[4]=(ee,Ae)=>o("renameSession",ee,Ae)),onForkSession:ve[5]||(ve[5]=ee=>o("forkSession",ee)),onArchiveSession:ve[6]||(ve[6]=ee=>o("archiveSession",ee))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):re("",!0),z.value&&e.betaToc?(C(),A("nav",{key:1,class:"conversation-toc","aria-label":M(m)("conversation.toc")},[h("div",qK,[(C(!0),A(Ie,null,Ye(le.value,(ee,Ae)=>(C(),A("button",{key:ee.id,type:"button",class:$e(["toc-bubble",[ee.role,{active:He.value===ee.id}]]),style:It({height:be.value[Ae]?.height+"px"}),"aria-label":`#${ee.no} ${ee.title}`,onMouseenter:Fe=>Ce(ee.title,Fe),onMouseleave:de,onClick:Fe=>Ke(ee.id)},[h("span",zK,N(ee.no),1)],46,jK))),128)),Ne.value?(C(),A("div",{key:0,class:"toc-viewport",style:It({top:Ne.value.top+"px",height:Ne.value.height+"px"})},null,4)):re("",!0)]),pt(Ti,{name:"toc-tip"},{default:kn(()=>[At(h("div",{class:"toc-tooltip",style:It({top:me.value.top+"px"})},N(me.value.text),5),[[Ro,me.value.visible]])]),_:1})],8,UK)):re("",!0),h("div",VK,[h("div",{ref:Q,class:"panes chat-scroll",onScrollPassive:xt},[h("div",{class:$e(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(C(),A(Ie,{key:0},[ve[58]||(ve[58]=h("div",{class:"empty-spacer"},null,-1)),h("div",KK,[h("span",GK,N(M(m)("composer.emptyConversationTitle")),1),h("span",YK,N(M(m)("composer.emptyConversation")),1),a.value?(C(),A("div",XK,[h("button",{type:"button",class:"ws-pick-btn",title:M(m)("conversation.switchWorkspace"),onClick:ve[7]||(ve[7]=Ge(ee=>i.value=!i.value,["stop"]))},[ve[54]||(ve[54]=h("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},[h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),h("path",{d:"M1 5.5h12"})],-1)),h("span",QK,N(l.value),1),(C(),A("svg",{class:$e(["ws-pick-chev",{open:i.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...ve[53]||(ve[53]=[h("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2))],8,ZK),i.value?(C(),A("div",{key:0,class:"ws-pick-backdrop",onClick:ve[8]||(ve[8]=ee=>i.value=!1)})):re("",!0),i.value?(C(),A("div",JK,[(C(!0),A(Ie,null,Ye(c.value,ee=>(C(),A("button",{key:ee.id,type:"button",class:$e(["ws-pick-item",{on:ee.id===e.activeWorkspaceId}]),onClick:Ge(Ae=>p(ee.id),["stop"])},[h("span",tG,N(ee.name),1),h("span",nG,N(ee.shortPath),1)],10,eG))),128)),u.value>0?(C(),A("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:ve[9]||(ve[9]=Ge(ee=>r.value=!r.value,["stop"]))},[h("span",null,N(M(m)("conversation.moreWorkspaces",{count:u.value})),1)])):re("",!0),ve[56]||(ve[56]=h("div",{class:"ws-pick-divider"},null,-1)),h("button",{type:"button",class:"ws-pick-action",onClick:ve[10]||(ve[10]=Ge(ee=>{i.value=!1,o("addWorkspace")},["stop"]))},[ve[55]||(ve[55]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("path",{d:"M8 3v10M3 8h10"})],-1)),h("span",null,N(M(m)("conversation.addWorkspace")),1)])])):re("",!0)])):(C(),A("button",{key:1,type:"button",class:"empty-add-workspace",onClick:ve[11]||(ve[11]=ee=>o("addWorkspace"))},[ve[57]||(ve[57]=h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),h("path",{d:"M1 5.5h12"}),h("path",{d:"M8 7.25v4.5M5.75 9.5h4.5"})],-1)),h("span",null,N(M(m)("conversation.addWorkspace")),1)]))]),pt(HT,{ref_key:"emptyComposerRef",ref:v,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,"hide-context":"",onSubmit:Ho,onSteer:ve[12]||(ve[12]=ee=>o("steer",ee)),onCommand:ve[13]||(ve[13]=ee=>o("command",ee)),onInterrupt:tn,onUnqueue:ve[14]||(ve[14]=ee=>o("unqueue",ee)),onEditQueued:ve[15]||(ve[15]=ee=>o("editQueued",ee)),onSetPermission:ve[16]||(ve[16]=ee=>o("setPermission",ee)),onSetThinking:ve[17]||(ve[17]=ee=>o("setThinking",ee)),onTogglePlan:ve[18]||(ve[18]=ee=>o("togglePlan")),onToggleSwarm:ve[19]||(ve[19]=ee=>o("toggleSwarm")),onToggleGoal:ve[20]||(ve[20]=ee=>o("toggleGoal")),onOpenBtw:ve[21]||(ve[21]=ee=>o("command","/btw")),onCreateGoal:ve[22]||(ve[22]=ee=>o("createGoal",ee)),onControlGoal:ve[23]||(ve[23]=ee=>o("controlGoal",ee)),onFocusGoal:I,onFocusSwarm:E,onCompact:ve[24]||(ve[24]=ee=>o("compact")),onPickModel:ve[25]||(ve[25]=ee=>o("pickModel")),onSelectModel:ve[26]||(ve[26]=ee=>o("selectModel",ee))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),ve[59]||(ve[59]=h("div",{class:"empty-spacer"},null,-1))],64)):(C(),A(Ie,{key:1},[(C(),qe(PT,{ref_key:"chatPaneRef",ref:f,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,bubble:S.value,mobile:e.mobile,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":ge.value,onOpenFile:ve[27]||(ve[27]=ee=>o("openFile",ee)),onOpenMedia:ve[28]||(ve[28]=ee=>o("openMedia",ee)),onCopyConversationCopied:k,onOpenThinking:ve[29]||(ve[29]=ee=>o("openThinking",ee)),onOpenCompaction:ve[30]||(ve[30]=ee=>o("openCompaction",ee)),onOpenAgent:ve[31]||(ve[31]=ee=>o("openAgent",ee)),onEditMessage:ve[32]||(ve[32]=ee=>o("editMessage",ee)),onLoadOlderMessages:Nn},null,8,["turns","approvals","bubble","mobile","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following"])),d.value.length>0?(C(),A("div",sG,[(C(!0),A(Ie,null,Ye(d.value,ee=>(C(),qe(cz,{key:ee.id,group:ee},null,8,["group"]))),128))])):re("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?re("",!0):(C(),qe(FK,{key:0,ref:ue,style:It(ce.value),"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":_.value,"dock-panel":F.value,"bash-tasks":T.value,"subagent-tasks":$.value,"bash-running":L.value,"subagent-running":R.value,"todo-done-count":O.value,"has-dock-work":B.value,todos:e.todos,"pending-question":Z.value,"pending-approval":fe.value,mobile:e.mobile,onToggleDockPanel:ve[33]||(ve[33]=ee=>G(ee)),onCloseDockPanel:ve[34]||(ve[34]=ee=>K()),onAnswer:$o,onDismiss:ve[35]||(ve[35]=ee=>o("dismiss",ee)),onApproval:ro,onCancelTask:ve[36]||(ve[36]=ee=>o("cancelTask",ee)),onControlGoal:ve[37]||(ve[37]=ee=>o("controlGoal",ee)),onSubmit:Ho,onSteer:ve[38]||(ve[38]=ee=>o("steer",ee)),onCommand:ve[39]||(ve[39]=ee=>o("command",ee)),onInterrupt:tn,onUnqueue:ve[40]||(ve[40]=ee=>o("unqueue",ee)),onEditQueued:ve[41]||(ve[41]=ee=>o("editQueued",ee)),onSetPermission:ve[42]||(ve[42]=ee=>o("setPermission",ee)),onSetThinking:ve[43]||(ve[43]=ee=>o("setThinking",ee)),onTogglePlan:ve[44]||(ve[44]=ee=>o("togglePlan")),onToggleSwarm:ve[45]||(ve[45]=ee=>o("toggleSwarm")),onToggleGoal:ve[46]||(ve[46]=ee=>o("toggleGoal")),onOpenBtw:ve[47]||(ve[47]=ee=>o("command","/btw")),onCreateGoal:ve[48]||(ve[48]=ee=>o("createGoal",ee)),onFocusGoal:I,onFocusSwarm:E,onCompact:ve[49]||(ve[49]=ee=>o("compact")),onPickModel:ve[50]||(ve[50]=ee=>o("pickModel")),onSelectModel:ve[51]||(ve[51]=ee=>o("selectModel",ee))},null,8,["style","session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","pending-approval","mobile"]))]),pt(Ti,{name:"pill"},{default:kn(()=>[xe.value?(C(),A("button",{key:0,class:"newmsg-pill",style:It({bottom:`${se.value+12}px`}),"aria-label":M(m)("conversation.jumpToLatestAria"),onClick:ve[52]||(ve[52]=ee=>Zt(!0))},[ve[60]||(ve[60]=h("svg",{class:"pill-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("polyline",{points:"4,6 8,10 12,6"})],-1)),dt(" "+N(M(m)("conversation.newMessages")),1)],12,oG)):re("",!0)]),_:1}),pt(Ti,{name:"abort-toast"},{default:kn(()=>[Ms.value?(C(),A("div",iG,[h("span",rG,N(M(m)("conversation.manuallyAborted")),1)])):re("",!0)]),_:1})],2))}}),fG=vt(dG,[["__scopeId","data-v-367814e0"]]),hG={key:0,class:"fp-empty fp-error"},pG={key:1,class:"fp-empty"},mG={key:2,class:"fp-loading"},gG={class:"fp-header"},vG={class:"fp-title"},yG=["title"],kG={class:"fp-meta"},bG={key:0,class:"fp-lines"},_G={class:"fp-size"},wG=["aria-label"],SG=["aria-label"],CG=["aria-label"],xG={key:3,class:"fp-search"},TG=["placeholder"],MG={key:0,class:"fp-search-count"},AG=["disabled","title"],EG=["disabled","title"],$G=["title"],IG={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},NG={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},LG=["title"],OG=["title"],RG=["href","title"],PG=["title"],DG={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},BG={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},FG=["title","aria-label"],HG={key:1,class:"fp-code"},WG={class:"fp-line-table"},UG=["data-line"],qG={class:"fp-gutter"},jG=["innerHTML"],zG={key:1,class:"fp-body fp-code"},VG={class:"fp-line-table"},KG=["data-line"],GG={class:"fp-gutter"},YG=["innerHTML"],XG={key:2,class:"fp-body"},ZG=["srcdoc","title"],QG={key:1,class:"fp-code"},JG={class:"fp-line-table"},eY=["data-line"],tY={class:"fp-gutter"},nY=["innerHTML"],sY={key:3,class:"fp-body fp-pdf-wrap"},oY=["src","title"],iY={key:1,class:"fp-binary-card"},rY={class:"fp-binary-label"},lY={key:4,class:"fp-body fp-table-wrap"},aY={class:"fp-table"},cY=["data-line"],uY={key:5,class:"fp-body fp-image-wrap"},dY=["src","alt"],fY={key:1,class:"fp-binary-card"},hY={class:"fp-binary-label"},pY={key:6,class:"fp-body fp-code"},mY={class:"fp-line-table"},gY=["data-line"],vY={class:"fp-gutter"},yY=["innerHTML"],kY={key:7,class:"fp-body fp-binary-wrap"},bY={class:"fp-binary-card"},_Y={class:"fp-binary-label"},wY=Xe({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=_t();function s(me,_e){const Ce=_e?_e.split("/").filter(Boolean):[];for(const de of me.split("/"))de===""||de==="."||(de===".."?Ce.pop():Ce.push(de));return Ce.join("/")}const o=Nt("resolveImage",async me=>me),i=j(()=>{const me=c.file?.path??"",_e=me.lastIndexOf("/");return _e>0?me.slice(0,_e):""});function r(me){if(/^(https?:|data:|blob:)/i.test(me)||me.startsWith("/"))return me;const _e=i.value;return _e?s(me,_e):me}async function l(me){const _e=r(me);return o?o(_e):_e}cn("resolveImage",l);function a(me){let _e=me.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(_e)||_e.startsWith("/"))return me;for(const de of["#","?"]){const z=_e.indexOf(de);z!==-1&&(_e=_e.slice(0,z))}const Ce=i.value;return{...me,path:s(_e,Ce)}}const c=e,u=t;function d(me){c.openFile?.(a(me))}const p=te(null),m=j(()=>{const me=c.file;if(!me)return"binary";const _e=me.mime??"",Ce=me.languageId??"",de=me.path.toLowerCase();return _e==="text/markdown"||Ce==="markdown"||Ce==="md"||de.endsWith(".mdx")?"markdown":_e==="application/json"||Ce==="json"?"json":_e==="text/html"||Ce==="html"||de.endsWith(".html")||de.endsWith(".htm")?"html":_e==="application/pdf"||de.endsWith(".pdf")?"pdf":_e==="text/csv"||Ce==="csv"||de.endsWith(".csv")?"csv":_e.startsWith("image/")?"image":me.isBinary?"binary":_e.startsWith("text/")||Ce!==""?"text":"binary"});function f(me){const _e=atob(me),Ce=Uint8Array.from(_e,de=>de.charCodeAt(0));return new TextDecoder().decode(Ce)}const v=j(()=>{const me=c.file;if(!me)return"";if(me.encoding==="base64")try{return f(me.content)}catch{return me.content}return me.content}),w=j(()=>{if(m.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(v.value),null,2)}catch{return v.value}}),b=j(()=>c.file?(m.value==="json"?w.value:v.value).split(`
|
|
247
|
+
`):[]),_=j(()=>c.file?m.value==="json"?w.value:v.value:""),g=te(""),y=te(0),k=j(()=>{const me=g.value.trim().toLowerCase();if(!me)return[];const _e=[];return b.value.forEach((Ce,de)=>{Ce.toLowerCase().includes(me)&&_e.push(de+1)}),_e});ze(g,()=>{y.value=0});function I(me,_e=!1){me&&ut(()=>{const Ce=p.value?.querySelector(".fp-body"),de=Ce?.querySelector(`[data-line="${me}"]`);if(!Ce||!de)return;_e&&(Ce.scrollTop=0);const z=Ce.getBoundingClientRect(),Z=de.getBoundingClientRect(),fe=Z.top-z.top+Ce.scrollTop;Ce.scrollTop=fe-Ce.clientHeight/2+Z.height/2})}ze(()=>[c.file?.path,c.line],()=>I(c.line,!0),{immediate:!0});function E(me){const _e=k.value;_e.length!==0&&(y.value=(y.value+me+_e.length)%_e.length,I(_e[y.value]))}function S(me){const _e=k.value;return{target:c.line===me,hit:_e.includes(me),active:_e[y.value]===me}}function T(me){return me<1024?`${me} B`:me<1024*1024?`${(me/1024).toFixed(1)} KB`:`${(me/(1024*1024)).toFixed(1)} MB`}const $=te(!1),L=te(!1);function R(){c.file&&navigator.clipboard.writeText(_.value).then(()=>{$.value=!0,setTimeout(()=>{$.value=!1},1400)}).catch(()=>{})}function O(){c.file&&navigator.clipboard.writeText(c.file.path).then(()=>{L.value=!0,setTimeout(()=>{L.value=!1},1400)}).catch(()=>{})}const B=te("preview"),F=te("preview"),q=te("fit");ze(m,me=>{B.value=me==="html"?"preview":"source",F.value="preview",q.value="fit"});const G=j(()=>{const me=c.file;return!me||m.value!=="image"?null:me.sourceUrl?me.sourceUrl:me.encoding==="base64"?`data:${me.mime};base64,${me.content}`:me.mime==="image/svg+xml"?`data:${me.mime};charset=utf-8,${encodeURIComponent(me.content)}`:null}),K=j(()=>{const me=c.file;return!me||m.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:me.encoding==="base64"?`data:${me.mime};base64,${me.content}`:null}),oe=j(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,v.value].join(""):"");function le(me){const _e=[];let Ce="",de=!1;for(let z=0;z<me.length;z++){const Z=me[z];Z==='"'&&me[z+1]==='"'?(Ce+='"',z++):Z==='"'?de=!de:Z===","&&!de?(_e.push(Ce),Ce=""):Ce+=Z}return _e.push(Ce),_e}const pe=j(()=>b.value.slice(0,200).map(le));function be(me){return me.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function Be(){const me=c.file;if(!me)return"";const _e=me.languageId?.toLowerCase();return _e||(me.path.split(".").pop()?.toLowerCase()??"")}function He(me){const _e=Be();let Ce=be(me);return m.value==="json"||_e==="json"||_e==="jsonc"?(Ce=Ce.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),Ce=Ce.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),Ce=Ce.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),Ce=Ce.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),Ce):m.value==="html"||_e==="html"||_e==="xml"||_e==="svg"?(Ce=Ce.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),Ce=Ce.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),Ce=Ce.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),Ce):(Ce=Ce.replace(/\b(async|await|break|case|catch|class|const|continue|else|export|extends|finally|for|from|function|if|import|interface|let|new|return|switch|throw|try|type|while)\b/g,'<span class="tok-keyword">$1</span>'),Ce=Ce.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),Ce=Ce.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),Ce)}function Ne(me,_e=55){return!me||me.length<=_e?me:"…"+me.slice(me.length-_e+1)}return(me,_e)=>(C(),A("div",{ref_key:"rootRef",ref:p,class:"file-preview"},[e.error&&!e.loading?(C(),A("div",hG,[h("span",null,N(e.error),1),e.closable?(C(),A("button",{key:0,type:"button",class:"fp-action",onClick:_e[0]||(_e[0]=Ce=>u("close"))},N(M(n)("filePreview.close")),1)):re("",!0)])):!e.file&&!e.loading?(C(),A("div",pG,N(M(n)("filePreview.empty")),1)):e.loading?(C(),A("div",mG,[_e[13]||(_e[13]=h("span",{class:"spinner"},null,-1)),h("span",null,N(M(n)("filePreview.loading")),1)])):e.file?(C(),A(Ie,{key:3},[h("div",gG,[h("span",vG,N(M(n)("common.preview")),1),h("span",{class:"fp-path",title:e.file.path},N(Ne(e.file.path)),9,yG),h("span",kG,[e.file.lineCount?(C(),A("span",bG,N(M(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):re("",!0),h("span",_G,N(T(e.file.size)),1)]),m.value==="html"?(C(),A("div",{key:0,class:"fp-seg",role:"group","aria-label":M(n)("filePreview.htmlMode")},[h("button",{type:"button",class:$e(["fp-seg-btn",{on:B.value==="preview"}]),onClick:_e[1]||(_e[1]=Ce=>B.value="preview")},N(M(n)("filePreview.preview")),3),h("button",{type:"button",class:$e(["fp-seg-btn",{on:B.value==="source"}]),onClick:_e[2]||(_e[2]=Ce=>B.value="source")},N(M(n)("filePreview.source")),3)],8,wG)):re("",!0),m.value==="markdown"?(C(),A("div",{key:1,class:"fp-seg",role:"group","aria-label":M(n)("filePreview.markdownMode")},[h("button",{type:"button",class:$e(["fp-seg-btn",{on:F.value==="preview"}]),onClick:_e[3]||(_e[3]=Ce=>F.value="preview")},N(M(n)("filePreview.preview")),3),h("button",{type:"button",class:$e(["fp-seg-btn",{on:F.value==="source"}]),onClick:_e[4]||(_e[4]=Ce=>F.value="source")},N(M(n)("filePreview.source")),3)],8,SG)):re("",!0),m.value==="image"?(C(),A("div",{key:2,class:"fp-seg",role:"group","aria-label":M(n)("filePreview.imageFit")},[h("button",{type:"button",class:$e(["fp-seg-btn",{on:q.value==="fit"}]),onClick:_e[5]||(_e[5]=Ce=>q.value="fit")},N(M(n)("filePreview.fit")),3),h("button",{type:"button",class:$e(["fp-seg-btn",{on:q.value==="actual"}]),onClick:_e[6]||(_e[6]=Ce=>q.value="actual")},N(M(n)("filePreview.actual")),3)],8,CG)):re("",!0),m.value==="text"||m.value==="json"||m.value==="html"||m.value==="csv"?(C(),A("div",xG,[At(h("input",{"onUpdate:modelValue":_e[7]||(_e[7]=Ce=>g.value=Ce),class:"fp-search-input",type:"search",placeholder:M(n)("filePreview.search")},null,8,TG),[[bn,g.value]]),g.value.trim()?(C(),A("span",MG,N(k.value.length),1)):re("",!0),h("button",{type:"button",class:"fp-icon-btn",disabled:k.value.length===0,title:M(n)("filePreview.prevMatch"),onClick:_e[8]||(_e[8]=Ce=>E(-1))},"↑",8,AG),h("button",{type:"button",class:"fp-icon-btn",disabled:k.value.length===0,title:M(n)("filePreview.nextMatch"),onClick:_e[9]||(_e[9]=Ce=>E(1))},"↓",8,EG)])):re("",!0),h("button",{type:"button",class:$e(["fp-action fp-act-icon",{copied:L.value}]),title:L.value?M(n)("filePreview.copied"):M(n)("filePreview.copyPath"),onClick:O},[L.value?(C(),A("svg",NG,[..._e[15]||(_e[15]=[h("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(C(),A("svg",IG,[..._e[14]||(_e[14]=[h("path",{d:"M6.5 9.5a3 3 0 0 0 4.2.3l2-2a3 3 0 0 0-4.2-4.2l-1 1"},null,-1),h("path",{d:"M9.5 6.5a3 3 0 0 0-4.2-.3l-2 2a3 3 0 0 0 4.2 4.2l1-1"},null,-1)])]))],10,$G),e.externalActions?(C(),A("button",{key:4,type:"button",class:"fp-action fp-act-icon",title:M(n)("filePreview.openInEditor"),onClick:_e[10]||(_e[10]=Ce=>u("openExternal"))},[..._e[16]||(_e[16]=[h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M12 8.7V12a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 12V5.5A1.5 1.5 0 0 1 4 4h3.3"}),h("path",{d:"M9.5 2.5h4v4"}),h("path",{d:"M13.5 2.5 7.5 8.5"})],-1)])],8,LG)):re("",!0),e.externalActions?(C(),A("button",{key:5,type:"button",class:"fp-action fp-act-icon",title:M(n)("filePreview.reveal"),onClick:_e[11]||(_e[11]=Ce=>u("reveal"))},[..._e[17]||(_e[17]=[h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M1.5 4.5A1.5 1.5 0 0 1 3 3h3l1.5 1.5H13A1.5 1.5 0 0 1 14.5 6v6A1.5 1.5 0 0 1 13 13.5H3A1.5 1.5 0 0 1 1.5 12z"})],-1)])],8,OG)):re("",!0),e.downloadUrl?(C(),A("a",{key:6,class:"fp-action fp-act-icon",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"",title:M(n)("filePreview.download")},[..._e[18]||(_e[18]=[h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M8 2v8"}),h("path",{d:"M4.5 6.5 8 10l3.5-3.5"}),h("path",{d:"M2.5 13.5h11"})],-1)])],8,RG)):re("",!0),!e.file.isBinary&&m.value!=="image"?(C(),A("button",{key:7,type:"button",class:$e(["fp-action fp-act-icon",{copied:$.value}]),title:$.value?M(n)("filePreview.copied"):M(n)("filePreview.copy"),onClick:R},[$.value?(C(),A("svg",BG,[..._e[20]||(_e[20]=[h("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(C(),A("svg",DG,[..._e[19]||(_e[19]=[h("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),h("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])]))],10,PG)):re("",!0),e.closable?(C(),A("button",{key:8,type:"button",class:"fp-close",title:M(n)("filePreview.close"),"aria-label":M(n)("filePreview.close"),onClick:_e[12]||(_e[12]=Ce=>u("close"))}," × ",8,FG)):re("",!0)]),m.value==="markdown"?(C(),A("div",{key:0,class:$e(["fp-body",{"fp-markdown":F.value==="preview"}])},[F.value==="preview"?(C(),qe(Ff,{key:0,text:v.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(C(),A("div",HG,[h("div",WG,[(C(!0),A(Ie,null,Ye(b.value,(Ce,de)=>(C(),A("div",{key:de,class:$e(["fp-line-row",S(de+1)]),"data-line":de+1},[h("span",qG,N(de+1),1),h("span",{class:"fp-line-text",innerHTML:He(Ce)},null,8,jG)],10,UG))),128))])]))],2)):m.value==="json"?(C(),A("div",zG,[h("div",VG,[(C(!0),A(Ie,null,Ye(b.value,(Ce,de)=>(C(),A("div",{key:de,class:$e(["fp-line-row",S(de+1)]),"data-line":de+1},[h("span",GG,N(de+1),1),h("span",{class:"fp-line-text",innerHTML:He(Ce)},null,8,YG)],10,KG))),128))])])):m.value==="html"?(C(),A("div",XG,[B.value==="preview"?(C(),A("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:oe.value,title:e.file.path},null,8,ZG)):(C(),A("div",QG,[h("div",JG,[(C(!0),A(Ie,null,Ye(b.value,(Ce,de)=>(C(),A("div",{key:de,class:$e(["fp-line-row",S(de+1)]),"data-line":de+1},[h("span",tY,N(de+1),1),h("span",{class:"fp-line-text",innerHTML:He(Ce)},null,8,nY)],10,eY))),128))])]))])):m.value==="pdf"?(C(),A("div",sY,[K.value?(C(),A("iframe",{key:0,class:"fp-pdf-frame",src:K.value,title:e.file.path},null,8,oY)):(C(),A("div",iY,[h("span",rY,N(M(n)("filePreview.pdfNoPreview")),1)]))])):m.value==="csv"?(C(),A("div",lY,[h("table",aY,[h("tbody",null,[(C(!0),A(Ie,null,Ye(pe.value,(Ce,de)=>(C(),A("tr",{key:de,class:$e(S(de+1)),"data-line":de+1},[h("th",null,N(de+1),1),(C(!0),A(Ie,null,Ye(Ce,(z,Z)=>(C(),A("td",{key:Z},N(z),1))),128))],10,cY))),128))])])])):m.value==="image"?(C(),A("div",uY,[G.value?(C(),A("img",{key:0,src:G.value,alt:e.file.path,class:$e(["fp-image",{actual:q.value==="actual"}])},null,10,dY)):(C(),A("div",fY,[_e[21]||(_e[21]=h("span",{class:"fp-binary-icon"},[h("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[h("rect",{x:"2",y:"2",width:"16",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),h("path",{d:"M7 10h6M10 7v6",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),h("span",hY,N(M(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:T(e.file.size)})),1)]))])):m.value==="text"?(C(),A("div",pY,[h("div",mY,[(C(!0),A(Ie,null,Ye(b.value,(Ce,de)=>(C(),A("div",{key:de,class:$e(["fp-line-row",S(de+1)]),"data-line":de+1},[h("span",vY,N(de+1),1),h("span",{class:"fp-line-text",innerHTML:He(Ce)},null,8,yY)],10,gY))),128))])])):(C(),A("div",kY,[h("div",bY,[_e[22]||(_e[22]=h("span",{class:"fp-binary-icon"},[h("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[h("path",{d:"M5 3h7l4 4v10H5V3z",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),h("path",{d:"M12 3v4h4",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),h("span",_Y,N(M(n)("filePreview.binaryNoPreview",{mime:e.file.mime||M(n)("filePreview.unknownType"),size:T(e.file.size)})),1)])]))],64)):re("",!0)],512))}}),SY=vt(wY,[["__scopeId","data-v-80fa7366"]]),CY={class:"tp"},xY={class:"tp-header"},TY={class:"tp-title"},MY={class:"tp-sub"},AY=["title","aria-label"],EY=Xe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=te(null);return ze(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||ut(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(C(),A("div",CY,[h("div",xY,[h("span",TY,N(M(o)("common.preview")),1),h("span",MY,N(e.subtitle??M(o)("thinking.panelTitle")),1),h("button",{type:"button",class:"tp-close",title:M(o)("thinking.close"),"aria-label":M(o)("thinking.close"),onClick:l[0]||(l[0]=a=>s("close"))},[...l[1]||(l[1]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,AY)]),h("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},N(e.text),513)]))}}),Tw=vt(EY,[["__scopeId","data-v-5cc773cd"]]),$Y={class:"ap"},IY={class:"ap-header"},NY={class:"ap-title"},LY={class:"ap-sub"},OY=["title","aria-label"],RY={key:0,class:"ap-type"},PY={key:1,class:"ap-reason"},DY={key:2,class:"ap-field"},BY={class:"ap-field-body"},FY={key:3,class:"ap-field"},HY={class:"ap-field-body ap-progress"},WY={key:4,class:"ap-field"},UY={class:"ap-field-body"},qY=Xe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=j(()=>(n.member.outputLines??[]).map(a=>a.trimEnd()).filter(a=>a.length>0));function r(a){switch(a){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const l=te(null);return ze(()=>i.value.length,()=>{const a=l.value;!a||!(a.scrollHeight-a.scrollTop-a.clientHeight<24)||ut(()=>{l.value&&(l.value.scrollTop=l.value.scrollHeight)})},{immediate:!0}),(a,c)=>(C(),A("div",$Y,[h("div",IY,[h("span",NY,N(M(o)("common.preview")),1),h("span",LY,N(e.member.name),1),h("span",{class:$e(["ap-phase",`phase-${e.member.phase}`])},N(r(e.member.phase)),3),h("button",{type:"button",class:"ap-close",title:M(o)("thinking.close"),"aria-label":M(o)("thinking.close"),onClick:c[0]||(c[0]=u=>s("close"))},[...c[1]||(c[1]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,OY)]),h("div",{ref_key:"bodyEl",ref:l,class:"ap-body"},[e.member.subagentType?(C(),A("div",RY,N(e.member.subagentType),1)):re("",!0),e.member.suspendedReason?(C(),A("div",PY,N(e.member.suspendedReason),1)):re("",!0),e.member.prompt?(C(),A("div",DY,[c[2]||(c[2]=h("span",{class:"ap-field-label"},"Task",-1)),h("div",BY,N(e.member.prompt),1)])):re("",!0),i.value.length>0?(C(),A("div",FY,[c[3]||(c[3]=h("span",{class:"ap-field-label"},"Progress",-1)),h("div",HY,[(C(!0),A(Ie,null,Ye(i.value,(u,d)=>(C(),A("span",{key:d},N(u),1))),128))])])):re("",!0),e.member.summary?(C(),A("div",WY,[c[4]||(c[4]=h("span",{class:"ap-field-label"},"Result",-1)),h("div",UY,N(e.member.summary),1)])):re("",!0)],512)]))}}),jY=vt(qY,[["__scopeId","data-v-723eed48"]]),zY={class:"sc"},VY={class:"sc-header"},KY={class:"sc-title"},GY=["title"],YY=["title","aria-label"],XY={key:0,class:"sc-empty"},ZY={key:2,class:"sc-loading","aria-hidden":"true"},QY={class:"sc-composer"},JY=["placeholder"],eX=["disabled","title"],tX=Xe({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=j(()=>n.turns.find(_=>_.role==="user")?.text?.trim()??""),r=j(()=>n.title?.trim()||o("sideChat.title")),l=j(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=te(""),c=te(null),u=te(null);function d(){const b=a.value.trim();b&&(s("send",b),a.value="",ut(()=>{c.value&&(c.value.style.height="auto"),p()}))}function p(){const b=u.value;b&&(b.scrollTop=b.scrollHeight)}const m=j(()=>{const b=n.turns;if(b.length===0)return"0";const _=b.at(-1),g=_.thinking?.length??0,y=_.tools?.reduce((k,I)=>k+I.name.length+(I.arg?.length??0)+(I.output?.join("").length??0),0)??0;return`${b.length}:${_.text.length}:${g}:${y}`});ze(m,async()=>{!n.running&&!n.sending||(await ut(),p())});const f=j(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function v(b){b.key==="Enter"&&!b.shiftKey&&!b.isComposing&&(b.preventDefault(),d())}function w(){const b=c.value;b&&(b.style.height="auto",b.style.height=`${Math.min(b.scrollHeight,160)}px`)}return(b,_)=>(C(),A("div",zY,[h("div",VY,[h("span",KY,N(r.value),1),h("span",{class:"sc-subtitle",title:l.value},N(l.value),9,GY),h("button",{type:"button",class:"sc-close",title:M(o)("thinking.close"),"aria-label":M(o)("thinking.close"),onClick:_[0]||(_[0]=g=>s("close"))},[..._[2]||(_[2]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,YY)]),h("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(C(),A("div",XY,N(M(o)("sideChat.empty")),1)):(C(),qe(PT,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending,bubble:""},null,8,["turns","running","sending"])),f.value?(C(),A("div",ZY,[pt(f1)])):re("",!0)],512),h("div",QY,[At(h("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":_[1]||(_[1]=g=>a.value=g),class:"sc-input",rows:"1",placeholder:M(o)("sideChat.placeholder"),onInput:w,onKeydown:v},null,40,JY),[[bn,a.value]]),h("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),title:M(o)("sideChat.send"),onClick:d},[..._[3]||(_[3]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M2 8h10"}),h("path",{d:"M8 4l4 4-4 4"})],-1)])],8,eX)])]))}}),nX=vt(tX,[["__scopeId","data-v-6db6c388"]]),sX={class:"changes-pane"},oX={class:"dv-panel-head"},iX={class:"dv-title"},rX=["title"],lX=["title","aria-label"],aX={class:"diff-head"},cX=["title"],uX={class:"back-label"},dX={key:0,class:"empty-state"},fX={key:1,class:"diff-lines"},hX={key:0,class:"hunk-text"},pX={class:"dl-gutter old"},mX={class:"dl-gutter new"},gX={class:"dl-sign"},vX={class:"dl-text"},yX={key:2,class:"empty-state"},kX={class:"dv-panel-head"},bX={class:"dv-title"},_X={class:"dv-change-count"},wX=["aria-label"],SX=["aria-pressed"],CX=["aria-pressed"],xX=["title","aria-label"],TX={class:"ch-head"},MX={class:"br-label"},AX={class:"br-name"},EX={key:0,class:"sync-info"},$X=["title"],IX=["title"],NX={key:1,class:"empty-head"},LX={key:0,class:"ch-list"},OX=["title","onClick"],RX={class:"fpath"},PX={key:1,class:"ch-list ch-tree"},DX={class:"tree-list"},BX=["onClick"],FX={class:"tree-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},HX=["d"],WX={class:"tree-name"},UX=["title","onClick"],qX={class:"tree-name"},jX={key:2,class:"empty-state"},zX={key:3,class:"empty-state"},VX=Xe({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t;function i(F){const q=F.toLowerCase();return q==="modified"?"modified":q==="added"?"added":q==="deleted"?"deleted":q==="renamed"?"renamed":q==="untracked"?"untracked":q==="conflicted"?"conflicted":q==="ignored"?"ignored":q==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,q=60){return F.length<=q?F:"…"+F.slice(F.length-q+1)}const c=j(()=>s.gitInfo!==null),u=j(()=>s.changes.length>0),d=j(()=>(s.selectedDiffPath??null)!==null),p=j(()=>s.mode==="detail"||s.mode==="full"&&d.value),m=j(()=>s.fileDiff??[]),f=j(()=>s.fileDiffLoading===!0);function v(F){return F.oldNo!==void 0?String(F.oldNo):""}function w(F){return F.newNo!==void 0?String(F.newNo):""}function b(F){return`dl-${F.type}`}function _(F){o("open",F)}function g(){o("back")}function y(){o("close")}const k=te("list");function I(F){k.value=F}function E(F){const q={children:[]},G=[...F].sort((K,oe)=>K.path.localeCompare(oe.path));for(const K of G){const oe=K.path.split("/");let le=q;for(let pe=0;pe<oe.length;pe++){const be=oe[pe],Be=pe===oe.length-1,He=oe.slice(0,pe+1).join("/");let Ne=le.children.find(me=>me.name===be&&me.kind===(Be?"file":"folder"));Ne||(Ne={name:be,path:He,kind:Be?"file":"folder",status:Be?K.status:void 0,children:[]},le.children.push(Ne)),le=Ne}}return q.children}const S=j(()=>E(s.changes)),T=te(new Set);function $(F){return!T.value.has(F)}const L=j(()=>{const F=[];function q(G,K){for(const oe of G)F.push({node:oe,depth:K}),oe.kind==="folder"&&$(oe.path)&&q(oe.children,K+1)}return q(S.value,0),F});function R(F){const q=new Set(T.value);q.has(F.path)?q.delete(F.path):q.add(F.path),T.value=q}const O=F=>"M1.5 3.5h3l1.5 2h7a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1z";function B(F){return`${16+F*16}px`}return(F,q)=>(C(),A("div",sX,[p.value?(C(),A(Ie,{key:0},[h("div",oX,[h("span",iX,N(M(n)("diff.title")),1),h("span",{class:"dv-path",title:e.selectedDiffPath??""},N(a(e.selectedDiffPath??"",50)),9,rX),e.closable?(C(),A("button",{key:0,type:"button",class:"dv-close",title:M(n)("diff.close"),"aria-label":M(n)("diff.close"),onClick:y},[...q[2]||(q[2]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,lX)):re("",!0)]),h("div",aX,[e.hideBack?re("",!0):(C(),A("button",{key:0,class:"back-btn",type:"button",onClick:g,title:M(n)("diff.back")},[q[3]||(q[3]=h("span",{"aria-hidden":"true"},"←",-1)),h("span",uX,N(M(n)("diff.back")),1)],8,cX))]),f.value?(C(),A("div",dX,N(M(n)("diff.loading")),1)):m.value.length>0?(C(),A("div",fX,[(C(!0),A(Ie,null,Ye(m.value,(G,K)=>(C(),A("div",{key:K,class:$e(["dl",b(G)])},[G.type==="hunk"?(C(),A("span",hX,N(G.text),1)):(C(),A(Ie,{key:1},[h("span",pX,N(v(G)),1),h("span",mX,N(w(G)),1),h("span",gX,N(G.type==="add"?"+":G.type==="del"?"-":" "),1),h("span",vX,N(G.text),1)],64))],2))),128))])):(C(),A("div",yX,N(M(n)("diff.noDiff")),1))],64)):(C(),A(Ie,{key:1},[h("div",kX,[h("span",bX,N(M(n)("diff.title")),1),h("span",_X,N(M(n)("diff.changeCount",{count:e.changes.length})),1),h("div",{class:"dv-toggle",role:"group","aria-label":M(n)("diff.list")+" / "+M(n)("diff.tree")},[h("button",{type:"button",class:$e(["dv-toggle-btn",{active:k.value==="list"}]),"aria-pressed":k.value==="list",onClick:q[0]||(q[0]=G=>I("list"))},N(M(n)("diff.list")),11,SX),h("button",{type:"button",class:$e(["dv-toggle-btn",{active:k.value==="tree"}]),"aria-pressed":k.value==="tree",onClick:q[1]||(q[1]=G=>I("tree"))},N(M(n)("diff.tree")),11,CX)],8,wX),e.closable?(C(),A("button",{key:0,type:"button",class:"dv-close",title:M(n)("diff.close"),"aria-label":M(n)("diff.close"),onClick:y},[...q[4]||(q[4]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,xX)):re("",!0)]),h("div",TX,[c.value?(C(),A(Ie,{key:0},[h("span",MX,N(M(n)("diff.branch")),1),h("span",AX,N(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(C(),A("span",EX,[e.gitInfo.ahead>0?(C(),A("span",{key:0,class:"ahead",title:M(n)("diff.aheadTitle")},"↑"+N(e.gitInfo.ahead),9,$X)):re("",!0),e.gitInfo.behind>0?(C(),A("span",{key:1,class:"behind",title:M(n)("diff.behindTitle")},"↓"+N(e.gitInfo.behind),9,IX)):re("",!0)])):re("",!0)],64)):(C(),A("span",NX,N(M(n)("diff.empty")),1))]),u.value&&k.value==="list"?(C(),A("div",LX,[(C(!0),A(Ie,null,Ye(e.changes,G=>(C(),A("button",{key:G.path,type:"button",class:"ch-row",title:G.path,onClick:K=>_(G.path)},[h("span",{class:$e(["badge",i(G.status)])},N(l(G.status)),3),h("span",RX,N(a(G.path)),1)],8,OX))),128))])):u.value&&k.value==="tree"?(C(),A("div",PX,[h("ul",DX,[(C(!0),A(Ie,null,Ye(L.value,({node:G,depth:K})=>(C(),A("li",{key:G.path,class:"tree-node"},[G.kind==="folder"?(C(),A("button",{key:0,type:"button",class:"tree-row tree-folder",style:It({paddingLeft:B(K)}),onClick:oe=>R(G)},[(C(),A("svg",FX,[h("path",{d:O($(G.path))},null,8,HX)])),h("span",WX,N(G.name),1)],12,BX)):(C(),A("button",{key:1,type:"button",class:"tree-row tree-file",style:It({paddingLeft:B(K)}),title:G.path,onClick:oe=>_(G.path)},[h("span",{class:$e(["badge",i(G.status)])},N(l(G.status)),3),h("span",qX,N(G.name),1)],12,UX))]))),128))])])):c.value?(C(),A("div",jX,N(M(n)("diff.clean")),1)):(C(),A("div",zX,N(M(n)("diff.empty")),1))],64))]))}}),KX=vt(VX,[["__scopeId","data-v-4c13e2b6"]]);function Oh(e,t){let n=null;Jt(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,ut(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),oo(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const GX=["aria-label"],YX={class:"dh"},XX={class:"dtitle"},ZX=["title"],QX={class:"search-wrap"},JX=["placeholder"],eZ=["aria-label"],tZ=["aria-selected","onClick"],nZ={key:1,class:"loading-state"},sZ={key:2,class:"unavail-state"},oZ={key:3,class:"model-list"},iZ=["aria-selected","onClick","onMouseenter"],rZ={class:"check"},lZ={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},aZ={class:"model-main"},cZ={class:"model-name"},uZ={class:"model-id"},dZ={class:"model-provider"},fZ={class:"model-ctx"},hZ={key:0,class:"caps"},pZ=["title","onClick"],mZ={viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true"},gZ=["fill"],vZ={key:0,class:"empty"},yZ={class:"footer-hint"},kZ=Xe({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=j(()=>new Set(s.starredIds??[]));function r(g){return i.value.has(g)}const l=te(""),a=te(null),c=te(null),u=te("all");Oh(c,a);const d=j(()=>{const g=new Set,y=[{id:"all",label:n("model.allTab")}];for(const k of s.models)g.has(k.provider)||(g.add(k.provider),y.push({id:k.provider,label:k.provider}));return y}),p=j(()=>{const g=l.value.toLowerCase().trim(),y=s.models.filter(k=>{if(u.value!=="all"&&k.provider!==u.value)return!1;const I=(k.displayName??k.model).toLowerCase().includes(g),E=k.provider.toLowerCase().includes(g),S=k.id.toLowerCase().includes(g);return!g||I||E||S});return u.value!=="all"?y:y.sort((k,I)=>{const E=r(k.id)?1:0;return(r(I.id)?1:0)-E})}),m=j(()=>p.value),f=te(0);ze([l,u],()=>{f.value=0}),ze(d,g=>{g.some(y=>y.id===u.value)||(u.value="all")}),ze(m,g=>{f.value=Math.min(f.value,Math.max(g.length-1,0))});function v(g){if(g.key==="Escape"){o("close");return}if(g.key==="ArrowDown")g.preventDefault(),f.value=Math.min(f.value+1,m.value.length-1);else if(g.key==="ArrowUp")g.preventDefault(),f.value=Math.max(f.value-1,0);else if(g.key==="Enter"){const y=m.value[f.value];y&&o("select",y.id)}}Jt(()=>{document.addEventListener("keydown",v)}),qt(()=>{document.removeEventListener("keydown",v)});function w(g){o("select",g)}function b(g){return m.value.indexOf(g)}function _(g){u.value=g}return(g,y)=>(C(),A("div",{class:"backdrop",onClick:y[3]||(y[3]=Ge(k=>o("close"),["self"]))},[h("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":M(n)("model.dialogLabel")},[h("div",YX,[h("span",XX,N(M(n)("model.title")),1),h("button",{class:"close-btn",title:M(n)("model.close"),onClick:y[0]||(y[0]=k=>o("close"))},"✕",8,ZX)]),h("div",QX,[At(h("input",{ref_key:"searchRef",ref:a,"onUpdate:modelValue":y[1]||(y[1]=k=>l.value=k),class:"search-input",type:"text",placeholder:M(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,JX),[[bn,l.value]])]),d.value.length>1?(C(),A("div",{key:0,class:"tab-strip",role:"tablist","aria-label":M(n)("model.providerTabs")},[(C(!0),A(Ie,null,Ye(d.value,k=>(C(),A("button",{key:k.id,type:"button",class:$e(["tab-btn",{on:k.id===u.value}]),role:"tab","aria-selected":k.id===u.value,onClick:I=>_(k.id)},N(k.label),11,tZ))),128))],8,eZ)):re("",!0),e.loading?(C(),A("div",nZ,[y[4]||(y[4]=h("svg",{class:"spin-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[h("circle",{cx:"8",cy:"8",r:"6","stroke-dasharray":"24 12","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"1s",repeatCount:"indefinite"})])],-1)),h("span",null,N(M(n)("model.loading")),1)])):e.unavailable?(C(),A("div",sZ,[y[5]||(y[5]=h("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[h("path",{d:"M10 2 L19 18 H1 Z"}),h("line",{x1:"10",y1:"9",x2:"10",y2:"13"}),h("circle",{cx:"10",cy:"16",r:"0.8",fill:"var(--warn)"})],-1)),h("span",null,N(M(n)("model.unavailable")),1)])):(C(),A("div",oZ,[(C(!0),A(Ie,null,Ye(m.value,k=>(C(),A("div",{key:k.id,class:$e(["model-row",{"is-current":k.id===e.current,"is-selected":b(k)===f.value}]),role:"option","aria-selected":k.id===e.current,onClick:I=>w(k.id),onMouseenter:I=>f.value=b(k)},[h("span",rZ,[k.id===e.current?(C(),A("svg",lZ,[...y[6]||(y[6]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):re("",!0)]),h("span",aZ,[h("span",cZ,N(k.displayName??k.model),1),h("span",uZ,N(k.id),1)]),h("span",dZ,N(k.provider),1),h("span",fZ,N(M(n)("model.contextSuffix",{size:Math.round(k.maxContextSize/1e3)})),1),k.capabilities&&k.capabilities.length>0?(C(),A("span",hZ,N(k.capabilities.join(", ")),1)):re("",!0),h("button",{type:"button",class:$e(["star-btn",{starred:r(k.id)}]),title:r(k.id)?M(n)("model.unstarTitle"):M(n)("model.starTitle"),onClick:Ge(I=>o("toggle-star",k.id),["stop"]),onMouseenter:y[2]||(y[2]=Ge(()=>{},["stop"]))},[(C(),A("svg",mZ,[h("path",{fill:r(k.id)?"currentColor":"none",stroke:"currentColor","stroke-width":"1.6","stroke-linejoin":"round",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,8,gZ)]))],42,pZ)],42,iZ))),128)),m.value.length===0&&!e.loading&&!e.unavailable?(C(),A("div",vZ,N(s.models.length===0?M(n)("model.emptyNoModels"):M(n)("model.emptyNoMatch")),1)):re("",!0)])),h("div",yZ,N(M(n)("model.footerHint")),1)],8,GX)]))}}),bZ=vt(kZ,[["__scopeId","data-v-cb98ad2b"]]),_Z=["aria-label"],wZ={class:"dh"},SZ={class:"dtitle"},CZ=["title"],xZ={class:"prov-list"},TZ={key:0,class:"state-row"},MZ={key:1,class:"state-row unavail"},AZ={key:2,class:"empty"},EZ=["title"],$Z={key:0,width:"8",height:"8",viewBox:"0 0 8 8"},IZ=["fill"],NZ={key:1,width:"8",height:"8",viewBox:"0 0 8 8"},LZ=["fill"],OZ={key:2,width:"8",height:"8",viewBox:"0 0 8 8"},RZ={class:"prov-info"},PZ={class:"prov-type"},DZ={key:0,class:"prov-url"},BZ={class:"prov-meta"},FZ={key:0},HZ={key:0,class:"confirm-row"},WZ={class:"confirm-text"},UZ={key:1,class:"prov-actions"},qZ=["title","onClick"],jZ=["title","onClick"],zZ={key:0,class:"add-section"},VZ={key:0,class:"add-btns"},KZ={key:1,class:"add-form"},GZ={class:"form-row"},YZ={class:"flabel"},XZ=["value"],ZZ={class:"form-row"},QZ={class:"flabel"},JZ={class:"form-row"},eQ={class:"flabel"},tQ=["placeholder"],nQ={class:"form-row"},sQ={class:"flabel"},oQ=["placeholder"],iQ={key:0,class:"add-error"},rQ={class:"form-btns"},lQ={class:"footer-hint"},aQ=Xe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=_t(),s=te(null);Oh(s);const o=t,i=te(null);function r(g){i.value=g}function l(){i.value&&(o("delete",i.value),i.value=null)}function a(){i.value=null}const c=te(!1),u=Ys({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),d=te(""),p=["moonshot","anthropic","openai","custom"];function m(){u.type="moonshot",u.apiKey="",u.baseUrl="",u.defaultModel="",d.value="",c.value=!0}function f(){c.value=!1}function v(){if(!u.apiKey.trim()){d.value=n("providers.apiKeyRequired");return}d.value="",o("add",{type:u.type,apiKey:u.apiKey.trim()||void 0,baseUrl:u.baseUrl.trim()||void 0,defaultModel:u.defaultModel.trim()||void 0}),c.value=!1}function w(g){if(g.key==="Escape"){if(c.value){f();return}if(i.value){a();return}o("close")}}Jt(()=>document.addEventListener("keydown",w)),qt(()=>document.removeEventListener("keydown",w));function b(g){return g==="connected"?"var(--ok)":g==="error"?"var(--err)":"var(--faint)"}function _(g){return n(g==="connected"?"providers.status.connected":g==="error"?"providers.status.error":"providers.status.unconfigured")}return(g,y)=>(C(),A("div",{class:"backdrop",onClick:y[7]||(y[7]=Ge(k=>o("close"),["self"]))},[h("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":M(n)("providers.dialogLabel")},[h("div",wZ,[h("span",SZ,N(M(n)("providers.title")),1),h("button",{class:"close-btn",title:M(n)("providers.close"),onClick:y[0]||(y[0]=k=>o("close"))},"✕",8,CZ)]),h("div",xZ,[e.loading?(C(),A("div",TZ,[y[8]||(y[8]=h("svg",{class:"spin-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[h("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)),h("span",null,N(M(n)("providers.loading")),1)])):e.unavailable?(C(),A("div",MZ,[y[9]||(y[9]=h("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[h("path",{d:"M8 1.5 L15.5 14.5 H0.5 Z"}),h("line",{x1:"8",y1:"7",x2:"8",y2:"10.5"}),h("circle",{cx:"8",cy:"12.5",r:"0.7",fill:"var(--warn)"})],-1)),h("span",null,N(M(n)("providers.unavailable")),1)])):e.providers.length===0?(C(),A("div",AZ,N(M(n)("providers.empty")),1)):(C(!0),A(Ie,{key:3},Ye(e.providers,k=>(C(),A("div",{key:k.id,class:"prov-row"},[h("span",{class:"status-dot",style:It({color:b(k.status)}),title:_(k.status)},[k.status==="connected"?(C(),A("svg",$Z,[h("circle",{cx:"4",cy:"4",r:"3.5",fill:b(k.status)},null,8,IZ)])):k.status==="error"?(C(),A("svg",NZ,[h("circle",{cx:"4",cy:"4",r:"3.5",fill:b(k.status)},null,8,LZ)])):(C(),A("svg",OZ,[...y[10]||(y[10]=[h("circle",{cx:"4",cy:"4",r:"3",fill:"none",stroke:"var(--faint)","stroke-width":"1"},null,-1)])]))],12,EZ),h("div",RZ,[h("span",PZ,N(k.type),1),k.baseUrl?(C(),A("span",DZ,N(k.baseUrl),1)):re("",!0),h("span",BZ,[h("span",{class:$e(["prov-key-state",k.hasApiKey?"has-key":"no-key"])},N(k.hasApiKey?M(n)("providers.keySet"):M(n)("providers.keyNotSet")),3),k.models&&k.models.length>0?(C(),A("span",FZ," · "+N(M(n)("providers.modelCount",{count:k.models.length})),1)):re("",!0)])]),i.value===k.id?(C(),A("div",HZ,[h("span",WZ,N(M(n)("providers.confirmDelete")),1),h("button",{class:"act-btn danger",onClick:l},N(M(n)("providers.confirm")),1),h("button",{class:"act-btn",onClick:a},N(M(n)("providers.cancel")),1)])):(C(),A("div",UZ,[h("button",{class:"act-btn",title:M(n)("providers.refreshTitle",{type:k.type}),onClick:I=>o("refresh",k.id)},N(M(n)("providers.refresh")),9,qZ),h("button",{class:"act-btn danger",title:M(n)("providers.deleteTitle",{type:k.type}),onClick:I=>r(k.id)},N(M(n)("providers.delete")),9,jZ)]))]))),128))]),e.unavailable?re("",!0):(C(),A("div",zZ,[c.value?(C(),A("div",KZ,[h("div",GZ,[h("label",YZ,N(M(n)("providers.fieldType")),1),At(h("select",{"onUpdate:modelValue":y[3]||(y[3]=k=>u.type=k),class:"finput fselect"},[(C(),A(Ie,null,Ye(p,k=>h("option",{key:k,value:k},N(k),9,XZ)),64))],512),[[df,u.type]])]),h("div",ZZ,[h("label",QZ,N(M(n)("providers.fieldApiKey")),1),At(h("input",{"onUpdate:modelValue":y[4]||(y[4]=k=>u.apiKey=k),class:"finput",type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,512),[[bn,u.apiKey]])]),h("div",JZ,[h("label",eQ,N(M(n)("providers.fieldBaseUrl")),1),At(h("input",{"onUpdate:modelValue":y[5]||(y[5]=k=>u.baseUrl=k),class:"finput",type:"text",placeholder:M(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,tQ),[[bn,u.baseUrl]])]),h("div",nQ,[h("label",sQ,N(M(n)("providers.fieldDefaultModel")),1),At(h("input",{"onUpdate:modelValue":y[6]||(y[6]=k=>u.defaultModel=k),class:"finput",type:"text",placeholder:M(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,oQ),[[bn,u.defaultModel]])]),d.value?(C(),A("div",iQ,N(d.value),1)):re("",!0),h("div",rQ,[h("button",{class:"act-btn primary",onClick:v},N(M(n)("providers.add")),1),h("button",{class:"act-btn",onClick:f},N(M(n)("providers.cancel")),1)])])):(C(),A("div",VZ,[h("button",{class:"add-btn-oauth",onClick:y[1]||(y[1]=k=>o("openLogin","moonshot"))},[y[11]||(y[11]=h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("circle",{cx:"5",cy:"3",r:"2"}),h("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),dt(" "+N(M(n)("providers.loginKimi")),1)]),h("button",{class:"add-btn-oauth",onClick:y[2]||(y[2]=k=>o("openLogin","anthropic"))},[y[12]||(y[12]=h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("circle",{cx:"5",cy:"3",r:"2"}),h("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),dt(" "+N(M(n)("providers.loginAnthropic")),1)]),h("button",{class:"add-btn add-btn-key",onClick:m},[y[13]||(y[13]=h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"5",y1:"1",x2:"5",y2:"9"}),h("line",{x1:"1",y1:"5",x2:"9",y2:"5"})],-1)),dt(" "+N(M(n)("providers.enterApiKey")),1)])]))])),h("div",lQ,N(M(n)("providers.escClose")),1)],8,_Z)]))}}),cQ=vt(aQ,[["__scopeId","data-v-2fd7e21e"]]),uQ={class:"backdrop"},dQ=["aria-label"],fQ={class:"dh"},hQ={class:"dtitle"},pQ=["title"],mQ={key:0,class:"center-body"},gQ={class:"center-text"},vQ={key:1,class:"nb"},yQ={class:"nb-lead"},kQ=["href"],bQ={class:"nb-or"},_Q={class:"nb-fallback"},wQ={class:"nb-fb-text"},SQ=["href"],CQ={class:"nb-code-row"},xQ={class:"nb-code"},TQ={class:"nb-status"},MQ=["aria-label"],AQ={class:"nb-status-text"},EQ={class:"nb-countdown"},$Q={key:2,class:"center-body"},IQ={class:"center-text success-text"},NQ={class:"center-hint"},LQ={class:"center-body"},OQ={class:"center-text err-text"},RQ={class:"center-hint"},PQ={class:"actions"},DQ={class:"center-body"},BQ={class:"center-text warn-text"},FQ={class:"center-hint"},HQ={class:"actions"},WQ=Xe({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=_t(),s=te(null);Oh(s);const o=t,i=e,r=te("starting"),l=te(null),a=te(0),c=te(!1);let u=null,d=null;Jt(async()=>{document.addEventListener("keydown",g),await p()}),qt(()=>{document.removeEventListener("keydown",g),v()});async function p(){v(),l.value=null,r.value="starting";const k=await i.onStartOAuthLogin();if(!k){r.value="error";return}l.value={flowId:k.flowId,verificationUri:k.verificationUri,verificationUriComplete:k.verificationUriComplete,userCode:k.userCode,expiresIn:k.expiresIn,interval:k.interval},a.value=k.expiresIn,r.value="device-code",m(),f(k.interval)}function m(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function f(k){u&&clearTimeout(u),u=setTimeout(async()=>{const I=await i.onPollOAuthLogin();I?.status==="authenticated"?(v(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):I?.status==="expired"||I?.status==="cancelled"?(v(),r.value="expired"):f(k)},k*1e3)}function v(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function w(){await p()}async function b(){if(l.value)try{await navigator.clipboard.writeText(l.value.userCode),c.value=!0,setTimeout(()=>{c.value=!1},2e3)}catch{}}async function _(){v(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function g(k){k.key==="Escape"&&_()}function y(k){const I=Math.floor(k/60),E=k%60;return`${I}:${String(E).padStart(2,"0")}`}return(k,I)=>(C(),A("div",uQ,[h("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":M(n)("login.title")},[h("div",fQ,[h("span",hQ,N(M(n)("login.title")),1),h("button",{class:"close-btn",title:M(n)("login.close"),onClick:_},[...I[0]||(I[0]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,pQ)]),r.value==="starting"?(C(),A("div",mQ,[I[1]||(I[1]=h("svg",{class:"spin-icon",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[h("circle",{cx:"11",cy:"11",r:"8","stroke-dasharray":"30 18","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 11 11",to:"360 11 11",dur:"0.9s",repeatCount:"indefinite"})])],-1)),h("span",gQ,N(M(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(C(),A("div",vQ,[h("div",yQ,N(M(n)("login.lead")),1),h("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[dt(N(M(n)("login.authorizeInBrowser"))+" ",1),I[2]||(I[2]=h("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.6"},[h("path",{d:"M6 2H2.5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8"}),h("path",{d:"M9.5 1.5h3v3M12.5 1.5 7 7"})],-1))],8,kQ),h("div",bQ,N(M(n)("login.orDivider")),1),h("div",_Q,[h("div",wQ,[dt(N(M(n)("login.fallbackPrefix")),1),h("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},N(l.value.verificationUri),9,SQ),dt(N(M(n)("login.fallbackSuffix")),1)]),h("div",CQ,[h("span",xQ,N(l.value.userCode),1),h("button",{class:$e(["nb-copy",{"is-copied":c.value}]),onClick:b},[c.value?(C(),A(Ie,{key:0},[I[3]||(I[3]=h("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("polyline",{points:"1,6 4,9 11,2"})],-1)),dt(" "+N(M(n)("login.copied")),1)],64)):(C(),A(Ie,{key:1},[I[4]||(I[4]=h("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),h("path",{d:"M8 4V2a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h2"})],-1)),dt(" "+N(M(n)("login.copy")),1)],64))],2)])]),h("div",TQ,[h("span",{class:"nb-spinner","aria-label":M(n)("login.waitingAuth")},[...I[5]||(I[5]=[h("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[h("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)])],8,MQ),h("span",AQ,N(M(n)("login.waitingAutoClose")),1),h("span",EQ,N(y(a.value)),1)])])):r.value==="success"?(C(),A("div",$Q,[I[6]||(I[6]=h("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--ok)","stroke-width":"2"},[h("circle",{cx:"18",cy:"18",r:"15"}),h("polyline",{points:"10,18 15,24 26,12"})],-1)),h("span",IQ,N(M(n)("login.success")),1),h("span",NQ,N(M(n)("login.successHint")),1)])):r.value==="expired"?(C(),A(Ie,{key:3},[h("div",LQ,[I[7]||(I[7]=h("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--err)","stroke-width":"1.5"},[h("circle",{cx:"14",cy:"14",r:"12"}),h("line",{x1:"14",y1:"8",x2:"14",y2:"15"}),h("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--err)"})],-1)),h("span",OQ,N(M(n)("login.expiredTitle")),1),h("span",RQ,N(M(n)("login.expiredHint")),1)]),h("div",PQ,[h("button",{class:"act-btn primary",onClick:w},N(M(n)("login.retry")),1),h("button",{class:"act-btn",onClick:_},N(M(n)("login.closeBtn")),1)])],64)):r.value==="error"?(C(),A(Ie,{key:4},[h("div",DQ,[I[8]||(I[8]=h("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[h("path",{d:"M14 3 L26 24 H2 Z"}),h("line",{x1:"14",y1:"12",x2:"14",y2:"18"}),h("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--warn)"})],-1)),h("span",BQ,N(M(n)("login.errorTitle")),1),h("span",FQ,N(M(n)("login.errorHint")),1)]),h("div",HQ,[h("button",{class:"act-btn primary",onClick:w},N(M(n)("login.retry")),1),h("button",{class:"act-btn",onClick:_},N(M(n)("login.closeBtn")),1)])],64)):re("",!0)],8,dQ)]))}}),UQ=vt(WQ,[["__scopeId","data-v-2c7f0348"]]),qQ=["aria-label"],jQ={class:"dh"},zQ={class:"dtitle"},VQ=["title"],KQ={class:"form-body"},GQ={class:"form-row"},YQ={class:"flabel",for:"ns-cwd"},XQ=["placeholder"],ZQ={key:0,class:"recent-section"},QQ={class:"recent-label"},JQ={class:"recent-list"},eJ=["title","onClick"],tJ={class:"recent-path"},nJ={class:"form-row"},sJ={class:"flabel",for:"ns-title"},oJ=["placeholder"],iJ={class:"actions"},rJ=["disabled"],lJ={class:"footer-hint"},aJ=Xe({__name:"NewSessionDialog",props:{recentCwds:{}},emits:["create","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te(""),r=te("");ze(()=>s.recentCwds,p=>{i.value===""&&p.length>0&&(i.value=p[0])},{immediate:!0});const l=j(()=>i.value.trim()),a=j(()=>l.value.length>0);function c(){if(!a.value)return;const p={cwd:l.value},m=r.value.trim();m&&(p.title=m),o("create",p)}function u(p){i.value=p}function d(p){p.key==="Escape"?o("close"):p.key==="Enter"&&!(p.target instanceof HTMLButtonElement)&&c()}return Jt(()=>document.addEventListener("keydown",d)),qt(()=>document.removeEventListener("keydown",d)),(p,m)=>(C(),A("div",{class:"backdrop",onClick:m[4]||(m[4]=Ge(f=>o("close"),["self"]))},[h("div",{class:"dialog",role:"dialog","aria-label":M(n)("newSession.title")},[h("div",jQ,[h("span",zQ,N(M(n)("newSession.title")),1),h("button",{class:"close-btn",title:M(n)("newSession.close"),onClick:m[0]||(m[0]=f=>o("close"))},[...m[5]||(m[5]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,VQ)]),h("div",KQ,[h("div",GQ,[h("label",YQ,N(M(n)("newSession.cwdLabel")),1),At(h("input",{id:"ns-cwd","onUpdate:modelValue":m[1]||(m[1]=f=>i.value=f),class:"finput",type:"text",placeholder:M(n)("newSession.cwdPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,XQ),[[bn,i.value]])]),e.recentCwds.length>0?(C(),A("div",ZQ,[h("div",QQ,N(M(n)("newSession.recentLabel")),1),h("div",JQ,[(C(!0),A(Ie,null,Ye(e.recentCwds,f=>(C(),A("button",{key:f,class:$e(["recent-item",{"is-active":i.value===f}]),title:f,onClick:v=>u(f)},[m[6]||(m[6]=h("svg",{class:"dir-icon",width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[h("rect",{x:"1",y:"3",width:"9",height:"6.5",rx:"1"}),h("path",{d:"M1 4.5V3a1 1 0 0 1 1-1h2.5l1 1.5"})],-1)),h("span",tJ,N(f),1)],10,eJ))),128))])])):re("",!0),h("div",nJ,[h("label",sJ,N(M(n)("newSession.titleFieldLabel")),1),At(h("input",{id:"ns-title","onUpdate:modelValue":m[2]||(m[2]=f=>r.value=f),class:"finput",type:"text",placeholder:M(n)("newSession.titleFieldPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,oJ),[[bn,r.value]])])]),h("div",iJ,[h("button",{class:"act-btn primary",disabled:!a.value,onClick:c},N(M(n)("newSession.create")),9,rJ),h("button",{class:"act-btn",onClick:m[3]||(m[3]=f=>o("close"))},N(M(n)("newSession.cancel")),1)]),h("div",lJ,N(M(n)("newSession.footerHint")),1)],8,qQ)]))}}),cJ=vt(aJ,[["__scopeId","data-v-9238ae59"]]),uJ={class:"lang-switch",role:"group","aria-label":"Language"},dJ=["aria-pressed","onClick"],fJ=Xe({__name:"LanguageSwitcher",setup(e){const{locale:t}=_t();function n(s){t.value!==s&&aC(s)}return(s,o)=>(C(),A("div",uJ,[(C(!0),A(Ie,null,Ye(M(lC),i=>(C(),A("button",{key:i.code,type:"button",class:$e(["lang-opt",{on:M(t)===i.code}]),"aria-pressed":M(t)===i.code,onClick:Ge(r=>n(i.code),["stop"])},N(i.label),11,dJ))),128))]))}}),WT=vt(fJ,[["__scopeId","data-v-807a4065"]]),Mw=jt.clientId,hJ="kimi-code-web",pJ="web";function mJ(){return{serverHttpUrl:vJ(),clientId:_J(),clientName:hJ,clientVersion:wJ(),clientUiMode:pJ}}function gJ(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function vJ(e){const t=gJ(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function yJ(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function kJ(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return yJ(e)}function Hf(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function bJ(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}function _J(){const e=Sn(Mw);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return wn(Mw,t),t}function wJ(){return"0.1.1".trim()?"0.1.1":"0.0.0-dev"}const Aw=1e3,Gm=16384,Ym=500,Xm=50,SJ=6,CJ=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,xJ=/^[A-Za-z0-9+/=_-]{200,}$/;let Zm=null;function ii(){if(Zm!==null)return Zm;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=Sn(jt.debug)==="1"),Zm=e,e}const lr=[];let TJ=1;const Bv=te(0),hc=fl(!1);function MJ(){return lr}function AJ(){lr.length=0,Bv.value++}function pl(e){hc.value||(lr.push({id:TJ++,ts:Date.now(),...e}),lr.length>Aw&&lr.splice(0,lr.length-Aw),Bv.value++)}function h1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return xJ.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>Ym?`${o.slice(0,Ym)}… [+${o.length-Ym} chars]`:o}if(n!=="object")return String(e);if(t>=SJ)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,Xm).map(i=>h1(i,t+1));return e.length>Xm&&o.push(`[+${e.length-Xm} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=CJ.test(o)?"[redacted]":h1(i,t+1);return s}function Ta(e){if(e===void 0)return;const t=h1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>Gm)return{_truncated:`detail JSON was ${n.length} chars; first ${Gm} kept`,preview:n.slice(0,Gm)}}catch{return"[unserializable detail]"}return t}function Ew(e){ii()&&pl({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Ta(e.body)}})}function $w(e){if(!ii())return;const t=e.code!==0;pl({source:"rest",kind:t?"rest:error":"rest:response",label:`← ${e.method} ${e.path} ${e.status} code=${e.code}${t?` "${e.msg}"`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,code:e.code,durationMs:e.durationMs,detail:{envelope:{code:e.code,msg:e.msg,request_id:e.envelopeRequestId},data:Ta(e.data)}})}function wd(e){ii()&&pl({source:"rest",kind:"rest:error",label:`✕ ${e.method} ${e.path} ${e.phase} error${e.status!==void 0?` (HTTP ${e.status})`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,durationMs:e.durationMs,detail:{phase:e.phase,error:String(e.error)}})}function Hl(e,t){ii()&&pl({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Ta(t)})}function EJ(e){if(!ii())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;pl({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:Ta(e)})}function $J(e){if(!ii())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);pl({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Ta(t.payload)})}const IJ={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Qm(e,t,n){ii()&&pl({source:"client",kind:`client:${e}`,label:`${IJ[e]} ${t}`,detail:Ta(n)})}let Iw=!1;function NJ(){if(!(Iw||!ii())){Iw=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{Qm("error",e.message||"window error",{source:e.filename,line:e.lineno,col:e.colno,stack:e.error instanceof Error?e.error.stack:void 0})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;Qm("error","unhandled promise rejection",{reason:t instanceof Error?`${t.name}: ${t.message}`:t,stack:t instanceof Error?t.stack:void 0})}))}catch{}for(const e of["error","warn","log","info","debug"]){const t=console[e];typeof t=="function"&&(console[e]=(...n)=>{try{Qm(e,n.map(LJ).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function LJ(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}function UT(e=lr){if(typeof document>"u")return;const t=new Blob([OJ(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function OJ(e=lr){return e.map(t=>JSON.stringify(t)).join(`
|
|
248
|
+
`)}const RJ=["aria-label"],PJ={class:"dh"},DJ={class:"dtitle"},BJ=["title"],FJ={class:"settings-layout"},HJ=["aria-label"],WJ=["aria-selected","aria-controls","id","onClick"],UJ={class:"body"},qJ={id:"settings-panel-general",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-general"},jJ={class:"sec"},zJ={class:"sec-title"},VJ={class:"row"},KJ={class:"rlabel"},GJ=["aria-label"],YJ=["aria-pressed"],XJ=["aria-pressed"],ZJ={class:"row"},QJ={class:"rlabel"},JJ=["aria-label"],eee=["aria-pressed"],tee=["aria-pressed"],nee=["aria-pressed"],see={class:"row"},oee={class:"rlabel"},iee={class:"num-field"},ree=["value","aria-label"],lee={class:"row"},aee={class:"rlabel"},cee={class:"sec"},uee={class:"sec-title"},dee={class:"row"},fee={class:"rlabel"},hee={key:0,class:"hint"},pee=["aria-checked","disabled"],mee={class:"sec"},gee={class:"sec-title"},vee={class:"row"},yee={class:"rlabel"},kee=["title"],bee={class:"actions"},_ee={class:"sec"},wee={class:"sec-title"},See={class:"row"},Cee={class:"rlabel"},xee={class:"rvalue mono"},Tee={id:"settings-panel-agent",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-agent"},Mee={class:"sec"},Aee={class:"sec-head"},Eee={class:"sec-title"},$ee={key:0,class:"saving"},Iee={class:"row"},Nee={class:"rlabel"},Lee={class:"hint"},Oee=["value","disabled","aria-label"],Ree={key:0,value:"",disabled:""},Pee=["label"],Dee=["value"],Bee={key:1,class:"rvalue mono"},Fee={class:"row"},Hee={class:"rlabel"},Wee={class:"hint"},Uee=["aria-label"],qee=["aria-pressed","disabled","onClick"],jee={class:"row"},zee={class:"rlabel"},Vee={class:"hint"},Kee=["aria-checked","disabled"],Gee={class:"row"},Yee={class:"rlabel"},Xee={class:"hint"},Zee=["aria-checked","disabled"],Qee={class:"row"},Jee={class:"rlabel"},ete={class:"hint"},tte=["aria-checked","disabled"],nte={key:0,class:"row"},ste={class:"rlabel"},ote=["aria-checked","disabled"],ite={key:1,class:"provider-list"},rte={class:"provider-main"},lte={class:"provider-id"},ate={class:"provider-type"},cte={class:"provider-meta"},ute={key:0,class:"provider-model"},dte={key:1,class:"empty-config"},fte={id:"settings-panel-advanced",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-advanced"},hte={class:"sec"},pte={class:"sec-title"},mte={class:"row"},gte={class:"rlabel"},vte={class:"rvalue mono"},yte={class:"row"},kte={class:"rlabel"},bte={key:0,class:"hint"},_te={id:"settings-panel-experimental",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-experimental"},wte={class:"sec"},Ste={class:"sec-title"},Cte={class:"row"},xte={class:"rlabel"},Tte={class:"hint"},Mte=["aria-checked"],Ate=Xe({__name:"SettingsDialog",props:{theme:{},colorScheme:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyPermission:{},betaToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setTheme","setColorScheme","setUiFontSize","setNotify","setBetaToc","login","logout","openOnboarding","updateConfig","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"experimental",labelKey:"settings.tabs.experimental"}],l=kJ(),a=["manual","auto","yolo"],c=te(null);Oh(c);function u(E){E.key==="Escape"&&o("close")}Jt(()=>document.addEventListener("keydown",u)),qt(()=>document.removeEventListener("keydown",u));function d(){UT()}const p=j(()=>{const E=new Map;for(const S of s.models??[])E.set(S.id,{id:S.id,label:S.displayName??S.model??S.id,provider:S.provider});for(const[S,T]of Object.entries(s.config?.models??{})){if(E.has(S))continue;const $=w(T);E.set(S,{id:S,label:b(S,T,$),provider:$??S})}return Array.from(E.values())}),m=j(()=>{const E=new Map;for(const S of p.value){const T=E.get(S.provider)??[];T.push(S),E.set(S.provider,T)}for(const S of E.values())S.sort((T,$)=>T.label.localeCompare($.label));return Array.from(E.entries()).toSorted(([S],[T])=>S.localeCompare(T)).map(([S,T])=>({provider:S,options:T}))}),f=j(()=>Object.entries(s.config?.providers??{}).map(([E,S])=>({id:E,provider:S})).sort((E,S)=>E.id.localeCompare(S.id))),v=j(()=>{const E=s.config?.defaultPermissionMode;return E==="auto"||E==="yolo"||E==="manual"?E:"manual"});function w(E){if(!E||typeof E!="object")return;const S=E;return typeof S.provider=="string"?S.provider:void 0}function b(E,S,T){if(!S||typeof S!="object")return E;const $=S,L=typeof $.model=="string"?$.model:void 0,R=T??w(S);return L&&R?`${E} (${R}/${L})`:L?`${E} (${L})`:E}function _(E){return E===!0}function g(E){const S=E.target.value;!S||S===s.config?.defaultModel||o("updateConfig",{defaultModel:S})}function y(E){E!==v.value&&o("updateConfig",{defaultPermissionMode:E})}function k(E){const S=s.config?.[E];o("updateConfig",{[E]:!_(S)})}function I(E){i.value=E}return(E,S)=>(C(),A("div",{class:"backdrop",onClick:S[16]||(S[16]=Ge(T=>o("close"),["self"]))},[h("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":M(n)("settings.title")},[h("div",PJ,[h("span",DJ,N(M(n)("settings.title")),1),h("button",{class:"close-btn",title:M(n)("newSession.close"),onClick:S[0]||(S[0]=T=>o("close"))},[...S[17]||(S[17]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,BJ)]),h("div",FJ,[h("nav",{class:"settings-tabs",role:"tablist","aria-label":M(n)("settings.title")},[(C(),A(Ie,null,Ye(r,T=>h("button",{key:T.id,type:"button",class:$e(["tab",{on:i.value===T.id}]),role:"tab","aria-selected":i.value===T.id,"aria-controls":`settings-panel-${T.id}`,id:`settings-tab-${T.id}`,onClick:$=>I(T.id)},N(M(n)(T.labelKey)),11,WJ)),64))],8,HJ),h("div",UJ,[At(h("section",qJ,[h("section",jJ,[h("h3",zJ,N(M(n)("settings.appearance")),1),h("div",VJ,[h("span",KJ,N(M(n)("theme.label")),1),h("div",{class:"seg",role:"group","aria-label":M(n)("theme.label")},[h("button",{type:"button",class:$e(["opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:S[1]||(S[1]=T=>o("setTheme","modern"))},N(M(n)("theme.modern")),11,YJ),h("button",{type:"button",class:$e(["opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:S[2]||(S[2]=T=>o("setTheme","kimi"))},N(M(n)("theme.kimi")),11,XJ)],8,GJ)]),h("div",ZJ,[h("span",QJ,N(M(n)("theme.colorSchemeLabel")),1),h("div",{class:"seg",role:"group","aria-label":M(n)("theme.colorSchemeLabel")},[h("button",{type:"button",class:$e(["opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:S[3]||(S[3]=T=>o("setColorScheme","light"))},N(M(n)("theme.light")),11,eee),h("button",{type:"button",class:$e(["opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:S[4]||(S[4]=T=>o("setColorScheme","dark"))},N(M(n)("theme.dark")),11,tee),h("button",{type:"button",class:$e(["opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:S[5]||(S[5]=T=>o("setColorScheme","system"))},N(M(n)("theme.system")),11,nee)],8,JJ)]),h("div",see,[h("span",oee,N(M(n)("settings.uiFontSize")),1),h("label",iee,[h("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":M(n)("settings.uiFontSize"),onInput:S[6]||(S[6]=T=>o("setUiFontSize",Number(T.target.value)))},null,40,ree),S[18]||(S[18]=h("span",{class:"num-unit"},"px",-1))])]),h("div",lee,[h("span",aee,N(M(n)("sidebar.language")),1),pt(WT)])]),h("section",cee,[h("h3",uee,N(M(n)("settings.notifications")),1),h("div",dee,[h("span",fee,[dt(N(M(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(C(),A("span",hee,N(M(n)("settings.notifyDenied")),1)):re("",!0)]),h("button",{type:"button",class:$e(["switch",{on:e.notify}]),role:"switch","aria-checked":e.notify,disabled:e.notifyPermission==="denied",onClick:S[7]||(S[7]=T=>o("setNotify",!e.notify))},[...S[19]||(S[19]=[h("span",{class:"knob"},null,-1)])],10,pee)])]),h("section",mee,[h("h3",gee,N(M(n)("settings.account")),1),h("div",vee,[h("span",yee,N(e.authReady?"managed:kimi-code":M(n)("sidebar.notSignedIn")),1),e.authReady&&e.accountModel?(C(),A("span",{key:0,class:"rvalue",title:e.accountModel},N(e.accountModel),9,kee)):re("",!0)]),h("div",bee,[h("button",{type:"button",class:"act",onClick:S[8]||(S[8]=T=>{o("openOnboarding"),o("close")})},N(M(n)("onboarding.reopen")),1),e.authReady?(C(),A("button",{key:0,type:"button",class:"act danger",onClick:S[9]||(S[9]=T=>o("logout"))},N(M(n)("sidebar.signOut")),1)):(C(),A("button",{key:1,type:"button",class:"act signin",onClick:S[10]||(S[10]=T=>o("login"))},N(M(n)("sidebar.signIn")),1))])]),h("section",_ee,[h("h3",wee,N(M(n)("settings.build")),1),h("div",See,[h("span",Cee,N(M(n)("settings.serverVersion")),1),h("span",xee,N(e.serverVersion||"-"),1)])])],512),[[Ro,i.value==="general"]]),At(h("section",Tee,[h("section",Mee,[h("div",Aee,[h("h3",Eee,N(M(n)("settings.agentDefaults")),1),e.configSaving?(C(),A("span",$ee,N(M(n)("settings.saving")),1)):re("",!0)]),e.config?(C(),A(Ie,{key:0},[h("div",Iee,[h("span",Nee,[dt(N(M(n)("settings.defaultModel"))+" ",1),h("span",Lee,N(M(n)("settings.defaultModelHint")),1)]),m.value.length>0?(C(),A("select",{key:0,class:"select-field",value:e.config.defaultModel??"",disabled:e.configSaving,"aria-label":M(n)("settings.defaultModel"),onChange:g},[e.config.defaultModel?re("",!0):(C(),A("option",Ree,N(M(n)("settings.noDefaultModel")),1)),(C(!0),A(Ie,null,Ye(m.value,T=>(C(),A("optgroup",{key:T.provider,label:T.provider},[(C(!0),A(Ie,null,Ye(T.options,$=>(C(),A("option",{key:$.id,value:$.id},N($.label),9,Dee))),128))],8,Pee))),128))],40,Oee)):(C(),A("span",Bee,N(e.config.defaultModel??M(n)("settings.noDefaultModel")),1))]),h("div",Fee,[h("span",Hee,[dt(N(M(n)("settings.defaultPermission"))+" ",1),h("span",Wee,N(M(n)("settings.defaultPermissionHint")),1)]),h("div",{class:"seg",role:"group","aria-label":M(n)("settings.defaultPermission")},[(C(),A(Ie,null,Ye(a,T=>h("button",{key:T,type:"button",class:$e(["opt",{on:v.value===T}]),"aria-pressed":v.value===T,disabled:e.configSaving,onClick:$=>y(T)},N(M(n)(`settings.permission.${T}`)),11,qee)),64))],8,Uee)]),h("div",jee,[h("span",zee,[dt(N(M(n)("settings.defaultThinking"))+" ",1),h("span",Vee,N(M(n)("settings.defaultThinkingHint")),1)]),h("button",{type:"button",class:$e(["switch",{on:_(e.config.defaultThinking)}]),role:"switch","aria-checked":_(e.config.defaultThinking),disabled:e.configSaving,onClick:S[11]||(S[11]=T=>k("defaultThinking"))},[...S[20]||(S[20]=[h("span",{class:"knob"},null,-1)])],10,Kee)]),h("div",Gee,[h("span",Yee,[dt(N(M(n)("settings.defaultPlanMode"))+" ",1),h("span",Xee,N(M(n)("settings.defaultPlanModeHint")),1)]),h("button",{type:"button",class:$e(["switch",{on:_(e.config.defaultPlanMode)}]),role:"switch","aria-checked":_(e.config.defaultPlanMode),disabled:e.configSaving,onClick:S[12]||(S[12]=T=>k("defaultPlanMode"))},[...S[21]||(S[21]=[h("span",{class:"knob"},null,-1)])],10,Zee)]),h("div",Qee,[h("span",Jee,[dt(N(M(n)("settings.mergeSkills"))+" ",1),h("span",ete,N(M(n)("settings.mergeSkillsHint")),1)]),h("button",{type:"button",class:$e(["switch",{on:_(e.config.mergeAllAvailableSkills)}]),role:"switch","aria-checked":_(e.config.mergeAllAvailableSkills),disabled:e.configSaving,onClick:S[13]||(S[13]=T=>k("mergeAllAvailableSkills"))},[...S[22]||(S[22]=[h("span",{class:"knob"},null,-1)])],10,tte)]),e.config.telemetry!==void 0?(C(),A("div",nte,[h("span",ste,N(M(n)("settings.telemetry")),1),h("button",{type:"button",class:$e(["switch",{on:_(e.config.telemetry)}]),role:"switch","aria-checked":_(e.config.telemetry),disabled:e.configSaving,onClick:S[14]||(S[14]=T=>k("telemetry"))},[...S[23]||(S[23]=[h("span",{class:"knob"},null,-1)])],10,ote)])):re("",!0),f.value.length>0?(C(),A("div",ite,[(C(!0),A(Ie,null,Ye(f.value,({id:T,provider:$})=>(C(),A("div",{key:T,class:"provider-row"},[h("div",rte,[h("span",lte,N(T),1),h("span",ate,N($.type),1)]),h("div",cte,[h("span",{class:$e(["provider-badge",$.hasApiKey?"ok":"warn"])},N($.hasApiKey?M(n)("settings.credentialReady"):M(n)("settings.credentialMissing")),3),$.defaultModel?(C(),A("span",ute,N($.defaultModel),1)):re("",!0)])]))),128))])):re("",!0)],64)):(C(),A("div",dte,N(M(n)("settings.configUnavailable")),1))])],512),[[Ro,i.value==="agent"]]),At(h("section",fte,[h("section",hte,[h("h3",pte,N(M(n)("settings.advanced")),1),h("div",mte,[h("span",gte,N(M(n)("sidebar.daemon")),1),h("span",vte,N(M(l)),1)]),h("div",yte,[h("span",kte,[dt(N(M(n)("settings.exportLog"))+" ",1),M(ii)()?re("",!0):(C(),A("span",bte,N(M(n)("settings.logHint")),1))]),h("button",{type:"button",class:"act",onClick:d},N(M(n)("settings.exportLogBtn")),1)])])],512),[[Ro,i.value==="advanced"]]),At(h("section",_te,[h("section",wte,[h("h3",Ste,N(M(n)("settings.beta")),1),h("div",Cte,[h("span",xte,[dt(N(M(n)("settings.betaToc"))+" ",1),h("span",Tte,N(M(n)("settings.betaTocHint")),1)]),h("button",{type:"button",class:$e(["switch",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc,onClick:S[15]||(S[15]=T=>o("setBetaToc",!e.betaToc))},[...S[24]||(S[24]=[h("span",{class:"knob"},null,-1)])],10,Mte)])])],512),[[Ro,i.value==="experimental"]])])])],8,RJ)]))}}),Ete=vt(Ate,[["__scopeId","data-v-96ebddac"]]),$te=["aria-label"],Ite={class:"dh"},Nte={class:"dtitle"},Lte={class:"count"},Ote=["aria-label","title"],Rte={class:"search-wrap"},Pte=["placeholder"],Dte={class:"session-list"},Bte=["aria-selected","onClick","onMouseenter"],Fte={class:"meta"},Hte={class:"title"},Wte={class:"sub"},Ute={class:"ws"},qte={class:"time"},jte={key:0,class:"attn-badge"},zte={key:0,class:"empty"},Vte={class:"footer-hint"},Kte=Xe({__name:"SessionsDialog",props:{sessions:{},workspaceGroups:{},attentionBySession:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=j(()=>{const f={};for(const v of s.workspaceGroups)for(const w of v.sessions)f[w.id]=v.workspace.name;return f}),r=te(""),l=te(null),a=j(()=>{const f=r.value.toLowerCase().trim();return f?s.sessions.filter(v=>v.title.toLowerCase().includes(f)):s.sessions}),c=te(0);ze(r,()=>{c.value=0});function u(f){o("select",f)}function d(f){return s.attentionBySession[f]??0}function p(f){return d(f.id)>0||f.status==="awaitingApproval"||f.status==="awaitingQuestion"?"attn":f.busy?"run":f.status==="aborted"?"aborted":"idle"}function m(f){if(f.key==="Escape"){o("close");return}if(f.key==="ArrowDown")f.preventDefault(),c.value=Math.min(c.value+1,a.value.length-1);else if(f.key==="ArrowUp")f.preventDefault(),c.value=Math.max(c.value-1,0);else if(f.key==="Enter"){const v=a.value[c.value];v&&u(v.id)}}return Jt(()=>{document.addEventListener("keydown",m),ut(()=>l.value?.focus())}),qt(()=>{document.removeEventListener("keydown",m)}),(f,v)=>(C(),A("div",{class:"backdrop",onClick:v[2]||(v[2]=Ge(w=>o("close"),["self"]))},[h("div",{class:"dialog",role:"dialog","aria-label":M(n)("sessions.title")},[h("div",Ite,[h("span",Nte,N(M(n)("sessions.title")),1),h("span",Lte,N(e.sessions.length),1),h("button",{class:"close-btn","aria-label":M(n)("sessions.close"),title:M(n)("sessions.close"),onClick:v[0]||(v[0]=w=>o("close"))},[...v[3]||(v[3]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Ote)]),h("div",Rte,[At(h("input",{ref_key:"searchRef",ref:l,"onUpdate:modelValue":v[1]||(v[1]=w=>r.value=w),class:"search-input",type:"text",placeholder:M(n)("sessions.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Pte),[[bn,r.value]])]),h("div",Dte,[(C(!0),A(Ie,null,Ye(a.value,(w,b)=>(C(),A("div",{key:w.id,class:$e(["session-row",{"is-active":w.id===e.activeId,"is-selected":b===c.value}]),role:"option","aria-selected":w.id===e.activeId,onClick:_=>u(w.id),onMouseenter:_=>c.value=b},[h("span",{class:$e(["dot",p(w)])},null,2),h("div",Fte,[h("span",Hte,N(w.title),1),h("span",Wte,[h("span",Ute,N(i.value[w.id]??M(n)("sessions.noWorkspace")),1),v[4]||(v[4]=h("span",{class:"sep"},"·",-1)),h("span",qte,N(w.time),1)])]),d(w.id)>0?(C(),A("span",jte,N(d(w.id)),1)):re("",!0)],42,Bte))),128)),a.value.length===0?(C(),A("div",zte,N(e.sessions.length===0?M(n)("sessions.emptyNone"):M(n)("sessions.emptyNoMatch")),1)):re("",!0)]),h("div",Vte,N(M(n)("sessions.footerHint")),1)],8,$te)]))}}),Gte=vt(Kte,[["__scopeId","data-v-c48c4439"]]),Yte=["aria-label"],Xte={class:"dh"},Zte={class:"dtitle"},Qte=["aria-label"],Jte={class:"crumbbar"},ene=["disabled","title","aria-label"],tne={class:"crumbs"},nne={key:0,class:"crumb-sep"},sne=["onClick"],one={key:0,class:"filterbar"},ine=["placeholder"],rne={key:0,class:"search-spin","aria-hidden":"true"},lne={class:"folder-list"},ane={key:0,class:"fl-loading"},cne=["onClick"],une={class:"folder-name search-rel"},dne={key:0,class:"git-tag"},fne={key:0,class:"git-branch"},hne={key:0,class:"fl-empty"},pne={key:1,class:"fl-loading"},mne=["onClick"],gne={class:"folder-name"},vne={key:0,class:"git-tag"},yne={key:0,class:"git-branch"},kne={key:0,class:"fl-empty"},bne={class:"paste-label",for:"aw-path"},_ne=["placeholder","onKeydown"],wne=["disabled","title"],Sne={class:"actions"},Cne=["disabled","title"],xne={class:"footer-hint"},Tne=600,Mne=6,Nw=150,Ane=Xe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te(!1),r=te(!1),l=te(""),a=te(null),c=te([]),u=te(""),d=te(!1),p=te([]),m=j(()=>u.value.trim().length>0);let f=0,v=null;function w(O,B){const F=O.toLowerCase(),q=B.toLowerCase();let G=0;for(let K=0;K<q.length&&G<F.length;K++)q[K]===F[G]&&G++;return G===F.length}async function b(O){const B=l.value,F=O.trim();if(!B||F===""){p.value=[],d.value=!1;return}const q=++f;d.value=!0;const G=[],K=[{path:B,depth:0}];let oe=0;for(;K.length>0&&oe<Tne&&G.length<Nw;){if(q!==f)return;const le=K.shift();oe++;let pe;try{pe=await s.browseFs(le.path)}catch{continue}if(q!==f)return;for(const be of pe.entries){if(!be.isDir)continue;const Be=be.path.startsWith(B)?be.path.slice(B.length).replace(/^\/+/,""):be.path;if(w(F,Be||be.name)&&(G.push({path:be.path,name:be.name,rel:Be||be.name,isGitRepo:be.isGitRepo,branch:be.branch}),G.length>=Nw))break;le.depth+1<Mne&&K.push({path:be.path,depth:le.depth+1})}q===f&&(p.value=[...G])}q===f&&(d.value=!1)}ze(u,O=>{if(v&&clearTimeout(v),O.trim()===""){f++,p.value=[],d.value=!1;return}v=setTimeout(()=>void b(O),220)});const _=te(!1),g=te(""),y=j(()=>g.value.trim()),k=j(()=>{const O=l.value;if(!O)return[];const B=O.split("/").filter(Boolean),F=[{label:"/",path:"/"}];let q="";for(const G of B)q+=`/${G}`,F.push({label:G,path:q});return F}),I=j(()=>l.value.length>0);async function E(O){i.value=!0;try{const B=await s.browseFs(O);if(!B.path){r.value=!0;return}l.value=B.path,a.value=B.parent,c.value=B.entries,u.value="",r.value=!1}catch{r.value=!0}finally{i.value=!1}}function S(O){O.isDir&&E(O.path)}function T(){a.value&&E(a.value)}function $(){I.value&&o("add",l.value)}function L(){y.value.length!==0&&o("add",y.value)}Jt(async()=>{i.value=!0;try{if(s.defaultPath&&(await E(s.defaultPath),!r.value))return;const O=await s.getFsHome();O.home?await E(O.home):r.value=!0}catch{r.value=!0}finally{i.value=!1}});function R(O){O.key==="Escape"&&o("close")}return Jt(()=>document.addEventListener("keydown",R)),qt(()=>{document.removeEventListener("keydown",R),v&&clearTimeout(v)}),(O,B)=>(C(),A("div",{class:"backdrop",onClick:B[6]||(B[6]=Ge(F=>o("close"),["self"]))},[h("div",{class:"dialog",role:"dialog","aria-label":M(n)("workspace.addTitle")},[h("div",Xte,[h("span",Zte,N(M(n)("workspace.addTitle")),1),h("button",{class:"close-btn","aria-label":M(n)("workspace.cancel"),onClick:B[0]||(B[0]=F=>o("close"))},[...B[7]||(B[7]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Qte)]),r.value?re("",!0):(C(),A(Ie,{key:0},[h("div",Jte,[h("button",{class:"up-btn",disabled:!a.value,title:M(n)("workspace.up"),"aria-label":M(n)("workspace.up"),onClick:T},[...B[8]||(B[8]=[h("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[h("path",{d:"M8 12V4M4 7l4-3 4 3"})],-1)])],8,ene),h("div",tne,[(C(!0),A(Ie,null,Ye(k.value,(F,q)=>(C(),A(Ie,{key:F.path},[q>1?(C(),A("span",nne,"/")):re("",!0),h("button",{class:$e(["crumb",{last:q===k.value.length-1}]),onClick:G=>E(F.path)},N(F.label),11,sne)],64))),128))])]),i.value?re("",!0):(C(),A("div",one,[B[9]||(B[9]=h("svg",{class:"filter-icon",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("circle",{cx:"7",cy:"7",r:"4.5"}),h("path",{d:"M11 11l3 3"})],-1)),At(h("input",{"onUpdate:modelValue":B[1]||(B[1]=F=>u.value=F),class:"filter-input",type:"text",placeholder:M(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:B[2]||(B[2]=Ge(()=>{},["stop"]))},null,40,ine),[[bn,u.value]]),d.value?(C(),A("span",rne)):re("",!0)])),h("div",lne,[i.value?(C(),A("div",ane,N(M(n)("workspace.browsing")),1)):m.value?(C(),A(Ie,{key:1},[(C(!0),A(Ie,null,Ye(p.value,F=>(C(),A("button",{key:F.path,class:"folder-row",onClick:q=>E(F.path)},[B[10]||(B[10]=h("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[h("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),h("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),h("span",une,N(F.rel),1),F.isGitRepo?(C(),A("span",dne,[dt(N(M(n)("workspace.gitTag")),1),F.branch?(C(),A("span",fne,N(F.branch),1)):re("",!0)])):re("",!0)],8,cne))),128)),!d.value&&p.value.length===0?(C(),A("div",hne,N(M(n)("workspace.noFilterMatch",{q:u.value.trim()})),1)):d.value&&p.value.length===0?(C(),A("div",pne,N(M(n)("workspace.searching")),1)):re("",!0)],64)):(C(),A(Ie,{key:2},[(C(!0),A(Ie,null,Ye(c.value,F=>(C(),A("button",{key:F.path,class:"folder-row",onClick:q=>S(F)},[B[11]||(B[11]=h("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[h("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),h("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),h("span",gne,N(F.name),1),F.isGitRepo?(C(),A("span",vne,[dt(N(M(n)("workspace.gitTag")),1),F.branch?(C(),A("span",yne,N(F.branch),1)):re("",!0)])):re("",!0)],8,mne))),128)),c.value.length===0?(C(),A("div",kne,N(M(n)("workspace.noSubfolders")),1)):re("",!0)],64))])],64)),h("div",{class:$e(["paste-section",{"paste-only":r.value}])},[!r.value&&!_.value?(C(),A("button",{key:0,type:"button",class:"paste-toggle",onClick:B[3]||(B[3]=F=>_.value=!0)},N(M(n)("workspace.pasteToggle")),1)):(C(),A(Ie,{key:1},[h("label",bne,N(M(n)("workspace.pathLabel")),1),At(h("input",{id:"aw-path","onUpdate:modelValue":B[4]||(B[4]=F=>g.value=F),class:"paste-input",type:"text",placeholder:M(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:So(Ge(L,["stop"]),["enter"])},null,40,_ne),[[bn,g.value]]),h("button",{class:"paste-add",disabled:y.value.length===0,title:M(n)("workspace.add"),onClick:L},[...B[12]||(B[12]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M8 3v10M3 8h10"})],-1)])],8,wne)],64))],2),h("div",Sne,[r.value?re("",!0):(C(),A("button",{key:0,class:"act-btn primary",disabled:!I.value,title:l.value,onClick:$},N(M(n)("workspace.openThisFolder")),9,Cne)),h("button",{class:"act-btn",onClick:B[5]||(B[5]=F=>o("close"))},N(M(n)("workspace.cancel")),1)]),h("div",xne,N(M(n)("workspace.browseHint")),1)],8,Yte)]))}}),Ene=vt(Ane,[["__scopeId","data-v-50af6ed0"]]),$ne=["aria-label"],Ine={class:"dh"},Nne={class:"dtitle"},Lne=["title"],One={class:"rows"},Rne={class:"row"},Pne={class:"row"},Dne={class:"row"},Bne={class:"row"},Fne={class:"row"},Hne={class:"row"},Wne={class:"ctx-text"},Une={key:0,class:"bar"},qne={class:"row"},jne=Xe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=j(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),r=j(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:i.value}):n("status.statusNone"));function l(f){return n(f==="yolo"?"status.permissionYolo":f==="auto"?"status.permissionAuto":"status.permissionManual")}const a=j(()=>{const f=s.status.permission;return f==="yolo"?"var(--err)":f==="auto"?"var(--warn)":"var(--ink)"}),c=j(()=>s.planMode?n("status.planOn"):n("status.planOff")),u=j(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),d=j(()=>typeof s.costUsd=="number"&&s.costUsd>0),p=j(()=>d.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));function m(f){f.key==="Escape"&&o("close")}return Jt(()=>document.addEventListener("keydown",m)),qt(()=>document.removeEventListener("keydown",m)),(f,v)=>(C(),A("div",{class:"backdrop",onClick:v[1]||(v[1]=Ge(w=>o("close"),["self"]))},[h("div",{class:"dialog",role:"dialog","aria-label":M(n)("status.statusPanelTitle")},[h("div",Ine,[h("span",Nne,N(M(n)("status.statusPanelTitle")),1),h("button",{class:"close-btn",title:M(n)("status.statusPanelClose"),onClick:v[0]||(v[0]=w=>o("close"))},"✕",8,Lne)]),h("dl",One,[h("div",Rne,[h("dt",null,N(M(n)("status.statusModel")),1),h("dd",null,N(e.status.model),1)]),h("div",Pne,[h("dt",null,N(M(n)("status.statusThinking")),1),h("dd",null,N(e.thinking),1)]),h("div",Dne,[h("dt",null,N(M(n)("status.statusPermission")),1),h("dd",{style:It({color:a.value})},N(l(e.status.permission)),5)]),h("div",Bne,[h("dt",null,N(M(n)("status.statusPlanMode")),1),h("dd",{class:$e({"plan-on":e.planMode})},N(c.value),3)]),h("div",Fne,[h("dt",null,N(M(n)("status.statusSwarmMode")),1),h("dd",{class:$e({"swarm-on":e.swarmMode})},N(u.value),3)]),h("div",Hne,[h("dt",null,N(M(n)("status.statusContext")),1),h("dd",null,[h("span",Wne,N(r.value),1),e.status.ctxMax>0?(C(),A("span",Une,[h("i",{style:It({width:i.value+"%"})},null,4)])):re("",!0)])]),h("div",qne,[h("dt",null,N(M(n)("status.statusCost")),1),h("dd",null,N(p.value),1)])])],8,$ne)]))}}),zne=vt(jne,[["__scopeId","data-v-b8e6208e"]]),Vne={key:0,class:"toasts",role:"status","aria-live":"polite"},Kne=["onPointerenter","onPointerleave"],Gne={class:"body"},Yne={class:"title"},Xne={key:0,class:"msg"},Zne={key:1,class:"actions"},Qne=["onClick"],Jne=["onClick"],ese={key:2,class:"details"},tse=["aria-label","onClick"],nse=Xe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t();function i(S){return typeof S=="object"&&S!==null}function r(S){return i(S)?S.title:S}function l(S){return i(S)?S.message??"":""}function a(S){return i(S)?S.details:void 0}function c(S){return i(S)?S.severity==="error":S.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(S)}function u(S){return i(S)?`notice:${S.severity}:${S.title}:${S.message??""}:${JSON.stringify(S.details??[])}`:`text:${S}`}function d(S){if(!i(S))return S;const T=[S.title];S.message&&T.push(S.message);const $=S.details??[];if($.length>0){T.push("",`${o("warnings.diagnostics")}:`);for(const L of $)T.push(`${L.label}: ${L.value}`)}return T.join(`
|
|
249
|
+
`)}let p=1;const m=te([]),f=new Map,v=new Map;function w(S){const T=c(S)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?T+5e3:T}function b(S,T){const $=f.get(S)??{handle:null,deadline:0,remaining:0};$.handle=setTimeout(()=>E(S),T),$.deadline=Date.now()+T,f.set(S,$)}function _(S){const T=f.get(S);T&&T.handle!==null&&clearTimeout(T.handle),f.delete(S)}function g(S){const T=f.get(S);!T||T.handle===null||(clearTimeout(T.handle),T.handle=null,T.remaining=Math.max(0,T.deadline-Date.now()))}function y(S){if(m.value.find(L=>L.id===S)?.detailsOpen)return;const $=f.get(S);!$||$.handle!==null||b(S,$.remaining)}function k(S){S.detailsOpen=!S.detailsOpen,S.detailsOpen?g(S.id):y(S.id)}async function I(S){if(!navigator.clipboard?.writeText)return;await navigator.clipboard.writeText(d(S.warning)),S.copied=!0;const T=v.get(S.id);T&&clearTimeout(T),v.set(S.id,setTimeout(()=>{S.copied=!1,v.delete(S.id)},1400))}function E(S){_(S);const T=v.get(S);T&&clearTimeout(T),v.delete(S);const $=m.value.findIndex(L=>L.id===S);$!==-1&&(m.value=m.value.filter(L=>L.id!==S),s("dismiss",$))}return ze(()=>n.warnings,S=>{const T=[...m.value];m.value=S.map($=>{const L=u($),R=T.findIndex(F=>F.key===L),O=R===-1?void 0:T.splice(R,1)[0];if(O)return O.warning=$,O;const B={id:p++,key:L,warning:$,detailsOpen:!1,copied:!1};return b(B.id,w($)),B});for(const $ of T){_($.id);const L=v.get($.id);L&&clearTimeout(L),v.delete($.id)}},{immediate:!0,flush:"post"}),qt(()=>{f.forEach(S=>{S.handle!==null&&clearTimeout(S.handle)}),f.clear(),v.forEach(S=>clearTimeout(S)),v.clear()}),(S,T)=>m.value.length?(C(),A("div",Vne,[(C(!0),A(Ie,null,Ye(m.value,$=>(C(),A("div",{key:$.id,class:$e(["toast",{err:c($.warning)}]),onPointerenter:L=>g($.id),onPointerleave:L=>y($.id)},[T[1]||(T[1]=h("span",{class:"dot","aria-hidden":"true"},null,-1)),h("div",Gne,[h("div",Yne,N(r($.warning)),1),l($.warning)?(C(),A("div",Xne,N(l($.warning)),1)):re("",!0),a($.warning)?.length?(C(),A("div",Zne,[h("button",{class:"link",type:"button",onClick:L=>k($)},N($.detailsOpen?M(o)("warnings.hideDetails"):M(o)("warnings.showDetails")),9,Qne),h("button",{class:"link",type:"button",onClick:L=>I($)},N($.copied?M(o)("warnings.copied"):M(o)("warnings.copyDetails")),9,Jne)])):re("",!0),$.detailsOpen&&a($.warning)?.length?(C(),A("dl",ese,[(C(!0),A(Ie,null,Ye(a($.warning),L=>(C(),A("div",{key:`${L.label}:${L.value}`,class:"detail-row"},[h("dt",null,N(L.label),1),h("dd",null,N(L.value),1)]))),128))])):re("",!0)]),h("button",{class:"x",type:"button","aria-label":M(o)("warnings.dismiss"),onClick:L=>E($.id)},[...T[0]||(T[0]=[h("svg",{viewBox:"0 0 16 16",width:"12",height:"12"},[h("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round"})],-1)])],8,tse)],42,Kne))),128))])):re("",!0)}}),sse=vt(nse,[["__scopeId","data-v-0a9833a1"]]),ose={class:"topbar"},ise={class:"wsq"},rse=["aria-label"],lse={class:"tb-path"},ase={class:"ws"},cse={class:"se"},use={class:"tb-sub"},dse=["aria-label"],fse=Xe({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=j(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=j(()=>s.workspace?.name??n("workspace.noWorkspace")),l=j(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(C(),A("div",ose,[h("span",ise,N(i.value),1),h("button",{type:"button",class:"tb-mid","aria-label":M(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[h("span",lse,[h("span",ase,N(r.value),1),e.sessionTitle?(C(),A(Ie,{key:0},[c[2]||(c[2]=h("span",{class:"sl"},"/",-1)),h("span",cse,N(e.sessionTitle),1)],64)):re("",!0),c[3]||(c[3]=h("span",{class:"cv"},"⌄",-1))]),h("span",use,[h("span",{class:$e(["rd",{on:e.running}])},null,2),h("span",null,N(l.value),1),e.branch?(C(),A(Ie,{key:0},[dt(" · "+N(e.branch),1)],64)):re("",!0),e.sessionCount>0?(C(),A(Ie,{key:1},[dt(" · "+N(M(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):re("",!0)])],8,rse),h("button",{type:"button",class:"tb-set","aria-label":M(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},[...c[4]||(c[4]=[mr('<svg viewBox="0 0 24 24" width="21" height="21" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" aria-hidden="true" data-v-95de12de><line x1="4" y1="8" x2="20" y2="8" data-v-95de12de></line><circle cx="10" cy="8" r="2.5" fill="var(--bg)" data-v-95de12de></circle><line x1="4" y1="16" x2="20" y2="16" data-v-95de12de></line><circle cx="15" cy="16" r="2.5" fill="var(--bg)" data-v-95de12de></circle></svg>',1)])],8,dse)]))}}),hse=vt(fse,[["__scopeId","data-v-95de12de"]]),pse={key:0,class:"sheet-root"},mse=["aria-label"],gse=["aria-label"],vse={key:0,class:"sheet-head"},yse={class:"sheet-title"},kse={class:"sheet-body"},bse=Xe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return ze(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),qt(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(C(),qe(Ti,{name:"sheet"},{default:kn(()=>[e.modelValue?(C(),A("div",pse,[h("div",{class:"sheet-scrim",onClick:i}),h("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||M(n)("mobile.sheetLabel")},[h("button",{type:"button",class:"sheet-grab","aria-label":M(n)("mobile.closeSheet"),onClick:i},null,8,gse),e.title?(C(),A("div",vse,[h("span",yse,N(e.title),1)])):re("",!0),h("div",kse,[ta(l.$slots,"default",{},void 0,!0)])],8,mse)])):re("",!0)]),_:3}))}}),qT=vt(bse,[["__scopeId","data-v-ee82f5a2"]]),_se={class:"mlist"},wse={key:0,class:"mempty"},Sse=["onClick"],Cse={class:"mgh-folder",width:"15",height:"15",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},xse={class:"mgh-main"},Tse={class:"mgh-name"},Mse=["title"],Ase={key:0,class:"att"},Ese=["title","aria-label","onClick"],$se=["title","aria-label","onClick"],Ise=["onClick"],Nse=["onClick"],Lse={key:0,class:"mempty small"},Ose=["onClick"],Rse={class:"m"},Pse={class:"s"},Dse={key:0,class:"att"},Bse=["title","onClick"],Fse=["onClick"],Hse=["onClick"],Wse=["onClick"],Lw=5,Use=7200*60*1e3,qse=Xe({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t;function i(){o("update:modelValue",!1)}function r(B){o("select",B),i()}function l(B){o("createInWorkspace",B),i()}function a(){o("create"),i()}function c(){o("addWorkspace"),i()}const u=te(new Set);function d(B){return u.value.has(B)}function p(B){const F=new Set(u.value);if(F.has(B)){F.delete(B);const q=new Set(f.value);q.delete(B),f.value=q}else F.add(B);u.value=F,_.value=null,S.value=null}function m(B){return s.attentionByWorkspace[B]??0}const f=te(new Set);function v(B){return f.value.has(B)}function w(B){const F=new Set(f.value);F.has(B)?F.delete(B):F.add(B),f.value=F}function b(B,F,q){if(F||B.length<=Lw)return B;const K=Date.now()-Use,oe=B.slice(0,Lw),le=new Set(oe.map(Be=>Be.id)),pe=B.filter(Be=>le.has(Be.id)?!1:(Be.updatedAt?Date.parse(Be.updatedAt):0)>K),be=[...oe,...pe];if(q&&!be.some(Be=>Be.id===q)){const Be=B.find(He=>He.id===q);Be&&be.push(Be)}return be}const _=te(null),g=te(null);let y;function k(B){_.value=_.value===B?null:B,S.value=null,clearTimeout(y),g.value=null}function I(B){_.value=null;const q=(typeof window<"u"?window.prompt(n("sidebar.rename"),B.title):null)?.trim();q&&o("rename",B.id,q)}function E(B){if(g.value===B){clearTimeout(y),g.value=null,_.value=null,o("archive",B);return}clearTimeout(y),g.value=B,y=setTimeout(()=>{g.value=null},2500)}const S=te(null),T=te(null);let $;function L(B){S.value=S.value===B?null:B,_.value=null,clearTimeout($),T.value=null}function R(B){navigator.clipboard.writeText(B.root),S.value=null}function O(B){if(T.value===B){clearTimeout($),T.value=null,S.value=null,o("deleteWorkspace",B);return}clearTimeout($),T.value=B,$=setTimeout(()=>{T.value=null},2500)}return qt(()=>{clearTimeout(y),clearTimeout($)}),(B,F)=>(C(),qe(qT,{"model-value":e.modelValue,"onUpdate:modelValue":F[2]||(F[2]=q=>o("update:modelValue",q))},{default:kn(()=>[h("button",{type:"button",class:"newrow",onClick:a},[F[3]||(F[3]=h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),dt(" "+N(M(n)("sidebar.newChat")),1)]),h("button",{type:"button",class:"newrow secondary",onClick:c},[F[4]||(F[4]=h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),h("path",{d:"M1 5.5h12"})],-1)),dt(" "+N(M(n)("sidebar.newWorkspace")),1)]),h("div",_se,[e.groups.length===0?(C(),A("div",wse,N(M(n)("workspace.noWorkspace")),1)):re("",!0),(C(!0),A(Ie,null,Ye(e.groups,q=>(C(),A("div",{key:q.workspace.id,class:"mgroup"},[h("div",{class:$e(["mgh",{on:q.workspace.id===e.activeWorkspaceId}]),onClick:G=>p(q.workspace.id)},[(C(),A("svg",Cse,[d(q.workspace.id)?(C(),A(Ie,{key:0},[F[5]||(F[5]=h("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),F[6]||(F[6]=h("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(C(),A(Ie,{key:1},[F[7]||(F[7]=h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),F[8]||(F[8]=h("path",{d:"M1 5.5h12"},null,-1))],64))])),h("div",xse,[h("span",Tse,N(q.workspace.name),1),h("span",{class:"mgh-path",title:q.workspace.root},N(q.workspace.branch||q.workspace.shortPath),9,Mse)]),d(q.workspace.id)&&m(q.workspace.id)>0?(C(),A("span",Ase,N(m(q.workspace.id)),1)):re("",!0),h("button",{type:"button",class:"mgh-more",title:M(n)("sidebar.options"),"aria-label":M(n)("sidebar.options"),onClick:Ge(G=>L(q.workspace.id),["stop"])},[...F[9]||(F[9]=[h("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"8",cy:"3",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,Ese),h("button",{type:"button",class:"mgh-add",title:M(n)("workspace.newInGroup"),"aria-label":M(n)("workspace.newInGroup"),onClick:Ge(G=>l(q.workspace.id),["stop"])},"+",8,$se),S.value===q.workspace.id?(C(),A("div",{key:1,class:"kmenu wsmenu",onClick:F[0]||(F[0]=Ge(()=>{},["stop"]))},[h("button",{class:"kitem",onClick:Ge(G=>R(q.workspace),["stop"])},N(M(n)("sidebar.copyPath")),9,Ise),h("button",{class:"kitem archive",onClick:Ge(G=>O(q.workspace.id),["stop"])},N(T.value===q.workspace.id?M(n)("sidebar.confirm"):M(n)("sidebar.delete")),9,Nse)])):re("",!0)],10,Sse),At(h("div",null,[q.sessions.length===0?(C(),A("div",Lse,N(M(n)("sidebar.noSessions")),1)):re("",!0),(C(!0),A(Ie,null,Ye(b(q.sessions,v(q.workspace.id),e.activeId),G=>(C(),A("div",{key:G.id,class:$e(["srow",{cur:G.id===e.activeId}]),onClick:K=>r(G.id)},[h("div",Rse,[h("div",{class:$e(["t",{run:G.busy,aborted:G.status==="aborted"}])},N(G.title),3),h("div",Pse,N(G.time),1)]),(e.attentionBySession[G.id]??0)>0?(C(),A("span",Dse,N(e.attentionBySession[G.id]),1)):re("",!0),h("button",{type:"button",class:"kb",title:M(n)("sidebar.options"),onClick:Ge(K=>k(G.id),["stop"])},[...F[10]||(F[10]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"8",cy:"3",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,Bse),_.value===G.id?(C(),A("div",{key:1,class:"kmenu",onClick:F[1]||(F[1]=Ge(()=>{},["stop"]))},[h("button",{class:"kitem",onClick:Ge(K=>I(G),["stop"])},N(M(n)("sidebar.rename")),9,Fse),h("button",{class:"kitem archive",onClick:Ge(K=>E(G.id),["stop"])},N(g.value===G.id?M(n)("sidebar.archiveConfirm"):M(n)("sidebar.archive")),9,Hse)])):re("",!0)],10,Ose))),128)),!v(q.workspace.id)&&b(q.sessions,!1,e.activeId).length<q.sessions.length?(C(),A("button",{key:1,type:"button",class:"mshow-more",onClick:Ge(G=>w(q.workspace.id),["stop"])},N(M(n)("sidebar.showMore",{count:q.sessions.length-b(q.sessions,!1,e.activeId).length})),9,Wse)):re("",!0)],512),[[Ro,!d(q.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),jse=vt(qse,[["__scopeId","data-v-6125071b"]]),zse={class:"srow-main"},Vse={class:"srow-label"},Kse={class:"srow-sub"},Gse={class:"srow-main"},Yse={class:"srow-label"},Xse={class:"srow-val"},Zse={class:"srow-main"},Qse={class:"srow-label"},Jse={class:"srow-sub"},eoe=["aria-checked"],toe={class:"srow-main"},noe={class:"srow-label"},soe={class:"srow-sub"},ooe=["aria-checked"],ioe={class:"srow-main"},roe={class:"srow-label"},loe={class:"srow read-only"},aoe={class:"srow-main"},coe={class:"srow-label"},uoe={class:"srow-sub"},doe=["aria-label"],foe={class:"srow read-only pref"},hoe={class:"srow-main"},poe={class:"srow-label"},moe=["aria-label"],goe=["aria-pressed"],voe=["aria-pressed"],yoe={class:"srow read-only pref"},koe={class:"srow-main"},boe={class:"srow-label"},_oe=["aria-label"],woe=["aria-pressed"],Soe=["aria-pressed"],Coe=["aria-pressed"],xoe={class:"srow read-only pref"},Toe={class:"srow-main"},Moe={class:"srow-label"},Aoe={class:"srow read-only pref"},Eoe={class:"srow-main"},$oe={class:"srow-label"},Ioe={class:"num-field"},Noe=["value","aria-label"],Loe={class:"srow-main"},Ooe={class:"srow-label"},Roe={class:"srow-sub"},Poe=["aria-checked"],Doe={class:"srow-main"},Boe={class:"srow-label"},Foe={class:"srow-main"},Hoe={class:"srow-label"},Woe={key:2,class:"srow read-only"},Uoe={class:"srow-main"},qoe={class:"srow-label"},joe={class:"srow-val dim"},zoe=Xe({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},theme:{default:"terminal"},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},betaToc:{type:Boolean},serverVersion:{default:""}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setTheme","setColorScheme","setUiFontSize","setBetaToc","login","logout"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=["manual","auto","yolo"],r=j(()=>s.thinking??"high"),l=j(()=>s.planMode===!0),a=j(()=>s.swarmMode===!0),c=j(()=>{const g=s.status.permission;return g==="yolo"?"var(--err)":g==="auto"?"var(--warn)":"var(--faint)"}),u=j(()=>{const g=s.status.permission,y=n(g==="yolo"?"mobile.permYoloSub":g==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${g} · ${y}`}),d=g=>`${Math.round(g/1e3)}k`,p=j(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),m=j(()=>s.status.ctxMax>0?`${d(s.status.ctxUsed)}/${d(s.status.ctxMax)}`:n("status.statusNone"));function f(){o("setThinking",r.value==="off"?"high":"off")}function v(){const g=i.indexOf(s.status.permission),y=i[(g+1)%i.length];o("setPermission",y)}function w(){o("pickModel"),o("update:modelValue",!1)}function b(){o("login"),o("update:modelValue",!1)}function _(){o("logout"),o("update:modelValue",!1)}return(g,y)=>(C(),qe(qT,{"model-value":e.modelValue,title:M(n)("mobile.settingsTitle"),"onUpdate:modelValue":y[9]||(y[9]=k=>o("update:modelValue",k))},{default:kn(()=>[h("button",{type:"button",class:"srow",onClick:w},[h("span",zse,[h("span",Vse,N(M(n)("status.statusModel")),1),h("span",Kse,N(e.status.model),1)]),y[10]||(y[10]=h("span",{class:"chev"},"›",-1))]),h("button",{type:"button",class:"srow",onClick:f},[h("span",Gse,[h("span",Yse,N(M(n)("status.statusThinking")),1)]),h("span",Xse,N(r.value==="off"?M(n)("status.planOff"):M(n)("status.planOn")),1),y[11]||(y[11]=h("span",{class:"chev"},"›",-1))]),h("button",{type:"button",class:"srow",onClick:y[0]||(y[0]=k=>o("togglePlan"))},[h("span",Zse,[h("span",Qse,N(M(n)("status.statusPlanMode")),1),h("span",Jse,N(M(n)("mobile.planModeSub")),1)]),h("span",{class:$e(["toggle",{on:l.value}]),role:"switch","aria-checked":l.value},null,10,eoe)]),h("button",{type:"button",class:"srow",onClick:y[1]||(y[1]=k=>o("toggleSwarm"))},[h("span",toe,[h("span",noe,N(M(n)("status.statusSwarmMode")),1),h("span",soe,N(M(n)("mobile.swarmModeSub")),1)]),h("span",{class:$e(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,ooe)]),h("button",{type:"button",class:"srow",onClick:v},[h("span",ioe,[h("span",roe,N(M(n)("status.statusPermission")),1),h("span",{class:"srow-sub",style:It({color:c.value})},N(u.value),5)]),y[12]||(y[12]=h("span",{class:"chev"},"›",-1))]),h("div",loe,[h("span",aoe,[h("span",coe,N(M(n)("status.statusContext")),1),h("span",uoe,N(m.value),1)]),h("span",{class:"ctx-meter","aria-label":m.value},[h("i",{style:It({width:p.value+"%"})},null,4)],8,doe)]),h("div",foe,[h("span",hoe,[h("span",poe,N(M(n)("theme.label")),1)]),h("div",{class:"seg",role:"group","aria-label":M(n)("theme.label")},[h("button",{type:"button",class:$e(["seg-opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:y[2]||(y[2]=k=>o("setTheme","modern"))},N(M(n)("theme.modern")),11,goe),h("button",{type:"button",class:$e(["seg-opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:y[3]||(y[3]=k=>o("setTheme","kimi"))},N(M(n)("theme.kimi")),11,voe)],8,moe)]),h("div",yoe,[h("span",koe,[h("span",boe,N(M(n)("theme.colorSchemeLabel")),1)]),h("div",{class:"seg",role:"group","aria-label":M(n)("theme.colorSchemeLabel")},[h("button",{type:"button",class:$e(["seg-opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:y[4]||(y[4]=k=>o("setColorScheme","light"))},N(M(n)("theme.light")),11,woe),h("button",{type:"button",class:$e(["seg-opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:y[5]||(y[5]=k=>o("setColorScheme","dark"))},N(M(n)("theme.dark")),11,Soe),h("button",{type:"button",class:$e(["seg-opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:y[6]||(y[6]=k=>o("setColorScheme","system"))},N(M(n)("theme.system")),11,Coe)],8,_oe)]),h("div",xoe,[h("span",Toe,[h("span",Moe,N(M(n)("sidebar.language")),1)]),pt(WT)]),h("div",Aoe,[h("span",Eoe,[h("span",$oe,N(M(n)("settings.uiFontSize")),1)]),h("label",Ioe,[h("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":M(n)("settings.uiFontSize"),onInput:y[7]||(y[7]=k=>o("setUiFontSize",Number(k.target.value)))},null,40,Noe),y[13]||(y[13]=h("span",{class:"num-unit"},"px",-1))])]),h("button",{type:"button",class:"srow",onClick:y[8]||(y[8]=k=>o("setBetaToc",!e.betaToc))},[h("span",Loe,[h("span",Ooe,N(M(n)("settings.betaToc")),1),h("span",Roe,N(M(n)("settings.betaTocHint")),1)]),h("span",{class:$e(["toggle",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc},null,10,Poe)]),e.authReady?(C(),A("button",{key:0,type:"button",class:"srow acct out",onClick:_},[h("span",Doe,[h("span",Boe,N(M(n)("sidebar.signOut")),1)])])):(C(),A("button",{key:1,type:"button",class:"srow acct in",onClick:b},[h("span",Foe,[h("span",Hoe,N(M(n)("sidebar.signIn")),1)])])),e.serverVersion?(C(),A("div",Woe,[h("span",Uoe,[h("span",qoe,N(M(n)("settings.serverVersion")),1)]),h("span",joe,N(e.serverVersion),1)])):re("",!0)]),_:1},8,["model-value","title"]))}}),Voe=vt(zoe,[["__scopeId","data-v-7fa4029d"]]),Koe={class:"ob-backdrop"},Goe=["aria-label"],Yoe=["aria-label"],Xoe={class:"ob-brand"},Zoe={class:"ob-title"},Qoe={class:"ob-sub"},Joe={class:"ob-sec"},eie={class:"ob-label"},tie={class:"ob-seg",role:"group"},nie=["aria-pressed","onClick"],sie={class:"ob-sec"},oie={class:"ob-label"},iie={class:"ob-themes"},rie=["aria-pressed"],lie={class:"ob-theme-name"},aie={class:"ob-theme-desc"},cie=["aria-pressed"],uie={class:"ob-theme-name"},die={class:"ob-theme-desc"},fie=Xe({__name:"Onboarding",props:{theme:{}},emits:["setTheme","complete","skip"],setup(e,{emit:t}){const n=e,s=t,{t:o,locale:i}=_t();function r(c){i.value!==c&&aC(c)}const l=te(n.theme);function a(){l.value!==n.theme&&s("setTheme",l.value),s("complete")}return(c,u)=>(C(),A("div",Koe,[h("div",{class:"ob-card",role:"dialog","aria-modal":"true","aria-label":M(o)("onboarding.title")},[h("button",{type:"button",class:"ob-close","aria-label":M(o)("onboarding.skip"),onClick:u[0]||(u[0]=d=>s("skip"))},[...u[3]||(u[3]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[h("path",{d:"M4 4l8 8M12 4l-8 8"})],-1)])],8,Yoe),h("div",Xoe,[u[4]||(u[4]=h("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[h("defs",null,[h("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[h("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),h("g",{class:"ob-eyes",fill:"#000"},[h("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),h("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),h("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--blue)",mask:"url(#obKimiEyes)"})],-1)),h("div",null,[h("div",Zoe,N(M(o)("onboarding.title")),1),h("div",Qoe,N(M(o)("onboarding.subtitle")),1)])]),h("section",Joe,[h("div",eie,N(M(o)("onboarding.languageLabel")),1),h("div",tie,[(C(!0),A(Ie,null,Ye(M(lC),d=>(C(),A("button",{key:d.code,type:"button",class:$e(["ob-seg-btn",{on:M(i)===d.code}]),"aria-pressed":M(i)===d.code,onClick:p=>r(d.code)},N(d.label),11,nie))),128))])]),h("section",sie,[h("div",oie,N(M(o)("onboarding.themeLabel")),1),h("div",iie,[h("button",{type:"button",class:$e(["ob-theme",{on:l.value==="modern"}]),"aria-pressed":l.value==="modern",onClick:u[1]||(u[1]=d=>l.value="modern")},[u[5]||(u[5]=h("span",{class:"ob-theme-prev modern","aria-hidden":"true"},[h("span",{class:"bub u"}),h("span",{class:"bub a"})],-1)),h("span",lie,N(M(o)("theme.modern")),1),h("span",aie,N(M(o)("onboarding.modernDesc")),1)],10,rie),h("button",{type:"button",class:$e(["ob-theme",{on:l.value==="kimi"}]),"aria-pressed":l.value==="kimi",onClick:u[2]||(u[2]=d=>l.value="kimi")},[u[6]||(u[6]=h("span",{class:"ob-theme-prev kimi","aria-hidden":"true"},[h("span",{class:"kb u"}),h("span",{class:"kb a"})],-1)),h("span",uie,N(M(o)("theme.kimi")),1),h("span",die,N(M(o)("onboarding.kimiDesc")),1)],10,cie)])]),h("button",{type:"button",class:"ob-start",onClick:a},N(M(o)("onboarding.start")),1)],8,Goe)]))}}),hie=vt(fie,[["__scopeId","data-v-f94b338e"]]),pie=["aria-label"],mie={class:"gload-box"},gie={class:"gload-text"},vie=Xe({__name:"GlobalLoading",setup(e){const{t}=_t();return(n,s)=>(C(),A("div",{class:"gload",role:"status","aria-label":M(t)("app.connecting")},[h("div",mie,[s[0]||(s[0]=mr('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-d8748888><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-d8748888></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-d8748888></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-d8748888></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-d8748888></path></svg><div class="gload-bar" aria-hidden="true" data-v-d8748888><span class="gload-bar-fill" data-v-d8748888></span></div>',2)),h("div",gie,N(M(t)("app.connecting")),1)])],8,pie))}}),yie=vt(vie,[["__scopeId","data-v-d8748888"]]),kie={class:"kap-root"},bie={class:"kap-head"},_ie={class:"kap-count"},wie={class:"kap-head-actions"},Sie={class:"kap-filters"},Cie=["value"],xie={class:"kap-check"},Tie={class:"kap-check"},Mie={class:"kap-view-toggle",role:"group"},Aie={key:0,class:"kap-empty"},Eie=["onClick"],$ie={class:"kap-ts"},Iie={class:"kap-label"},Nie={key:0,class:"kap-detail"},Lie={class:"kap-detail-actions"},Oie=["onClick"],Rie={key:1,class:"kap-agg"},Pie={class:"mono"},Die={class:"mono"},Bie={class:"num"},Fie={class:"num"},Hie={key:0},Wie={class:"mono"},Uie={class:"num"},qie={class:"num"},jie={key:0},zie=Xe({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=te("all"),o=te(""),i=te(""),r=te(!1),l=te("timeline"),a=j(()=>(Bv.value,[...MJ()])),c=j(()=>{const T=new Set;for(const $ of a.value)$.sessionId&&T.add($.sessionId);return[...T].sort()});function u(T){return T.kind==="rest:error"||T.code!==void 0&&T.code!==0||T.eventType==="error"||T.eventType==="parse-error"}const d=j(()=>{const T=o.value.trim().toLowerCase();return a.value.filter($=>!(s.value!=="all"&&$.source!==s.value||i.value&&$.sessionId!==i.value||r.value&&!u($)||T&&!`${$.label} ${$.kind} ${$.eventType??""} ${$.sessionId??""} ${$.requestId??""}`.toLowerCase().includes(T)))}),p=j(()=>{const T=new Map;for(const $ of d.value){if($.kind!=="ws:in"&&$.kind!=="ws:out")continue;const L=$.kind==="ws:in"?"←":"→",R=`${L} ${$.eventType??"?"} @ ${$.sessionId??"-"}`,O=T.get(R)??{key:R,sessionId:$.sessionId??"-",eventType:$.eventType??"?",dir:L,count:0};O.count++,$.seq!==void 0&&(O.lastSeq=$.seq),T.set(R,O)}return[...T.values()].sort(($,L)=>L.count-$.count)}),m=j(()=>{const T=new Map;for(const $ of d.value){if($.source!=="rest"||$.kind==="rest:request")continue;const L=`${$.method??"?"} ${$.path??"?"}`,R=T.get(L)??{count:0,errors:0,totalMs:0,timed:0};R.count++,u($)&&R.errors++,$.durationMs!==void 0&&(R.totalMs+=$.durationMs,R.timed++),T.set(L,R)}return[...T.entries()].map(([$,L])=>({key:$,count:L.count,errors:L.errors,avgMs:L.timed>0?Math.round(L.totalMs/L.timed):0})).sort(($,L)=>L.count-$.count)}),f=te(null),v=te(!0),w=te(null),b=te(null);ze(()=>d.value.length,async()=>{if(!v.value||l.value!=="timeline")return;await ut();const T=w.value;T&&(T.scrollTop=T.scrollHeight)});function _(T){f.value=f.value===T?null:T}function g(T){const $=new Date(T),L=(R,O=2)=>String(R).padStart(O,"0");return`${L($.getHours())}:${L($.getMinutes())}:${L($.getSeconds())}.${L($.getMilliseconds(),3)}`}function y(T){return JSON.stringify(T,null,2)}async function k(T){try{await navigator.clipboard.writeText(y(T)),b.value=T.id,setTimeout(()=>{b.value===T.id&&(b.value=null)},1500)}catch{}}function I(){UT(d.value)}function E(T){return u(T)||T.source==="client"?"b-err":T.source==="rest"?"b-rest":T.kind==="ws:lifecycle"?"b-life":T.kind==="ws:out"?"b-out":"b-in"}function S(T){return T.source==="rest"?"REST":T.source==="client"?"APP":"WS"}return(T,$)=>(C(),A("section",kie,[h("header",bie,[$[11]||($[11]=h("strong",null,"KAP debug",-1)),h("span",_ie,N(d.value.length)+"/"+N(a.value.length),1),h("div",wie,[h("button",{type:"button",class:$e({on:M(hc)}),onClick:$[0]||($[0]=L=>hc.value=!M(hc))},N(M(hc)?"resume":"pause"),3),h("button",{type:"button",onClick:$[1]||($[1]=L=>M(AJ)())},"clear"),h("button",{type:"button",onClick:$[2]||($[2]=L=>I())},"export jsonl"),h("button",{type:"button",title:"Close window",onClick:$[3]||($[3]=L=>n("close"))},"✕")])]),h("div",Sie,[At(h("select",{"onUpdate:modelValue":$[4]||($[4]=L=>s.value=L),"aria-label":"Source filter"},[...$[12]||($[12]=[h("option",{value:"all"},"rest + ws + app",-1),h("option",{value:"rest"},"rest",-1),h("option",{value:"ws"},"ws",-1),h("option",{value:"client"},"app errors",-1)])],512),[[df,s.value]]),At(h("select",{"onUpdate:modelValue":$[5]||($[5]=L=>i.value=L),"aria-label":"Session filter"},[$[13]||($[13]=h("option",{value:""},"all sessions",-1)),(C(!0),A(Ie,null,Ye(c.value,L=>(C(),A("option",{key:L,value:L},N(L),9,Cie))),128))],512),[[df,i.value]]),At(h("input",{"onUpdate:modelValue":$[6]||($[6]=L=>o.value=L),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[bn,o.value]]),h("label",xie,[At(h("input",{"onUpdate:modelValue":$[7]||($[7]=L=>r.value=L),type:"checkbox"},null,512),[[uf,r.value]]),$[14]||($[14]=dt(" errors",-1))]),h("label",Tie,[At(h("input",{"onUpdate:modelValue":$[8]||($[8]=L=>v.value=L),type:"checkbox"},null,512),[[uf,v.value]]),$[15]||($[15]=dt(" follow",-1))]),h("div",Mie,[h("button",{type:"button",class:$e({on:l.value==="timeline"}),onClick:$[9]||($[9]=L=>l.value="timeline")},"timeline",2),h("button",{type:"button",class:$e({on:l.value==="aggregate"}),onClick:$[10]||($[10]=L=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(C(),A("div",{key:0,ref_key:"listRef",ref:w,class:"kap-list"},[d.value.length===0?(C(),A("div",Aie," No trace entries yet. REST calls and WS frames will appear here. ")):re("",!0),(C(!0),A(Ie,null,Ye(d.value,L=>(C(),A("div",{key:L.id,class:"kap-row-wrap"},[h("button",{type:"button",class:$e(["kap-row",{expanded:f.value===L.id}]),onClick:R=>_(L.id)},[h("span",$ie,N(g(L.ts)),1),h("span",{class:$e(["kap-badge",E(L)])},N(S(L)),3),h("span",Iie,N(L.label),1)],10,Eie),f.value===L.id?(C(),A("div",Nie,[h("div",Lie,[h("button",{type:"button",onClick:R=>k(L)},N(b.value===L.id?"copied ✓":"copy json"),9,Oie)]),h("pre",null,N(y(L)),1)])):re("",!0)]))),128))],512)):(C(),A("div",Rie,[$[20]||($[20]=h("h4",null,"WS frames by session / type",-1)),h("table",null,[$[17]||($[17]=h("thead",null,[h("tr",null,[h("th",null,"dir"),h("th",null,"type"),h("th",null,"session"),h("th",null,"count"),h("th",null,"last seq")])],-1)),h("tbody",null,[(C(!0),A(Ie,null,Ye(p.value,L=>(C(),A("tr",{key:L.key},[h("td",null,N(L.dir),1),h("td",Pie,N(L.eventType),1),h("td",Die,N(L.sessionId),1),h("td",Bie,N(L.count),1),h("td",Fie,N(L.lastSeq??"—"),1)]))),128)),p.value.length===0?(C(),A("tr",Hie,[...$[16]||($[16]=[h("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):re("",!0)])]),$[21]||($[21]=h("h4",null,"REST by endpoint",-1)),h("table",null,[$[19]||($[19]=h("thead",null,[h("tr",null,[h("th",null,"endpoint"),h("th",null,"count"),h("th",null,"errors"),h("th",null,"avg ms")])],-1)),h("tbody",null,[(C(!0),A(Ie,null,Ye(m.value,L=>(C(),A("tr",{key:L.key},[h("td",Wie,N(L.key),1),h("td",Uie,N(L.count),1),h("td",{class:$e(["num",{err:L.errors>0}])},N(L.errors),3),h("td",qie,N(L.avgMs),1)]))),128)),m.value.length===0?(C(),A("tr",jie,[...$[18]||($[18]=[h("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):re("",!0)])])]))]))}}),Vie=vt(zie,[["__scopeId","data-v-ecab45a5"]]),Kie=["title"],Gie=Xe({__name:"DebugPanel",setup(e){const t=te(!1);let n=null,s=null,o=null;const i=["data-theme","data-color-scheme","data-accent"];function r(u){const d=document.documentElement,p=u.documentElement;for(const m of i){const f=d.getAttribute(m);f!==null?p.setAttribute(m,f):p.removeAttribute(m)}}function l(u){const d=u.document;d.title="KAP debug";const p=d.createElement("base");p.href=location.href,d.head.appendChild(p);for(const f of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(f.cloneNode(!0));r(d),d.body.style.margin="0";const m=d.createElement("div");return m.style.height="100vh",d.body.appendChild(m),m}function a(){o?.disconnect(),o=null;try{s?.unmount()}catch{}s=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),p=ff(Vie,{onClose:()=>u.close()});p.mount(d),s=p,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return Jt(()=>{c()}),oo(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(C(),A("button",{class:"kap-fab",type:"button",title:t.value?"Focus KAP debug window":"Open KAP debug window",onClick:c}," KAP ",8,Kie))}}),Yie=vt(Gie,[["__scopeId","data-v-0a50ee88"]]);function jT(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function p1(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaiting_approval":return"awaitingApproval";case"awaiting_question":return"awaitingQuestion";case"aborted":return"aborted"}}function Xie(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function Zo(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:p1(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:jT(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function Wf(e){return{id:e.id,root:e.root,name:e.name,isGitRepo:e.is_git_repo,branch:e.branch??void 0,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function Ow(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:{kind:"url",url:e.url}}function Fv(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:Ow(e.source)};case"video":return{type:"video",source:Ow(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function m1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Fv),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Zie(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function Qie(e){return{content:e.content.map(Zie),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function Jie(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function zT(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function ere(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function tre(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(ere),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function VT(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(tre),expiresAt:e.expires_at,createdAt:e.created_at}}function nre(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function sre(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=nre(s);return{answers:t,method:e.method,note:e.note}}function g1(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index}}function Rw(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function Zi(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Wl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function po(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function ore(e){if(!e||typeof e!="object")return null;const t=e,n=Zi(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:Zi(t,"goalId")??Zi(t,"goal_id")??"goal",objective:Zi(t,"objective")??"",completionCriterion:Zi(t,"completionCriterion")??Zi(t,"completion_criterion"),status:n,turnsUsed:Wl(t,"turnsUsed")??Wl(t,"turns_used")??0,tokensUsed:Wl(t,"tokensUsed")??Wl(t,"tokens_used")??0,wallClockMs:Wl(t,"wallClockMs")??Wl(t,"wall_clock_ms")??0,terminalReason:Zi(t,"terminalReason")??Zi(t,"terminal_reason"),budget:{tokenBudget:po(o,"tokenBudget")??po(o,"token_budget"),remainingTokens:po(o,"remainingTokens")??po(o,"remaining_tokens"),turnBudget:po(o,"turnBudget")??po(o,"turn_budget"),remainingTurns:po(o,"remainingTurns")??po(o,"remaining_turns"),wallClockBudgetMs:po(o,"wallClockBudgetMs")??po(o,"wall_clock_budget_ms"),remainingWallClockMs:po(o,"remainingWallClockMs")??po(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function ire(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Zo(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Zo(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:Wf(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Wf(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.status_changed":return{type:"sessionStatusChanged",sessionId:t.session_id,status:p1(t.payload.status),previousStatus:p1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:jT(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=ore(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:m1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Fv),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:zT(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:VT(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.question.expired":return{type:"questionExpired",sessionId:t.session_id,questionId:t.payload.question_id};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:g1(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:v1(t.payload.config)};default:return{type:"unknown",raw:e}}}function rre(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function Jm(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function v1(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultThinking:e.default_thinking,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function lre(e){return e.session_id}function are(e){return e.seq}const cre="main",ure=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed"]);function nr(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function dre(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function Pw(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map}}function ns(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Yr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function mo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function fre(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=ns(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=ns(t,"goalId")??ns(t,"goal_id")??"goal",r=ns(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:ns(t,"completionCriterion")??ns(t,"completion_criterion"),status:o,turnsUsed:Yr(t,"turnsUsed")??Yr(t,"turns_used")??0,tokensUsed:Yr(t,"tokensUsed")??Yr(t,"tokens_used")??0,wallClockMs:Yr(t,"wallClockMs")??Yr(t,"wall_clock_ms")??0,terminalReason:ns(t,"terminalReason")??ns(t,"terminal_reason"),budget:{tokenBudget:mo(s,"tokenBudget")??mo(s,"token_budget"),remainingTokens:mo(s,"remainingTokens")??mo(s,"remaining_tokens"),turnBudget:mo(s,"turnBudget")??mo(s,"turn_budget"),remainingTurns:mo(s,"remainingTurns")??mo(s,"remaining_turns"),wallClockBudgetMs:mo(s,"wallClockBudgetMs")??mo(s,"wall_clock_budget_ms"),remainingWallClockMs:mo(s,"remainingWallClockMs")??mo(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function pc(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function hre(e){if(e==null)return"";try{const t=typeof e=="string"?e:JSON.stringify(e);return t.length>120?`${t.slice(0,117)}...`:t}catch{return""}}function pre(e,t){if(e==="turn.step.started")return"Started a step";if(e==="tool.use"||e==="tool.call.started"){const n=ns(t,"name")??ns(t,"toolName")??"tool",s=hre(t.args??t.input);return s?`Calling ${n}: ${s}`:`Calling ${n}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=ns(n,"text");if(o)return o;const i=ns(n,"message");if(i)return i}const s=ns(t,"message");if(s)return s}return e==="tool.result"?`Finished ${ns(t,"name")??ns(t,"toolName")??ns(t,"toolCallId")??"tool"}`:null}function mre(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];const r=pre(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=pc(e,t,n,{status:"running",subagentPhase:"working",startedAt:l?.startedAt??new Date().toISOString()}),c=[];return a&&c.push({type:"taskCreated",sessionId:t,task:a}),c.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:r,stream:"stdout"}),c}function Sd(e){return{...e,content:e.content.map(t=>({...t}))}}function Dw(e,t,n){const s={id:nr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function gre(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function vre(e){return Array.isArray(e)?e.map(t=>Fv(t)):[]}function Bw(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function yre(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function kre(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:o}:null}function Fw(e,t){e.messages.find(n=>n.id===t)}function bre(e,t,n,s,o,i){const r={id:nr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function eg(e,t){return e.messages.find(n=>n.id===t)}function Hw(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}function _re(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=Pw(),e.set(u,d)),d}function s(u){e.set(u,Pw())}function o(u){t.add(u)}function i(u,d){const p=n(u);p.currentPromptId=d}function r(u,d){s(u);const p=n(u),m=d.promptId??nr("pr_");p.currentPromptId=m,p.turnPromptId.set(d.turnId,m);const f=Dw(p,u,m);d.thinkingText.length>0&&f.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&f.content.push({type:"text",text:d.assistantText});for(const v of d.runningTools){const w=typeof v.lastProgress?.text=="string"&&v.lastProgress.text.length>0?[v.lastProgress.text]:void 0;f.content.push({type:"toolUse",toolCallId:v.toolCallId,toolName:v.name,input:v.args??{},outputLines:w}),p.toolStartTimes.set(v.toolCallId,Date.now())}return p.currentAssistantMsgId=f.id,p.turnTextLen=d.assistantText.length,p.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:m},{type:"messageCreated",message:Sd(f)}]}function l(u,d,p,m){try{return c(u,d,p,m)}catch(f){return console.error("[agentProjector] Error projecting event:",u,f instanceof Error?f.message:f),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,p,m){const f=n(p),v=d,w=[],b=v?.agentId;if(typeof b=="string"&&b!==cre){const _=t.has(b);if(_&&(u==="thinking.delta"||u==="assistant.delta")){const g=v?.delta??"";return g?[{type:"agentDelta",sessionId:p,agentId:b,delta:{[u==="thinking.delta"?"thinking":"text"]:g}}]:[]}if(_&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:p,agentId:b,reason:v?.reason}];if(ure.has(u))return mre(f,p,b,u,v??{},t)}switch(u){case"session.meta.updated":{const _=v?.patch?.title??v?.title,g=v?.patch?.lastPrompt,y={};typeof _=="string"&&_.length>0&&(y.title=_),typeof g=="string"&&(y.lastPrompt=g),(y.title!==void 0||y.lastPrompt!==void 0)&&w.push({type:"sessionMetaUpdated",sessionId:p,...y});break}case"prompt.submitted":{const _=v?.promptId,g=v?.userMessageId;if(!_||!g)break;const y=vre(v?.content);if(y.length===0)break;f.currentPromptId=_;const k=gre(f,p,_,g,y,typeof v?.createdAt=="string"?v.createdAt:new Date().toISOString());w.push({type:"messageCreated",message:Sd(k)});break}case"turn.started":{const _=v?.turnId,g=f.currentPromptId??nr("pr_");f.currentPromptId=g,_!==void 0&&f.turnPromptId.set(_,g),f.turnTextLen=0,f.turnThinkLen=0,w.push({type:"sessionStatusChanged",sessionId:p,status:"running",previousStatus:"idle",currentPromptId:g});break}case"turn.step.started":{const _=v?.turnId;let g=f.turnPromptId.get(_)??f.currentPromptId;g||(g=nr("pr_"),f.currentPromptId=g,_!==void 0&&f.turnPromptId.set(_,g));const y=Dw(f,p,g);f.currentAssistantMsgId=y.id,w.push({type:"messageCreated",message:Sd(y)});break}case"thinking.delta":{const _=f.currentAssistantMsgId;if(!_)break;const g=v?.delta??"";if(!g)break;m?.offset===0&&f.turnThinkLen>0&&(f.turnThinkLen=0);const y=a(f.turnThinkLen,m?.offset);if(y==="skip")break;if(y==="gap"){w.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"delta_gap"});break}const k=Bw(f,_,"thinking",g);if(k<0)break;f.turnThinkLen+=g.length,w.push({type:"assistantDelta",sessionId:p,messageId:_,contentIndex:k,delta:{thinking:g}});break}case"assistant.delta":{const _=f.currentAssistantMsgId;if(!_)break;const g=v?.delta??"";if(!g)break;m?.offset===0&&f.turnTextLen>0&&(f.turnTextLen=0);const y=a(f.turnTextLen,m?.offset);if(y==="skip")break;if(y==="gap"){w.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"delta_gap"});break}const k=Bw(f,_,"text",g);if(k<0)break;f.turnTextLen+=g.length,w.push({type:"assistantDelta",sessionId:p,messageId:_,contentIndex:k,delta:{text:g}});break}case"tool.use":case"tool.call.started":{const _=f.currentAssistantMsgId,g=v?.turnId,y=f.turnPromptId.get(g)??f.currentPromptId;if(!_||!y)break;const k=v?.toolCallId,I=v?.name??v?.toolName??"",E=v?.args??v?.input??{};yre(f,_,k,I,E);const S=eg(f,_);S&&S.content.length-1,f.toolStartTimes.set(k,Date.now()),S&&w.push({type:"messageUpdated",sessionId:p,messageId:_,content:S.content.map(T=>({...T})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const _=v?.toolCallId,g=kre(v??{});_&&g&&w.push({type:"toolOutput",sessionId:p,toolCallId:_,outputChunk:g.outputChunk,stream:g.stream});break}case"tool.result":{const _=v?.turnId;let g=f.turnPromptId.get(_)??f.currentPromptId;g||(g=nr("pr_"),f.currentPromptId=g,_!==void 0&&f.turnPromptId.set(_,g));const y=v?.toolCallId,k=v?.output,I=v?.isError??!1;f.toolStartTimes.get(y)??Date.now(),f.toolStartTimes.delete(y);const E=bre(f,p,y,k,I,g);w.push({type:"messageCreated",message:Sd(E)}),f.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const _=f.currentAssistantMsgId,g=dre(v?.usage);if(f.totalInput+=g.input,f.totalOutput+=g.output,f.totalCacheRead+=g.cacheRead,f.totalCacheCreate+=g.cacheCreate,_){Fw(f,_);const y=eg(f,_);y&&w.push({type:"messageUpdated",sessionId:p,messageId:_,content:y.content.map(k=>({...k})),status:"completed"})}break}case"agent.status.updated":{v?.model&&(f.model=v.model),v?.contextTokens!==void 0&&(f.contextTokens=v.contextTokens),v?.maxContextTokens!==void 0&&(f.contextLimit=v.maxContextTokens),w.push({type:"sessionUsageUpdated",sessionId:p,usage:Hw(f),model:f.model||void 0,swarmMode:v?.swarmMode===!0?!0:v?.swarmMode===!1?!1:void 0,planMode:v?.planMode===!0?!0:v?.planMode===!1?!1:void 0});break}case"turn.ended":{const _=f.currentAssistantMsgId,g=v?.reason??"completed",y=Yr(v??{},"durationMs");if(_){Fw(f,_);const E=eg(f,_);E&&w.push({type:"messageUpdated",sessionId:p,messageId:_,content:E.content.map(S=>({...S})),status:g==="failed"||g==="filtered"?"error":"completed",durationMs:y})}f.turnCount++;const k=Hw(f);w.push({type:"sessionUsageUpdated",sessionId:p,usage:k});const I=g==="cancelled"||g==="failed"||g==="filtered"?"aborted":"idle";w.push({type:"sessionStatusChanged",sessionId:p,status:I,previousStatus:"running"}),f.currentAssistantMsgId=void 0,f.currentPromptId=void 0,f.turnTextLen=0,f.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{f.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const g={id:typeof v?.subagentId=="string"&&v.subagentId.length>0?v.subagentId:nr("task_"),sessionId:p,kind:"subagent",description:typeof v?.description=="string"?v.description:v?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof v?.subagentName=="string"?v.subagentName:void 0,parentToolCallId:typeof v?.parentToolCallId=="string"?v.parentToolCallId:void 0,swarmIndex:typeof v?.swarmIndex=="number"?v.swarmIndex:void 0};f.subagentMeta.set(g.id,g),w.push({type:"taskCreated",sessionId:p,task:g});break}case"subagent.started":{const _=pc(f,p,v?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});_&&w.push({type:"taskCreated",sessionId:p,task:_});break}case"subagent.suspended":{const _=pc(f,p,v?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof v?.reason=="string"?v.reason:void 0});_&&w.push({type:"taskCreated",sessionId:p,task:_});break}case"subagent.completed":{const _=typeof v?.resultSummary=="string"?v.resultSummary:void 0,g=pc(f,p,v?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:_});g&&w.push({type:"taskCreated",sessionId:p,task:g}),w.push({type:"taskCompleted",sessionId:p,taskId:v?.subagentId??"",status:"completed",outputPreview:_});break}case"subagent.failed":{const _=typeof v?.error=="string"?v.error:void 0,g=pc(f,p,v?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:_});g&&w.push({type:"taskCreated",sessionId:p,task:g}),w.push({type:"taskCompleted",sessionId:p,taskId:v?.subagentId??"",status:"failed",outputPreview:_});break}case"error":{w.push({type:"unknown",raw:{_agentError:!0,code:v?.code,message:v?.message}});break}case"warning":{w.push({type:"unknown",raw:{_agentWarning:!0,message:v?.message}});break}case"background.task.started":{const _=v?.info??{},g=typeof _.startedAt=="number"?new Date(_.startedAt).toISOString():void 0,y=typeof _.taskId=="string"?_.taskId:typeof _.taskId=="number"?String(_.taskId):nr("task_"),k=typeof _.description=="string"?_.description:typeof _.command=="string"?_.command:Cn.global.t("tasks.defaultDescription"),I=typeof _.command=="string"?_.command:void 0;w.push({type:"taskCreated",sessionId:p,task:{id:y,sessionId:p,kind:"bash",description:k,command:I,status:"running",createdAt:g??new Date().toISOString(),startedAt:g,outputPreview:I!==void 0?`$ ${I}`:void 0}});break}case"background.task.terminated":{const _=v?.info??{},g=_.status==="failed"||typeof _.exitCode=="number"&&_.exitCode!==0;w.push({type:"taskCompleted",sessionId:p,taskId:typeof _.taskId=="string"?_.taskId:typeof _.taskId=="number"?String(_.taskId):"",status:g?"failed":"completed"});break}case"compaction.completed":{const _=v?.result??{};w.push({type:"compactionCompleted",sessionId:p,tokensBefore:typeof _.tokensBefore=="number"?_.tokensBefore:void 0,tokensAfter:typeof _.tokensAfter=="number"?_.tokensAfter:void 0,summary:typeof _.summary=="string"?_.summary:void 0}),w.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{w.push({type:"compactionStarted",sessionId:p,trigger:v?.trigger==="manual"?"manual":"auto",instruction:typeof v?.instruction=="string"?v.instruction:void 0});break}case"compaction.cancelled":{w.push({type:"compactionCancelled",sessionId:p});break}case"goal.updated":{const _=fre(v?.snapshot??null);w.push({type:"goalUpdated",sessionId:p,goal:_?.status==="complete"?null:_});break}}return w}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const wre=new Set(["server_hello","ack","ping","resync_required","error","pong"]),Ww=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","background.task.started","background.task.terminated"]),Sre=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","question.expired","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),Cre=new Set(["assistant.delta","thinking.delta"]);function xre(e,t){if(wre.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return Cre.has(s)?Tre(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?Sre.has(s)?{route:"protocol"}:Ww.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:Ww.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function Tre(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}class y1 extends Error{code;requestId;details;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details}}class mc extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview}}function vu(e){return e instanceof y1||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function KT(e){return e instanceof mc||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const gc=3e4,GT="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Uw=500;function qw(){try{return AbortSignal.timeout(gc)}catch{return}}function Mre(e,t){let n="",s=e;for(let o=0;o<t;o++)n=GT[s%32]+n,s=Math.floor(s/32);return n}function Are(e){const t=new Uint8Array(e);if(globalThis.crypto?.getRandomValues)globalThis.crypto.getRandomValues(t);else for(let n=0;n<t.length;n++)t[n]=Math.floor(Math.random()*256);return Array.from(t,n=>GT[n%32]).join("")}function jw(){return`${Mre(Date.now(),10)}${Are(16)}`}function Ere(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function zw(e){try{const t=await e.text();return t?t.length>Uw?`${t.slice(0,Uw)}...`:t:void 0}catch{return}}class $re{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=Hf(this.origin,t),o=jw(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();Ew({method:"POST",path:t,url:s,requestId:o,body:Ere(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:qw()})}catch(u){throw wd({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new mc({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:gc})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw wd({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new mc({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:gc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await zw(c)})}if($w({method:"POST",path:t,requestId:o,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),a.code!==0)throw new y1({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,s,o,i=[]){let r=Hf(this.origin,n);if(o){const m=new URLSearchParams;for(const[v,w]of Object.entries(o))w!==void 0&&m.set(v,String(w));const f=m.toString();f&&(r=`${r}?${f}`)}const l=jw(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();Ew({method:t,path:n,url:r,requestId:l,body:s});let u;try{u=await fetch(r,{method:t,headers:a,body:s!==void 0?JSON.stringify(s):void 0,signal:qw()})}catch(m){throw wd({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:m}),new mc({message:`Network error calling ${t} ${n}`,cause:m,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:gc})}let d;const p=u.clone();try{d=await u.json()}catch(m){throw wd({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:m}),new mc({message:`Failed to parse JSON response from ${t} ${n}`,cause:m,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:gc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await zw(p)})}if($w({method:t,path:n,requestId:l,status:u.status,durationMs:Date.now()-c,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),d.code!==0&&!i.includes(d.code))throw new y1({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details});return d.data}addClientHeaders(t){this.identity!==void 0&&(t["X-Kimi-Client-Id"]=this.identity.clientId,t["X-Kimi-Client-Name"]=this.identity.clientName,t["X-Kimi-Client-Version"]=this.identity.clientVersion,t["X-Kimi-Client-Ui-Mode"]=this.identity.clientUiMode)}}class Ire{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;Hl("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=new WebSocket(this.wsUrl);this.ws=t,t.onopen=()=>{Hl("open")},t.onmessage=n=>{try{const s=JSON.parse(String(n.data));$J(s),this.handleFrame(s)}catch(s){Hl("parse-error",{error:String(s)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},t.onerror=()=>{Hl("error"),this.handlers.onError(0,"WebSocket error",!1)},t.onclose=n=>{Hl("close",n?{code:n.code,reason:n.reason,wasClean:n.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,Hl("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,s){const o=Cd(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(Cd(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(Cd(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}handleFrame(t){const n=t;switch(t.type){case"server_hello":this.onServerHello();break;case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,o=n.terminal_id,i=n.seq,r=Cd(s,o),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=xre(s,n.payload);if(o.route==="protocol"){this.handlers.onWireEvent(n);break}if(o.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:o.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const s of this.pendingSubscriptions)this.subscriptions.set(s.sessionId,s.cursor),t.includes(s.sessionId)||t.push(s.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[s,o]of this.subscriptions.entries())n[s]=o;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const s of this.terminalAttachments.values())this.sendTerminalAttach(s.sessionId,s.terminalId,s.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,s){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:s>0?s:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,s=t.seq;if(typeof n!="string"||typeof s!="number")return;const o=this.subscriptions.get(n);if(!o||s<=o.seq&&o.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(s,o.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),EJ(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function Cd(e,t){return`${e}\0${t}`}function tg(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function Vw(e){return e==="auto_compact"||e==="manual_compact"}class Nre{http;config;constructor(t){this.config=t,this.http=new $re(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[]}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?Xie(t.status):void 0,include_archive:t?.includeArchive,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(Zo),hasMore:s.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const s=await this.http.post("/sessions",n);return Zo(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Zo(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return Zo(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingLevel:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async listMessages(t,n){const s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(m1),hasMore:o.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:Zo(n.session),messages:n.messages.items.map(m1),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(zT),pendingQuestions:n.pending_questions.map(VT)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Qie(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return Zo(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return Zo(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Zo)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,Jie(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,sre(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const s={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,s)).items.map(g1)}async getTask(t,n,s){const o={with_output:s?.withOutput,output_bytes:s?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return g1(i)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(tg)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return tg(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return tg(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(Rw)])):void 0;return{items:o.items.map(Rw),childrenByPath:i,truncated:o.truncated}}async readFile(t,n){const s={path:n.path};n.offset!==void 0&&(s.offset=n.offset),n.length!==void 0&&(s.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,s);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const s={query:n.query};n.limit!==void 0&&(s.limit=n.limit);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,s);return{items:o.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const s={pattern:n.pattern};n.regex!==void 0&&(s.regex=n.regex),n.caseSensitive!==void 0&&(s.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,s);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const s={};n!==void 0&&(s.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,s);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:s.path,diff:s.diff}}getFileDownloadUrl(t,n){const s=n.split("/").map(o=>encodeURIComponent(o)).join("/");return Hf(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${s}:download`)}async openFile(t,n){const s={path:n.path};return n.line!==void 0&&(s.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,s)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,s,o){const i={app_id:n,path:s};o!==void 0&&(i.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Wf)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const s=await this.http.post("/workspaces",n);return Wf(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(rre)}async listProviders(){return(await this.http.get("/providers")).items.map(Jm)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const s=await this.http.post("/providers",n);return Jm(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return Jm(n)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return{changed:t.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.unchanged,failed:t.failed}}async getConfig(){const t=await this.http.get("/config");return v1(t)}async setConfig(t){const n={},s={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultThinking:"default_thinking",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return v1(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return Hf(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=bJ(this.config.serverHttpUrl,this.config.clientId),s=_re(),o=new Ire(n,this.config.clientId,{onWireEvent:i=>{const r=lre(i),l=are(i),a=ire(i);a.type==="historyCompacted"&&!Vw(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const p of d)p.type==="historyCompacted"&&!Vw(p.reason)&&t.onResync(a,l),t.onEvent(p,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},close(){o.close()}}}}let Kw;function ot(){return Kw??=new Nre(mJ()),Kw}const YT=["blue","mono"],XT=["light","dark","system"],ZT=15,Lre=12,Ore=20;function Rre(){const e=Sn(jt.accent);return e&&YT.includes(e)?e:"blue"}function Pre(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Dre(){const e=Sn(jt.colorScheme);return e&&XT.includes(e)?e:"system"}function Bre(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(s=>{const i=(s.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";s.setAttribute("content",n??i)})}function Fre(){const e=Sn(jt.theme);return e==="terminal"||e==="modern"||e==="kimi"?e:"modern"}function Hre(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.theme=e)}function Hv(e){return Number.isFinite(e)?Math.min(Ore,Math.max(Lre,Math.round(e))):ZT}function Wre(){const e=Sn(jt.uiFontSize);return e===null?ZT:Hv(Number(e))}function Ure(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${Hv(e)}px`)}const Rh=te(Fre()),Wv=te(Dre()),Uv=te(Rre()),qv=te(Wre());ze(Rh,Hre,{immediate:!0});ze(Wv,Bre,{immediate:!0});ze(Uv,Pre,{immediate:!0});ze(qv,Ure,{immediate:!0});function QT(e){e!=="terminal"&&e!=="modern"&&e!=="kimi"||(Rh.value=e,wn(jt.theme,e))}function qre(){QT(Rh.value==="modern"?"terminal":"modern")}function jre(e){XT.includes(e)&&(Wv.value=e,wn(jt.colorScheme,e))}function zre(e){YT.includes(e)&&(Uv.value=e,wn(jt.accent,e))}function Vre(e){const t=Hv(e);qv.value=t,wn(jt.uiFontSize,String(t))}const Kre=600,Gre=250,Ph=250,Yre=1e3,Xre=160,Uf=te(!1);let Jr=[],nl=null,qf=-Ph;function Zre(){Jr=[],qf=-Ph,Uf.value=!1,nl!==null&&(clearTimeout(nl),nl=null)}function Qre(){Uf.value=!0,nl!==null&&clearTimeout(nl),nl=setTimeout(()=>{nl=null,Jr=[],qf=-Ph,Uf.value=!1},Yre)}function Jre(e){if(e<=0)return;const t=Date.now();Jr.push({time:t,chars:e});const n=t-Kre;if(Jr=Jr.filter(l=>l.time>=n),t-qf<Ph)return;qf=t;const s=Jr[0]?.time??t,o=Math.max(t-s,Gre);Jr.reduce((l,a)=>l+a.chars,0)/o*1e3>=Xre&&Qre()}function ele(){return{theme:Rh,colorScheme:Wv,accent:Uv,uiFontSize:qv,fastMoon:Uf,setTheme:QT,toggleTheme:qre,setColorScheme:jre,setAccent:zre,setUiFontSize:Vre,resetFastMoon:Zre,recordMoonDelta:Jre}}function tle(){const e=Sn(jt.notifyOnComplete);return e===null?!0:e==="1"}const jf=te(tle()),jv=te(typeof Notification<"u"?Notification.permission:"denied");async function nle(e){if(!e){jf.value=!1,wn(jt.notifyOnComplete,"0");return}if(typeof Notification>"u")return;let t=Notification.permission;if(t==="default")try{t=await Notification.requestPermission()}catch{}jv.value=t,t==="granted"&&(jf.value=!0,wn(jt.notifyOnComplete,"1"))}function sle(e,t){if(!jf.value||typeof Notification>"u")return;const n=Notification.permission;if(n!=="denied"){if(n==="default"){Notification.requestPermission().then(s=>{jv.value=s,s==="granted"&&Gw(e,t)});return}Gw(e,t)}}function Gw(e,t){if(t.isActiveAndVisible)return;const n=t.sessionTitle.trim()||"Kimi Code";try{const s=new Notification(n,{body:Cn.global.t("settings.notifyBody"),tag:`kimi-complete-${e}`});s.onclick=()=>{try{window.focus()}catch{}t.onClick(),s.close()}}catch{}}function ole(){return{notifyOnComplete:jf,notifyPermission:jv,setNotifyOnComplete:nle,maybeNotifyCompletion:sle}}const JT="kimiWeb.compaction",ile="kimiWeb.optimisticUserMessage";function rle(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function lle(e){return{...e,sessions:[...e.sessions],messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function ale(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function ng(e){return e.role==="user"&&e.metadata?.[ile]===!0}function cle(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function Yw(e){let t="",n=0;for(const s of e.content)s.type==="text"?t+=s.text:(s.type==="image"||s.type==="file")&&(n+=1);return{text:t,media:n}}function ule(e,t){const n=Yw(e),s=Yw(t);return n.text===s.text&&n.media===s.media}function dle(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(ng(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(ng(o)&&cle(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(ng(o)&&ule(o,t))return s}return-1}function fle(e,t,n){let s=!1;const o=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(s=!0,{...i,content:l}):i});return s?o:e}function hle(e,t,n){const s=lle(e);switch(ale(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title??o.title,lastPrompt:t.lastPrompt??o.lastPrompt}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[JT]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=s.messagesBySession[o]??[];if(!i.some(l=>l.id===t.message.id)){if(t.message.role==="user"){const l=dle(i,t.message);if(l!==-1){const a=[...i],c=a[l];a[l]={...t.message,id:c.id,promptId:t.message.promptId??c.promptId,metadata:{...t.message.metadata,...c.metadata}},s.messagesBySession[o]=a;break}}s.messagesBySession[o]=[...i,t.message]}break}case"messageUpdated":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=fle(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(l=>l.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":case"questionExpired":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i];l[r]=t.task,s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;const l=r.outputLines??[];return l.at(-1)===t.outputChunk?r:{...r,outputLines:[...l,t.outputChunk].slice(-40)}});break}case"taskCompleted":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?Cn.global.t("warnings.errorLabel"):Cn.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}const k1="/sessions/";function e3(e){const{pathname:t}=e;if(!t.startsWith(k1))return;const n=t.slice(k1.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function ple(e){return e===void 0||e.length===0?"/":`${k1}${encodeURIComponent(e)}`}function mle(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function gle(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
|
|
250
|
+
`)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&mle(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),s=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:i});continue}if(!o||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:s}),s+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:s}),n+=1,s+=1)}return t}function t3(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const vle=/^read[_-]?media(?:file)?$/i,yle=/^agent$/i,kle=/^data:([^;]+);base64,(.*)$/s,ble=/^<(image|video|audio)\s+path="([^"]+)">$/,_le=/Mime type:\s*([^.\s]+)/i,wle=/Size:\s*(\d+)\s*bytes/i,Sle=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Cle(e){if(e.length===0)return 0;const t=e.endsWith("==")?2:e.endsWith("=")?1:0;return Math.floor(e.length*3/4)-t}function xle(e){if(Array.isArray(e))return e;if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t:null}catch{return null}}function Tle(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const o=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof o!="object"||o===null)return null;const i=o.url;return typeof i=="string"?{kind:n,url:i}:null}function Mle(e,t){if(!vle.test(e))return;const n=xle(t);if(n===null)return;let s,o,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const m=d.text,f=ble.exec(m);f&&(o=f[1],s=f[2]);const v=_le.exec(m);v?.[1]&&(i=v[1]);const w=wle.exec(m);w?.[1]&&(r=Number(w[1]));const b=Sle.exec(m);b?.[1]&&b[2]&&(l=`${b[1]}x${b[2]}`);continue}const p=Tle(d);p&&(a=p)}if(a===null)return;const c=kle.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Cle(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function n3(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
251
|
+
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
252
|
+
`));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
|
|
253
|
+
`)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
|
|
254
|
+
`)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Ale(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function Ele(e){let t=null;if(typeof e=="string")try{const n=JSON.parse(e);n&&typeof n=="object"&&(t=n)}catch{t=null}else e&&typeof e=="object"&&(t=e);return t?{description:typeof t.description=="string"?t.description:void 0,subagentType:typeof t.subagent_type=="string"?t.subagent_type:void 0,prompt:typeof t.prompt=="string"?t.prompt:void 0}:{}}function $le(e,t,n,s){const o=Ele(t),i=n?n.isError?"failed":"completed":s?"working":"completed",r=n?n3(n.output):void 0;return{id:e,toolCallId:e,name:o.description&&o.description.length>0?o.description:"Sub Agent",subagentType:o.subagentType,prompt:o.prompt,phase:i,status:n?n.isError?"failed":"completed":s?"running":"completed",summary:r&&r.length>0?r.join(`
|
|
255
|
+
`):void 0}}function Ile(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,s=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==s?n-s:e.createdAt.localeCompare(t.createdAt)}function Nle(e,t){const n=e.split(`
|
|
256
|
+
`),s=t.split(`
|
|
257
|
+
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Lle(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:Nle(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}return n==="shell"||n==="command"?{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0}:n==="file_content"||n==="file"?{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0}:n==="file_op"||n==="fileop"?{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0}:n==="url_fetch"||n==="url"?{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action}:n==="search"?{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0}:n==="invocation"||n==="agent_call"||n==="skill_call"?{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0}:n==="todo"||n==="todo_list"?{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})}:{kind:"generic",summary:e.action}}function Ole(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"?t?.trigger==="user-slash":!1}function Rle(e){return e.metadata?.origin?.kind==="compaction_summary"}function Ple(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function s3(e,t,n,s=!0,o=[]){const i=[];let r=1;const l=new Map;for(const f of t)l.set(f.toolCallId,f);const a=new Map;for(const f of o){if(f.kind!=="subagent")continue;const v=[f.parentToolCallId,f.id].filter(w=>typeof w=="string"&&w.length>0);for(const w of v){const b=a.get(w)??[];b.push(f),a.set(w,b)}}for(const[f,v]of a.entries())a.set(f,v.toSorted(Ile));const c=new Map;for(const f of e)for(const v of f.content)v.type==="toolResult"&&c.set(v.toolCallId,{output:v.output,isError:!!v.isError});let u=null;function d(f=!1){if(!u)return;const v=u;if(u=null,!f||!s)for(let w=0;w<v.tools.length;w++){const b=v.tools[w];if(b.status!=="running")continue;const _={...b,status:"ok"};v.tools[w]=_;const g=v.blocks.find(y=>y.kind==="tool"&&y.tool.id===_.id);g&&g.kind==="tool"&&(g.tool=_)}i.push({id:v.id,role:"assistant",no:r++,text:v.textParts.join(`
|
|
258
|
+
`),thinking:v.thinkingParts.length>0?v.thinkingParts.join(`
|
|
259
|
+
`):void 0,tools:v.tools.length>0?v.tools:void 0,blocks:v.blocks.length>0?v.blocks:void 0,approval:v.approval,approvalId:v.approvalId,durationMs:v.durationMs})}function p(f,v){for(const w of v)if(w.type==="text"){if(w.text){f.textParts.push(w.text);const b=f.blocks.at(-1);b&&b.kind==="text"?b.text+=`
|
|
260
|
+
`+w.text:f.blocks.push({kind:"text",text:w.text})}}else if(w.type==="thinking"){if(w.thinking){f.thinkingParts.push(w.thinking);const b=f.blocks.at(-1);b&&b.kind==="thinking"?b.thinking+=`
|
|
261
|
+
`+w.thinking:f.blocks.push({kind:"thinking",thinking:w.thinking})}}else if(w.type==="toolUse"){const b=a.get(w.toolCallId);if(b&&b.length>0){if(b.filter(I=>I.swarmIndex!==void 0).length>1)continue;const k=b.map(Ale);k.length===1?f.blocks.push({kind:"agent",member:k[0]}):f.blocks.push({kind:"agentGroup",members:k});continue}if(yle.test(w.toolName)){const y=$le(w.toolCallId,w.input,c.get(w.toolCallId),s);f.blocks.push({kind:"agent",member:y});continue}const _=l.get(w.toolCallId),g={id:w.toolCallId,name:w.toolName,arg:typeof w.input=="string"?w.input:JSON.stringify(w.input),status:"running",output:w.outputLines};f.tools.push(g),f.blocks.push({kind:"tool",tool:g}),_&&(f.approval=Lle(_),f.approvalId=_.approvalId)}else if(w.type==="toolResult"){const b=f.tools.findIndex(_=>_.id===w.toolCallId);if(b!==-1){const _=f.tools[b],g={..._,status:w.isError?"error":"ok",output:n3(w.output),media:w.isError?void 0:Mle(_.name,w.output)};f.tools[b]=g;const y=f.blocks.find(k=>k.kind==="tool"&&k.tool.id===w.toolCallId);y&&y.kind==="tool"&&(y.tool=g)}}}function m(f){if(f.type==="image"||f.type==="video"){const v=f.type,w=f.source;if(w.kind==="url")return{url:w.url,kind:v};if(w.kind==="base64")return{url:`data:${w.mediaType};base64,${w.data}`,kind:v};if(w.kind==="file"&&n)return{url:n(w.fileId),kind:v}}if(f.type==="file"&&n){if(f.mediaType.startsWith("image/"))return{url:n(f.fileId),kind:"image"};if(f.mediaType.startsWith("video/"))return{url:n(f.fileId),kind:"video"}}}for(const f of e){if(f.role==="system")continue;if(Rle(f)){d();const g=f.metadata?.[JT];i.push({id:f.id,role:"compaction",no:r,text:f.content.filter(y=>y.type==="text").map(y=>y.text).join(`
|
|
262
|
+
`),compaction:{trigger:g?.trigger,tokensBefore:g?.tokensBefore,tokensAfter:g?.tokensAfter}});continue}if(f.role==="user"){if(d(),!Ole(f))continue;const g=f.metadata?.origin,y=g?.kind==="skill_activation"&&g?.trigger==="user-slash",k=[],I=[];for(const E of f.content){E.type==="text"&&(y?k.push(g.skillArgs??""):k.push(E.text));const S=m(E);S&&I.push({url:S.url,kind:S.kind,alt:E.type==="file"?E.name:void 0})}i.push({id:f.id,role:"user",no:r++,text:k.join(`
|
|
263
|
+
`),images:I.length>0?I:void 0,skillActivation:y?{name:g.skillName,args:g.skillArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){u&&p(u,f.content);continue}const v=f.promptId;Ple(u,v)?u!==null&&u.promptId===void 0&&v!==void 0&&(u.promptId=v):(d(),u={id:f.id,promptId:v,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:f.durationMs});const b=u;if(b===null)continue;const _=JSON.stringify(f.content);b.promptId!==void 0&&b.seenSigs.has(_)||(b.seenSigs.add(_),p(b,f.content))}return d(!0),i}function Dle(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Ble(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let s=n.content.length-1;s>=0;s--){const o=n.content[s];if(o.type!=="toolUse"||du(o.toolName)!=="todo")continue;let i=o.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:Dle(a.status)}]:[]})}}return[]}const Fle=["queued","working","suspended","completed","failed"];function Hle(e){return e.subagentPhase?e.subagentPhase:e.status==="completed"?"completed":e.status==="failed"?"failed":"working"}function Wle(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Ule(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const s=n.parentToolCallId??"swarm",o=t.get(s)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:Hle(n),summary:n.outputPreview,outputLines:n.outputLines,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=Wle();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function qle(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of Fle)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}const Ks=ele(),qd=ole(),o3=jt.permission,Dh=jt.activeWorkspace,i3=jt.thinking,r3=jt.planMode,l3=jt.swarmMode,a3=jt.goalMode,c3=jt.starredModels,u3=jt.unread,Xw=40401,jle=40402,d3=jt.onboarded,zle=["off","low","medium","high","xhigh","max"];uu(jt.codeFont);function Vle(){try{const e=Sn(o3);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Kle(e){try{wn(o3,e)}catch{}}function Gle(){try{const e=Sn(i3);if(e&&zle.includes(e))return e}catch{}return"high"}function b1(e){try{wn(i3,e)}catch{}}function Yle(){try{return Sn(r3)==="true"}catch{return!1}}function Xle(e){try{wn(r3,e?"true":"false")}catch{}}function Zle(){try{return Sn(l3)==="true"}catch{return!1}}function Qle(e){try{wn(l3,e?"true":"false")}catch{}}function Jle(){try{return Sn(a3)==="true"}catch{return!1}}function f3(e){try{wn(a3,e?"true":"false")}catch{}}function eae(){try{const e=Sn(u3);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[s,o]of Object.entries(t))o===!0&&(n[s]=!0);return n}catch{return{}}}function h3(e){try{const t={};for(const[n,s]of Object.entries(e))s&&(t[n]=!0);wn(u3,JSON.stringify(t))}catch{}}function tae(){try{const e=Sn(c3);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function nae(e){try{wn(c3,JSON.stringify(e))}catch{}}function sae(){try{return Sn(Dh)}catch{return null}}const p3=jt.hiddenWorkspaces;function oae(){try{const e=Sn(p3);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function zv(e){try{wn(p3,JSON.stringify(e))}catch{}}function Vv(e){try{wn(Dh,e)}catch{}}function m3(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function iae(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const W=Ys({...rle(),connected:!1,serverVersion:"",workspaceName:"kimi-web",connection:"disconnected",permission:Vle(),thinking:Gle(),planMode:Yle(),swarmMode:Zle(),goalMode:Jle(),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:eae(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:sae(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:oae(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{}}),Bh=te([]),jd=te(tae()),zf=te({}),Vf=te([]),rae=1e3,lae=4096,g3=32*1024;let Lc=null,_1,eu=new Set;const tu=te(null);function v3(e){if(!(e==null||e.length===0))return Bh.value.find(t=>t.id===e||t.model===e)}function aae(){const e=W.activeSessionId?W.sessions.find(t=>t.id===W.activeSessionId):void 0;return v3(e?.model??tu.value??W.defaultModel)}function Kv(e){const t=FT(aae(),e);return W.thinking=t,b1(t),t}const Yl=te(null),Oc=te([]),Kf=te(!1);async function Fh(e){let t;try{t=await ot().getSessionStatus(e)}catch{return}W.sessions=W.sessions.map(n=>n.id===e?{...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}}:n),W.swarmMode=t.swarmMode,W.planMode=t.planMode}function Hh(e){const t=W.activeSessionId;t&&Promise.resolve(ot().updateSession(t,e)).then(()=>Fh(t)).catch(()=>{})}const y3=jt.betaToc;function cae(){try{return Sn(y3)==="true"}catch{return!1}}function uae(e){try{wn(y3,e?"true":"false")}catch{}}const k3=te(cae());function dae(e){k3.value=e,uae(e)}function fae(e){try{return Sn(e)??""}catch{return""}}const b3=te(fae(d3)==="1");function hae(e){b3.value=e;try{wn(d3,e?"1":"0")}catch{}}let si=null,Zw=0;function Wh(){return Zw+=1,`msg_opt_${Date.now().toString(36)}_${Zw}`}const ti=new Set;function pae(e,t,n){const s={sessions:W.sessions,activeSessionId:W.activeSessionId,messagesBySession:W.messagesBySession,approvalsBySession:W.approvalsBySession,questionsBySession:W.questionsBySession,tasksBySession:W.tasksBySession,goalBySession:W.goalBySession,lastSeqBySession:W.lastSeqBySession,compactionBySession:W.compactionBySession,config:W.config,warnings:W.warnings},o=hle(s,e,{sessionId:t,seq:n});W.sessions=o.sessions,W.activeSessionId=o.activeSessionId,W.messagesBySession=o.messagesBySession,W.approvalsBySession=o.approvalsBySession,W.questionsBySession=o.questionsBySession,W.tasksBySession=o.tasksBySession,W.goalBySession=o.goalBySession,W.lastSeqBySession=o.lastSeqBySession,W.compactionBySession=o.compactionBySession,W.config=o.config??null,W.warnings=o.warnings,e.type==="configChanged"&&(W.defaultModel=e.config.defaultModel??null),e.type==="sessionUsageUpdated"&&e.sessionId===W.activeSessionId&&e.swarmMode!==void 0&&(W.swarmMode=e.swarmMode),e.type==="sessionUsageUpdated"&&e.sessionId===W.activeSessionId&&e.planMode!==void 0&&(W.planMode=e.planMode)}function Gv(){if(si!==null||typeof WebSocket>"u")return;W.connection="connecting",si=ot().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){Vce(t);return}pae(t,n.sessionId,n.seq);const s=Mo.value[n.sessionId];if(s){const{agentId:o}=s,i=n.sessionId;t.type==="agentDelta"&&t.agentId===o?t.delta.text&&w1(o,i,t.delta.text):t.type==="agentTurnEnded"&&t.agentId===o?Jw(o,i):t.type==="taskProgress"&&t.taskId===o?w1(o,i,t.outputChunk):t.type==="taskCompleted"&&t.taskId===o&&Jw(o,i,t.outputPreview)}if(t.type==="messageCreated"&&t.message.role==="user"&&t.message.promptId!==void 0){const o=t.message.sessionId;W.promptIdBySession[o]!==t.message.promptId&&(W.promptIdBySession={...W.promptIdBySession,[o]:t.message.promptId})}if(t.type==="assistantDelta"&&n.sessionId===W.activeSessionId&&Ks.recordMoonDelta((t.delta.text?.length??0)+(t.delta.thinking?.length??0)),t.type==="sessionStatusChanged"&&(t.status==="idle"||t.status==="aborted")&&Fce(t.sessionId,t.status),t.type==="approvalRequested"){const o=W.permission;(o==="auto"||o==="yolo")&&Jv(t.approval.approvalId,{decision:"approved",scope:o==="yolo"?"session":void 0})}},onResync(t,n,s){s!==void 0&&(Uh[t]=s),Yv(t)},onError(t,n,s){w3({severity:"error",title:Cn.global.t("warnings.wsTitle"),message:n,details:[Hn("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){W.connected=t,W.connection=t?"connected":"disconnected"}})}const Uh={},nu=new Set;function mae(e){return vu(e)&&e.code===Xw?!0:typeof e=="object"&&e!==null&&e.code===Xw}function Hn(e,t){if(!(t==null||t===""))return{label:Cn.global.t(`warnings.details.${e}`),value:_3(t)}}function _3(e){if(e instanceof Error)return e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function gae(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function vae(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function yae(e,t,n){const s=[Hn("operation",e),Hn("sessionId",n)];return KT(t)?s.push(Hn("request",`${t.method} ${t.path}`),Hn("endpoint",t.url),Hn("requestId",t.requestId),Hn("phase",t.phase),Hn("timeout",`${t.timeoutMs}ms`),Hn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Hn("contentType",t.contentType),Hn("responsePreview",t.bodyPreview),Hn("cause",t.cause)):vu(t)?s.push(Hn("code",t.code),Hn("requestId",t.requestId),Hn("message",t.message),Hn("details",t.details)):s.push(Hn("errorName",gae(t)),Hn("message",vae(t)??_3(t))),s.filter(o=>o!==void 0)}function kae(e,t,n={}){const s=KT(t),o=vu(t),i=n.title??(s?Cn.global.t("warnings.daemonNetworkTitle"):o?Cn.global.t("warnings.daemonApiTitle"):Cn.global.t("warnings.operationFailedTitle")),r=n.message??(s?Cn.global.t("warnings.daemonNetworkMessage"):o?t.message:Cn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:yae(e,t,n.sessionId)}}function w3(e){W.warnings=[...W.warnings,e]}function St(e,t,n){w3(kae(e,t,n))}const bae={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function S3(e){if(!vu(e))return;const t=bae[e.code];return t?Cn.global.t(t):void 0}async function _ae(e){if(W.sessions=W.sessions.filter(n=>n.id!==e),delete W.messagesBySession[e],delete W.approvalsBySession[e],delete W.questionsBySession[e],delete W.tasksBySession[e],delete W.goalBySession[e],delete W.gitStatusBySession[e],delete W.lastSeqBySession[e],delete W.compactionBySession[e],delete W.messagesLoadingMoreBySession[e],delete W.messagesHasMoreBySession[e],delete W.messagesLoadMoreErrorBySession[e],delete Uh[e],nu.delete(e),W.activeSessionId!==e)return;const t=W.sessions[0];t?await Fs(t.id,{urlMode:"replace"}):(W.activeSessionId=void 0,W.sessionLoading=!1,Mr(void 0,"replace"))}async function Yv(e){try{const n=await ot().getSessionSnapshot(e);return W.sessions=W.sessions.map(s=>s.id===e?{...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model}:s),W.messagesBySession={...W.messagesBySession,[e]:n.messages},W.messagesHasMoreBySession={...W.messagesHasMoreBySession,[e]:n.hasMoreMessages},W.approvalsBySession={...W.approvalsBySession,[e]:n.pendingApprovals},W.questionsBySession={...W.questionsBySession,[e]:n.pendingQuestions},W.lastSeqBySession={...W.lastSeqBySession,[e]:n.asOfSeq},Uh[e]=n.epoch,Gv(),si&&(si.seedSnapshot(e,n),si.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch})),"ok"}catch(t){return mae(t)?(await _ae(e),"not-found"):(St("getSessionSnapshot",t,{title:Cn.global.t("warnings.sessionSnapshotTitle"),message:Cn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const wae=50;async function Sae(e){if(W.messagesLoadingMoreBySession[e])return;const t=W.messagesBySession[e];if(!t||t.length===0)return;const n=t[0].id;W.messagesLoadingMoreBySession={...W.messagesLoadingMoreBySession,[e]:!0},W.messagesLoadMoreErrorBySession={...W.messagesLoadMoreErrorBySession,[e]:!1};try{const s=await ot().listMessages(e,{beforeId:n,pageSize:wae}),o=[...s.items].reverse(),i=W.messagesBySession[e]??t;W.messagesBySession={...W.messagesBySession,[e]:[...o,...i]},W.messagesHasMoreBySession={...W.messagesHasMoreBySession,[e]:s.hasMore}}catch(s){W.messagesLoadMoreErrorBySession={...W.messagesLoadMoreErrorBySession,[e]:!0},St("loadOlderMessages",s,{sessionId:e})}finally{W.messagesLoadingMoreBySession={...W.messagesLoadingMoreBySession,[e]:!1}}}async function Cae(e){try{const n=await ot().listTasks(e);W.tasksBySession={...W.tasksBySession,[e]:t3(n,W.tasksBySession[e]??[])},await xae(e,n)}catch{}}async function xae(e,t){if(W.activeSessionId!==e)return;const n=t??W.tasksBySession[e]??[],s=ot(),o=new Map;if(await Promise.all(n.map(async r=>{if((r.status==="completed"||r.status==="failed"||r.status==="cancelled")&&!eu.has(r.id)&&!((r.outputLines?.length??0)>0))try{const a=await s.getTask(e,r.id,{withOutput:!0,outputBytes:g3});a.outputPreview!==void 0&&o.set(r.id,{preview:a.outputPreview,bytes:a.outputBytes})}catch{}finally{eu.add(r.id)}})),o.size===0)return;const i=W.tasksBySession[e]??[];W.tasksBySession={...W.tasksBySession,[e]:i.map(r=>{const l=o.get(r.id);return l?{...r,outputPreview:l.preview,outputBytes:l.bytes}:r})}}async function Qw(e){if(W.activeSessionId!==e)return;const t=ot();let n;try{n=await t.listTasks(e)}catch{return}const s=new Map;await Promise.all(n.map(async l=>{const a=l.status==="running",c=l.status==="completed"||l.status==="failed"||l.status==="cancelled";if(!(!a&&!c)&&!(c&&(eu.has(l.id)||(l.outputLines?.length??0)>0)))try{const u=await t.getTask(e,l.id,{withOutput:!0,outputBytes:a?lae:g3});u.outputPreview!==void 0&&s.set(l.id,{preview:u.outputPreview,bytes:u.outputBytes})}catch{}finally{c&&eu.add(l.id)}}));const o=W.tasksBySession[e]??[],i=new Map(o.map(l=>[l.id,l])),r=n.map(l=>{const a=i.get(l.id),c=s.get(l.id);return{...l,outputLines:a?.outputLines,outputPreview:c?.preview??a?.outputPreview,outputBytes:c?.bytes??a?.outputBytes}});W.tasksBySession={...W.tasksBySession,[e]:t3(r,o)}}function Tae(e){Lc!==null&&_1===e||(Gf(),_1=e,Qw(e),Lc=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(W.activeSessionId===e?Qw(e):Gf())},rae))}function Gf(){Lc!==null&&(clearInterval(Lc),Lc=null),_1=void 0,eu.clear()}async function Mae(e){try{const n=await ot().listSkills(e);zf.value={...zf.value,[e]:n}}catch{}}function Aae(e){return Object.prototype.hasOwnProperty.call(W.messagesBySession,e)}function Eae(e){if(Gv(),si){const t=W.lastSeqBySession[e]??0,n=Uh[e];si.subscribe(e,{seq:t,epoch:n})}}function $ae(e){Cae(e),Zv(e),Fh(e),Object.prototype.hasOwnProperty.call(zf.value,e)||Mae(e)}function qh(e){const t=W.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=Mo.value[e]?.agentId,o=(W.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&W.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function Xv(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;return o<6e4?Cn.global.t("sessions.justNow"):i<1?`${Math.round(o/6e4)}m`:i<24?`${Math.round(i)}h`:n.toLocaleDateString(Cn.global.locale.value,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}const Iae=3e4,su=te(0);let sg=null;function Nae(){sg===null&&(sg=setInterval(()=>{su.value=(su.value+1)%Number.MAX_SAFE_INTEGER},Iae),sg.unref?.())}function Lae(e,t){const n=e.split(`
|
|
264
|
+
`),s=t.split(`
|
|
265
|
+
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Oae(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:Lae(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command"){const s=typeof t.command=="string"?t.command:e.action,o=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:s,cwd:o,danger:i}}if(n==="file_content"||n==="file"){const s=typeof t.path=="string"?t.path:"",o=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:s,content:o,language:i}}if(n==="file_op"||n==="fileop"){const s=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,o=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s,path:o,detail:i}}if(n==="url_fetch"||n==="url"){const s=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:s}}if(n==="search"){const s=typeof t.query=="string"?t.query:e.action,o=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:s,scope:o}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const s=typeof t.kind=="string"?t.kind:n,o=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:s,name:o,description:i}}return n==="todo"||n==="todo_list"?{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})}:{kind:"generic",summary:e.action}}function Rae(e){return{questionId:e.questionId,sessionId:e.sessionId,questions:e.questions.map(t=>({id:t.id,question:t.question,header:t.header,body:t.body,options:t.options.map(n=>({id:n.id,label:n.label,description:n.description,recommended:n.recommended})),multiSelect:t.multiSelect,allowOther:t.allowOther,otherLabel:t.otherLabel}))}}function Pae(e){const t=W.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function Dae(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":t="fail";let n="";if(e.status==="running"&&e.startedAt){const r=Math.round((Date.now()-new Date(e.startedAt).getTime())/1e3),l=Math.floor(r/60),a=r%60;n=Cn.global.t("tasks.timingRunning",{time:`${l}:${String(a).padStart(2,"0")}`})}else if(e.completedAt&&e.startedAt){const r=Math.round((new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime())/1e3);n=Cn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??Pae(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s}}const Bae=j(()=>{const e=W.sessions.find(n=>n.id===W.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:W.workspaceName,branch:t}}),Fae=j(()=>(su.value,W.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Xv(e.updatedAt,e.status),status:e.status,busy:qh(e.id)})))),Hae=j(()=>W.activeSessionId??""),Wae=j(()=>{const e=W.activeSessionId;return e?zf.value[e]??[]:[]}),Uae=j(()=>{const e=W.activeSessionId;return e?W.sendingBySession[e]??!1:!1}),jh=j(()=>{const e=W.activeSessionId;if(!e)return[];const t=Mo.value[e]?.agentId;return(W.tasksBySession[e]??[]).filter(n=>n.id!==t)}),qae=j(()=>{const e=W.activeSessionId;if(!e)return[];const t=new Set(W.sideChatUserMessageIdsBySession[e]??[]),n=(W.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=W.approvalsBySession[e]??[];return s3(n,s,o=>ot().getFileUrl(o),yu.value!=="idle",jh.value)}),Mo=te({}),Ma=j(()=>{const e=W.activeSessionId;if(!e)return null;const t=Mo.value[e];return t?{parentId:e,agentId:t.agentId}:null}),jae=j(()=>Ma.value?.parentId??null),zae=j(()=>Ma.value!==null),Vae=j(()=>{const e=Ma.value;return e?!!W.sideChatSendingByAgent[e.agentId]:!1}),C3=j(()=>{const e=Ma.value;return e?W.sideChatSendingByAgent[e.agentId]?!0:(W.tasksBySession[e.parentId]??[]).some(t=>t.id===e.agentId&&t.status==="running"):!1}),Kae=j(()=>{const e=Ma.value;if(!e)return[];const t=W.sideChatMessagesByAgent[e.agentId]??[];return s3(t,[],n=>ot().getFileUrl(n),C3.value,[])});function zh(e,t){W.sideChatMessagesByAgent={...W.sideChatMessagesByAgent,[e]:t(W.sideChatMessagesByAgent[e]??[])}}function Gae(e,t){zh(e,n=>[...n,t])}function Yae(e){zh(e,t=>{const n=[...t].reverse().findIndex(o=>o.role==="user");if(n===-1)return t;const s=t.length-1-n;return t.filter((o,i)=>i!==s)})}function Xae(e,t){zh(e,n=>{const s=[...n];for(let o=s.length-1;o>=0;o-=1){const i=s[o];if(i.role==="user")return s[o]={...i,promptId:i.promptId??t},s}return n})}function w1(e,t,n){n&&zh(e,s=>{const o=s.at(-1);if(o?.role==="assistant"){const i=o.content[0],r=i?.type==="text"?i.text:"";return[...s.slice(0,-1),{...o,content:[{type:"text",text:`${r}${n}`}]}]}return[...s,{id:Wh(),sessionId:t,role:"assistant",content:[{type:"text",text:n}],createdAt:new Date().toISOString()}]})}function Jw(e,t,n){if(W.sideChatSendingByAgent={...W.sideChatSendingByAgent,[e]:!1},!n)return;const o=(W.sideChatMessagesByAgent[e]??[]).at(-1);(o?.role==="assistant"&&o.content[0]?.type==="text"?o.content[0].text:"").trim().length>0||w1(e,t,n)}async function Zae(e){const t=W.activeSessionId;if(t){if(!Mo.value[t]){let n;try{({agentId:n}=await ot().startBtw(t))}catch(s){St("openSideChat",s,{sessionId:t});return}W.sideChatMessagesByAgent={...W.sideChatMessagesByAgent,[n]:W.sideChatMessagesByAgent[n]??[]},Mo.value={...Mo.value,[t]:{agentId:n}},Gv(),si?.markSideChannelAgent(n)}e&&e.trim()&&await x3(e.trim())}}function Qae(){const e=W.activeSessionId;if(!e)return;const{[e]:t,...n}=Mo.value;Mo.value=n}async function x3(e){const t=Ma.value,n=e.trim();if(!t||!n)return;const s=t.parentId,o=t.agentId;W.sideChatSendingByAgent={...W.sideChatSendingByAgent,[o]:!0};const i={id:Wh(),sessionId:s,role:"user",content:[{type:"text",text:n}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};Gae(o,i);try{const r=await ot().submitPrompt(s,{content:[{type:"text",text:n}],agentId:o});Xae(o,r.promptId),W.sideChatUserMessageIdsBySession={...W.sideChatUserMessageIdsBySession,[s]:[...W.sideChatUserMessageIdsBySession[s]??[],r.userMessageId]}}catch(r){St("sendSideChatPrompt",r,{sessionId:s}),Yae(o),W.sideChatSendingByAgent={...W.sideChatSendingByAgent,[o]:!1}}}function Jae(e){if(!Mo.value[e])return;const{[e]:t,...n}=Mo.value;Mo.value=n}const S1=te(0);let rc=null;ze(()=>jh.value.some(e=>e.status==="running"),e=>{e&&rc===null?rc=setInterval(()=>{S1.value=(S1.value+1)%Number.MAX_SAFE_INTEGER},1e3):!e&&rc!==null&&(clearInterval(rc),rc=null)},{immediate:!0});ze(()=>{const e=W.activeSessionId;if(!e)return{sid:void 0,hasRunning:!1};const t=W.tasksBySession[e]??[];return{sid:e,hasRunning:t.some(n=>n.status==="running")}},({sid:e,hasRunning:t},n,s)=>{let o;t&&e!==void 0?Tae(e):e!==void 0?o=setTimeout(()=>{(W.tasksBySession[e]??[]).some(r=>r.status==="running")||Gf()},1500):Gf(),s(()=>{o!==void 0&&clearTimeout(o)})},{deep:!0,immediate:!0});const ece=j(()=>(S1.value,jh.value.map(Dae))),T3=j(()=>Ule(jh.value)),zl=j(()=>{const e=W.activeSessionId;return e?W.goalBySession[e]??null:null}),tce=j(()=>{const e=W.activeSessionId;return e?Ble(W.messagesBySession[e]??[]):[]}),nce=j(()=>{const e=W.activeSessionId;return e?W.compactionBySession[e]??null:null}),sce=j(()=>W.connection),oce=j(()=>W.loading),ice=j(()=>W.sessionLoading),rce=j(()=>{const e=W.activeSessionId;return e?W.messagesLoadingMoreBySession[e]??!1:!1}),lce=j(()=>{const e=W.activeSessionId;return e?W.messagesHasMoreBySession[e]??!1:!1}),ace=j(()=>{const e=W.activeSessionId;return e?W.messagesLoadMoreErrorBySession[e]??!1:!1}),cce=j(()=>W.serverVersion),uce=j(()=>W.permission),dce=j(()=>W.thinking),fce=j(()=>W.planMode),hce=j(()=>W.swarmMode),pce=j(()=>W.goalMode),mce=j(()=>{const e=qle(T3.value);return{plan:W.planMode,goal:zl.value&&zl.value.status!=="complete"?{status:zl.value.status,turnsUsed:zl.value.turnsUsed,elapsedMs:zl.value.wallClockMs}:null,swarm:e.total>0?e:null}}),gce=j(()=>{const e=W.activeSessionId;return e?(W.queuedBySession[e]??[]).map(t=>({text:t.text,attachmentCount:t.attachments?.length??0})):[]}),vce=j(()=>W.warnings),yce=j(()=>{const e=W.activeSessionId;return e?(W.questionsBySession[e]??[]).map(Rae):[]}),kce=j(()=>{const e=W.activeSessionId;return e?(W.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:Oae(t),agentName:t.agentName})):[]}),yu=j(()=>{const e=W.activeSessionId;return e?(W.approvalsBySession[e]??[]).length>0?"awaiting-approval":(W.questionsBySession[e]??[]).length>0?"awaiting-question":qh(e)?"running":"idle":"idle"}),Yf=j(()=>{const e=W.activeSessionId;if(!e)return null;const t=W.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),bce=j(()=>{const e=W.activeSessionId;return e?W.gitStatusBySession[e]?.pullRequest??null:null}),_ce=j(()=>{const e=W.activeSessionId;if(!e)return[];const t=W.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),wce=j(()=>{const e=W.activeSessionId;if(!e)return null;const t=W.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),M3=j(()=>{const e=W.sessions.find(r=>r.id===W.activeSessionId),t=Yf.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?tu.value:null,s=(e?.model&&e.model.length>0?e.model:n??W.defaultModel)??"—",o=Bh.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:W.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Yf.value!==null}}),Sce=j(()=>Oc.value),Cce=j(()=>W.sessions.find(t=>t.id===W.activeSessionId)?.usage.totalCostUsd??0),xce=j(()=>W.authReady),Tce=j(()=>W.defaultModel),Mce=j(()=>W.managedProviderStatus),Ace=j(()=>W.config),Ece=j(()=>{const e=W.activeSessionId;if(!e)return{};const t=W.gitStatusBySession[e];return t?{...t.entries}:{}});function Tr(e){return W.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const _r=j(()=>{const e=new Set(W.hiddenWorkspaceRoots),t=new Map;for(const a of W.workspaces)e.has(a.root)||t.set(a.root,{...a});for(const a of W.sessions){const c=a.cwd;c&&(e.has(c)||t.has(c)||t.set(c,{id:a.workspaceId??c,root:c,name:m3(c),isGitRepo:!1,sessionCount:0}))}const n=new Map;for(const a of W.sessions){const c=Tr(a);n.set(c,(n.get(c)??0)+1)}const s=Yf.value,o=W.sessions.find(a=>a.id===W.activeSessionId)?.cwd,i=W.workspaces.map(a=>a.root),r=[...t.keys()].filter(a=>!i.includes(a));r.sort((a,c)=>a.localeCompare(c));const l=[];for(const a of[...i,...r]){const c=t.get(a),u=n.get(c.id)??n.get(c.root)??(W.loading?c.sessionCount:0);let d=c.branch;!d&&s&&o===c.root&&(d=s.branch),l.push({...c,sessionCount:u,branch:d})}return l}),Vh=j(()=>_r.value.map(e=>({id:e.id,name:e.name,root:e.root,shortPath:iae(e.root,W.fsHome),branch:e.branch,sessionCount:e.sessionCount}))),A3=j(()=>{const e=W.activeWorkspaceId,t=_r.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),$ce=j(()=>{const e=A3.value;return e?Vh.value.find(t=>t.id===e)??null:null}),Ice=j(()=>{su.value;const e=new Set(Vh.value.map(t=>t.id));return W.sessions.filter(t=>!t.parentSessionId&&e.has(Tr(t))).map(t=>({id:t.id,title:t.title,time:Xv(t.updatedAt,t.status),status:t.status,busy:qh(t.id),lastPrompt:t.lastPrompt}))}),Nce=j(()=>{su.value;const e=new Map;for(const t of W.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=Tr(t),s={id:t.id,title:t.title,time:Xv(t.updatedAt,t.status),status:t.status,busy:qh(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Vh.value.map(t=>({workspace:t,sessions:e.get(t.id)??[]}))}),E3=j(()=>{const e={};for(const[t,n]of Object.entries(W.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(W.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),Lce=j(()=>{const e={};for(const[t,n]of Object.entries(W.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(W.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),Oce=j(()=>{const e={};for(const[t,n]of Object.entries(W.unreadBySession))n&&(e[t]=!0);return e}),Rce=j(()=>{const e={},t=E3.value;for(const n of W.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=Tr(n);e[o]=(e[o]??0)+s}return e}),Pce=j(()=>W.recentRoots),Dce=j(()=>{const e=new Set,t=[];for(const n of W.sessions){const s=n.cwd;if(s&&!e.has(s)&&(e.add(s),t.push(s),t.length>=8))break}return t}),Bce=j(()=>W.availableOpenInApps);function Fce(e,t){if(ti.delete(e),W.sendingBySession={...W.sendingBySession,[e]:!1},W.promptIdBySession[e]!==void 0){const i={...W.promptIdBySession};delete i[e],W.promptIdBySession=i}e===W.activeSessionId?(Ks.resetFastMoon(),Zv(e),Fh(e)):t==="idle"&&(W.unreadBySession={...W.unreadBySession,[e]:!0},h3(W.unreadBySession)),qd.maybeNotifyCompletion(e,{isActiveAndVisible:e===W.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:W.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{Fs(e)}});const n=W.queuedBySession[e]??[];if(n.length===0)return;const[s,...o]=n;W.queuedBySession={...W.queuedBySession,[e]:o},s!==void 0&&Gh(e,s.text,s.attachments).then(i=>{if(!i){const r=W.queuedBySession[e]??[];W.queuedBySession={...W.queuedBySession,[e]:[s,...r]}}})}async function Hce(e){const t=W.activeSessionId;if(t){Yl.value=e,Oc.value=[],Kf.value=!0;try{const s=await ot().getFileDiff(t,e);if(Yl.value!==e)return;Oc.value=gle(s.diff)}catch(n){Yl.value===e&&(Oc.value=[]),console.warn("[loadFileDiff] diff unavailable for",e,n)}finally{Yl.value===e&&(Kf.value=!1)}}}function ku(){Yl.value=null,Oc.value=[],Kf.value=!1}async function Zv(e){try{const n=await ot().getGitStatus(e);W.gitStatusBySession={...W.gitStatusBySession,[e]:n}}catch{}}async function Qv(){try{const t=await ot().getAuth();W.authReady=t.ready,W.defaultModel=t.defaultModel,W.managedProviderStatus=t.managedProvider?.status??null}catch{}}async function Wce(){try{const e=ot();W.config=await e.getConfig()}catch{}}async function Uce(e){try{const n=await ot().setConfig(e);return W.config=n,W.defaultModel=n.defaultModel??null,!0}catch(t){return St("setConfig",t),!1}}const $3=te(!1),qce=100;async function jce(){const e=ot(),t=[];let n;for(;;){const s=await e.listSessions({pageSize:qce,beforeId:n});if(t.push(...s.items),!s.hasMore||s.items.length===0)break;n=s.items[s.items.length-1].id}return t}async function I3(){W.loading=!0;try{const e=ot();await Promise.all([e.getHealth().catch(()=>null),e.getMeta().then(r=>{W.serverVersion=r.serverVersion,W.availableOpenInApps=r.openInApps}).catch(()=>null),Yh()]),await Qv(),await Wce();const t=await jce().catch(()=>[]);W.sessions=t,await N3();const n=t[0],s=W.activeWorkspaceId;!(s!==null&&_r.value.some(r=>r.id===s))&&n&&ml(Tr(n)),eue();const i=typeof window<"u"?e3(window.location):void 0;!W.activeSessionId&&i!==void 0&&(W.sessions.some(l=>l.id===i)||await L3(i))&&await Fs(i,{urlMode:"replace"}),!W.activeSessionId&&t.length>0&&await Fs(t[0].id,{urlMode:"replace"})}catch(e){St("load",e)}finally{W.loading=!1,$3.value=!0}}async function N3(){try{const e=ot(),[t,n]=await Promise.all([e.listWorkspaces().catch(()=>[]),e.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);W.workspaces=t,W.fsHome=n.home||null,W.recentRoots=n.recentRoots}catch{}}function ml(e){W.activeWorkspaceId=e,Vv(e)}function zce(e){ml(e);const t=W.sessions.filter(n=>Tr(n)===e);if(t.length>0){const n=t[0];n&&n.id!==W.activeSessionId&&Fs(n.id)}else W.activeSessionId=void 0,Mr(void 0,"push")}function Kh(e){W.hiddenWorkspaceRoots.includes(e.root)&&(W.hiddenWorkspaceRoots=W.hiddenWorkspaceRoots.filter(s=>s!==e.root),zv(W.hiddenWorkspaceRoots));const t=W.workspaces.findIndex(s=>s.id===e.id||s.root===e.root);if(t===-1){W.workspaces=[e,...W.workspaces];return}const n=[...W.workspaces];n[t]=e,W.workspaces=n}function Vce(e){if(e.type==="workspaceCreated"||e.type==="workspaceUpdated"){Kh(e.workspace);return}const t=W.workspaces.find(s=>s.id===e.workspaceId)?.root??e.root;if(t&&!W.hiddenWorkspaceRoots.includes(t)&&(W.hiddenWorkspaceRoots=[...W.hiddenWorkspaceRoots,t],zv(W.hiddenWorkspaceRoots)),W.workspaces=W.workspaces.filter(s=>s.id!==e.workspaceId&&s.root!==t),W.activeWorkspaceId===e.workspaceId||W.activeWorkspaceId===t){const s=_r.value[0]?.id??null;if(W.activeWorkspaceId=s,s)Vv(s);else try{uu(Dh)}catch{}W.activeSessionId=void 0,W.sessionLoading=!1,ku(),Mr(void 0,"replace")}}function Kce(){W.activeSessionId=void 0,Mr(void 0,"push")}function C1(e){ml(e),Kce(),ku()}async function Gce(e){const t=_r.value.find(n=>n.id===e);if(t)try{const n=ot();let s,o=t.root;try{const r=await n.addWorkspace({root:t.root});s=r.id,o=r.root,Kh(r)}catch{}const i=await n.createSession({workspaceId:s,cwd:o});return W.sessions=[i,...W.sessions.filter(r=>r.id!==i.id)],ml(i.workspaceId??s??e),nu.add(i.id),await Fs(i.id),i}catch(n){St("createSessionInWorkspace",n);return}}async function Yce(e,t,n){const s=_r.value.find(o=>o.id===e);if(s)try{const o=ot();let i,r=s.root;try{const u=await o.addWorkspace({root:s.root});i=u.id,r=u.root,Kh(u)}catch{}const l=tu.value??void 0,a=await o.createSession({workspaceId:i,cwd:r,model:l});tu.value=null;const c=l!==void 0&&(!a.model||a.model.length===0)?{...a,model:l}:a;W.sessions=[c,...W.sessions.filter(u=>u.id!==a.id)],ml(a.workspaceId??i??e),await Fs(a.id),await Gh(a.id,t,n)}catch(o){St("startSessionAndSendPrompt",o)}}async function Xce(e){const t=e.trim();if(!t)return;const n=ot();try{const s=await n.addWorkspace({root:t});Kh(s),C1(s.id)}catch{W.workspaces.find(o=>o.root===t)||(W.workspaces=[{id:t,root:t,name:m3(t),isGitRepo:!1,sessionCount:0},...W.workspaces]),C1(t)}}async function Zce(e){try{return await ot().browseFs(e)}catch{return{path:"",parent:null,entries:[]}}}async function Qce(){try{return await ot().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Mr(e,t){if(t==="none"||typeof window>"u"||!window.history)return;const n=ple(e);if(window.location.pathname!==n)try{t==="push"?window.history.pushState(null,"",n):window.history.replaceState(null,"",n)}catch{}}async function L3(e){try{const t=await ot().getSession(e);return W.sessions.some(n=>n.id===t.id)||(W.sessions=[...W.sessions,t]),!0}catch{return!1}}function Jce(){const e=e3(window.location);if(e===void 0){W.activeSessionId=void 0;return}if(e!==W.activeSessionId){if(W.sessions.some(t=>t.id===e)){Fs(e,{urlMode:"none"});return}(async()=>{if(await L3(e)){await Fs(e,{urlMode:"none"});return}const t=W.sessions[0];t?await Fs(t.id,{urlMode:"replace"}):(W.activeSessionId=void 0,Mr(void 0,"replace"))})()}}let e2=!1;function eue(){e2||typeof window>"u"||(e2=!0,window.addEventListener("popstate",Jce))}async function Fs(e,t){const n=Aae(e),s=!n&&nu.has(e);nu.delete(e);try{Mr(e,t?.urlMode??"push"),W.sessionLoading=!n&&!s,W.activeSessionId=e,Ks.resetFastMoon(),W.unreadBySession[e]&&(W.unreadBySession={...W.unreadBySession,[e]:!1},h3(W.unreadBySession)),ku();const o=W.sessions.find(i=>i.id===e);if(o){const i=Tr(o);W.activeWorkspaceId!==i&&ml(i)}if(n)Eae(e);else if(await Yv(e)==="not-found")return;$ae(e)}catch(o){St("selectSession",o,{sessionId:e})}finally{W.activeSessionId===e&&(W.sessionLoading=!1)}}async function tue(e,t){try{const s=await ot().createSession({cwd:e,title:t?.title,model:t?.model});W.sessions=[s,...W.sessions.filter(o=>o.id!==s.id)],nu.add(s.id),await Fs(s.id)}catch(n){St("createSession",n)}}async function Gh(e,t,n){ti.add(e),W.sendingBySession={...W.sendingBySession,[e]:!0};const s=Wh();try{const o=ot(),i=[];t&&i.push({type:"text",text:t});for(const m of n??[])m.kind==="video"?i.push({type:"video",source:{kind:"file",fileId:m.fileId}}):i.push({type:"image",source:{kind:"file",fileId:m.fileId}});if(i.length===0)return ti.delete(e),W.sendingBySession={...W.sendingBySession,[e]:!1},!1;const r={id:s,sessionId:e,role:"user",content:i,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}},l=W.messagesBySession[e]??[];W.messagesBySession={...W.messagesBySession,[e]:[...l,r]};const a=W.sessions.find(m=>m.id===e),c=(a?.model&&a.model.length>0?a.model:W.defaultModel)??void 0;if(W.goalMode&&t)try{await o.updateSession(e,{goalObjective:t.trim()})}catch(m){St("createGoal",m,{sessionId:e}),ti.delete(e),W.sendingBySession={...W.sendingBySession,[e]:!1};const f=W.messagesBySession[e]??[];return f.some(v=>v.id===s)&&(W.messagesBySession={...W.messagesBySession,[e]:f.filter(v=>v.id!==s)}),!1}const u=await o.submitPrompt(e,{content:i,model:c,thinking:W.thinking,permissionMode:W.permission,planMode:W.planMode,swarmMode:W.swarmMode});W.goalMode&&(W.goalMode=!1,f3(!1)),W.promptIdBySession={...W.promptIdBySession,[e]:u.promptId};const d=W.messagesBySession[e]??[],p=d.findIndex(m=>m.id===s);if(p!==-1){const m=[...d];m[p]={...m[p],promptId:m[p].promptId??u.promptId},W.messagesBySession={...W.messagesBySession,[e]:m}}return si?.bindNextPromptId(e,u.promptId),!0}catch(o){ti.delete(e),W.sendingBySession={...W.sendingBySession,[e]:!1};const i=W.messagesBySession[e]??[];return i.some(r=>r.id===s)&&(W.messagesBySession={...W.messagesBySession,[e]:i.filter(r=>r.id!==s)}),St("sendPrompt",o,{sessionId:e}),!1}}async function O3(e,t){const n=W.activeSessionId;if(n){if(yu.value!=="idle"||ti.has(n)){R3(e,t);return}await Gh(n,e,t)}}async function nue(e,t){const n=W.activeSessionId;if(!n)return;const s=W.queuedBySession[n]??[],o=[],i=[];for(const d of s){const p=d.text.trim();p&&o.push(p),d.attachments?.length&&i.push(...d.attachments)}const r=e.trim();if(r&&o.push(r),t?.length&&i.push(...t),o.length===0&&i.length===0)return;s.length>0&&(W.queuedBySession={...W.queuedBySession,[n]:[]});const l=o.join(`
|
|
266
|
+
|
|
267
|
+
`);if(yu.value==="idle"&&!ti.has(n)){await Gh(n,l,i);return}const a=[];l&&a.push({type:"text",text:l});for(const d of i)d.kind==="video"?a.push({type:"video",source:{kind:"file",fileId:d.fileId}}):a.push({type:"image",source:{kind:"file",fileId:d.fileId}});const c=Wh(),u={id:c,sessionId:n,role:"user",content:a,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};W.messagesBySession={...W.messagesBySession,[n]:[...W.messagesBySession[n]??[],u]};try{const d=ot(),p=W.sessions.find(b=>b.id===n),m=(p?.model&&p.model.length>0?p.model:W.defaultModel)??void 0,f=await d.submitPrompt(n,{content:a,model:m,thinking:W.thinking,permissionMode:W.permission,planMode:W.planMode,swarmMode:W.swarmMode}),v=W.messagesBySession[n]??[],w=v.findIndex(b=>b.id===c);if(w!==-1){const b=[...v];b[w]={...b[w],promptId:b[w].promptId??f.promptId},W.messagesBySession={...W.messagesBySession,[n]:b}}if(f.status!=="queued"){W.promptIdBySession={...W.promptIdBySession,[n]:f.promptId},si?.bindNextPromptId(n,f.promptId);return}try{await d.steerPrompts(n,[f.promptId])}catch{}}catch(d){const p=W.messagesBySession[n]??[];W.messagesBySession={...W.messagesBySession,[n]:p.filter(m=>m.id!==c)},St("steer",d,{sessionId:n})}}async function sue(e,t){try{const s=await ot().uploadFile({file:e,name:t});return{fileId:s.id,name:s.name,mediaType:s.mediaType}}catch(n){return St("uploadImage",n),null}}function R3(e,t){const n=W.activeSessionId;if(!n)return;const s=W.queuedBySession[n]??[];W.queuedBySession={...W.queuedBySession,[n]:[...s,{text:e,attachments:t}]}}async function oue(){const e=W.activeSessionId;if(!e)return;const t=W.sessions.find(o=>o.id===e);let n=W.promptIdBySession[e];if(n===void 0){const o=t?.currentPromptId;o?.startsWith("prompt_")&&(n=o)}const s=ot();if(n!==void 0)try{await s.abortPrompt(e,n);return}catch(o){if(!(vu(o)&&o.code===jle)){St("abortCurrentPrompt",o,{sessionId:e});return}}try{await s.abortSession(e)}catch(o){St("abortCurrentPrompt",o,{sessionId:e})}}async function Jv(e,t){const n=W.activeSessionId;if(n)try{const s=ot(),o={decision:t.decision,scope:t.scope,feedback:t.feedback};await s.respondApproval(n,e,o);const i=W.approvalsBySession[n]??[];W.approvalsBySession={...W.approvalsBySession,[n]:i.filter(r=>r.approvalId!==e)}}catch(s){St("respondApproval",s,{sessionId:n})}}async function iue(e,t){const n=W.activeSessionId;if(n)try{await ot().respondQuestion(n,e,t);const o=W.questionsBySession[n]??[];W.questionsBySession={...W.questionsBySession,[n]:o.filter(i=>i.questionId!==e)}}catch(s){St("respondQuestion",s,{sessionId:n})}}async function rue(e){const t=W.activeSessionId;if(t)try{await ot().dismissQuestion(t,e);const s=W.questionsBySession[t]??[];W.questionsBySession={...W.questionsBySession,[t]:s.filter(o=>o.questionId!==e)}}catch(n){St("dismissQuestion",n,{sessionId:t})}}async function lue(e){const t=W.activeSessionId;if(t)try{await ot().cancelTask(t,e);const s=W.tasksBySession[t]??[];W.tasksBySession={...W.tasksBySession,[t]:s.map(o=>o.id===e?{...o,status:"cancelled"}:o)}}catch(n){St("cancelTask",n,{sessionId:t})}}function aue(e){const t=Kv(e);Hh({thinking:t})}function P3(e){W.planMode=e,Xle(e),Hh({planMode:e})}function cue(){P3(!W.planMode)}function D3(e){W.swarmMode=e,Qle(e),Hh({swarmMode:e})}function uue(){const e=!W.swarmMode;e&&W.permission==="manual"&&!confirm("Enable swarm mode? The agent will run multiple sub agents in parallel.")||D3(e)}function B3(e){W.goalMode=e,f3(e)}function due(){B3(!W.goalMode)}async function fue(e){const t=e.trim();if(!t||W.permission==="manual"&&!confirm(`Start goal: "${t}"? The agent will run autonomously toward this objective.`))return;const n=W.activeSessionId;if(n){try{await ot().updateSession(n,{goalObjective:t})}catch(s){St("createGoal",s,{sessionId:n,message:S3(s)});return}await O3(t)}}function hue(e){const t=W.activeSessionId;t&&Promise.resolve(ot().updateSession(t,{goalControl:e})).catch(n=>{St("controlGoal",n,{sessionId:t,message:S3(n)})})}function pue(e){if(W.permission=e,Kle(e),Hh({permissionMode:e}),e==="auto"||e==="yolo"){const t=W.activeSessionId;if(t){const n=[...W.approvalsBySession[t]??[]];for(const s of n)Jv(s.approvalId,{decision:"approved",scope:e==="yolo"?"session":void 0})}}}function mue(e){const t=[...W.warnings];t.splice(e,1),W.warnings=t}async function gue(e,t){try{await ot().updateSession(e,{title:t}),W.sessions=W.sessions.map(s=>s.id===e?{...s,title:t}:s)}catch(n){St("renameSession",n,{sessionId:e})}}function vue(e,t){W.workspaces=W.workspaces.map(n=>n.id===e?{...n,name:t}:n)}async function yue(e){const t=W.workspaces.find(i=>i.id===e)?.root??_r.value.find(i=>i.id===e)?.root??e,n=W.activeSessionId?W.sessions.find(i=>i.id===W.activeSessionId):void 0,s=W.activeWorkspaceId===e||W.activeWorkspaceId===t,o=!!(n&&(n.cwd===t||n.workspaceId===e||Tr(n)===e));t&&!W.hiddenWorkspaceRoots.includes(t)&&(W.hiddenWorkspaceRoots=[...W.hiddenWorkspaceRoots,t],zv(W.hiddenWorkspaceRoots));try{await ot().deleteWorkspace(e)}catch{}if(W.workspaces=W.workspaces.filter(i=>i.id!==e&&i.root!==t),s||o){const i=_r.value[0]?.id??null;if(W.activeWorkspaceId=i,i)Vv(i);else try{uu(Dh)}catch{}}(s||o)&&(W.activeSessionId=void 0,W.sessionLoading=!1,ku(),Mr(void 0,"replace"))}async function kue(e){try{await ot().archiveSession(e),W.sessions=W.sessions.filter(o=>o.id!==e),Jae(e);const{[e]:n,...s}=W.sideChatUserMessageIdsBySession;if(W.sideChatUserMessageIdsBySession=s,W.activeSessionId===e){const o=W.sessions[0];o?await Fs(o.id,{urlMode:"replace"}):(W.activeSessionId=void 0,Mr(void 0,"replace"))}}catch(t){St("archiveSession",t,{sessionId:e})}}async function Yh(){try{const e=ot();Bh.value=await e.listModels(),Kv(W.thinking)}catch(e){St("loadModels",e)}}async function bue(){try{const e=await ot().refreshOAuthProviderModels();for(const t of e.failed)St("refreshOAuthProviderModels",new Error(t.reason),{message:t.provider})}catch{}}async function e0(){try{const e=ot();Vf.value=await e.listProviders()}catch(e){St("loadProviders",e)}}async function _ue(e){const t=W.activeSessionId,n=FT(v3(e),W.thinking),s=W.thinking;if(!t){tu.value=e,Kv(n);return}const o=W.sessions.find(i=>i.id===t)?.model;W.sessions=W.sessions.map(i=>i.id===t?{...i,model:e}:i),n!==s&&(W.thinking=n,b1(n));try{await ot().updateSession(t,{model:e,thinking:n!==s?n:void 0})}catch(i){W.sessions=W.sessions.map(r=>r.id===t?{...r,model:o??r.model}:r),n!==s&&(W.thinking=s,b1(s)),St("setModel",i,{sessionId:t});return}await Fh(t)}function wue(e){const t=new Set(jd.value);t.has(e)?t.delete(e):t.add(e),jd.value=Array.from(t),nae(jd.value)}async function Sue(e,t){const n=W.activeSessionId;if(!n)return;const s=yu.value==="idle"&&!ti.has(n),o=`msg_skill_opt_${Date.now().toString(36)}`;if(s){ti.add(n),W.sendingBySession={...W.sendingBySession,[n]:!0};const i={id:o,sessionId:n,role:"user",content:[{type:"text",text:`/${e}${t?` ${t}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:e,skillArgs:t}}};W.messagesBySession={...W.messagesBySession,[n]:[...W.messagesBySession[n]??[],i]}}try{await ot().activateSkill(n,e,t)}catch(i){if(s){ti.delete(n),W.sendingBySession={...W.sendingBySession,[n]:!1};const r=W.messagesBySession[n]??[];W.messagesBySession={...W.messagesBySession,[n]:r.filter(l=>l.id!==o)}}St("activateSkill",i,{sessionId:n})}}async function Cue(e){try{await ot().addProvider(e),await Promise.all([e0(),Yh()])}catch(t){St("addProvider",t)}}async function xue(e){try{await ot().deleteProvider(e),await Promise.all([e0(),Yh()])}catch(t){St("deleteProvider",t)}}async function Tue(e){try{const n=await ot().refreshProvider(e);Vf.value=Vf.value.map(s=>s.id===e?n:s)}catch(t){St("refreshProvider",t)}}async function Mue(){try{return await ot().startOAuthLogin()}catch{return null}}async function Aue(){try{return await ot().pollOAuthLogin()}catch{return null}}async function Eue(){try{await ot().cancelOAuthLogin()}catch{}}async function $ue(){try{await ot().logout(),await Qv(),await I3()}catch(e){St("logout",e)}}function Iue(e){const t=W.activeSessionId;t&&ot().compactSession(t,e).catch(n=>{St("compact",n,{sessionId:t})})}async function Nue(e){const t=e??W.activeSessionId;if(t)try{const n=await ot().forkSession(t);W.sessions=[n,...W.sessions.filter(s=>s.id!==n.id)],await Fs(n.id)}catch(n){St("fork",n,{sessionId:t})}}async function Lue(e=1){const t=W.activeSessionId;if(!t)return null;const n=(()=>{const s=W.messagesBySession[t]??[];for(let o=s.length-1;o>=0;o--){const i=s[o];if(i.role==="user"&&!(i.metadata?.origin&&i.metadata.origin.kind!=="user"))return i.content.filter(r=>r.type==="text").map(r=>r.text).join(`
|
|
268
|
+
`)}return null})();try{return await ot().undoSession(t,e),await Yv(t),n}catch(s){return St("undo",s,{sessionId:t}),null}}function Oue(e){const t=W.activeSessionId;if(!t)return;const n=W.queuedBySession[t]??[];if(e<0||e>=n.length)return;const s=[...n];s.splice(e,1),W.queuedBySession={...W.queuedBySession,[t]:s}}async function Rue(e){const t=W.activeSessionId;if(!t)return[];try{return(await ot().listDirectory(t,{path:e,includeGitStatus:!0})).items}catch{return[]}}async function Pue(e){const t=W.activeSessionId;if(!t)return null;try{const s=await ot().readFile(t,{path:e});return{path:s.path,content:s.content,encoding:s.encoding,mime:s.mime,languageId:s.languageId,isBinary:s.isBinary,size:s.size,lineCount:s.lineCount}}catch{return null}}const Due=10485760;function Bue(e){const t=W.activeSessionId;return t?ot().getFileDownloadUrl(t,e):null}async function Fue(e,t){const n=W.activeSessionId;if(!n)return!1;try{return await ot().openFile(n,{path:e,line:t}),!0}catch(s){return St("openFile",s,{sessionId:n}),!1}}async function Hue(e){const t=W.activeSessionId;if(!t)return;const n=M3.value.cwd||".";try{await ot().openInApp(t,e,n)}catch(s){St("openInApp",s,{sessionId:t})}}async function Wue(e){const t=W.activeSessionId;if(!t)return!1;try{return await ot().revealFile(t,{path:e}),!0}catch(n){return St("revealFile",n,{sessionId:t}),!1}}async function Uue(e){if(/^(https?:|data:|blob:)/i.test(e))return e;const t=W.activeSessionId;if(!t)return e;let n=e;if(n.startsWith("/")){const s=W.sessions.find(o=>o.id===t)?.cwd;if(s&&(n===s||n.startsWith(s.endsWith("/")?s:`${s}/`))){if(n=n.slice(s.length).replace(/^\//,""),!n)return e}else return e}try{const o=await ot().readFile(t,{path:n,length:Due});return!o.isBinary||o.encoding!=="base64"||o.truncated?e:`data:${o.mime};base64,${o.content}`}catch{return e}}async function que(e){const t=W.activeSessionId;if(!t)return[];try{return(await ot().searchFiles(t,{query:e,limit:20})).items.map(o=>({path:o.path,name:o.name}))}catch{return[]}}function jue(){return Nae(),{workspace:Bae,sessions:Fae,activeSessionId:Hae,workspacesView:Vh,visibleWorkspace:$ce,activeWorkspaceId:A3,sessionsForView:Ice,workspaceGroups:Nce,attentionBySession:E3,pendingBySession:Lce,attentionByWorkspace:Rce,unreadBySession:Oce,recentRoots:Pce,turns:qae,tasks:ece,todos:tce,goal:zl,swarms:T3,activationBadges:mce,compaction:nce,status:M3,sessionCost:Cce,fileDiff:Sce,selectedDiffPath:Yl,fileDiffLoading:Kf,changes:_ce,gitInfo:Yf,gitDiffStats:wce,activePullRequest:bce,changesByPath:Ece,pendingApprovals:kce,recentCwds:Dce,availableOpenInApps:Bce,connection:sce,loading:oce,sessionLoading:ice,loadingMoreMessages:rce,hasMoreMessages:lce,loadMoreMessagesError:ace,serverVersion:cce,initialized:$3,permission:uce,thinking:dce,planMode:fce,swarmMode:hce,goalMode:pce,queued:gce,warnings:vce,questions:yce,activity:yu,isSending:Uae,fastMoon:Ks.fastMoon,models:Bh,starredModelIds:jd,providers:Vf,theme:Ks.theme,setTheme:Ks.setTheme,toggleTheme:Ks.toggleTheme,uiFontSize:Ks.uiFontSize,setUiFontSize:Ks.setUiFontSize,betaToc:k3,setBetaToc:dae,colorScheme:Ks.colorScheme,setColorScheme:Ks.setColorScheme,accent:Ks.accent,setAccent:Ks.setAccent,notifyOnComplete:qd.notifyOnComplete,notifyPermission:qd.notifyPermission,setNotifyOnComplete:qd.setNotifyOnComplete,onboarded:b3,setOnboarded:hae,load:I3,selectSession:Fs,createSession:tue,loadOlderMessages:Sae,loadWorkspaces:N3,selectWorkspace:ml,openWorkspace:zce,openWorkspaceDraft:C1,createSessionInWorkspace:Gce,startSessionAndSendPrompt:Yce,addWorkspaceByPath:Xce,browseFs:Zce,getFsHome:Qce,sendPrompt:O3,steerPrompt:nue,sideChatVisible:zae,sideChatSessionId:jae,sideChatTurns:Kae,sideChatRunning:C3,sideChatSending:Vae,openSideChat:Zae,closeSideChat:Qae,sendSideChatPrompt:x3,uploadImage:sue,abortCurrentPrompt:oue,respondApproval:Jv,respondQuestion:iue,dismissQuestion:rue,cancelTask:lue,setPermission:pue,setThinking:aue,setPlanMode:P3,togglePlanMode:cue,setSwarmMode:D3,toggleSwarmMode:uue,setGoalMode:B3,toggleGoalMode:due,createGoal:fue,controlGoal:hue,enqueue:R3,dismissWarning:mue,renameSession:gue,renameWorkspace:vue,deleteWorkspace:yue,archiveSession:kue,compact:Iue,forkSession:Nue,undo:Lue,unqueue:Oue,searchFiles:que,loadGitStatus:Zv,loadFileDiff:Hce,clearFileDiff:ku,listDir:Rue,readFileContent:Pue,getFileDownloadUrl:Bue,openWorkspaceFile:Fue,openInApp:Hue,revealWorkspaceFile:Wue,resolveImageUrl:Uue,refreshOAuthProviderModels:bue,loadModels:Yh,loadProviders:e0,skills:Wae,activateSkill:Sue,setModel:_ue,toggleStarModel:wue,addProvider:Cue,deleteProvider:xue,refreshProvider:Tue,authReady:xce,defaultModel:Tce,managedProviderStatus:Mce,config:Ace,updateConfig:Uce,checkAuth:Qv,startOAuthLogin:Mue,pollOAuthLogin:Aue,cancelOAuthLogin:Eue,logout:$ue}}const zue=640,Vue=`(max-width: ${zue}px)`;function Kue(){const e=te(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Vue);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),qt(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),qt(()=>t.removeListener(n))),e}const Gue={class:"app-shell"},Yue={key:0,class:"auth-page"},Xue={class:"auth-page-inner"},Zue={class:"auth-page-copy"},Que={key:0,class:"sidebar-rail"},Jue=["title","aria-label"],ede={key:3,class:"coming-soon"},tde={class:"cs-text"},nde=["aria-label","aria-hidden"],og="/login",t2=270,sde=170,ode=420,ide=36,rde="kimi-web.file-preview-width",Gr=320,lde=Xe({__name:"App",setup(e){const t=jue();cn("resolveImage",t.resolveImageUrl);const{t:n}=_t(),s=ii(),o=Kue(),i=te(!1),r=te(!1),l=j(()=>{const De=t.activeSessionId.value;return t.sessions.value.find(ae=>ae.id===De)?.title??""}),a=j(()=>t.visibleWorkspace.value?.sessionCount??0),c=j(()=>t.activity.value!=="idle"),u=j(()=>t.authReady.value),d=j(()=>t.initialized.value&&!u.value),p=te(null),m=te(null);let f=null;function v(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function w(De){typeof window>"u"||window.history.replaceState(window.history.state,"",De)}ze(d,De=>{if(!(typeof window>"u")){if(De){window.location.pathname!==og&&(p.value=v(),w(og));return}window.location.pathname===og&&(w(p.value??"/"),p.value=null)}},{immediate:!0});function b(){const De=m.value;De&&(De.classList.remove("blink-now"),De.getBoundingClientRect(),De.classList.add("blink-now"),f!==null&&clearTimeout(f),f=setTimeout(()=>{f=null,De.classList.remove("blink-now")},300))}const _=["◐","◓","◑","◒"],g=te(0);let y=null;function k(){y===null&&(g.value=0,y=setInterval(()=>{g.value=(g.value+1)%_.length},250))}function I(){y!==null&&(clearInterval(y),y=null),g.value=0}ze(c,De=>{De?k():I()},{immediate:!0});const E=j(()=>{const De=c.value?`${_[g.value]} `:"";return d.value?`${De}${n("app.authPageTitle")} - Kimi Code Web`:`${De}Kimi Code Web`});TA(()=>{typeof document<"u"&&(document.title=E.value)});function S(De){return De==="off"?"high":"off"}const T=te(!t.onboarded.value);function $(){t.setOnboarded(!0),T.value=!1}function L(){T.value=!0}Jt(()=>{t.load(),oe(),document.addEventListener("keydown",O,!0)}),qt(()=>{document.removeEventListener("keydown",O,!0),I(),f!==null&&clearTimeout(f)});function R(){return be.value==="thinking"&&je.value?(nt(),!0):be.value==="compaction"&&xt.value?(Ht(),!0):be.value==="agent"&&Ke.value?(Hs(),!0):be.value==="file"?(xe(),!0):be.value==="diff"?(Us(),!0):be.value==="btw"?($o(),!0):!1}function O(De){De.key==="Escape"&&(Ee.value||R()&&(De.stopPropagation(),De.preventDefault()))}const B=jt.sidebarWidth,F=jt.sidebarCollapsed,q=te(t2),G=te(!1),K=j(()=>G.value?ide:q.value);function oe(){try{G.value=Sn(F)==="true"}catch{G.value=!1}}function le(){try{wn(F,String(G.value))}catch{}}function pe(){G.value=!G.value,le()}const be=te(null);function Be(){return typeof window>"u"?Gr*2:Math.max(0,window.innerWidth-K.value)}function He(De){const ae=Math.max(Gr,Be()-Gr);return Math.min(ae,Math.max(Gr,Math.round(De)))}function Ne(){return He(Be()/2)}const me=j(()=>Ne()),_e=j(()=>Math.max(Gr,Be()-Gr)),Ce=te(me.value),de=te(null),z=te(null),Z=te(!1),fe=te(null),P=te(null);let X=0;const ne=j(()=>{const De=P.value;return De?t.getFileDownloadUrl(De):null}),se=j(()=>de.value!==null);function ce(De){return De.length>1?De.replace(/\/+$/,""):De}function H(De){const ae=[];for(const Te of De.split(/[\\/]+/))if(!(!Te||Te===".")){if(Te===".."){ae.pop();continue}ae.push(Te)}return ae.join("/")}function U(De){const ae=De.trim();if(!ae)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(ae))return{error:n("filePreview.errors.unsupportedPath")};if(ae.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const Te=ce(t.status.value.cwd);if(ae.startsWith("/")){if(!Te||ae!==Te&&!ae.startsWith(`${Te}/`))return{error:n("filePreview.errors.outsideWorkspace")};const hs=ae===Te?"":ae.slice(Te.length+1);if(hs.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const ps=H(hs);return ps?{path:ps}:{error:n("filePreview.errors.isDirectory")}}if(ae.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const Et=H(ae);return Et?{path:Et}:{error:n("filePreview.errors.emptyPath")}}async function Q(De){const ae=++X;be.value="file",z.value=null,fe.value=null,Z.value=!0,de.value=De,P.value=null;const Te=U(De.path);if("error"in Te){Z.value=!1,fe.value=Te.error;return}P.value=Te.path;try{const Et=await t.readFileContent(Te.path);if(ae!==X)return;Et?z.value={...Et,path:Et.path||Te.path}:z.value={path:Te.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(Et){if(ae!==X)return;fe.value=Et instanceof Error?Et.message:n("filePreview.errors.loadFailed")}finally{ae===X&&(Z.value=!1)}}function ue(De){return/^data:([^;,]+)/i.exec(De)?.[1]}function ge(De){De.kind==="image"&&(be.value="file",de.value=null,P.value=null,fe.value=null,Z.value=!1,z.value={path:De.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:De.mimeType??ue(De.url)??"image/*",sourceUrl:De.url,isBinary:!0,size:De.bytes??0})}function xe(){de.value=null,P.value=null,z.value=null,fe.value=null,Z.value=!1,be.value==="file"&&(be.value=null)}const ie=te(null),we=j(()=>{const De=ie.value;if(!De)return null;const Te=t.turns.value.find(Et=>Et.id===De.turnId)?.blocks?.[De.blockIndex];return Te?.kind==="thinking"?Te.thinking:null}),je=j(()=>we.value!==null);function Je(De){const ae=ie.value;if(ae&&ae.turnId===De.turnId&&ae.blockIndex===De.blockIndex){ie.value=null,be.value==="thinking"&&(be.value=null);return}be.value="thinking",ie.value=De}function nt(){ie.value=null,be.value==="thinking"&&(be.value=null)}const Ve=te(null),ft=j(()=>{const De=Ve.value;if(!De)return null;const ae=t.turns.value.find(Te=>Te.id===De.turnId);return ae?.role==="compaction"&&ae.text?ae.text:null}),xt=j(()=>ft.value!==null);function Zt(De){if(Ve.value?.turnId===De.turnId){Ve.value=null,be.value==="compaction"&&(be.value=null);return}be.value="compaction",Ve.value=De}function Ht(){Ve.value=null,be.value==="compaction"&&(be.value=null)}const Nn=te(null),xn=j(()=>{const De=Nn.value;if(!De)return null;const Te=t.turns.value.find(Et=>Et.id===De.turnId)?.blocks?.[De.blockIndex];return Te?Te.kind==="agent"?Te.member.id===De.memberId?Te.member:null:Te.kind==="agentGroup"?Te.members.find(Et=>Et.id===De.memberId)??null:null:null}),Ke=j(()=>xn.value!==null);function en(De){const ae=Nn.value;if(ae&&ae.turnId===De.turnId&&ae.memberId===De.memberId){Nn.value=null,be.value==="agent"&&(be.value=null);return}be.value="agent",Nn.value=De}function Hs(){Nn.value=null,be.value==="agent"&&(be.value=null)}const qn=te("list"),Bn=te(null);function Ws(){be.value="diff",qn.value="list",Bn.value=null,t.loadGitStatus(t.activeSessionId.value)}function Us(){be.value==="diff"&&(be.value=null),qn.value="list",Bn.value=null,t.clearFileDiff()}async function qs(De){qn.value="detail",Bn.value=De,await t.loadFileDiff(De)}async function Ho(De){await t.openSideChat(De),be.value="btw"}function $o(){t.closeSideChat(),be.value==="btw"&&(be.value=null)}function ro(){be.value==="btw"&&(be.value=null)}const Ln=j(()=>t.sideChatVisible.value),on=j(()=>be.value!==null&&(be.value!=="thinking"||je.value)&&(be.value!=="compaction"||xt.value)&&(be.value!=="agent"||Ke.value)&&(be.value!=="btw"||Ln.value)),Zn=te(!1);function wt(){const De=z.value?.path??de.value?.path;De&&t.openWorkspaceFile(De,de.value?.line)}function as(){const De=z.value?.path??de.value?.path;De&&t.revealWorkspaceFile(De)}ze(t.activeSessionId,()=>{xe(),nt(),Ht(),Hs(),Us(),ro()});const Vt=te(null),lo=te([]),ri=j(()=>lo.value.length>1);function Wo(De){lo.value=De}const cs=te(!1),xs=te(!1),Ts=te(!1),gt=te(!1),Ms=te(!1),pn=te(!1),us=te(!1),tn=te(!1),ln=te(null),Ee=j(()=>cs.value||xs.value||Ts.value||gt.value||Ms.value||pn.value||us.value||tn.value||T.value||i.value||r.value),ve=te(!1),ee=te(!1),Ae=te(!1),Fe=te(!1),tt=te(!1);async function yt(){ve.value=!0,ee.value=!1,cs.value=!0;try{await t.refreshOAuthProviderModels(),await t.loadModels()}catch{ee.value=!0}finally{ve.value=!1}}async function Pt(){Ae.value=!0,Fe.value=!1,xs.value=!0;try{await t.loadProviders()}catch{Fe.value=!0}finally{Ae.value=!1}}function mn(){Ts.value=!0}async function Qn(De){cs.value=!1,await t.setModel(De)}async function gn(De){await t.addProvider(De)}async function ao(De){await t.deleteProvider(De)}async function Ri(De){await t.refreshProvider(De)}async function co(De){tt.value=!0;try{await t.updateConfig(De)&&await t.checkAuth()}finally{tt.value=!1}}async function Ar(){return t.startOAuthLogin()}async function ds(){return t.pollOAuthLogin()}async function bu(){return t.cancelOAuthLogin()}async function Xh(){Ts.value=!1,await t.checkAuth(),await t.load()}async function Er(De){await t.undo(1),await ut(),Vt.value?.loadComposerForEdit(De)}function fs(De){if(De==="/compact"||De.startsWith("/compact ")){t.compact(De.slice(8).trim()||void 0);return}if(De==="/swarm"||De.startsWith("/swarm ")){const ae=De.slice(6).trim();ae==="on"?t.setSwarmMode(!0):ae==="off"?t.setSwarmMode(!1):ae?(t.setSwarmMode(!0),t.sendPrompt(ae)):t.toggleSwarmMode();return}if(De==="/goal"||De.startsWith("/goal ")){const ae=De.slice(5).trim();ae==="pause"||ae==="resume"||ae==="cancel"?t.controlGoal(ae):ae?t.createGoal(ae):t.toggleGoalMode();return}if(De==="/btw"||De.startsWith("/btw ")){const ae=De.slice(4).trim();!ae&&t.sideChatVisible.value?t.closeSideChat():Ho(ae||void 0);return}switch(De){case"/new":case"/clear":gt.value=!0;break;case"/sessions":Ms.value=!0;break;case"/fork":t.forkSession();break;case"/undo":t.undo();break;case"/permission":{const ae=t.permission.value,Te=ae==="manual"?"auto":ae==="auto"?"yolo":"manual";t.setPermission(Te);break}case"/plan":t.togglePlanMode();break;case"/auto":t.setPermission("auto");break;case"/yolo":t.setPermission("yolo");break;case"/thinking":t.setThinking(S(t.thinking.value));break;case"/help":t.dismissWarning(-1);break;case"/status":us.value=!0;break;case"/model":yt();break;case"/provider":Pt();break;case"/login":mn();break;default:{const ae=De.indexOf(" "),Te=(ae===-1?De:De.slice(0,ae)).slice(1),Et=ae===-1?void 0:De.slice(ae+1).trim()||void 0;Te&&t.activateSkill(Te,Et);break}}}function li(De){t.unqueue(De)}function Aa(De){t.unqueue(De)}async function $r(De){const ae=t.activeWorkspaceId.value;if(!t.activeSessionId.value&&ae){await t.startSessionAndSendPrompt(ae,De.text,De.attachments);return}if(!t.activeSessionId.value&&!ae){ln.value=De,pn.value=!0;return}t.sendPrompt(De.text,De.attachments)}async function Pi(De){pn.value=!1,await t.addWorkspaceByPath(De);const ae=ln.value;ln.value=null;const Te=t.activeWorkspaceId.value;ae&&Te&&await t.startSessionAndSendPrompt(Te,ae.text,ae.attachments)}function Zh(){ln.value=null,pn.value=!1}function _u(){const De=t.activeWorkspaceId.value;De?t.openWorkspaceDraft(De):gt.value=!0}function Ea(De){t.openWorkspaceDraft(De)}function gl(De){De&&window.open(De,"_blank","noopener")}return(De,ae)=>(C(),A("div",Gue,[d.value?(C(),A("section",Yue,[h("div",Xue,[(C(),A("svg",{ref_key:"authLogoRef",ref:m,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:ae[0]||(ae[0]=Ge(()=>{},["prevent"])),onClick:b},[...ae[90]||(ae[90]=[mr('<defs data-v-20e408ee><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-20e408ee><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-20e408ee></rect><g class="ch-eyes" fill="#000" data-v-20e408ee><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-20e408ee></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-20e408ee></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-20e408ee></rect>',2)])],544)),h("div",Zue,[h("h1",null,N(M(n)("app.authPageTitle")),1),h("p",null,N(M(n)("app.authPageMessage")),1)]),h("button",{type:"button",class:"auth-page-btn",onClick:mn},[ae[91]||(ae[91]=h("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M6 3h5a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6"}),h("path",{d:"M9 8H2"}),h("path",{d:"M5 5l3 3-3 3"})],-1)),h("span",null,N(M(n)("app.authPageLogin")),1)])])])):(C(),A("div",{key:1,class:$e(["app",{mobile:M(o),"sidebar-collapsed":G.value&&!M(o)}]),style:It({"--side-w":K.value+"px","--preview-w":Ce.value+"px"})},[M(o)?(C(),qe(hse,{key:1,workspace:M(t).visibleWorkspace.value,"session-title":l.value,running:c.value,branch:M(t).status.value.branch,"session-count":a.value,onOpenSwitcher:ae[12]||(ae[12]=Te=>i.value=!0),onOpenSettings:ae[13]||(ae[13]=Te=>r.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(C(),A(Ie,{key:0},[At(pt(dI,{"col-width":q.value,"active-workspace":M(t).visibleWorkspace.value,"active-workspace-id":M(t).activeWorkspaceId.value,sessions:M(t).sessionsForView.value,groups:M(t).workspaceGroups.value,"active-id":M(t).activeSessionId.value,"attention-by-session":M(t).attentionBySession.value,"pending-by-session":M(t).pendingBySession.value,"unread-by-session":M(t).unreadBySession.value,onSelect:ae[1]||(ae[1]=Te=>M(t).selectSession(Te)),onCreate:_u,onCreateInWorkspace:ae[2]||(ae[2]=Te=>Ea(Te)),onSelectWorkspace:ae[3]||(ae[3]=Te=>M(t).openWorkspace(Te)),onAddWorkspace:ae[4]||(ae[4]=Te=>pn.value=!0),onRename:ae[5]||(ae[5]=(Te,Et)=>M(t).renameSession(Te,Et)),onArchive:ae[6]||(ae[6]=Te=>M(t).archiveSession(Te)),onFork:ae[7]||(ae[7]=Te=>M(t).forkSession(Te)),onRenameWorkspace:ae[8]||(ae[8]=(Te,Et)=>M(t).renameWorkspace(Te,Et)),onDeleteWorkspace:ae[9]||(ae[9]=Te=>M(t).deleteWorkspace(Te)),onSelectWorkspaces:Wo,onOpenSettings:ae[10]||(ae[10]=Te=>tn.value=!0),onCollapse:pe},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session"]),[[Ro,!G.value]]),At(pt(Bk,{"storage-key":M(B),"default-width":t2,min:sde,max:ode,"onUpdate:width":ae[11]||(ae[11]=Te=>q.value=Te)},null,8,["storage-key"]),[[Ro,!G.value]]),G.value?(C(),A("div",Que,[h("button",{type:"button",class:"sidebar-expand-btn",title:M(n)("sidebar.expandSidebar"),"aria-label":M(n)("sidebar.expandSidebar"),onClick:pe},[...ae[92]||(ae[92]=[mr('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-20e408ee><path d="M4 6h9" data-v-20e408ee></path><path d="M4 12h9" data-v-20e408ee></path><path d="M4 18h9" data-v-20e408ee></path><path d="M17 9l3 3-3 3" data-v-20e408ee></path></svg>',1)])],8,Jue)])):re("",!0)],64)),ri.value?(C(),A("div",ede,[ae[93]||(ae[93]=h("span",{class:"cs-icon"},"🚧",-1)),h("span",tde,N(M(n)("app.comingSoon")),1)])):(C(),qe(fG,{key:2,ref_key:"conversationPaneRef",ref:Vt,mobile:M(o),modern:M(t).theme.value==="modern"||M(t).theme.value==="kimi",turns:M(t).turns.value,"session-id":M(t).activeSessionId.value,approvals:M(t).pendingApprovals.value,changes:M(t).changes.value,"git-info":M(t).gitInfo.value,tasks:M(t).tasks.value,todos:M(t).todos.value,goal:M(t).goal.value,swarms:M(t).swarms.value,"activation-badges":M(t).activationBadges.value,status:M(t).status.value,thinking:M(t).thinking.value,"plan-mode":M(t).planMode.value,"swarm-mode":M(t).swarmMode.value,"goal-mode":M(t).goalMode.value,models:M(t).models.value,"starred-ids":M(t).starredModelIds.value,skills:M(t).skills.value,questions:M(t).questions.value,running:c.value,queued:M(t).queued.value,"search-files":M(t).searchFiles,"upload-image":M(t).uploadImage,sending:M(t).isSending.value,"fast-moon":M(t).fastMoon.value,"file-reload-key":M(t).activeSessionId.value,"session-loading":M(t).sessionLoading.value,compaction:M(t).compaction.value,"has-more-messages":M(t).hasMoreMessages.value,"loading-more":M(t).loadingMoreMessages.value,"loading-more-error":M(t).loadMoreMessagesError.value,"load-older-messages":M(t).loadOlderMessages,"workspace-name":M(t).visibleWorkspace.value?.name,"workspace-root":M(t).visibleWorkspace.value?.root??M(t).status.value.cwd,"git-diff-stats":M(t).gitDiffStats.value,workspaces:M(t).workspacesView.value,"active-workspace-id":M(t).activeWorkspaceId.value,"session-title":l.value,pr:M(t).activePullRequest.value,"beta-toc":M(t).betaToc.value,onOpenChanges:ae[14]||(ae[14]=Te=>Ws()),onSelectWorkspace:ae[15]||(ae[15]=Te=>Ea(Te)),onAddWorkspace:ae[16]||(ae[16]=Te=>pn.value=!0),onOpenPr:gl,onSubmit:ae[17]||(ae[17]=Te=>$r(Te)),onSteer:ae[18]||(ae[18]=Te=>M(t).steerPrompt(Te.text,Te.attachments)),onApproval:ae[19]||(ae[19]=(Te,Et)=>M(t).respondApproval(Te,Et)),onCancelTask:ae[20]||(ae[20]=Te=>M(t).cancelTask(Te)),onAnswer:ae[21]||(ae[21]=(Te,Et)=>M(t).respondQuestion(Te,Et)),onDismiss:ae[22]||(ae[22]=Te=>M(t).dismissQuestion(Te)),onCommand:fs,onInterrupt:ae[23]||(ae[23]=Te=>M(t).abortCurrentPrompt()),onUnqueue:li,onEditQueued:Aa,onSetPermission:ae[24]||(ae[24]=Te=>M(t).setPermission(Te)),onSetThinking:ae[25]||(ae[25]=Te=>M(t).setThinking(Te)),onTogglePlan:ae[26]||(ae[26]=Te=>M(t).togglePlanMode()),onToggleSwarm:ae[27]||(ae[27]=Te=>M(t).toggleSwarmMode()),onToggleGoal:ae[28]||(ae[28]=Te=>M(t).toggleGoalMode()),onCreateGoal:ae[29]||(ae[29]=Te=>M(t).createGoal(Te)),onControlGoal:ae[30]||(ae[30]=Te=>M(t).controlGoal(Te)),onRefreshGitStatus:ae[31]||(ae[31]=Te=>M(t).activeSessionId.value&&M(t).loadGitStatus(M(t).activeSessionId.value)),onRenameSession:ae[32]||(ae[32]=(Te,Et)=>M(t).renameSession(Te,Et)),onForkSession:ae[33]||(ae[33]=Te=>M(t).forkSession(Te)),onArchiveSession:ae[34]||(ae[34]=Te=>M(t).archiveSession(Te)),onCompact:ae[35]||(ae[35]=Te=>M(t).compact()),onPickModel:ae[36]||(ae[36]=Te=>yt()),onSelectModel:ae[37]||(ae[37]=Te=>M(t).setModel(Te)),onOpenFile:ae[38]||(ae[38]=Te=>Q(Te)),onOpenMedia:ae[39]||(ae[39]=Te=>ge(Te)),onOpenThinking:ae[40]||(ae[40]=Te=>Je(Te)),onOpenCompaction:ae[41]||(ae[41]=Te=>Zt(Te)),onOpenAgent:ae[42]||(ae[42]=Te=>en(Te)),onEditMessage:Er},null,8,["mobile","modern","turns","session-id","approvals","changes","git-info","tasks","todos","goal","swarms","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","running","queued","search-files","upload-image","sending","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","beta-toc"])),on.value&&!M(o)?(C(),qe(Bk,{key:4,"storage-key":rde,"default-width":me.value,min:Gr,max:_e.value,reverse:"","aria-label":M(n)("layout.resizePreviewAria"),"onUpdate:width":ae[43]||(ae[43]=Te=>Ce.value=Te),"onUpdate:dragging":ae[44]||(ae[44]=Te=>Zn.value=Te)},null,8,["default-width","max","aria-label"])):re("",!0),!M(o)||on.value?(C(),A("aside",{key:5,class:$e(["global-preview",{open:on.value,mobile:M(o),"no-anim":Zn.value}]),role:"complementary","aria-label":M(n)("layout.detailPanelAria"),"aria-hidden":!on.value},[be.value==="thinking"&&je.value?(C(),qe(Tw,{key:0,text:we.value??"",onClose:nt},null,8,["text"])):be.value==="compaction"&&xt.value?(C(),qe(Tw,{key:1,text:ft.value??"",subtitle:M(n)("conversation.summaryTitle"),onClose:Ht},null,8,["text","subtitle"])):be.value==="agent"&&xn.value?(C(),qe(jY,{key:2,member:xn.value,onClose:Hs},null,8,["member"])):be.value==="btw"&&Ln.value?(C(),qe(nX,{key:3,turns:M(t).sideChatTurns.value,running:M(t).sideChatRunning.value,sending:M(t).sideChatSending.value,onSend:ae[45]||(ae[45]=Te=>M(t).sendSideChatPrompt(Te)),onClose:$o},null,8,["turns","running","sending"])):be.value==="diff"?(C(),qe(KX,{key:4,mode:qn.value,changes:M(t).changes.value,"git-info":M(t).gitInfo.value,"file-diff":M(t).fileDiff.value,"selected-diff-path":M(t).selectedDiffPath.value,"file-diff-loading":M(t).fileDiffLoading.value,closable:"",onOpen:qs,onBack:ae[46]||(ae[46]=Te=>{qn.value="list",Bn.value=null,M(t).clearFileDiff()}),onClose:Us},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading"])):be.value==="file"?(C(),qe(SY,{key:5,file:z.value,loading:Z.value,error:fe.value,line:de.value?.line,"download-url":ne.value,closable:"","external-actions":se.value,"open-file":Q,onClose:xe,onOpenExternal:wt,onReveal:as},null,8,["file","loading","error","line","download-url","external-actions"])):re("",!0)],10,nde)):re("",!0),cs.value?(C(),qe(bZ,{key:6,models:M(t).models.value,current:M(t).status.value.modelId,"starred-ids":M(t).starredModelIds.value,loading:ve.value,unavailable:ee.value,onSelect:ae[47]||(ae[47]=Te=>Qn(Te)),onToggleStar:ae[48]||(ae[48]=Te=>M(t).toggleStarModel(Te)),onClose:ae[49]||(ae[49]=Te=>cs.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):re("",!0),tn.value?(C(),qe(Ete,{key:7,theme:M(t).theme.value,"color-scheme":M(t).colorScheme.value,"ui-font-size":M(t).uiFontSize.value,"auth-ready":M(t).authReady.value,"account-model":M(t).defaultModel.value,notify:M(t).notifyOnComplete.value,"notify-permission":M(t).notifyPermission.value,"beta-toc":M(t).betaToc.value,config:M(t).config.value,models:M(t).models.value,"config-saving":tt.value,"server-version":M(t).serverVersion.value,onSetTheme:ae[50]||(ae[50]=Te=>M(t).setTheme(Te)),onSetColorScheme:ae[51]||(ae[51]=Te=>M(t).setColorScheme(Te)),onSetUiFontSize:ae[52]||(ae[52]=Te=>M(t).setUiFontSize(Te)),onSetNotify:ae[53]||(ae[53]=Te=>M(t).setNotifyOnComplete(Te)),onSetBetaToc:ae[54]||(ae[54]=Te=>M(t).setBetaToc(Te)),onUpdateConfig:ae[55]||(ae[55]=Te=>co(Te)),onLogin:ae[56]||(ae[56]=()=>{tn.value=!1,mn()}),onLogout:M(t).logout,onOpenOnboarding:ae[57]||(ae[57]=()=>{tn.value=!1,L()}),onClose:ae[58]||(ae[58]=Te=>tn.value=!1)},null,8,["theme","color-scheme","ui-font-size","auth-ready","account-model","notify","notify-permission","beta-toc","config","models","config-saving","server-version","onLogout"])):re("",!0),xs.value?(C(),qe(cQ,{key:8,providers:M(t).providers.value,loading:Ae.value,unavailable:Fe.value,onAdd:ae[59]||(ae[59]=Te=>gn(Te)),onRefresh:ae[60]||(ae[60]=Te=>Ri(Te)),onDelete:ae[61]||(ae[61]=Te=>ao(Te)),onOpenLogin:ae[62]||(ae[62]=()=>{xs.value=!1,mn()}),onClose:ae[63]||(ae[63]=Te=>xs.value=!1)},null,8,["providers","loading","unavailable"])):re("",!0),gt.value?(C(),qe(cJ,{key:9,"recent-cwds":M(t).recentCwds.value,onCreate:ae[64]||(ae[64]=({cwd:Te,title:Et})=>{gt.value=!1,M(t).createSession(Te,{title:Et})}),onClose:ae[65]||(ae[65]=Te=>gt.value=!1)},null,8,["recent-cwds"])):re("",!0),Ms.value?(C(),qe(Gte,{key:10,sessions:M(t).sessions.value,"workspace-groups":M(t).workspaceGroups.value,"attention-by-session":M(t).attentionBySession.value,"active-id":M(t).activeSessionId.value,onSelect:ae[66]||(ae[66]=Te=>{M(t).selectSession(Te),Ms.value=!1}),onClose:ae[67]||(ae[67]=Te=>Ms.value=!1)},null,8,["sessions","workspace-groups","attention-by-session","active-id"])):re("",!0),us.value?(C(),qe(zne,{key:11,status:M(t).status.value,thinking:M(t).thinking.value,"plan-mode":M(t).planMode.value,"swarm-mode":M(t).swarmMode.value,"cost-usd":M(t).sessionCost.value,onClose:ae[68]||(ae[68]=Te=>us.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):re("",!0),pn.value?(C(),qe(Ene,{key:12,"browse-fs":M(t).browseFs,"get-fs-home":M(t).getFsHome,"default-path":M(t).visibleWorkspace.value?.root??M(t).status.value.cwd,onAdd:ae[69]||(ae[69]=Te=>Pi(Te)),onClose:Zh},null,8,["browse-fs","get-fs-home","default-path"])):re("",!0),pt(Ti,{name:"gload-fade"},{default:kn(()=>[M(t).initialized.value?re("",!0):(C(),qe(yie,{key:0}))]),_:1}),T.value&&!d.value?(C(),qe(hie,{key:13,theme:M(t).theme.value,onSetTheme:ae[70]||(ae[70]=Te=>M(t).setTheme(Te)),onComplete:$,onSkip:$},null,8,["theme"])):re("",!0),pt(sse,{warnings:M(t).warnings.value,onDismiss:M(t).dismissWarning},null,8,["warnings","onDismiss"]),M(s)?(C(),qe(Yie,{key:14})):re("",!0),M(o)?(C(),qe(jse,{key:15,modelValue:i.value,"onUpdate:modelValue":ae[71]||(ae[71]=Te=>i.value=Te),groups:M(t).workspaceGroups.value,"active-workspace-id":M(t).activeWorkspaceId.value,"active-id":M(t).activeSessionId.value,"attention-by-session":M(t).attentionBySession.value,"attention-by-workspace":M(t).attentionByWorkspace.value,onSelect:ae[72]||(ae[72]=Te=>M(t).selectSession(Te)),onCreate:_u,onCreateInWorkspace:ae[73]||(ae[73]=Te=>Ea(Te)),onAddWorkspace:ae[74]||(ae[74]=Te=>pn.value=!0),onRename:ae[75]||(ae[75]=(Te,Et)=>M(t).renameSession(Te,Et)),onArchive:ae[76]||(ae[76]=Te=>M(t).archiveSession(Te)),onDeleteWorkspace:ae[77]||(ae[77]=Te=>M(t).deleteWorkspace(Te))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):re("",!0),M(o)?(C(),qe(Voe,{key:16,modelValue:r.value,"onUpdate:modelValue":ae[78]||(ae[78]=Te=>r.value=Te),status:M(t).status.value,thinking:M(t).thinking.value,"plan-mode":M(t).planMode.value,"swarm-mode":M(t).swarmMode.value,theme:M(t).theme.value,"color-scheme":M(t).colorScheme.value,"ui-font-size":M(t).uiFontSize.value,"auth-ready":M(t).authReady.value,"beta-toc":M(t).betaToc.value,"server-version":M(t).serverVersion.value,onPickModel:ae[79]||(ae[79]=Te=>yt()),onSetThinking:ae[80]||(ae[80]=Te=>M(t).setThinking(Te)),onTogglePlan:ae[81]||(ae[81]=Te=>M(t).togglePlanMode()),onToggleSwarm:ae[82]||(ae[82]=Te=>M(t).toggleSwarmMode()),onSetPermission:ae[83]||(ae[83]=Te=>M(t).setPermission(Te)),onSetTheme:ae[84]||(ae[84]=Te=>M(t).setTheme(Te)),onSetColorScheme:ae[85]||(ae[85]=Te=>M(t).setColorScheme(Te)),onSetUiFontSize:ae[86]||(ae[86]=Te=>M(t).setUiFontSize(Te)),onSetBetaToc:ae[87]||(ae[87]=Te=>M(t).setBetaToc(Te)),onLogin:ae[88]||(ae[88]=()=>{r.value=!1,mn()}),onLogout:M(t).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","theme","color-scheme","ui-font-size","auth-ready","beta-toc","server-version","onLogout"])):re("",!0)],6)),Ts.value?(C(),qe(UQ,{key:2,"on-start-o-auth-login":Ar,"on-poll-o-auth-login":ds,"on-cancel-o-auth-login":bu,onSuccess:Xh,onClose:ae[89]||(ae[89]=Te=>Ts.value=!1)})):re("",!0)]))}}),ade=vt(lde,[["__scopeId","data-v-20e408ee"]]);NJ();ff(ade).use(Cn).mount("#app");export{qM as $,Pde as A,LA as B,Mn as C,ufe as D,a2 as E,Ie as F,mr as G,dt as H,pt as I,fA as J,Ode as K,ei as L,Xe as M,iE as N,Fde as O,Hde as P,qde as Q,Vd as R,sa as S,Mde as T,Wde as U,j1 as V,Bde as W,ffe as X,Ude as Y,ife as Z,ude as _,P2 as a,os as a$,ls as a0,M1 as a1,kde as a2,L1 as a3,E4 as a4,Ut as a5,_a as a6,xde as a7,gfe as a8,$de as a9,W2 as aA,jA as aB,XA as aC,Jt as aD,YA as aE,GA as aF,A1 as aG,KA as aH,qt as aI,R1 as aJ,vA as aK,C as aL,nE as aM,Sde as aN,cn as aO,x2 as aP,wde as aQ,Zd as aR,Ys as aS,Gd as aT,te as aU,Jde as aV,bE as aW,Ye as aX,ta as aY,QA as aZ,Rde as a_,Lde as aa,Nde as ab,Ide as ac,tfe as ad,vfe as ae,Nt as af,R4 as ag,ch as ah,ar as ai,Ii as aj,En as ak,efe as al,Zs as am,pr as an,ir as ao,Vde as ap,Kde as aq,Kt as ar,ut as as,H4 as at,$e as au,cde as av,It as aw,qA as ax,VA as ay,oo as az,_de as b,WB as b$,afe as b0,Fc as b1,sf as b2,rfe as b3,hr as b4,aA as b5,fde as b6,fl as b7,CA as b8,lfe as b9,bn as bA,Ro as bB,P4 as bC,sfe as bD,ze as bE,TA as bF,Tde as bG,MA as bH,Yde as bI,kn as bJ,jde as bK,At as bL,So as bM,nfe as bN,Ge as bO,Cde as bP,zt as bQ,Xs as bR,Cfe as bS,$F as bT,rT as bU,Tfe as bV,yB as bW,Ev as bX,xfe as bY,Kg as bZ,Mfe as b_,dde as ba,N as bb,xd as bc,Dde as bd,$t as be,gde as bf,mde as bg,pde as bh,Qde as bi,hde as bj,M as bk,au as bl,pfe as bm,dfe as bn,lE as bo,Ade as bp,Xde as bq,xA as br,hfe as bs,zde as bt,Ede as bu,R2 as bv,uf as bw,mE as bx,MS as by,df as bz,ofe as c,HB as c0,nT as c1,FB as c2,_fe as c3,pB as c4,bfe as c5,BB as c6,Efe as c7,CT as c8,Df as c9,_T as ca,$fe as cb,Afe as cc,Sfe as cd,ko as ce,kfe as cf,wfe as cg,ST as ch,bT as ci,AH as cj,yfe as ck,Zde as d,cr as e,vde as f,Ti as g,mfe as h,yde as i,bde as j,Ao as k,iu as l,Dn as m,th as n,Ni as o,cfe as p,j as q,ff as r,qe as s,re as t,A as u,h as v,b4 as w,Gde as x,k4 as y,_E as z};
|