@moonshot-ai/kimi-code 0.22.0 → 0.22.2
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 +61341 -60031
- package/dist-web/assets/{CodeBlockNode-CHRi13cp.js → CodeBlockNode-CaJnX8WY.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-Bw3zdw7l.js → CodeBlockShell.vue_vue_type_style_index_0_lang-BRgPQSVb.js} +1 -1
- package/dist-web/assets/DesignSystemView-2XTmljim.js +12 -0
- package/dist-web/assets/DesignSystemView-BskvdBnn.css +1 -0
- package/dist-web/assets/{Tooltip-Co8nMusV.js → Tooltip-DZguFKhz.js} +1 -1
- package/dist-web/assets/arc-DtSq864Y.js +1 -0
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-CVGQC8aY.js → architectureDiagram-3BPJPVTR-DMQz4tYy.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-B2akGU98.js → blockDiagram-GPEHLZMM-uiDJjfXs.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-d0Tnj3h7.js → c4Diagram-AAUBKEIU-Dupe9n1b.js} +1 -1
- package/dist-web/assets/channel-DzCUXF8u.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-aLmQ7kE7.js → chunk-2J33WTMH-CAvfdKCa.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-jj7AfMtu.js → chunk-4BX2VUAB-Bqf9QeRR.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-DOuxcNQK.js → chunk-55IACEB6-DMDy7rWA.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-ByX_U4aJ.js → chunk-727SXJPM-RW5JVWWF.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-Dwe8AVWQ.js → chunk-AQP2D5EJ-C3cDBsoU.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-D4Su5t72.js → chunk-FMBD7UC4-P4JPvwBw.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-BNRuB-eG.js → chunk-ND2GUHAM-CrF954Ah.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-CfTAMtms.js → chunk-QZHKN3VN-Vs9ezeZH.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-Dk9AsUOO.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Dk9AsUOO.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-Db4x33Cx.js → cose-bilkent-S5V4N54A-COoPAHpC.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-CSVzL3o5.js → dagre-BM42HDAG-BBOPrdG4.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-ChQghRCe.js → diagram-2AECGRRQ-LRx2sTw8.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-CzjFtwV4.js → diagram-5GNKFQAL-DsCaLaVB.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-DzzhiPZ_.js → diagram-KO2AKTUF-C5eIL5L7.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-D_U1BnUF.js → diagram-LMA3HP47-DFMNWSuI.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-BfFICgG3.js → diagram-OG6HWLK6-YtRDbT5E.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-DrJpAckD.js → erDiagram-TEJ5UH35-DcGLpZq8.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-DXu73Cwn.js → flowDiagram-I6XJVG4X-iTJJ8EFf.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-C6uzlaWx.js → ganttDiagram-6RSMTGT7-DQgm6pxo.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-BJs5S8Wt.js → gitGraphDiagram-PVQCEYII-DhCBgkG8.js} +1 -1
- package/dist-web/assets/{index-CZrAeDIj.js → index-CFiJLIKp.js} +2 -2
- package/dist-web/assets/index-CY9IR2gG.js +279 -0
- package/dist-web/assets/index-Cioxfv4p.css +1 -0
- package/dist-web/assets/{index-0aK13Vx6.js → index-DpLAujyX.js} +1 -1
- package/dist-web/assets/{index10-B0hKHFI0.js → index10-Cq9SfqzI.js} +1 -1
- package/dist-web/assets/{index11-97AxRDhM.js → index11-BsI2TwS2.js} +1 -1
- package/dist-web/assets/{index5-Dhi5S4AY.js → index5-D0QCZ2WX.js} +1 -1
- package/dist-web/assets/{index6-Bt9yqgGH.js → index6-BCwMTbX-.js} +1 -1
- package/dist-web/assets/{index7-CnqGakDF.js → index7-ngQ9Fglu.js} +1 -1
- package/dist-web/assets/{index8-Dca1sG3X.js → index8-B8E09VXR.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-Cfn6nswp.js → infoDiagram-5YYISTIA-VG0FT9QF.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-BJ-8LuY8.js → ishikawaDiagram-YF4QCWOH-57-3fzN_.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-D1yaSavm.js → journeyDiagram-JHISSGLW-_qj0ZBQM.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-BBFB4HDO.js → kanban-definition-UN3LZRKU-cpqKXF62.js} +1 -1
- package/dist-web/assets/{linear-hHmXIR2Z.js → linear-lEP30Zqf.js} +1 -1
- package/dist-web/assets/{mermaid.core-VDZ71vKz.js → mermaid.core-COCaMagj.js} +66 -66
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-RMoWi0xV.js → mindmap-definition-RKZ34NQL-BTy9wxvg.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-CQ4ZrI1-.js → pieDiagram-4H26LBE5-B9qPVNTt.js} +2 -2
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-Znu_X2s5.js → quadrantDiagram-W4KKPZXB-CIkg17kt.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-VSTs_T7S.js → requirementDiagram-4Y6WPE33-Cp6p0EDe.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-DMQVbj0y.js → sankeyDiagram-5OEKKPKP-D4mtZQUj.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-B8CkNeLt.js → sequenceDiagram-3UESZ5HK-CYHpIUE5.js} +1 -1
- package/dist-web/assets/stateDiagram-AJRCARHV-B1Vf-wla.js +1 -0
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BdYtlYmX.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-BhvuXeeE.js → timeline-definition-PNZ67QCA-Dau6vvwN.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-CSNE2nud.js → vennDiagram-CIIHVFJN-DTu2pySe.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-B84GkS0f.js → vue.runtime.esm-bundler-Bd0MpuGP.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-uLQHoAEc.js → wardley-L42UT6IY-CRpR3kk0.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-ChcE1LUX.js → wardleyDiagram-YWT4CUSO-XbULEr5H.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-o26J5Mzy.js → xychartDiagram-2RQKCTM6-C34wLyKM.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +7 -7
- package/dist-web/assets/arc-dY0kCO7r.js +0 -1
- package/dist-web/assets/channel-Bw3RVCmn.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DSr63Xlm.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DSr63Xlm.js +0 -1
- package/dist-web/assets/index-Bfuo9grI.css +0 -1
- package/dist-web/assets/index-_zaDlMUv.js +0 -279
- package/dist-web/assets/stateDiagram-AJRCARHV-Lhe74gFS.js +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-C4weiutZ.js +0 -1
- package/dist-web/design-system.html +0 -2251
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-2XTmljim.js","assets/DesignSystemView-BskvdBnn.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-CaJnX8WY.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-BRgPQSVb.js","assets/index8-B8E09VXR.js","assets/index11-BsI2TwS2.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
|
|
3
|
+
* @vue/shared v3.5.35
|
|
4
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
+
* @license MIT
|
|
6
|
+
**/function zp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const qt={},Da=[],Gs=()=>{},rC=()=>!1,Yu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Up=e=>e.startsWith("onUpdate:"),fn=Object.assign,P1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},dE=Object.prototype.hasOwnProperty,tn=(e,t)=>dE.call(e,t),kt=Array.isArray,Ba=e=>cc(e)==="[object Map]",Gl=e=>cc(e)==="[object Set]",Vk=e=>cc(e)==="[object Date]",fE=e=>cc(e)==="[object RegExp]",Et=e=>typeof e=="function",kn=e=>typeof e=="string",Is=e=>typeof e=="symbol",nn=e=>e!==null&&typeof e=="object",R1=e=>(nn(e)||Et(e))&&Et(e.then)&&Et(e.catch),lC=Object.prototype.toString,cc=e=>lC.call(e),pE=e=>cc(e).slice(8,-1),qp=e=>cc(e)==="[object Object]",jp=e=>kn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Rl=zp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Vp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},hE=/-\w/g,go=Vp(e=>e.replace(hE,t=>t.slice(1).toUpperCase())),mE=/\B([A-Z])/g,as=Vp(e=>e.replace(mE,"-$1").toLowerCase()),Kp=Vp(e=>e.charAt(0).toUpperCase()+e.slice(1)),yf=Vp(e=>e?`on${Kp(e)}`:""),Eo=(e,t)=>!Object.is(e,t),Fa=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},aC=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},Gp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Bf=e=>{const t=kn(e)?Number(e):NaN;return isNaN(t)?e:t};let Kk;const Yp=()=>Kk||(Kk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),gE="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",vE=zp(gE);function Yt(e){if(kt(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=kn(o)?_E(o):Yt(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(kn(e)||nn(e))return e}const yE=/;(?![^(]*\))/g,kE=/:([^]+)/,bE=/\/\*[^]*?\*\//g;function _E(e){const t={};return e.replace(bE,"").split(yE).forEach(n=>{if(n){const o=n.split(kE);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function De(e){let t="";if(kn(e))t=e;else if(kt(e))for(let n=0;n<e.length;n++){const o=De(e[n]);o&&(t+=o+" ")}else if(nn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Bfe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!kn(t)&&(e.class=De(t)),n&&(e.style=Yt(n)),e}const wE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",SE=zp(wE);function cC(e){return!!e||e===""}function CE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Ji(e[o],t[o]);return n}function Ji(e,t){if(e===t)return!0;let n=Vk(e),o=Vk(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=Is(e),o=Is(t),n||o)return e===t;if(n=kt(e),o=kt(t),n||o)return n&&o?CE(e,t):!1;if(n=nn(e),o=nn(t),n||o){if(!n||!o)return!1;const s=Object.keys(e).length,i=Object.keys(t).length;if(s!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Ji(e[r],t[r]))return!1}}return String(e)===String(t)}function Xp(e,t){return e.findIndex(n=>Ji(n,t))}const uC=e=>!!(e&&e.__v_isRef===!0),R=e=>kn(e)?e:e==null?"":kt(e)||nn(e)&&(e.toString===lC||!Et(e.toString))?uC(e)?R(e.value):JSON.stringify(e,dC,2):String(e),dC=(e,t)=>uC(t)?dC(e,t.value):Ba(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[Bm(o,i)+" =>"]=s,n),{})}:Gl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Bm(n))}:Is(t)?Bm(t):nn(t)&&!kt(t)&&!qp(t)?String(t):t,Bm=(e,t="")=>{var n;return Is(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function xE(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 mo;class fC{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&&mo&&(mo.active?(this.parent=mo,this.index=(mo.scopes||(mo.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=mo;try{return mo=this,t()}finally{mo=n}}}on(){++this._on===1&&(this.prevScope=mo,mo=this)}off(){if(this._on>0&&--this._on===0){if(mo===this)mo=this.prevScope;else{let t=mo;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,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function AE(e){return new fC(e)}function D1(){return mo}function B1(e,t=!1){mo&&mo.cleanups.push(e)}let Mn;const Fm=new WeakSet;class Ff{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,mo&&(mo.active?mo.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Fm.has(this)&&(Fm.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||hC(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Gk(this),mC(this);const t=Mn,n=ui;Mn=this,ui=!0;try{return this.fn()}finally{gC(this),Mn=t,ui=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)W1(t);this.deps=this.depsTail=void 0,Gk(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Fm.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){dv(this)&&this.run()}get dirty(){return dv(this)}}let pC=0,nu,ou;function hC(e,t=!1){if(e.flags|=8,t){e.next=ou,ou=e;return}e.next=nu,nu=e}function F1(){pC++}function H1(){if(--pC>0)return;if(ou){let t=ou;for(ou=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;nu;){let t=nu;for(nu=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function mC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function gC(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),W1(o),TE(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function dv(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(vC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function vC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===_u)||(e.globalVersion=_u,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!dv(e))))return;e.flags|=2;const t=e.dep,n=Mn,o=ui;Mn=e,ui=!0;try{mC(e);const s=e.fn(e._value);(t.version===0||Eo(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Mn=n,ui=o,gC(e),e.flags&=-3}}function W1(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)W1(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function TE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Ffe(e,t){e.effect instanceof Ff&&(e=e.effect.fn);const n=new Ff(e);t&&fn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function Hfe(e){e.effect.stop()}let ui=!0;const yC=[];function er(){yC.push(ui),ui=!1}function tr(){const e=yC.pop();ui=e===void 0?!0:e}function Gk(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Mn;Mn=void 0;try{t()}finally{Mn=n}}}let _u=0;class ME{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 Qp{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(!Mn||!ui||Mn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Mn)n=this.activeLink=new ME(Mn,this),Mn.deps?(n.prevDep=Mn.depsTail,Mn.depsTail.nextDep=n,Mn.depsTail=n):Mn.deps=Mn.depsTail=n,kC(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Mn.depsTail,n.nextDep=void 0,Mn.depsTail.nextDep=n,Mn.depsTail=n,Mn.deps===n&&(Mn.deps=o)}return n}trigger(t){this.version++,_u++,this.notify(t)}notify(t){F1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{H1()}}}function kC(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)kC(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Hf=new WeakMap,Dl=Symbol(""),fv=Symbol(""),wu=Symbol("");function Bo(e,t,n){if(ui&&Mn){let o=Hf.get(e);o||Hf.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new Qp),s.map=o,s.key=n),s.track()}}function ji(e,t,n,o,s,i){const r=Hf.get(e);if(!r){_u++;return}const l=a=>{a&&a.trigger()};if(F1(),t==="clear")r.forEach(l);else{const a=kt(e),c=a&&jp(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===wu||!Is(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(wu)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Dl)),Ba(e)&&l(r.get(fv)));break;case"delete":a||(l(r.get(Dl)),Ba(e)&&l(r.get(fv)));break;case"set":Ba(e)&&l(r.get(Dl));break}}H1()}function EE(e,t){const n=Hf.get(e);return n&&n.get(t)}function ma(e){const t=Gt(e);return t===e?t:(Bo(t,"iterate",wu),Cs(e)?t:t.map(fi))}function Zp(e){return Bo(e=Gt(e),"iterate",wu),e}function Mi(e,t){return nr(e)?Ja(Hr(e)?fi(t):t):fi(t)}const IE={__proto__:null,[Symbol.iterator](){return Hm(this,Symbol.iterator,e=>Mi(this,e))},concat(...e){return ma(this).concat(...e.map(t=>kt(t)?ma(t):t))},entries(){return Hm(this,"entries",e=>(e[1]=Mi(this,e[1]),e))},every(e,t){return Bi(this,"every",e,t,void 0,arguments)},filter(e,t){return Bi(this,"filter",e,t,n=>n.map(o=>Mi(this,o)),arguments)},find(e,t){return Bi(this,"find",e,t,n=>Mi(this,n),arguments)},findIndex(e,t){return Bi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Bi(this,"findLast",e,t,n=>Mi(this,n),arguments)},findLastIndex(e,t){return Bi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Bi(this,"forEach",e,t,void 0,arguments)},includes(...e){return Wm(this,"includes",e)},indexOf(...e){return Wm(this,"indexOf",e)},join(e){return ma(this).join(e)},lastIndexOf(...e){return Wm(this,"lastIndexOf",e)},map(e,t){return Bi(this,"map",e,t,void 0,arguments)},pop(){return Dc(this,"pop")},push(...e){return Dc(this,"push",e)},reduce(e,...t){return Yk(this,"reduce",e,t)},reduceRight(e,...t){return Yk(this,"reduceRight",e,t)},shift(){return Dc(this,"shift")},some(e,t){return Bi(this,"some",e,t,void 0,arguments)},splice(...e){return Dc(this,"splice",e)},toReversed(){return ma(this).toReversed()},toSorted(e){return ma(this).toSorted(e)},toSpliced(...e){return ma(this).toSpliced(...e)},unshift(...e){return Dc(this,"unshift",e)},values(){return Hm(this,"values",e=>Mi(this,e))}};function Hm(e,t,n){const o=Zp(e),s=o[t]();return o!==e&&!Cs(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const $E=Array.prototype;function Bi(e,t,n,o,s,i){const r=Zp(e),l=r!==e&&!Cs(e),a=r[t];if(a!==$E[t]){const d=a.apply(e,i);return l?fi(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,Mi(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,o);return l&&s?s(u):u}function Yk(e,t,n,o){const s=Zp(e),i=s!==e&&!Cs(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=Mi(e,c)),n.call(this,c,Mi(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](r,...o);return l?Mi(e,a):a}function Wm(e,t,n){const o=Gt(e);Bo(o,"iterate",wu);const s=o[t](...n);return(s===-1||s===!1)&&th(n[0])?(n[0]=Gt(n[0]),o[t](...n)):s}function Dc(e,t,n=[]){er(),F1();const o=Gt(e)[t].apply(e,n);return H1(),tr(),o}const NE=zp("__proto__,__v_isRef,__isVue"),bC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Is));function LE(e){Is(e)||(e=String(e));const t=Gt(this);return Bo(t,"has",e),t.hasOwnProperty(e)}class _C{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(s?i?TC:AC:i?xC:CC).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=kt(t);if(!s){let a;if(r&&(a=IE[n]))return a;if(n==="hasOwnProperty")return LE}const l=Reflect.get(t,n,to(t)?t:o);if((Is(n)?bC.has(n):NE(n))||(s||Bo(t,"get",n),i))return l;if(to(l)){const a=r&&jp(n)?l:l.value;return s&&nn(a)?Wf(a):a}return nn(l)?s?Wf(l):No(l):l}}class wC extends _C{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=kt(t)&&jp(n);if(!this._isShallow){const c=nr(i);if(!Cs(o)&&!nr(o)&&(i=Gt(i),o=Gt(o)),!r&&to(i)&&!to(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:tn(t,n),a=Reflect.set(t,n,o,to(t)?t:s);return t===Gt(s)&&(l?Eo(o,i)&&ji(t,"set",n,o):ji(t,"add",n,o)),a}deleteProperty(t,n){const o=tn(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&ji(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!Is(n)||!bC.has(n))&&Bo(t,"has",n),o}ownKeys(t){return Bo(t,"iterate",kt(t)?"length":Dl),Reflect.ownKeys(t)}}class SC extends _C{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const OE=new wC,PE=new SC,RE=new wC(!0),DE=new SC(!0),pv=e=>e,Rd=e=>Reflect.getPrototypeOf(e);function BE(e,t,n){return function(...o){const s=this.__v_raw,i=Gt(s),r=Ba(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?pv:t?Ja:fi;return!t&&Bo(i,"iterate",a?fv:Dl),fn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Dd(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function FE(e,t){const n={get(s){const i=this.__v_raw,r=Gt(i),l=Gt(s);e||(Eo(s,l)&&Bo(r,"get",s),Bo(r,"get",l));const{has:a}=Rd(r),c=t?pv:e?Ja:fi;if(a.call(r,s))return c(i.get(s));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(s)},get size(){const s=this.__v_raw;return!e&&Bo(Gt(s),"iterate",Dl),s.size},has(s){const i=this.__v_raw,r=Gt(i),l=Gt(s);return e||(Eo(s,l)&&Bo(r,"has",s),Bo(r,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const r=this,l=r.__v_raw,a=Gt(l),c=t?pv:e?Ja:fi;return!e&&Bo(a,"iterate",Dl),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return fn(n,e?{add:Dd("add"),set:Dd("set"),delete:Dd("delete"),clear:Dd("clear")}:{add(s){const i=Gt(this),r=Rd(i),l=Gt(s),a=!t&&!Cs(s)&&!nr(s)?l:s;return r.has.call(i,a)||Eo(s,a)&&r.has.call(i,s)||Eo(l,a)&&r.has.call(i,l)||(i.add(a),ji(i,"add",a,a)),this},set(s,i){!t&&!Cs(i)&&!nr(i)&&(i=Gt(i));const r=Gt(this),{has:l,get:a}=Rd(r);let c=l.call(r,s);c||(s=Gt(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?Eo(i,u)&&ji(r,"set",s,i):ji(r,"add",s,i),this},delete(s){const i=Gt(this),{has:r,get:l}=Rd(i);let a=r.call(i,s);a||(s=Gt(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&ji(i,"delete",s,void 0),c},clear(){const s=Gt(this),i=s.size!==0,r=s.clear();return i&&ji(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=BE(s,e,t)}),n}function Jp(e,t){const n=FE(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(tn(n,s)&&s in o?n:o,s,i)}const HE={get:Jp(!1,!1)},WE={get:Jp(!1,!0)},zE={get:Jp(!0,!1)},UE={get:Jp(!0,!0)},CC=new WeakMap,xC=new WeakMap,AC=new WeakMap,TC=new WeakMap;function qE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function No(e){return nr(e)?e:eh(e,!1,OE,HE,CC)}function jE(e){return eh(e,!1,RE,WE,xC)}function Wf(e){return eh(e,!0,PE,zE,AC)}function Wfe(e){return eh(e,!0,DE,UE,TC)}function eh(e,t,n,o,s){if(!nn(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=s.get(e);if(i)return i;const r=qE(pE(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function Hr(e){return nr(e)?Hr(e.__v_raw):!!(e&&e.__v_isReactive)}function nr(e){return!!(e&&e.__v_isReadonly)}function Cs(e){return!!(e&&e.__v_isShallow)}function th(e){return e?!!e.__v_raw:!1}function Gt(e){const t=e&&e.__v_raw;return t?Gt(t):e}function Rr(e){return!tn(e,"__v_skip")&&Object.isExtensible(e)&&aC(e,"__v_skip",!0),e}const fi=e=>nn(e)?No(e):e,Ja=e=>nn(e)?Wf(e):e;function to(e){return e?e.__v_isRef===!0:!1}function Z(e){return MC(e,!1)}function Yl(e){return MC(e,!0)}function MC(e,t){return to(e)?e:new VE(e,t)}class VE{constructor(t,n){this.dep=new Qp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Gt(t),this._value=n?t:fi(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||Cs(t)||nr(t);t=o?t:Gt(t),Eo(t,n)&&(this._rawValue=t,this._value=o?t:fi(t),this.dep.trigger())}}function zfe(e){e.dep&&e.dep.trigger()}function A(e){return to(e)?e.value:e}function EC(e){return Et(e)?e():A(e)}const KE={get:(e,t,n)=>t==="__v_raw"?e:A(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return to(s)&&!to(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function IC(e){return Hr(e)?e:new Proxy(e,KE)}class GE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Qp,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function YE(e){return new GE(e)}function Ufe(e){const t=kt(e)?new Array(e.length):{};for(const n in e)t[n]=$C(e,n);return t}class XE{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=Is(n)?n:String(n),this._raw=Gt(t);let s=!0,i=t;if(!kt(t)||Is(this._key)||!jp(this._key))do s=!th(i)||Cs(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=A(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&to(this._raw[this._key])){const n=this._object[this._key];if(to(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return EE(this._raw,this._key)}}class QE{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 qfe(e,t,n){return to(e)?e:Et(e)?new QE(e):nn(e)&&arguments.length>1?$C(e,t,n):Z(e)}function $C(e,t,n){return new XE(e,t,n)}class ZE{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Qp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=_u-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Mn!==this)return hC(this,!0),!0}get value(){const t=this.dep.track();return vC(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function JE(e,t,n=!1){let o,s;return Et(e)?o=e:(o=e.get,s=e.set),new ZE(o,s,n)}const jfe={GET:"get",HAS:"has",ITERATE:"iterate"},Vfe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Bd={},zf=new WeakMap;let Mr;function Kfe(){return Mr}function eI(e,t=!1,n=Mr){if(n){let o=zf.get(n);o||zf.set(n,o=[]),o.push(e)}}function tI(e,t,n=qt){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>s?y:Cs(y)||s===!1||s===0?Vi(y,1):Vi(y);let u,d,f,h,p=!1,m=!1;if(to(e)?(d=()=>e.value,p=Cs(e)):Hr(e)?(d=()=>c(e),p=!0):kt(e)?(m=!0,p=e.some(y=>Hr(y)||Cs(y)),d=()=>e.map(y=>{if(to(y))return y.value;if(Hr(y))return c(y);if(Et(y))return a?a(y,2):y()})):Et(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){er();try{f()}finally{tr()}}const y=Mr;Mr=u;try{return a?a(e,3,[h]):e(h)}finally{Mr=y}}:d=Gs,t&&s){const y=d,C=s===!0?1/0:s;d=()=>Vi(y(),C)}const b=D1(),_=()=>{u.stop(),b&&b.active&&P1(b.effects,u)};if(i&&t){const y=t;t=(...C)=>{y(...C),_()}}let g=m?new Array(e.length).fill(Bd):Bd;const v=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const C=u.run();if(s||p||(m?C.some((L,$)=>Eo(L,g[$])):Eo(C,g))){f&&f();const L=Mr;Mr=u;try{const $=[C,g===Bd?void 0:m&&g[0]===Bd?[]:g,h];g=C,a?a(t,3,$):t(...$)}finally{Mr=L}}}else u.run()};return l&&l(v),u=new Ff(d),u.scheduler=r?()=>r(v,!1):v,h=y=>eI(y,!1,u),f=u.onStop=()=>{const y=zf.get(u);if(y){if(a)a(y,4);else for(const C of y)C();zf.delete(u)}},t?o?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function Vi(e,t=1/0,n){if(t<=0||!nn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,to(e))Vi(e.value,t,n);else if(kt(e))for(let o=0;o<e.length;o++)Vi(e[o],t,n);else if(Gl(e)||Ba(e))e.forEach(o=>{Vi(o,t,n)});else if(qp(e)){for(const o in e)Vi(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Vi(e[o],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 NC=[];function nI(e){NC.push(e)}function oI(){NC.pop()}function Gfe(e,t){}const Yfe={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"},sI={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 Xu(e,t,n,o){try{return o?e(...o):e()}catch(s){uc(s,t,n)}}function Qs(e,t,n,o){if(Et(e)){const s=Xu(e,t,n,o);return s&&R1(s)&&s.catch(i=>{uc(i,t,n)}),s}if(kt(e)){const s=[];for(let i=0;i<e.length;i++)s.push(Qs(e[i],t,n,o));return s}}function uc(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||qt;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){er(),Xu(i,null,10,[e,a,c]),tr();return}}iI(e,n,s,o,r)}function iI(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const Ko=[];let Ci=-1;const Ha=[];let Er=null,Sa=0;const LC=Promise.resolve();let Uf=null;function gt(e){const t=Uf||LC;return e?t.then(this?e.bind(this):e):t}function rI(e){let t=Ci+1,n=Ko.length;for(;t<n;){const o=t+n>>>1,s=Ko[o],i=Su(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function z1(e){if(!(e.flags&1)){const t=Su(e),n=Ko[Ko.length-1];!n||!(e.flags&2)&&t>=Su(n)?Ko.push(e):Ko.splice(rI(t),0,e),e.flags|=1,OC()}}function OC(){Uf||(Uf=LC.then(PC))}function qf(e){kt(e)?Ha.push(...e):Er&&e.id===-1?Er.splice(Sa+1,0,e):e.flags&1||(Ha.push(e),e.flags|=1),OC()}function Xk(e,t,n=Ci+1){for(;n<Ko.length;n++){const o=Ko[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;Ko.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function jf(e){if(Ha.length){const t=[...new Set(Ha)].sort((n,o)=>Su(n)-Su(o));if(Ha.length=0,Er){Er.push(...t);return}for(Er=t,Sa=0;Sa<Er.length;Sa++){const n=Er[Sa];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Er=null,Sa=0}}const Su=e=>e.id==null?e.flags&2?-1:1/0:e.id;function PC(e){try{for(Ci=0;Ci<Ko.length;Ci++){const t=Ko[Ci];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Xu(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ci<Ko.length;Ci++){const t=Ko[Ci];t&&(t.flags&=-2)}Ci=-1,Ko.length=0,jf(),Uf=null,(Ko.length||Ha.length)&&PC()}}let Ca,Fd=[];function RC(e,t){var n,o;Ca=e,Ca?(Ca.enabled=!0,Fd.forEach(({event:s,args:i})=>Ca.emit(s,...i)),Fd=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{RC(i,t)}),setTimeout(()=>{Ca||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Fd=[])},3e3)):Fd=[]}let Lo=null,nh=null;function Cu(e){const t=Lo;return Lo=e,nh=e&&e.type.__scopeId||null,t}function Xfe(e){nh=e}function Qfe(){nh=null}const Zfe=e=>ke;function ke(e,t=Lo,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&Xf(-1);const i=Cu(t);let r;try{r=e(...s)}finally{Cu(i),o._d&&Xf(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function En(e,t){if(Lo===null)return e;const n=ed(Lo),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=qt]=t[s];i&&(Et(i)&&(i={mounted:i,updated:i}),i.deep&&Vi(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Ai(e,t,n,o){const s=e.dirs,i=t&&t.dirs;for(let r=0;r<s.length;r++){const l=s[r];i&&(l.oldValue=i[r].value);let a=l.dir[o];a&&(er(),Qs(a,n,8,[e.el,l,e,t]),tr())}}function On(e,t){if(Io){let n=Io.provides;const o=Io.parent&&Io.parent.provides;o===n&&(n=Io.provides=Object.create(o)),n[e]=t}}function jt(e,t,n=!1){const o=Oo();if(o||Bl){let s=Bl?Bl._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Et(t)?t.call(o&&o.proxy):t}}function Jfe(){return!!(Oo()||Bl)}const lI=Symbol.for("v-scx"),aI=()=>jt(lI);function cI(e,t){return Qu(e,null,t)}function epe(e,t){return Qu(e,null,{flush:"post"})}function uI(e,t){return Qu(e,null,{flush:"sync"})}function Ge(e,t,n){return Qu(e,t,n)}function Qu(e,t,n=qt){const{immediate:o,deep:s,flush:i,once:r}=n,l=fn({},n),a=t&&o||!t&&i!=="post";let c;if(ql){if(i==="sync"){const h=aI();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=Gs,h.resume=Gs,h.pause=Gs,h}}const u=Io;l.call=(h,p,m)=>Qs(h,u,p,m);let d=!1;i==="post"?l.scheduler=h=>{so(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():z1(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=tI(e,t,l);return ql&&(c?c.push(f):a&&f()),f}function dI(e,t,n){const o=this.proxy,s=kn(e)?e.includes(".")?DC(o,e):()=>o[e]:e.bind(o,o);let i;Et(t)?i=t:(i=t.handler,n=t);const r=dc(this),l=Qu(s,i.bind(o),n);return r(),l}function DC(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}const Ar=new WeakMap,BC=Symbol("_vte"),FC=e=>e.__isTeleport,Ml=e=>e&&(e.disabled||e.disabled===""),fI=e=>e&&(e.defer||e.defer===""),Qk=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Zk=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,hv=(e,t)=>{const n=e&&e.to;return kn(n)?t?t(n):null:n},pI={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:m,createComment:b,parentNode:_}}=c,g=Ml(t.props);let{dynamicChildren:v}=t;const y=($,k,M)=>{$.shapeFlag&16&&u($.children,k,M,s,i,r,l,a)},C=($=t)=>{const k=Ml($.props),M=$.target=hv($.props,p),E=mv(M,$,m,h);M&&(r!=="svg"&&Qk(M)?r="svg":r!=="mathml"&&Zk(M)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(M),k||(y($,M,E),Vc($,!1)))},L=$=>{const k=()=>{if(Ar.get($)===k){if(Ar.delete($),Ml($.props)){const M=_($.el)||n;y($,M,$.anchor),Vc($,!0)}C($)}};Ar.set($,k),so(k,i)};if(e==null){const $=t.el=m(""),k=t.anchor=m("");if(h($,n,o),h(k,n,o),fI(t.props)||i&&i.pendingBranch){L(t);return}g&&(y(t,n,k),Vc(t,!0)),C()}else{t.el=e.el;const $=t.anchor=e.anchor,k=Ar.get(e);if(k){k.flags|=8,Ar.delete(e),L(t);return}t.targetStart=e.targetStart;const M=t.target=e.target,E=t.targetAnchor=e.targetAnchor,O=Ml(e.props),S=O?n:M,I=O?$:E;if(r==="svg"||Qk(M)?r="svg":(r==="mathml"||Zk(M))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,s,i,r,l),J1(e,t,!0)):a||d(e,t,S,I,s,i,r,l,!1),g)O?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Hd(t,n,$,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const P=t.target=hv(t.props,p);P&&Hd(t,P,null,c,0)}else O&&Hd(t,M,E,c,1);Vc(t,g)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,h=i||!Ml(f),p=Ar.get(e);if(p&&(p.flags|=8,Ar.delete(e)),d&&(s(c),s(u)),i&&s(a),!p&&r&16)for(let m=0;m<l.length;m++){const b=l[m];o(b,t,n,h,!!b.dynamicChildren)}},move:Hd,hydrate:hI};function Hd(e,t,n,{o:{insert:o},m:s},i=2){i===0&&o(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&o(r,t,n),!Ar.has(e)&&(!d||Ml(u))&&a&16)for(let f=0;f<c.length;f++)s(c[f],t,n,2);d&&o(l,t,n)}function hI(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(b,_){let g=_;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,b._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(b,_){_.anchor=d(r(b),_,l(b),n,o,s,i)}const p=t.target=hv(t.props,a),m=Ml(t.props);if(p){const b=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(p,b),t.targetAnchor||mv(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,b),t.targetAnchor||mv(p,t,u,c),d(b&&r(b),t,p,n,o,s,i))),Vc(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const oh=pI;function Vc(e,t){const n=e.ctx;if(n&&n.ut){let o,s;for(t?(o=e.el,s=e.anchor):(o=e.targetStart,s=e.targetAnchor);o&&o!==s;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function mv(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[BC]=r,e&&(o(i,e,s),o(r,e,s)),r}const zs=Symbol("_leaveCb"),Bc=Symbol("_enterCb");function HC(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return bn(()=>{e.isMounted=!0}),vo(()=>{e.isUnmounting=!0}),e}const Ds=[Function,Array],WC={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ds,onEnter:Ds,onAfterEnter:Ds,onEnterCancelled:Ds,onBeforeLeave:Ds,onLeave:Ds,onAfterLeave:Ds,onLeaveCancelled:Ds,onBeforeAppear:Ds,onAppear:Ds,onAfterAppear:Ds,onAppearCancelled:Ds},zC=e=>{const t=e.subTree;return t.component?zC(t.component):t},mI={name:"BaseTransition",props:WC,setup(e,{slots:t}){const n=Oo(),o=HC();return()=>{const s=t.default&&U1(t.default(),!0),i=s&&s.length?UC(s):n.subTree?ie():void 0;if(!i)return;const r=Gt(e),{mode:l}=r;if(o.isLeaving)return zm(i);const a=Jk(i);if(!a)return zm(i);let c=xu(a,r,o,n,d=>c=d);a.type!==ro&&jr(a,c);let u=n.subTree&&Jk(n.subTree);if(u&&u.type!==ro&&!ri(u,a)&&zC(n).type!==ro){let d=xu(u,r,o,n);if(jr(u,d),l==="out-in"&&a.type!==ro)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},zm(i);l==="in-out"&&a.type!==ro?d.delayLeave=(f,h,p)=>{const m=qC(o,u);m[String(u.key)]=u,f[zs]=()=>{h(),f[zs]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function UC(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==ro){t=n;break}}return t}const gI=mI;function qC(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function xu(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:b,onAppear:_,onAfterAppear:g,onAppearCancelled:v}=t,y=String(e.key),C=qC(n,e),L=(M,E)=>{M&&Qs(M,o,9,E)},$=(M,E)=>{const O=E[1];L(M,E),kt(M)?M.every(S=>S.length<=1)&&O():M.length<=1&&O()},k={mode:r,persisted:l,beforeEnter(M){let E=a;if(!n.isMounted)if(i)E=b||a;else return;M[zs]&&M[zs](!0);const O=C[y];O&&ri(e,O)&&O.el[zs]&&O.el[zs](),L(E,[M])},enter(M){if(C[y]===e)return;let E=c,O=u,S=d;if(!n.isMounted)if(i)E=_||c,O=g||u,S=v||d;else return;let I=!1;M[Bc]=D=>{I||(I=!0,D?L(S,[M]):L(O,[M]),k.delayedLeave&&k.delayedLeave(),M[Bc]=void 0)};const P=M[Bc].bind(null,!1);E?$(E,[M,P]):P()},leave(M,E){const O=String(e.key);if(M[Bc]&&M[Bc](!0),n.isUnmounting)return E();L(f,[M]);let S=!1;M[zs]=P=>{S||(S=!0,E(),P?L(m,[M]):L(p,[M]),M[zs]=void 0,C[O]===e&&delete C[O])};const I=M[zs].bind(null,!1);C[O]=e,h?$(h,[M,I]):I()},clone(M){const E=xu(M,t,n,o,s);return s&&s(E),E}};return k}function zm(e){if(Zu(e))return e=or(e),e.children=null,e}function Jk(e){if(!Zu(e))return FC(e.type)&&e.children?UC(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&&Et(n.default))return n.default()}}function jr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,jr(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 U1(e,t=!1,n){let o=[],s=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===Oe?(r.patchFlag&128&&s++,o=o.concat(U1(r.children,t,l))):(t||r.type!==ro)&&o.push(l!=null?or(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function Ve(e,t){return Et(e)?fn({name:e.name},t,{setup:e}):e}function tpe(){const e=Oo();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function q1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function npe(e){const t=Oo(),n=Yl(null);if(t){const s=t.refs===qt?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function eb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Vf=new WeakMap;function Wa(e,t,n,o,s=!1){if(kt(e)){e.forEach((m,b)=>Wa(m,t&&(kt(t)?t[b]:t),n,o,s));return}if(Qi(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Wa(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?ed(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===qt?l.refs={}:l.refs,d=l.setupState,f=Gt(d),h=d===qt?rC:m=>eb(u,m)?!1:tn(f,m),p=(m,b)=>!(b&&eb(u,b));if(c!=null&&c!==a){if(tb(t),kn(c))u[c]=null,h(c)&&(d[c]=null);else if(to(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(Et(a))Xu(a,l,12,[r,u]);else{const m=kn(a),b=to(a);if(m||b){const _=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(s)kt(g)&&P1(g,i);else if(kt(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],h(a)&&(d[a]=u[a]);else{const v=[i];p(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,h(a)&&(d[a]=r)):b&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{_(),Vf.delete(e)};g.id=-1,Vf.set(e,g),so(g,n)}else tb(e),_()}}}function tb(e){const t=Vf.get(e);t&&(t.flags|=8,Vf.delete(e))}let nb=!1;const ga=()=>{nb||(console.error("Hydration completed but contains mismatches."),nb=!0)},vI=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",yI=e=>e.namespaceURI.includes("MathML"),Wd=e=>{if(e.nodeType===1){if(vI(e))return"svg";if(yI(e))return"mathml"}},Ia=e=>e.nodeType===8;function kI(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,y)=>{if(!y.hasChildNodes()){n(null,v,y),jf(),y._vnode=v;return}d(y.firstChild,v,null,null,null),jf(),y._vnode=v},d=(v,y,C,L,$,k=!1)=>{k=k||!!y.dynamicChildren;const M=Ia(v)&&v.data==="[",E=()=>m(v,y,C,L,$,M),{type:O,ref:S,shapeFlag:I,patchFlag:P}=y;let D=v.nodeType;y.el=v,P===-2&&(k=!1,y.dynamicChildren=null);let H=null;switch(O){case Wr:D!==3?y.children===""?(a(y.el=s(""),r(v),v),H=v):H=E():(v.data!==y.children&&(ga(),v.data=y.children),H=i(v));break;case ro:g(v)?(H=i(v),_(y.el=v.content.firstChild,v,C)):D!==8||M?H=E():H=i(v);break;case Ua:if(M&&(v=i(v),D=v.nodeType),D===1||D===3){H=v;const z=!y.children.length;for(let U=0;U<y.staticCount;U++)z&&(y.children+=H.nodeType===1?H.outerHTML:H.data),U===y.staticCount-1&&(y.anchor=H),H=i(H);return M?i(H):H}else E();break;case Oe:M?H=p(v,y,C,L,$,k):H=E();break;default:if(I&1)(D!==1||y.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?H=E():H=f(v,y,C,L,$,k);else if(I&6){y.slotScopeIds=$;const z=r(v);if(M?H=b(v):Ia(v)&&v.data==="teleport start"?H=b(v,v.data,"teleport end"):H=i(v),t(y,z,null,C,L,Wd(z),k),Qi(y)&&!y.type.__asyncResolved){let U;M?(U=se(Oe),U.anchor=H?H.previousSibling:z.lastChild):U=v.nodeType===3?je(""):se("div"),U.el=v,y.component.subTree=U}}else I&64?D!==8?H=E():H=y.type.hydrate(v,y,C,L,$,k,e,h):I&128&&(H=y.type.hydrate(v,y,C,L,Wd(r(v)),$,k,e,d))}return S!=null&&Wa(S,null,L,y),H},f=(v,y,C,L,$,k)=>{k=k||!!y.dynamicChildren;const{type:M,props:E,patchFlag:O,shapeFlag:S,dirs:I,transition:P}=y,D=M==="input"||M==="option";if(D||O!==-1){I&&Ai(y,null,C,"created");let H=!1;if(g(v)){H=cx(null,P)&&C&&C.vnode.props&&C.vnode.props.appear;const U=v.content.firstChild;if(H){const Q=U.getAttribute("class");Q&&(U.$cls=Q),P.beforeEnter(U)}_(U,v,C),y.el=v=U}if(S&16&&!(E&&(E.innerHTML||E.textContent))){let U=h(v.firstChild,y,v,C,L,$,k);for(U&&!zd(v,1)&&ga();U;){const Q=U;U=U.nextSibling,l(Q)}}else if(S&8){let U=y.children;U[0]===`
|
|
15
|
+
`&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(U=U.slice(1));const{textContent:Q}=v;Q!==U&&Q!==U.replace(/\r\n|\r/g,`
|
|
16
|
+
`)&&(zd(v,0)||ga(),v.textContent=y.children)}if(E){if(D||!k||O&48){const U=v.tagName.includes("-");for(const Q in E)(D&&(Q.endsWith("value")||Q==="indeterminate")||Yu(Q)&&!Rl(Q)||Q[0]==="."||U&&!Rl(Q))&&o(v,Q,null,E[Q],void 0,C)}else if(E.onClick)o(v,"onClick",null,E.onClick,void 0,C);else if(O&4&&Hr(E.style))for(const U in E.style)E.style[U]}let z;(z=E&&E.onVnodeBeforeMount)&&ss(z,C,y),I&&Ai(y,null,C,"beforeMount"),((z=E&&E.onVnodeMounted)||I||H)&&px(()=>{z&&ss(z,C,y),H&&P.enter(v),I&&Ai(y,null,C,"mounted")},L)}return v.nextSibling},h=(v,y,C,L,$,k,M)=>{M=M||!!y.dynamicChildren;const E=y.children,O=E.length;let S=!1;for(let I=0;I<O;I++){const P=M?E[I]:E[I]=ls(E[I]),D=P.type===Wr;v?(D&&!M&&I+1<O&&ls(E[I+1]).type===Wr&&(a(s(v.data.slice(P.children.length)),C,i(v)),v.data=P.children),v=d(v,P,L,$,k,M)):D&&!P.children?a(P.el=s(""),C):(S||(S=!0,zd(C,1)||ga()),n(null,P,C,null,L,$,Wd(C),k))}return v},p=(v,y,C,L,$,k)=>{const{slotScopeIds:M}=y;M&&($=$?$.concat(M):M);const E=r(v),O=h(i(v),y,E,C,L,$,k);return O&&Ia(O)&&O.data==="]"?i(y.anchor=O):(ga(),a(y.anchor=c("]"),E,O),O)},m=(v,y,C,L,$,k)=>{if(zd(v.parentElement,1)||ga(),y.el=null,k){const O=b(v);for(;;){const S=i(v);if(S&&S!==O)l(S);else break}}const M=i(v),E=r(v);return l(v),n(null,y,E,M,C,L,Wd(E),$),C&&(C.vnode.el=y.el,rh(C,y.el)),M},b=(v,y="[",C="]")=>{let L=0;for(;v;)if(v=i(v),v&&Ia(v)&&(v.data===y&&L++,v.data===C)){if(L===0)return i(v);L--}return v},_=(v,y,C)=>{const L=y.parentNode;L&&L.replaceChild(v,y);let $=C;for(;$;)$.vnode.el===y&&($.vnode.el=$.subTree.el=v),$=$.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const ob="data-allow-mismatch",bI={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function zd(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(ob);)e=e.parentElement;const n=e&&e.getAttribute(ob);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(bI[t])}}const _I=Yp().requestIdleCallback||(e=>setTimeout(e,1)),wI=Yp().cancelIdleCallback||(e=>clearTimeout(e)),ope=(e=1e4)=>t=>{const n=_I(t,{timeout:e});return()=>wI(n)};function SI(e){const{top:t,left:n,bottom:o,right:s}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||o>0&&o<i)&&(n>0&&n<r||s>0&&s<r)}const spe=e=>(t,n)=>{const o=new IntersectionObserver(s=>{for(const i of s)if(i.isIntersecting){o.disconnect(),t();break}},e);return n(s=>{if(s instanceof Element){if(SI(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},ipe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},rpe=(e=[])=>(t,n)=>{kn(e)&&(e=[e]);let o=!1;const s=r=>{o||(o=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,s)})};return n(r=>{for(const l of e)r.addEventListener(l,s,{once:!0})}),i};function CI(e,t){if(Ia(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(Ia(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const Qi=e=>!!e.type.__asyncLoader;function li(e){Et(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((b,_)=>{a(m,()=>b(f()),()=>_(m),d+1)});throw m}).then(m=>p!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return Ve({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,m,b){let _=!1;(m.bu||(m.bu=[])).push(()=>_=!0);const g=()=>{_||b()},v=i?()=>{const y=i(g,C=>CI(p,C));y&&(m.bum||(m.bum=[])).push(y)}:g;u?v():h().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const p=Io;if(q1(p),u)return()=>Ud(u,p);const m=v=>{c=null,uc(v,p,13,!o)};if(l&&p.suspense||ql)return h().then(v=>()=>Ud(v,p)).catch(v=>(m(v),()=>o?se(o,{error:v}):null));const b=Z(!1),_=Z(),g=Z(!!s);return s&&setTimeout(()=>{g.value=!1},s),r!=null&&setTimeout(()=>{if(!b.value&&!_.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),_.value=v}},r),h().then(()=>{b.value=!0,p.parent&&Zu(p.parent.vnode)&&p.parent.update()}).catch(v=>{m(v),_.value=v}),()=>{if(b.value&&u)return Ud(u,p);if(_.value&&o)return se(o,{error:_.value});if(n&&!g.value)return Ud(n,p)}}})}function Ud(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=se(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Zu=e=>e.type.__isKeepAlive,xI={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Oo(),o=n.ctx;if(!o.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const s=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,f=d("div");o.activate=(g,v,y,C,L)=>{const $=g.component;c(g,v,y,0,l),a($.vnode,g,v,y,$,l,C,g.slotScopeIds,L),so(()=>{$.isDeactivated=!1,$.a&&Fa($.a);const k=g.props&&g.props.onVnodeMounted;k&&ss(k,$.parent,g)},l)},o.deactivate=g=>{const v=g.component;Gf(v.m),Gf(v.a),c(g,f,null,1,l),so(()=>{v.da&&Fa(v.da);const y=g.props&&g.props.onVnodeUnmounted;y&&ss(y,v.parent,g),v.isDeactivated=!0},l)};function h(g){Um(g),u(g,n,l,!0)}function p(g){s.forEach((v,y)=>{const C=Cv(Qi(v)?v.type.__asyncResolved||{}:v.type);C&&!g(C)&&m(y)})}function m(g){const v=s.get(g);v&&(!r||!ri(v,r))?h(v):r&&Um(r),s.delete(g),i.delete(g)}Ge(()=>[e.include,e.exclude],([g,v])=>{g&&p(y=>Kc(g,y)),v&&p(y=>!Kc(v,y))},{flush:"post",deep:!0});let b=null;const _=()=>{b!=null&&(Yf(n.subTree.type)?so(()=>{s.set(b,qd(n.subTree))},n.subTree.suspense):s.set(b,qd(n.subTree)))};return bn(_),j1(_),vo(()=>{s.forEach(g=>{const{subTree:v,suspense:y}=n,C=qd(v);if(g.type===C.type&&g.key===C.key){Um(C);const L=C.component.da;L&&so(L,y);return}h(g)})}),()=>{if(b=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!Vr(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let y=qd(v);if(y.type===ro)return r=null,y;const C=y.type,L=Cv(Qi(y)?y.type.__asyncResolved||{}:C),{include:$,exclude:k,max:M}=e;if($&&(!L||!Kc($,L))||k&&L&&Kc(k,L))return y.shapeFlag&=-257,r=y,v;const E=y.key==null?C:y.key,O=s.get(E);return y.el&&(y=or(y),v.shapeFlag&128&&(v.ssContent=y)),b=E,O?(y.el=O.el,y.component=O.component,y.transition&&jr(y,y.transition),y.shapeFlag|=512,i.delete(E),i.add(E)):(i.add(E),M&&i.size>parseInt(M,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,Yf(v.type)?v:y}}},lpe=xI;function Kc(e,t){return kt(e)?e.some(n=>Kc(n,t)):kn(e)?e.split(",").includes(t):fE(e)?(e.lastIndex=0,e.test(t)):!1}function AI(e,t){jC(e,"a",t)}function TI(e,t){jC(e,"da",t)}function jC(e,t,n=Io){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(sh(t,o,n),n){let s=n.parent;for(;s&&s.parent;)Zu(s.parent.vnode)&&MI(o,t,n,s),s=s.parent}}function MI(e,t,n,o){const s=sh(t,e,o,!0);_n(()=>{P1(o[t],s)},n)}function Um(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function qd(e){return e.shapeFlag&128?e.ssContent:e}function sh(e,t,n=Io,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{er();const l=dc(n),a=Qs(t,n,e,r);return l(),tr(),a});return o?s.unshift(i):s.push(i),i}}const ir=e=>(t,n=Io)=>{(!ql||e==="sp")&&sh(e,(...o)=>t(...o),n)},EI=ir("bm"),bn=ir("m"),VC=ir("bu"),j1=ir("u"),vo=ir("bum"),_n=ir("um"),II=ir("sp"),$I=ir("rtg"),NI=ir("rtc");function LI(e,t=Io){sh("ec",e,t)}const V1="components",OI="directives";function PI(e,t){return K1(V1,e,!0,t)||e}const KC=Symbol.for("v-ndc");function Fo(e){return kn(e)?K1(V1,e,!1)||e:e||KC}function ape(e){return K1(OI,e)}function K1(e,t,n=!0,o=!1){const s=Lo||Io;if(s){const i=s.type;if(e===V1){const l=Cv(i,!1);if(l&&(l===t||l===go(t)||l===Kp(go(t))))return i}const r=sb(s[e]||i[e],t)||sb(s.appContext[e],t);return!r&&o?i:r}}function sb(e,t){return e&&(e[t]||e[go(t)]||e[Kp(go(t))])}function st(e,t,n,o){let s;const i=n&&n[o],r=kt(e);if(r||kn(e)){const l=r&&Hr(e);let a=!1,c=!1;l&&(a=!Cs(e),c=nr(e),e=Zp(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?Ja(fi(e[u])):fi(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){s=new Array(e);for(let l=0;l<e;l++)s[l]=t(l+1,l,void 0,i&&i[l])}else if(nn(e))if(e[Symbol.iterator])s=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];s[a]=t(e[u],u,a,i&&i[a])}}else s=[];return n&&(n[o]=s),s}function G1(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(kt(o))for(let s=0;s<o.length;s++)e[o[s].name]=o[s].fn;else o&&(e[o.name]=o.key?(...s)=>{const i=o.fn(...s);return i&&(i.key=o.key),i}:o.fn)}return e}function An(e,t,n={},o,s){if(Lo.ce||Lo.parent&&Qi(Lo.parent)&&Lo.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),ge(Oe,null,[se("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),w();const r=i&&Y1(i(n)),l=n.key||r&&r.key,a=ge(Oe,{key:(l&&!Is(l)?l:`_${t}`)+(!r&&o?"_fb":"")},r||(o?o():[]),r&&e._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function Y1(e){return e.some(t=>Vr(t)?!(t.type===ro||t.type===Oe&&!Y1(t.children)):!0)?e:null}function cpe(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:yf(o)]=e[o];return n}const gv=e=>e?yx(e)?ed(e):gv(e.parent):null,su=fn(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=>gv(e.parent),$root:e=>gv(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>X1(e),$forceUpdate:e=>e.f||(e.f=()=>{z1(e.update)}),$nextTick:e=>e.n||(e.n=gt.bind(e.proxy)),$watch:e=>dI.bind(e)}),qm=(e,t)=>e!==qt&&!e.__isScriptSetup&&tn(e,t),vv={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(qm(o,t))return r[t]=1,o[t];if(s!==qt&&tn(s,t))return r[t]=2,s[t];if(tn(i,t))return r[t]=3,i[t];if(n!==qt&&tn(n,t))return r[t]=4,n[t];yv&&(r[t]=0)}}const c=su[t];let u,d;if(c)return t==="$attrs"&&Bo(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==qt&&tn(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,tn(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return qm(s,t)?(s[t]=n,!0):o!==qt&&tn(o,t)?(o[t]=n,!0):tn(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:i,type:r}},l){let a;return!!(n[l]||e!==qt&&l[0]!=="$"&&tn(e,l)||qm(t,l)||tn(i,l)||tn(o,l)||tn(su,l)||tn(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:tn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},RI=fn({},vv,{get(e,t){if(t!==Symbol.unscopables)return vv.get(e,t,e)},has(e,t){return t[0]!=="_"&&!vE(t)}});function upe(){return null}function dpe(){return null}function fpe(e){}function ppe(e){}function hpe(){return null}function mpe(){}function gpe(e,t){return null}function vpe(){return GC().slots}function Ju(){return GC().attrs}function GC(e){const t=Oo();return t.setupContext||(t.setupContext=_x(t))}function Au(e){return kt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function ype(e,t){const n=Au(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?kt(s)||Et(s)?s=n[o]={type:s,default:t[o]}:s.default=t[o]:s===null&&(s=n[o]={default:t[o]}),s&&t[`__skip_${o}`]&&(s.skipFactory=!0)}return n}function kpe(e,t){return!e||!t?e||t:kt(e)&&kt(t)?e.concat(t):fn({},Au(e),Au(t))}function bpe(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function _pe(e){const t=Oo(),n=ql;let o=e();Mu(),n&&qa(!1);const s=()=>{dc(t),n&&qa(!0)},i=()=>{Oo()!==t&&t.scope.off(),Mu(),n&&qa(!1)};return R1(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let yv=!0;function DI(e){const t=X1(e),n=e.proxy,o=e.ctx;yv=!1,t.beforeCreate&&ib(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:m,deactivated:b,beforeDestroy:_,beforeUnmount:g,destroyed:v,unmounted:y,render:C,renderTracked:L,renderTriggered:$,errorCaptured:k,serverPrefetch:M,expose:E,inheritAttrs:O,components:S,directives:I,filters:P}=t;if(c&&BI(c,o,null),r)for(const z in r){const U=r[z];Et(U)&&(o[z]=U.bind(n))}if(s){const z=s.call(n,n);nn(z)&&(e.data=No(z))}if(yv=!0,i)for(const z in i){const U=i[z],Q=Et(U)?U.bind(n,n):Et(U.get)?U.get.bind(n,n):Gs,X=!Et(U)&&Et(U.set)?U.set.bind(n):Gs,ue=W({get:Q,set:X});Object.defineProperty(o,z,{enumerable:!0,configurable:!0,get:()=>ue.value,set:me=>ue.value=me})}if(l)for(const z in l)YC(l[z],o,n,z);if(a){const z=Et(a)?a.call(n):a;Reflect.ownKeys(z).forEach(U=>{On(U,z[U])})}u&&ib(u,e,"c");function H(z,U){kt(U)?U.forEach(Q=>z(Q.bind(n))):U&&z(U.bind(n))}if(H(EI,d),H(bn,f),H(VC,h),H(j1,p),H(AI,m),H(TI,b),H(LI,k),H(NI,L),H($I,$),H(vo,g),H(_n,y),H(II,M),kt(E))if(E.length){const z=e.exposed||(e.exposed={});E.forEach(U=>{Object.defineProperty(z,U,{get:()=>n[U],set:Q=>n[U]=Q,enumerable:!0})})}else e.exposed||(e.exposed={});C&&e.render===Gs&&(e.render=C),O!=null&&(e.inheritAttrs=O),S&&(e.components=S),I&&(e.directives=I),M&&q1(e)}function BI(e,t,n=Gs){kt(e)&&(e=kv(e));for(const o in e){const s=e[o];let i;nn(s)?"default"in s?i=jt(s.from||o,s.default,!0):i=jt(s.from||o):i=jt(s),to(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function ib(e,t,n){Qs(kt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function YC(e,t,n,o){let s=o.includes(".")?DC(n,o):()=>n[o];if(kn(e)){const i=t[e];Et(i)&&Ge(s,i)}else if(Et(e))Ge(s,e.bind(n));else if(nn(e))if(kt(e))e.forEach(i=>YC(i,t,n,o));else{const i=Et(e.handler)?e.handler.bind(n):t[e.handler];Et(i)&&Ge(s,i,e)}}function X1(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!o?a=t:(a={},s.length&&s.forEach(c=>Kf(a,c,r,!0)),Kf(a,t,r)),nn(t)&&i.set(t,a),a}function Kf(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&Kf(e,i,n,!0),s&&s.forEach(r=>Kf(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=FI[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const FI={data:rb,props:lb,emits:lb,methods:Gc,computed:Gc,beforeCreate:qo,created:qo,beforeMount:qo,mounted:qo,beforeUpdate:qo,updated:qo,beforeDestroy:qo,beforeUnmount:qo,destroyed:qo,unmounted:qo,activated:qo,deactivated:qo,errorCaptured:qo,serverPrefetch:qo,components:Gc,directives:Gc,watch:WI,provide:rb,inject:HI};function rb(e,t){return t?e?function(){return fn(Et(e)?e.call(this,this):e,Et(t)?t.call(this,this):t)}:t:e}function HI(e,t){return Gc(kv(e),kv(t))}function kv(e){if(kt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function qo(e,t){return e?[...new Set([].concat(e,t))]:t}function Gc(e,t){return e?fn(Object.create(null),e,t):t}function lb(e,t){return e?kt(e)&&kt(t)?[...new Set([...e,...t])]:fn(Object.create(null),Au(e),Au(t??{})):t}function WI(e,t){if(!e)return t;if(!t)return e;const n=fn(Object.create(null),e);for(const o in t)n[o]=qo(e[o],t[o]);return n}function XC(){return{app:null,config:{isNativeTag:rC,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 zI=0;function UI(e,t){return function(o,s=null){Et(o)||(o=fn({},o)),s!=null&&!nn(s)&&(s=null);const i=XC(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:zI++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:k$,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&Et(u.install)?(r.add(u),u.install(c,...d)):Et(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,f){if(!a){const h=c._ceVNode||se(o,s);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(h,u):e(h,u,f),a=!0,c._container=u,u.__vue_app__=c,ed(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Qs(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=Bl;Bl=c;try{return u()}finally{Bl=d}}};return c}}let Bl=null;function wpe(e,t,n=qt){const o=Oo(),s=go(t),i=as(t),r=QC(e,s),l=YE((a,c)=>{let u,d=qt,f;return uI(()=>{const h=e[s];Eo(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const p=n.set?n.set(h):h;if(!Eo(p,u)&&!(d!==qt&&Eo(h,d)))return;const m=o.vnode.props;m&&(t in m||s in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${s}`in m||`onUpdate:${i}`in m)||(u=h,c()),o.emit(`update:${t}`,p),Eo(h,p)&&Eo(h,d)&&!Eo(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||qt:l,done:!1}:{done:!0}}}},l}const QC=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${go(t)}Modifiers`]||e[`${as(t)}Modifiers`];function qI(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||qt;let s=n;const i=t.startsWith("update:"),r=i&&QC(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>kn(u)?u.trim():u)),r.number&&(s=n.map(Gp)));let l,a=o[l=yf(t)]||o[l=yf(go(t))];!a&&i&&(a=o[l=yf(as(t))]),a&&Qs(a,e,6,s);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Qs(c,e,6,s)}}const jI=new WeakMap;function ZC(e,t,n=!1){const o=n?jI:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!Et(e)){const a=c=>{const u=ZC(c,t,!0);u&&(l=!0,fn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(nn(e)&&o.set(e,null),null):(kt(i)?i.forEach(a=>r[a]=null):fn(r,i),nn(e)&&o.set(e,r),r)}function ih(e,t){return!e||!Yu(t)?!1:(t=t.slice(2).replace(/Once$/,""),tn(e,t[0].toLowerCase()+t.slice(1))||tn(e,as(t))||tn(e,t))}function kf(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:m}=e,b=Cu(e);let _,g;try{if(n.shapeFlag&4){const y=s||o,C=y;_=ls(c.call(C,y,u,d,h,f,p)),g=l}else{const y=t;_=ls(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),g=t.props?l:KI(l)}}catch(y){iu.length=0,uc(y,e,1),_=se(ro)}let v=_;if(g&&m!==!1){const y=Object.keys(g),{shapeFlag:C}=v;y.length&&C&7&&(i&&y.some(Up)&&(g=GI(g,i)),v=or(v,g,!1,!0))}return n.dirs&&(v=or(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&jr(v,n.transition),_=v,Cu(b),_}function VI(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(Vr(s)){if(s.type!==ro||s.children==="v-if"){if(n)return;n=s}}else return}return n}const KI=e=>{let t;for(const n in e)(n==="class"||n==="style"||Yu(n))&&((t||(t={}))[n]=e[n]);return t},GI=(e,t)=>{const n={};for(const o in e)(!Up(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function YI(e,t,n){const{props:o,children:s,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 o?ab(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(JC(r,o,f)&&!ih(c,f))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?ab(o,r,c):!0:!!r;return!1}function ab(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){const i=o[s];if(JC(t,e,i)&&!ih(n,i))return!0}return!1}function JC(e,t,n){const o=e[n],s=t[n];return n==="style"&&nn(o)&&nn(s)?!Ji(o,s):o!==s}function rh({vnode:e,parent:t,suspense:n},o){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=o,e=s),s===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}const ex={},tx=()=>Object.create(ex),nx=e=>Object.getPrototypeOf(e)===ex;function XI(e,t,n,o=!1){const s={},i=tx();e.propsDefaults=Object.create(null),ox(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:jE(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function QI(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=Gt(s),[a]=e.propsOptions;let c=!1;if((o||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(ih(e.emitsOptions,f))continue;const h=t[f];if(a)if(tn(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=go(f);s[p]=bv(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{ox(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!tn(t,d)&&((u=as(d))===d||!tn(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=bv(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!tn(t,d))&&(delete i[d],c=!0)}c&&ji(e.attrs,"set","")}function ox(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Rl(a))continue;const c=t[a];let u;s&&tn(s,u=go(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:ih(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=Gt(n),c=l||qt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=bv(s,a,d,c[d],e,!tn(c,d))}}return r}function bv(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=tn(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&Et(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=dc(s);o=c[n]=a.call(null,t),u()}}else o=a;s.ce&&s.ce._setProp(n,o)}r[0]&&(i&&!l?o=!1:r[1]&&(o===""||o===as(n))&&(o=!0))}return o}const ZI=new WeakMap;function sx(e,t,n=!1){const o=n?ZI:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!Et(e)){const u=d=>{a=!0;const[f,h]=sx(d,t,!0);fn(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return nn(e)&&o.set(e,Da),Da;if(kt(i))for(let u=0;u<i.length;u++){const d=go(i[u]);cb(d)&&(r[d]=qt)}else if(i)for(const u in i){const d=go(u);if(cb(d)){const f=i[u],h=r[d]=kt(f)||Et(f)?{type:f}:fn({},f),p=h.type;let m=!1,b=!0;if(kt(p))for(let _=0;_<p.length;++_){const g=p[_],v=Et(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(b=!1)}else m=Et(p)&&p.name==="Boolean";h[0]=m,h[1]=b,(m||tn(h,"default"))&&l.push(d)}}const c=[r,l];return nn(e)&&o.set(e,c),c}function cb(e){return e[0]!=="$"&&!Rl(e)}const Q1=e=>e==="_"||e==="_ctx"||e==="$stable",Z1=e=>kt(e)?e.map(ls):[ls(e)],JI=(e,t,n)=>{if(t._n)return t;const o=ke((...s)=>Z1(t(...s)),n);return o._c=!1,o},ix=(e,t,n)=>{const o=e._ctx;for(const s in e){if(Q1(s))continue;const i=e[s];if(Et(i))t[s]=JI(s,i,o);else if(i!=null){const r=Z1(i);t[s]=()=>r}}},rx=(e,t)=>{const n=Z1(t);e.slots.default=()=>n},lx=(e,t,n)=>{for(const o in t)(n||!Q1(o))&&(e[o]=t[o])},e$=(e,t,n)=>{const o=e.slots=tx();if(e.vnode.shapeFlag&32){const s=t._;s?(lx(o,t,n),n&&aC(o,"_",s,!0)):ix(t,o)}else t&&rx(e,t)},t$=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=qt;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:lx(s,t,n):(i=!t.$stable,ix(t,s)),r=t}else t&&(rx(e,t),r={default:1});if(i)for(const l in s)!Q1(l)&&r[l]==null&&delete s[l]},so=px;function n$(e){return ax(e)}function o$(e){return ax(e,kI)}function ax(e,t){const n=Yp();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=Gs,insertStaticContent:p}=e,m=(q,Y,de,ne=null,ce=null,j=null,G=void 0,re=null,he=!!Y.dynamicChildren)=>{if(q===Y)return;q&&!ri(q,Y)&&(ne=Fe(q),me(q,ce,j,!0),q=null),Y.patchFlag===-2&&(he=!1,Y.dynamicChildren=null);const{type:Ce,ref:Ee,shapeFlag:ae}=Y;switch(Ce){case Wr:b(q,Y,de,ne);break;case ro:_(q,Y,de,ne);break;case Ua:q==null&&g(Y,de,ne,G);break;case Oe:S(q,Y,de,ne,ce,j,G,re,he);break;default:ae&1?C(q,Y,de,ne,ce,j,G,re,he):ae&6?I(q,Y,de,ne,ce,j,G,re,he):(ae&64||ae&128)&&Ce.process(q,Y,de,ne,ce,j,G,re,he,F)}Ee!=null&&ce?Wa(Ee,q&&q.ref,j,Y||q,!Y):Ee==null&&q&&q.ref!=null&&Wa(q.ref,null,j,q,!0)},b=(q,Y,de,ne)=>{if(q==null)o(Y.el=l(Y.children),de,ne);else{const ce=Y.el=q.el;Y.children!==q.children&&c(ce,Y.children)}},_=(q,Y,de,ne)=>{q==null?o(Y.el=a(Y.children||""),de,ne):Y.el=q.el},g=(q,Y,de,ne)=>{[q.el,q.anchor]=p(q.children,Y,de,ne,q.el,q.anchor)},v=({el:q,anchor:Y},de,ne)=>{let ce;for(;q&&q!==Y;)ce=f(q),o(q,de,ne),q=ce;o(Y,de,ne)},y=({el:q,anchor:Y})=>{let de;for(;q&&q!==Y;)de=f(q),s(q),q=de;s(Y)},C=(q,Y,de,ne,ce,j,G,re,he)=>{if(Y.type==="svg"?G="svg":Y.type==="math"&&(G="mathml"),q==null)L(Y,de,ne,ce,j,G,re,he);else{const Ce=q.el&&q.el._isVueCE?q.el:null;try{Ce&&Ce._beginPatch(),M(q,Y,ce,j,G,re,he)}finally{Ce&&Ce._endPatch()}}},L=(q,Y,de,ne,ce,j,G,re)=>{let he,Ce;const{props:Ee,shapeFlag:ae,transition:xe,dirs:Ke}=q;if(he=q.el=r(q.type,j,Ee&&Ee.is,Ee),ae&8?u(he,q.children):ae&16&&k(q.children,he,null,ne,ce,jm(q,j),G,re),Ke&&Ai(q,null,ne,"created"),$(he,q,q.scopeId,G,ne),Ee){for(const _t in Ee)_t!=="value"&&!Rl(_t)&&i(he,_t,null,Ee[_t],j,ne);"value"in Ee&&i(he,"value",null,Ee.value,j),(Ce=Ee.onVnodeBeforeMount)&&ss(Ce,ne,q)}Ke&&Ai(q,null,ne,"beforeMount");const ot=cx(ce,xe);ot&&xe.beforeEnter(he),o(he,Y,de),((Ce=Ee&&Ee.onVnodeMounted)||ot||Ke)&&so(()=>{try{Ce&&ss(Ce,ne,q),ot&&xe.enter(he),Ke&&Ai(q,null,ne,"mounted")}finally{}},ce)},$=(q,Y,de,ne,ce)=>{if(de&&h(q,de),ne)for(let j=0;j<ne.length;j++)h(q,ne[j]);if(ce){let j=ce.subTree;if(Y===j||Yf(j.type)&&(j.ssContent===Y||j.ssFallback===Y)){const G=ce.vnode;$(q,G,G.scopeId,G.slotScopeIds,ce.parent)}}},k=(q,Y,de,ne,ce,j,G,re,he=0)=>{for(let Ce=he;Ce<q.length;Ce++){const Ee=q[Ce]=re?qi(q[Ce]):ls(q[Ce]);m(null,Ee,Y,de,ne,ce,j,G,re)}},M=(q,Y,de,ne,ce,j,G)=>{const re=Y.el=q.el;let{patchFlag:he,dynamicChildren:Ce,dirs:Ee}=Y;he|=q.patchFlag&16;const ae=q.props||qt,xe=Y.props||qt;let Ke;if(de&&kl(de,!1),(Ke=xe.onVnodeBeforeUpdate)&&ss(Ke,de,Y,q),Ee&&Ai(Y,q,de,"beforeUpdate"),de&&kl(de,!0),(ae.innerHTML&&xe.innerHTML==null||ae.textContent&&xe.textContent==null)&&u(re,""),Ce?E(q.dynamicChildren,Ce,re,de,ne,jm(Y,ce),j):G||U(q,Y,re,null,de,ne,jm(Y,ce),j,!1),he>0){if(he&16)O(re,ae,xe,de,ce);else if(he&2&&ae.class!==xe.class&&i(re,"class",null,xe.class,ce),he&4&&i(re,"style",ae.style,xe.style,ce),he&8){const ot=Y.dynamicProps;for(let _t=0;_t<ot.length;_t++){const wt=ot[_t],It=ae[wt],Pt=xe[wt];(Pt!==It||wt==="value")&&i(re,wt,It,Pt,ce,de)}}he&1&&q.children!==Y.children&&u(re,Y.children)}else!G&&Ce==null&&O(re,ae,xe,de,ce);((Ke=xe.onVnodeUpdated)||Ee)&&so(()=>{Ke&&ss(Ke,de,Y,q),Ee&&Ai(Y,q,de,"updated")},ne)},E=(q,Y,de,ne,ce,j,G)=>{for(let re=0;re<Y.length;re++){const he=q[re],Ce=Y[re],Ee=he.el&&(he.type===Oe||!ri(he,Ce)||he.shapeFlag&198)?d(he.el):de;m(he,Ce,Ee,null,ne,ce,j,G,!0)}},O=(q,Y,de,ne,ce)=>{if(Y!==de){if(Y!==qt)for(const j in Y)!Rl(j)&&!(j in de)&&i(q,j,Y[j],null,ce,ne);for(const j in de){if(Rl(j))continue;const G=de[j],re=Y[j];G!==re&&j!=="value"&&i(q,j,re,G,ce,ne)}"value"in de&&i(q,"value",Y.value,de.value,ce)}},S=(q,Y,de,ne,ce,j,G,re,he)=>{const Ce=Y.el=q?q.el:l(""),Ee=Y.anchor=q?q.anchor:l("");let{patchFlag:ae,dynamicChildren:xe,slotScopeIds:Ke}=Y;Ke&&(re=re?re.concat(Ke):Ke),q==null?(o(Ce,de,ne),o(Ee,de,ne),k(Y.children||[],de,Ee,ce,j,G,re,he)):ae>0&&ae&64&&xe&&q.dynamicChildren&&q.dynamicChildren.length===xe.length?(E(q.dynamicChildren,xe,de,ce,j,G,re),(Y.key!=null||ce&&Y===ce.subTree)&&J1(q,Y,!0)):U(q,Y,de,Ee,ce,j,G,re,he)},I=(q,Y,de,ne,ce,j,G,re,he)=>{Y.slotScopeIds=re,q==null?Y.shapeFlag&512?ce.ctx.activate(Y,de,ne,G,he):P(Y,de,ne,ce,j,G,he):D(q,Y,he)},P=(q,Y,de,ne,ce,j,G)=>{const re=q.component=vx(q,ne,ce);if(Zu(q)&&(re.ctx.renderer=F),kx(re,!1,G),re.asyncDep){if(ce&&ce.registerDep(re,H,G),!q.el){const he=re.subTree=se(ro);_(null,he,Y,de),q.placeholder=he.el}}else H(re,q,Y,de,ce,j,G)},D=(q,Y,de)=>{const ne=Y.component=q.component;if(YI(q,Y,de))if(ne.asyncDep&&!ne.asyncResolved){z(ne,Y,de);return}else ne.next=Y,ne.update();else Y.el=q.el,ne.vnode=Y},H=(q,Y,de,ne,ce,j,G)=>{const re=()=>{if(q.isMounted){let{next:ae,bu:xe,u:Ke,parent:ot,vnode:_t}=q;{const Kt=ux(q);if(Kt){ae&&(ae.el=_t.el,z(q,ae,G)),Kt.asyncDep.then(()=>{so(()=>{q.isUnmounted||Ce()},ce)});return}}let wt=ae,It;kl(q,!1),ae?(ae.el=_t.el,z(q,ae,G)):ae=_t,xe&&Fa(xe),(It=ae.props&&ae.props.onVnodeBeforeUpdate)&&ss(It,ot,ae,_t),kl(q,!0);const Pt=kf(q),bt=q.subTree;q.subTree=Pt,m(bt,Pt,d(bt.el),Fe(bt),q,ce,j),ae.el=Pt.el,wt===null&&rh(q,Pt.el),Ke&&so(Ke,ce),(It=ae.props&&ae.props.onVnodeUpdated)&&so(()=>ss(It,ot,ae,_t),ce)}else{let ae;const{el:xe,props:Ke}=Y,{bm:ot,m:_t,parent:wt,root:It,type:Pt}=q,bt=Qi(Y);if(kl(q,!1),ot&&Fa(ot),!bt&&(ae=Ke&&Ke.onVnodeBeforeMount)&&ss(ae,wt,Y),kl(q,!0),xe&&ee){const Kt=()=>{q.subTree=kf(q),ee(xe,q.subTree,q,ce,null)};bt&&Pt.__asyncHydrate?Pt.__asyncHydrate(xe,q,Kt):Kt()}else{It.ce&&It.ce._hasShadowRoot()&&It.ce._injectChildStyle(Pt,q.parent?q.parent.type:void 0);const Kt=q.subTree=kf(q);m(null,Kt,de,ne,q,ce,j),Y.el=Kt.el}if(_t&&so(_t,ce),!bt&&(ae=Ke&&Ke.onVnodeMounted)){const Kt=Y;so(()=>ss(ae,wt,Kt),ce)}(Y.shapeFlag&256||wt&&Qi(wt.vnode)&&wt.vnode.shapeFlag&256)&&q.a&&so(q.a,ce),q.isMounted=!0,Y=de=ne=null}};q.scope.on();const he=q.effect=new Ff(re);q.scope.off();const Ce=q.update=he.run.bind(he),Ee=q.job=he.runIfDirty.bind(he);Ee.i=q,Ee.id=q.uid,he.scheduler=()=>z1(Ee),kl(q,!0),Ce()},z=(q,Y,de)=>{Y.component=q;const ne=q.vnode.props;q.vnode=Y,q.next=null,QI(q,Y.props,ne,de),t$(q,Y.children,de),er(),Xk(q),tr()},U=(q,Y,de,ne,ce,j,G,re,he=!1)=>{const Ce=q&&q.children,Ee=q?q.shapeFlag:0,ae=Y.children,{patchFlag:xe,shapeFlag:Ke}=Y;if(xe>0){if(xe&128){X(Ce,ae,de,ne,ce,j,G,re,he);return}else if(xe&256){Q(Ce,ae,de,ne,ce,j,G,re,he);return}}Ke&8?(Ee&16&&qe(Ce,ce,j),ae!==Ce&&u(de,ae)):Ee&16?Ke&16?X(Ce,ae,de,ne,ce,j,G,re,he):qe(Ce,ce,j,!0):(Ee&8&&u(de,""),Ke&16&&k(ae,de,ne,ce,j,G,re,he))},Q=(q,Y,de,ne,ce,j,G,re,he)=>{q=q||Da,Y=Y||Da;const Ce=q.length,Ee=Y.length,ae=Math.min(Ce,Ee);let xe;for(xe=0;xe<ae;xe++){const Ke=Y[xe]=he?qi(Y[xe]):ls(Y[xe]);m(q[xe],Ke,de,null,ce,j,G,re,he)}Ce>Ee?qe(q,ce,j,!0,!1,ae):k(Y,de,ne,ce,j,G,re,he,ae)},X=(q,Y,de,ne,ce,j,G,re,he)=>{let Ce=0;const Ee=Y.length;let ae=q.length-1,xe=Ee-1;for(;Ce<=ae&&Ce<=xe;){const Ke=q[Ce],ot=Y[Ce]=he?qi(Y[Ce]):ls(Y[Ce]);if(ri(Ke,ot))m(Ke,ot,de,null,ce,j,G,re,he);else break;Ce++}for(;Ce<=ae&&Ce<=xe;){const Ke=q[ae],ot=Y[xe]=he?qi(Y[xe]):ls(Y[xe]);if(ri(Ke,ot))m(Ke,ot,de,null,ce,j,G,re,he);else break;ae--,xe--}if(Ce>ae){if(Ce<=xe){const Ke=xe+1,ot=Ke<Ee?Y[Ke].el:ne;for(;Ce<=xe;)m(null,Y[Ce]=he?qi(Y[Ce]):ls(Y[Ce]),de,ot,ce,j,G,re,he),Ce++}}else if(Ce>xe)for(;Ce<=ae;)me(q[Ce],ce,j,!0),Ce++;else{const Ke=Ce,ot=Ce,_t=new Map;for(Ce=ot;Ce<=xe;Ce++){const Dt=Y[Ce]=he?qi(Y[Ce]):ls(Y[Ce]);Dt.key!=null&&_t.set(Dt.key,Ce)}let wt,It=0;const Pt=xe-ot+1;let bt=!1,Kt=0;const Dn=new Array(Pt);for(Ce=0;Ce<Pt;Ce++)Dn[Ce]=0;for(Ce=Ke;Ce<=ae;Ce++){const Dt=q[Ce];if(It>=Pt){me(Dt,ce,j,!0);continue}let pn;if(Dt.key!=null)pn=_t.get(Dt.key);else for(wt=ot;wt<=xe;wt++)if(Dn[wt-ot]===0&&ri(Dt,Y[wt])){pn=wt;break}pn===void 0?me(Dt,ce,j,!0):(Dn[pn-ot]=Ce+1,pn>=Kt?Kt=pn:bt=!0,m(Dt,Y[pn],de,null,ce,j,G,re,he),It++)}const In=bt?s$(Dn):Da;for(wt=In.length-1,Ce=Pt-1;Ce>=0;Ce--){const Dt=ot+Ce,pn=Y[Dt],Kn=Y[Dt+1],nt=Dt+1<Ee?Kn.el||dx(Kn):ne;Dn[Ce]===0?m(null,pn,de,nt,ce,j,G,re,he):bt&&(wt<0||Ce!==In[wt]?ue(pn,de,nt,2):wt--)}}},ue=(q,Y,de,ne,ce=null)=>{const{el:j,type:G,transition:re,children:he,shapeFlag:Ce}=q;if(Ce&6){ue(q.component.subTree,Y,de,ne);return}if(Ce&128){q.suspense.move(Y,de,ne);return}if(Ce&64){G.move(q,Y,de,F);return}if(G===Oe){o(j,Y,de);for(let ae=0;ae<he.length;ae++)ue(he[ae],Y,de,ne);o(q.anchor,Y,de);return}if(G===Ua){v(q,Y,de);return}if(ne!==2&&Ce&1&&re)if(ne===0)re.persisted&&!j[zs]?o(j,Y,de):(re.beforeEnter(j),o(j,Y,de),so(()=>re.enter(j),ce));else{const{leave:ae,delayLeave:xe,afterLeave:Ke}=re,ot=()=>{q.ctx.isUnmounted?s(j):o(j,Y,de)},_t=()=>{const wt=j._isLeaving||!!j[zs];j._isLeaving&&j[zs](!0),re.persisted&&!wt?ot():ae(j,()=>{ot(),Ke&&Ke()})};xe?xe(j,ot,_t):_t()}else o(j,Y,de)},me=(q,Y,de,ne=!1,ce=!1)=>{const{type:j,props:G,ref:re,children:he,dynamicChildren:Ce,shapeFlag:Ee,patchFlag:ae,dirs:xe,cacheIndex:Ke,memo:ot}=q;if(ae===-2&&(ce=!1),re!=null&&(er(),Wa(re,null,de,q,!0),tr()),Ke!=null&&(Y.renderCache[Ke]=void 0),Ee&256){Y.ctx.deactivate(q);return}const _t=Ee&1&&xe,wt=!Qi(q);let It;if(wt&&(It=G&&G.onVnodeBeforeUnmount)&&ss(It,Y,q),Ee&6)ze(q.component,de,ne);else{if(Ee&128){q.suspense.unmount(de,ne);return}_t&&Ai(q,null,Y,"beforeUnmount"),Ee&64?q.type.remove(q,Y,de,F,ne):Ce&&!Ce.hasOnce&&(j!==Oe||ae>0&&ae&64)?qe(Ce,Y,de,!1,!0):(j===Oe&&ae&384||!ce&&Ee&16)&&qe(he,Y,de),ne&&Ae(q)}const Pt=ot!=null&&Ke==null;(wt&&(It=G&&G.onVnodeUnmounted)||_t||Pt)&&so(()=>{It&&ss(It,Y,q),_t&&Ai(q,null,Y,"unmounted"),Pt&&(q.el=null)},de)},Ae=q=>{const{type:Y,el:de,anchor:ne,transition:ce}=q;if(Y===Oe){be(de,ne);return}if(Y===Ua){y(q);return}const j=()=>{s(de),ce&&!ce.persisted&&ce.afterLeave&&ce.afterLeave()};if(q.shapeFlag&1&&ce&&!ce.persisted){const{leave:G,delayLeave:re}=ce,he=()=>G(de,j);re?re(q.el,j,he):he()}else j()},be=(q,Y)=>{let de;for(;q!==Y;)de=f(q),s(q),q=de;s(Y)},ze=(q,Y,de)=>{const{bum:ne,scope:ce,job:j,subTree:G,um:re,m:he,a:Ce}=q;Gf(he),Gf(Ce),ne&&Fa(ne),ce.stop(),j&&(j.flags|=8,me(G,q,Y,de)),re&&so(re,Y),so(()=>{q.isUnmounted=!0},Y)},qe=(q,Y,de,ne=!1,ce=!1,j=0)=>{for(let G=j;G<q.length;G++)me(q[G],Y,de,ne,ce)},Fe=q=>{if(q.shapeFlag&6)return Fe(q.component.subTree);if(q.shapeFlag&128)return q.suspense.next();const Y=f(q.anchor||q.el),de=Y&&Y[BC];return de?f(de):Y};let Le=!1;const le=(q,Y,de)=>{let ne;q==null?Y._vnode&&(me(Y._vnode,null,null,!0),ne=Y._vnode.component):m(Y._vnode||null,q,Y,null,null,null,de),Y._vnode=q,Le||(Le=!0,Xk(ne),jf(),Le=!1)},F={p:m,um:me,m:ue,r:Ae,mt:P,mc:k,pc:U,pbc:E,n:Fe,o:e};let te,ee;return t&&([te,ee]=t(F)),{render:le,hydrate:te,createApp:UI(le,te)}}function jm({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 kl({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function cx(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function J1(e,t,n=!1){const o=e.children,s=t.children;if(kt(o)&&kt(s))for(let i=0;i<o.length;i++){const r=o[i];let l=s[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=s[i]=qi(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&J1(r,l)),l.type===Wr&&(l.patchFlag===-1&&(l=s[i]=qi(l)),l.el=r.el),l.type===ro&&!l.el&&(l.el=r.el)}}function s$(e){const t=e.slice(),n=[0];let o,s,i,r,l;const a=e.length;for(o=0;o<a;o++){const c=e[o];if(c!==0){if(s=n[n.length-1],e[s]<c){t[o]=s,n.push(o);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[o]=n[i-1]),n[i]=o)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function ux(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ux(t)}function Gf(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function dx(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?dx(t.subTree):null}const Yf=e=>e.__isSuspense;let _v=0;const i$={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)r$(t,n,o,s,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}l$(e,t,n,o,s,r,l,a,c)}},hydrate:a$,normalize:c$},Spe=i$;function Tu(e,t){const n=e.props&&e.props[t];Et(n)&&n()}function r$(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=fx(e,s,o,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,o,f,i,r),f.deps>0?(Tu(e,"onPending"),Tu(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),za(f,e.ssFallback)):f.resolve(!1,!0)}function l$(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:p,pendingBranch:m,isInFallback:b,isHydrating:_}=d;if(m)d.pendingBranch=f,ri(m,f)?(a(m,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():b&&(_||(a(p,h,n,o,s,null,i,r,l),za(d,h)))):(d.pendingId=_v++,_?(d.isHydrating=!1,d.activeBranch=m):c(m,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),b?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,o,s,null,i,r,l),za(d,h))):p&&ri(p,f)?(a(p,f,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(p&&ri(p,f))a(p,f,n,o,s,d,i,r,l),za(d,f);else if(Tu(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=_v++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:v}=d;g>0?setTimeout(()=>{d.pendingId===v&&d.fallback(h)},g):g===0&&d.fallback(h)}}function fx(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:m,remove:b}}=c;let _;const g=u$(e);g&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);const v=e.props?Bf(e.props.timeout):void 0,y=i,C={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:_v++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(L=!1,$=!1){const{vnode:k,activeBranch:M,pendingBranch:E,pendingId:O,effects:S,parentComponent:I,container:P,isInFallback:D}=C;let H=!1;if(C.isHydrating)C.isHydrating=!1;else if(!L){H=M&&E.transition&&E.transition.mode==="out-in";let Q=!1;H&&(M.transition.afterLeave=()=>{O===C.pendingId&&(f(E,P,i===y&&!Q?p(M):i,0),qf(S),D&&k.ssFallback&&(k.ssFallback.el=null))}),M&&!C.isFallbackMountPending&&(m(M.el)===P&&(i=p(M),Q=!0),h(M,I,C,!0),!H&&D&&k.ssFallback&&so(()=>k.ssFallback.el=null,C)),H||f(E,P,i,0)}C.isFallbackMountPending=!1,za(C,E),C.pendingBranch=null,C.isInFallback=!1;let z=C.parent,U=!1;for(;z;){if(z.pendingBranch){z.effects.push(...S),U=!0;break}z=z.parent}!U&&!H&&qf(S),C.effects=[],g&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!$&&t.resolve()),Tu(k,"onResolve")},fallback(L){if(!C.pendingBranch)return;const{vnode:$,activeBranch:k,parentComponent:M,container:E,namespace:O}=C;Tu($,"onFallback");const S=p(k),I=()=>{C.isFallbackMountPending=!1,C.isInFallback&&(d(null,L,E,S,M,null,O,l,a),za(C,L))},P=L.transition&&L.transition.mode==="out-in";P&&(C.isFallbackMountPending=!0,k.transition.afterLeave=I),C.isInFallback=!0,h(k,M,null,!0),P||I()},move(L,$,k){C.activeBranch&&f(C.activeBranch,L,$,k),C.container=L},next(){return C.activeBranch&&p(C.activeBranch)},registerDep(L,$,k){const M=!!C.pendingBranch;M&&C.deps++;const E=L.vnode.el;L.asyncDep.catch(O=>{uc(O,L,0)}).then(O=>{if(L.isUnmounted||C.isUnmounted||C.pendingId!==L.suspenseId)return;Mu(),L.asyncResolved=!0;const{vnode:S}=L;wv(L,O,!1),E&&(S.el=E);const I=!E&&L.subTree.el;$(L,S,m(E||L.subTree.el),E?null:p(L.subTree),C,r,k),I&&(S.placeholder=null,b(I)),rh(L,S.el),M&&--C.deps===0&&C.resolve()})},unmount(L,$){C.isUnmounted=!0,C.activeBranch&&h(C.activeBranch,n,L,$),C.pendingBranch&&h(C.pendingBranch,n,L,$)}};return C}function a$(e,t,n,o,s,i,r,l,a){const c=t.suspense=fx(t,o,n,e.parentNode,document.createElement("div"),null,s,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 c$(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=ub(o?n.default:n),e.ssFallback=o?ub(n.fallback):se(ro)}function ub(e){let t;if(Et(e)){const n=Ul&&e._c;n&&(e._d=!1,w()),e=e(),n&&(e._d=!0,t=Ho,hx())}return kt(e)&&(e=VI(e)),e=ls(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function px(e,t){t&&t.pendingBranch?kt(e)?t.effects.push(...e):t.effects.push(e):qf(e)}function za(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let s=t.el;for(;!s&&t.component;)t=t.component.subTree,s=t.el;n.el=s,o&&o.subTree===n&&(o.vnode.el=s,rh(o,s))}function u$(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Oe=Symbol.for("v-fgt"),Wr=Symbol.for("v-txt"),ro=Symbol.for("v-cmt"),Ua=Symbol.for("v-stc"),iu=[];let Ho=null;function w(e=!1){iu.push(Ho=e?null:[])}function hx(){iu.pop(),Ho=iu[iu.length-1]||null}let Ul=1;function Xf(e,t=!1){Ul+=e,e<0&&Ho&&t&&(Ho.hasOnce=!0)}function mx(e){return e.dynamicChildren=Ul>0?Ho||Da:null,hx(),Ul>0&&Ho&&Ho.push(e),e}function N(e,t,n,o,s,i){return mx(T(e,t,n,o,s,i,!0))}function ge(e,t,n,o,s){return mx(se(e,t,n,o,s,!0))}function Vr(e){return e?e.__v_isVNode===!0:!1}function ri(e,t){return e.type===t.type&&e.key===t.key}function Cpe(e){}const gx=({key:e})=>e??null,bf=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?kn(e)||to(e)||Et(e)?{i:Lo,r:e,k:t,f:!!n}:e:null);function T(e,t=null,n=null,o=0,s=null,i=e===Oe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&gx(t),ref:t&&bf(t),scopeId:nh,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:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Lo};return l?(t0(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=kn(n)?8:16),Ul>0&&!r&&Ho&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&Ho.push(a),a}const se=d$;function d$(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===KC)&&(e=ro),Vr(e)){const l=or(e,t,!0);return n&&t0(l,n),Ul>0&&!i&&Ho&&(l.shapeFlag&6?Ho[Ho.indexOf(e)]=l:Ho.push(l)),l.patchFlag=-2,l}if(v$(e)&&(e=e.__vccOpts),t){t=f$(t);let{class:l,style:a}=t;l&&!kn(l)&&(t.class=De(l)),nn(a)&&(th(a)&&!kt(a)&&(a=fn({},a)),t.style=Yt(a))}const r=kn(e)?1:Yf(e)?128:FC(e)?64:nn(e)?4:Et(e)?2:0;return T(e,t,n,o,s,r,i,!0)}function f$(e){return e?th(e)||nx(e)?fn({},e):e:null}function or(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?un(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&gx(c),ref:t&&t.ref?n&&i?kt(i)?i.concat(bf(t)):[i,bf(t)]:bf(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!==Oe?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&&or(e.ssContent),ssFallback:e.ssFallback&&or(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&jr(u,a.clone(u)),u}function je(e=" ",t=0){return se(Wr,null,e,t)}function e0(e,t){const n=se(Ua,null,e);return n.staticCount=t,n}function ie(e="",t=!1){return t?(w(),ge(ro,null,e)):se(ro,null,e)}function ls(e){return e==null||typeof e=="boolean"?se(ro):kt(e)?se(Oe,null,e.slice()):Vr(e)?qi(e):se(Wr,null,String(e))}function qi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:or(e)}function t0(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(kt(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),t0(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!nx(t)?t._ctx=Lo:s===3&&Lo&&(Lo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Et(t)?(t={default:t,_ctx:Lo},n=32):(t=String(t),o&64?(n=16,t=[je(t)]):n=8);e.children=t,e.shapeFlag|=n}function un(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=De([t.class,o.class]));else if(s==="style")t.style=Yt([t.style,o.style]);else if(Yu(s)){const i=t[s],r=o[s];r&&i!==r&&!(kt(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!Up(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function ss(e,t,n,o=null){Qs(e,t,7,[n,o])}const p$=XC();let h$=0;function vx(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||p$,i={uid:h$++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new fC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:sx(o,s),emitsOptions:ZC(o,s),emit:null,emitted:null,propsDefaults:qt,inheritAttrs:o.inheritAttrs,ctx:qt,data:qt,props:qt,attrs:qt,slots:qt,refs:qt,setupState:qt,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=qI.bind(null,i),e.ce&&e.ce(i),i}let Io=null;const Oo=()=>Io||Lo;let Qf,qa;{const e=Yp(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),i=>{s.length>1?s.forEach(r=>r(i)):s[0](i)}};Qf=t("__VUE_INSTANCE_SETTERS__",n=>Io=n),qa=t("__VUE_SSR_SETTERS__",n=>ql=n)}const dc=e=>{const t=Io;return Qf(e),e.scope.on(),()=>{e.scope.off(),Qf(t)}},Mu=()=>{Io&&Io.scope.off(),Qf(null)};function yx(e){return e.vnode.shapeFlag&4}let ql=!1;function kx(e,t=!1,n=!1){t&&qa(t);const{props:o,children:s}=e.vnode,i=yx(e);XI(e,o,i,t),e$(e,s,n||t);const r=i?m$(e,t):void 0;return t&&qa(!1),r}function m$(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,vv);const{setup:o}=n;if(o){er();const s=e.setupContext=o.length>1?_x(e):null,i=dc(e),r=Xu(o,e,0,[e.props,s]),l=R1(r);if(tr(),i(),(l||e.sp)&&!Qi(e)&&q1(e),l){if(r.then(Mu,Mu),t)return r.then(a=>{wv(e,a,t)}).catch(a=>{uc(a,e,0)});e.asyncDep=r}else wv(e,r,t)}else bx(e,t)}function wv(e,t,n){Et(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:nn(t)&&(e.setupState=IC(t)),bx(e,n)}let Zf,Sv;function xpe(e){Zf=e,Sv=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,RI))}}const Ape=()=>!Zf;function bx(e,t,n){const o=e.type;if(!e.render){if(!t&&Zf&&!o.render){const s=o.template||X1(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=fn(fn({isCustomElement:i,delimiters:l},r),a);o.render=Zf(s,c)}}e.render=o.render||Gs,Sv&&Sv(e)}{const s=dc(e);er();try{DI(e)}finally{tr(),s()}}}const g$={get(e,t){return Bo(e,"get",""),e[t]}};function _x(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,g$),slots:e.slots,emit:e.emit,expose:t}}function ed(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(IC(Rr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in su)return su[n](e)},has(t,n){return n in t||n in su}})):e.proxy}function Cv(e,t=!0){return Et(e)?e.displayName||e.name:e.name||t&&e.__name}function v$(e){return Et(e)&&"__vccOpts"in e}const W=(e,t)=>JE(e,t,ql);function ln(e,t,n){try{Xf(-1);const o=arguments.length;return o===2?nn(t)&&!kt(t)?Vr(t)?se(e,null,[t]):se(e,t):se(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Vr(n)&&(n=[n]),se(e,t,n))}finally{Xf(1)}}function Tpe(){}function Mpe(e,t,n,o){const s=n[o];if(s&&y$(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function y$(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(Eo(n[o],t[o]))return!1;return Ul>0&&Ho&&Ho.push(e),!0}const k$="3.5.35",Epe=Gs,Ipe=sI,$pe=Ca,Npe=RC,b$={createComponentInstance:vx,setupComponent:kx,renderComponentRoot:kf,setCurrentRenderingInstance:Cu,isVNode:Vr,normalizeVNode:ls,getComponentPublicInstance:ed,ensureValidVNode:Y1,pushWarningContext:nI,popWarningContext:oI},Lpe=b$,Ope=null,Ppe=null,Rpe=null;/**
|
|
17
|
+
* @vue/runtime-dom v3.5.35
|
|
18
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
+
* @license MIT
|
|
20
|
+
**/let xv;const db=typeof window<"u"&&window.trustedTypes;if(db)try{xv=db.createPolicy("vue",{createHTML:e=>e})}catch{}const wx=xv?e=>xv.createHTML(e):e=>e,_$="http://www.w3.org/2000/svg",w$="http://www.w3.org/1998/Math/MathML",Wi=typeof document<"u"?document:null,fb=Wi&&Wi.createElement("template"),S$={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?Wi.createElementNS(_$,e):t==="mathml"?Wi.createElementNS(w$,e):n?Wi.createElement(e,{is:n}):Wi.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>Wi.createTextNode(e),createComment:e=>Wi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Wi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,i){const r=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{fb.innerHTML=wx(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=fb.content;if(o==="svg"||o==="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]}},vr="transition",Fc="animation",ec=Symbol("_vtc"),Sx={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},Cx=fn({},WC,Sx),C$=e=>(e.displayName="Transition",e.props=Cx,e),Kr=C$((e,{slots:t})=>ln(gI,xx(e),t)),bl=(e,t=[])=>{kt(e)?e.forEach(n=>n(...t)):e&&e(...t)},pb=e=>e?kt(e)?e.some(t=>t.length>1):e.length>1:!1;function xx(e){const t={};for(const S in e)S in Sx||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,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:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=x$(s),m=p&&p[0],b=p&&p[1],{onBeforeEnter:_,onEnter:g,onEnterCancelled:v,onLeave:y,onLeaveCancelled:C,onBeforeAppear:L=_,onAppear:$=g,onAppearCancelled:k=v}=t,M=(S,I,P,D)=>{S._enterCancelled=D,Tr(S,I?u:l),Tr(S,I?c:r),P&&P()},E=(S,I)=>{S._isLeaving=!1,Tr(S,d),Tr(S,h),Tr(S,f),I&&I()},O=S=>(I,P)=>{const D=S?$:g,H=()=>M(I,S,P);bl(D,[I,H]),hb(()=>{Tr(I,S?a:i),Si(I,S?u:l),pb(D)||mb(I,o,m,H)})};return fn(t,{onBeforeEnter(S){bl(_,[S]),Si(S,i),Si(S,r)},onBeforeAppear(S){bl(L,[S]),Si(S,a),Si(S,c)},onEnter:O(!1),onAppear:O(!0),onLeave(S,I){S._isLeaving=!0;const P=()=>E(S,I);Si(S,d),S._enterCancelled?(Si(S,f),Av(S)):(Av(S),Si(S,f)),hb(()=>{S._isLeaving&&(Tr(S,d),Si(S,h),pb(y)||mb(S,o,b,P))}),bl(y,[S,P])},onEnterCancelled(S){M(S,!1,void 0,!0),bl(v,[S])},onAppearCancelled(S){M(S,!0,void 0,!0),bl(k,[S])},onLeaveCancelled(S){E(S),bl(C,[S])}})}function x$(e){if(e==null)return null;if(nn(e))return[Vm(e.enter),Vm(e.leave)];{const t=Vm(e);return[t,t]}}function Vm(e){return Bf(e)}function Si(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ec]||(e[ec]=new Set)).add(t)}function Tr(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[ec];n&&(n.delete(t),n.size||(e[ec]=void 0))}function hb(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let A$=0;function mb(e,t,n,o){const s=e._endId=++A$,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=Ax(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=h=>{h.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function Ax(e,t){const n=window.getComputedStyle(e),o=p=>(n[p]||"").split(", "),s=o(`${vr}Delay`),i=o(`${vr}Duration`),r=gb(s,i),l=o(`${Fc}Delay`),a=o(`${Fc}Duration`),c=gb(l,a);let u=null,d=0,f=0;t===vr?r>0&&(u=vr,d=r,f=i.length):t===Fc?c>0&&(u=Fc,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?vr:Fc:null,f=u?u===vr?i.length:a.length:0);const h=u===vr&&/\b(?:transform|all)(?:,|$)/.test(o(`${vr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function gb(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>vb(n)+vb(e[o])))}function vb(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Av(e){return(e?e.ownerDocument:document).body.offsetHeight}function T$(e,t,n){const o=e[ec];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Jf=Symbol("_vod"),Tx=Symbol("_vsh"),Vs={name:"show",beforeMount(e,{value:t},{transition:n}){e[Jf]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Hc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Hc(e,!0),o.enter(e)):o.leave(e,()=>{Hc(e,!1)}):Hc(e,t))},beforeUnmount(e,{value:t}){Hc(e,t)}};function Hc(e,t){e.style.display=t?e[Jf]:"none",e[Tx]=!t}function M$(){Vs.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const Mx=Symbol("");function Dpe(e){const t=Oo();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>ep(i,s))},o=()=>{const s=e(t.proxy);t.ce?ep(t.ce,s):Tv(t.subTree,s),n(s)};VC(()=>{qf(o)}),bn(()=>{Ge(o,Gs,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),_n(()=>s.disconnect())})}function Tv(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Tv(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)ep(e.el,t);else if(e.type===Oe)e.children.forEach(n=>Tv(n,t));else if(e.type===Ua){let{el:n,anchor:o}=e;for(;n&&(ep(n,t),n!==o);)n=n.nextSibling}}function ep(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=xE(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[Mx]=o}}const E$=/(?:^|;)\s*display\s*:/;function I$(e,t,n){const o=e.style,s=kn(n);let i=!1;if(n&&!s){if(t)if(kn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Yc(o,l,"")}else for(const r in t)n[r]==null&&Yc(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?N$(e,r,!kn(t)&&t?t[r]:void 0,l)||Yc(o,r,l):Yc(o,r,"")}}else if(s){if(t!==n){const r=o[Mx];r&&(n+=";"+r),o.cssText=n,i=E$.test(n)}}else t&&e.removeAttribute("style");Jf in e&&(e[Jf]=i?o.display:"",e[Tx]&&(o.display="none"))}const yb=/\s*!important$/;function Yc(e,t,n){if(kt(n))n.forEach(o=>Yc(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=$$(e,t);yb.test(n)?e.setProperty(as(o),n.replace(yb,""),"important"):e[o]=n}}const kb=["Webkit","Moz","ms"],Km={};function $$(e,t){const n=Km[t];if(n)return n;let o=go(t);if(o!=="filter"&&o in e)return Km[t]=o;o=Kp(o);for(let s=0;s<kb.length;s++){const i=kb[s]+o;if(i in e)return Km[t]=i}return t}function N$(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&kn(o)&&n===o}const bb="http://www.w3.org/1999/xlink";function _b(e,t,n,o,s,i=SE(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(bb,t.slice(6,t.length)):e.setAttributeNS(bb,t,n):n==null||i&&!cC(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Is(n)?String(n):n)}function wb(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?wx(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=cC(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(s||t)}function Ki(e,t,n,o){e.addEventListener(t,n,o)}function L$(e,t,n,o){e.removeEventListener(t,n,o)}const Sb=Symbol("_vei");function O$(e,t,n,o,s=null){const i=e[Sb]||(e[Sb]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=P$(t);if(o){const c=i[t]=B$(o,s);Ki(e,l,c,a)}else r&&(L$(e,l,r,a),i[t]=void 0)}}const Cb=/(?:Once|Passive|Capture)$/;function P$(e){let t;if(Cb.test(e)){t={};let o;for(;o=e.match(Cb);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):as(e.slice(2)),t]}let Gm=0;const R$=Promise.resolve(),D$=()=>Gm||(R$.then(()=>Gm=0),Gm=Date.now());function B$(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(kt(s)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const r=s.slice(),l=[o];for(let a=0;a<r.length&&!o._stopped;a++){const c=r[a];c&&Qs(c,t,5,l)}}else Qs(s,t,5,[o])};return n.value=e,n.attached=D$(),n}const xb=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,F$=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?T$(e,o,r):t==="style"?I$(e,n,o):Yu(t)?Up(t)||O$(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):H$(e,t,o,r))?(wb(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_b(e,t,o,r,i,t!=="value")):e._isVueCE&&(W$(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!kn(o)))?wb(e,go(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),_b(e,t,o,r))};function H$(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&xb(t)&&Et(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 s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return xb(t)&&kn(n)?!1:t in e}function W$(e,t){const n=e._def.props;if(!n)return!1;const o=go(t);return Array.isArray(n)?n.some(s=>go(s)===o):Object.keys(n).some(s=>go(s)===o)}const Ab={};function z$(e,t,n){let o=Ve(e,t);qp(o)&&(o=fn({},o,t));class s extends n0{constructor(r){super(o,r,n)}}return s.def=o,s}const Bpe=((e,t)=>z$(e,t,i6)),U$=typeof HTMLElement<"u"?HTMLElement:class{};class n0 extends U${constructor(t,n={},o=op){super(),this._def=t,this._props=n,this._createApp=o,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&&o!==op?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(fn({},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 n0){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,gt(()=>{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 o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=o;let l;if(i&&!kt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Bf(this._props[a])),(l||(l=Object.create(null)))[go(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(r),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!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 o in n)tn(this,o)||Object.defineProperty(this,o,{get:()=>A(n[o])})}_resolveProps(t){const{props:n}=t,o=kt(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&o.includes(s)&&this._setProp(s,this[s]);for(const s of o.map(go))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(i){this._setProp(s,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):Ab;const s=go(t);n&&this._numberProps&&this._numberProps[s]&&(o=Bf(o)),this._setProp(s,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,s=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Ab?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),o)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(as(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(as(t),n+""):n||this.removeAttribute(as(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),s6(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=se(this._def,fn(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const s=(i,r)=>{this.dispatchEvent(new CustomEvent(i,qp(r[0])?fn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),as(i)!==i&&s(as(i),r)},this._setParent()}),n}_applyStyles(t,n,o){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,i=this.shadowRoot,r=o?this._getStyleAnchor(o)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");s&&c.setAttribute("nonce",s),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(o||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 o=t.childNodes[n];if(!(o instanceof HTMLStyleElement))return o}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const s=t[o],i=s.getAttribute("name")||"default",r=this._slots[i],l=s.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,s)}else for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const s=o.querySelectorAll("slot");for(let i=0;i<s.length;i++)n.add(s[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 q$(e){const t=Oo(),n=t&&t.ce;return n||null}function Fpe(){const e=q$();return e&&e.shadowRoot}function Hpe(e="$style"){{const t=Oo();if(!t)return qt;const n=t.type.__cssModules;if(!n)return qt;const o=n[e];return o||qt}}const Ex=new WeakMap,Ix=new WeakMap,tp=Symbol("_moveCb"),Tb=Symbol("_enterCb"),j$=e=>(delete e.props.mode,e),V$=j$({name:"TransitionGroup",props:fn({},Cx,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Oo(),o=HC();let s,i;return j1(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!Q$(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(G$),s.forEach(Y$);const l=s.filter(X$);Av(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Si(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[tp]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[tp]=null,Tr(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=Gt(e),l=xx(r);let a=r.tag||Oe;if(s=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(s.push(u),jr(u,xu(u,l,o,n)),Ex.set(u,$x(u.el)))}i=t.default?U1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&jr(u,xu(u,l,o,n))}return se(a,null,i)}}}),K$=V$;function G$(e){const t=e.el;t[tp]&&t[tp](),t[Tb]&&t[Tb]()}function Y$(e){Ix.set(e,$x(e.el))}function X$(e){const t=Ex.get(e),n=Ix.get(e),o=t.left-n.left,s=t.top-n.top;if(o||s){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(${o/a}px,${s/c}px)`,r.transitionDuration="0s",e}}function $x(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function Q$(e,t,n){const o=e.cloneNode(),s=e[ec];s&&s.forEach(l=>{l.split(/\s+/).forEach(a=>a&&o.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:r}=Ax(o);return i.removeChild(o),r}const Gr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return kt(t)?n=>Fa(t,n):t};function Z$(e){e.target.composing=!0}function Mb(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ys=Symbol("_assign");function Eb(e,t,n){return t&&(e=e.trim()),n&&(e=Gp(e)),e}const ms={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[Ys]=Gr(s);const i=o||s.props&&s.props.type==="number";Ki(e,t?"change":"input",r=>{r.target.composing||e[Ys](Eb(e.value,n,i))}),(n||i)&&Ki(e,"change",()=>{e.value=Eb(e.value,n,i)}),t||(Ki(e,"compositionstart",Z$),Ki(e,"compositionend",Mb),Ki(e,"change",Mb))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[Ys]=Gr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Gp(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"&&(o&&t===n||s&&e.value.trim()===a)||(e.value=a)}},np={deep:!0,created(e,t,n){e[Ys]=Gr(n),Ki(e,"change",()=>{const o=e._modelValue,s=tc(e),i=e.checked,r=e[Ys];if(kt(o)){const l=Xp(o,s),a=l!==-1;if(i&&!a)r(o.concat(s));else if(!i&&a){const c=[...o];c.splice(l,1),r(c)}}else if(Gl(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(Lx(e,i))})},mounted:Ib,beforeUpdate(e,t,n){e[Ys]=Gr(n),Ib(e,t,n)}};function Ib(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(kt(t))s=Xp(t,o.props.value)>-1;else if(Gl(t))s=t.has(o.props.value);else{if(t===n)return;s=Ji(t,Lx(e,!0))}e.checked!==s&&(e.checked=s)}const Nx={created(e,{value:t},n){e.checked=Ji(t,n.props.value),e[Ys]=Gr(n),Ki(e,"change",()=>{e[Ys](tc(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[Ys]=Gr(o),t!==n&&(e.checked=Ji(t,o.props.value))}},Mv={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=Gl(t);Ki(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Gp(tc(r)):tc(r));e[Ys](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,gt(()=>{e._assigning=!1})}),e[Ys]=Gr(o)},mounted(e,{value:t}){$b(e,t)},beforeUpdate(e,t,n){e[Ys]=Gr(n)},updated(e,{value:t}){e._assigning||$b(e,t)}};function $b(e,t){const n=e.multiple,o=kt(t);if(!(n&&!o&&!Gl(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=tc(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=Xp(t,l)>-1}else r.selected=t.has(l);else if(Ji(tc(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function tc(e){return"_value"in e?e._value:e.value}function Lx(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const J$={created(e,t,n){jd(e,t,n,null,"created")},mounted(e,t,n){jd(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){jd(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){jd(e,t,n,o,"updated")}};function Ox(e,t){switch(e){case"SELECT":return Mv;case"TEXTAREA":return ms;default:switch(t){case"checkbox":return np;case"radio":return Nx;default:return ms}}}function jd(e,t,n,o,s){const r=Ox(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function e6(){ms.getSSRProps=({value:e})=>({value:e}),Nx.getSSRProps=({value:e},t)=>{if(t.props&&Ji(t.props.value,e))return{checked:!0}},np.getSSRProps=({value:e},t)=>{if(kt(e)){if(t.props&&Xp(e,t.props.value)>-1)return{checked:!0}}else if(Gl(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},J$.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=Ox(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const t6=["ctrl","shift","alt","meta"],n6={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)=>t6.some(n=>e[`${n}Key`]&&!t.includes(n))},yt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...i)=>{for(let r=0;r<t.length;r++){const l=n6[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},o6={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ai=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=as(s.key);if(t.some(r=>r===i||o6[r]===i))return e(s)}))},Px=fn({patchProp:F$},S$);let ru,Nb=!1;function Rx(){return ru||(ru=n$(Px))}function Dx(){return ru=Nb?ru:o$(Px),Nb=!0,ru}const s6=((...e)=>{Rx().render(...e)}),Wpe=((...e)=>{Dx().hydrate(...e)}),op=((...e)=>{const t=Rx().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=Fx(o);if(!s)return;const i=t._component;!Et(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,Bx(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),i6=((...e)=>{const t=Dx().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=Fx(o);if(s)return n(s,!0,Bx(s))},t});function Bx(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Fx(e){return kn(e)?document.querySelector(e):e}let Lb=!1;const zpe=()=>{Lb||(Lb=!0,e6(),M$())};/*!
|
|
21
|
+
* shared v11.4.5
|
|
22
|
+
* (c) 2026 kazuya kawaguchi
|
|
23
|
+
* Released under the MIT License.
|
|
24
|
+
*/function r6(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const sp=typeof window<"u",el=(e,t=!1)=>t?Symbol.for(e):Symbol(e),l6=(e,t,n)=>a6({l:e,k:t,s:n}),a6=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),ao=e=>typeof e=="number"&&isFinite(e),Hx=e=>s0(e)==="[object Date]",nc=e=>s0(e)==="[object RegExp]",lh=e=>Vt(e)&&Object.keys(e).length===0,co=Object.assign,c6=Object.create,yn=(e=null)=>c6(e);let Ob;const Ll=()=>Ob||(Ob=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:yn());function Pb(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function u6(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const d6=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,f6=/^(?:href|src|action|formaction)$/i;function o0(e){return d6.test(e)}function p6(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const i=s.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const f=e[l];if(c){f===c&&(c=null);continue}if(f==='"'||f==="'")c=f;else if(f==="(")a++;else if(f===")"&&(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(o,i),n+=o0(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function Rb(e,t){if(f6.test(e)&&o0(t))return"about:blank";const n=e.toLowerCase()==="style"?p6(t):t;return u6(n)}function h6(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${Rb(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${Rb(o,s)}'`),/\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,o,s)=>o0(s)?`${o}about:blank`:n),e}const m6=Object.prototype.hasOwnProperty;function Ks(e,t){return m6.call(e,t)}const Qn=Array.isArray,Rn=e=>typeof e=="function",ht=e=>typeof e=="string",Zt=e=>typeof e=="boolean",Jt=e=>e!==null&&typeof e=="object",g6=e=>Jt(e)&&Rn(e.then)&&Rn(e.catch),Wx=Object.prototype.toString,s0=e=>Wx.call(e),Vt=e=>s0(e)==="[object Object]",v6=e=>e==null?"":Qn(e)||Vt(e)&&e.toString===Wx?JSON.stringify(e,null,2):String(e);function i0(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const Vd=e=>!Jt(e)||Qn(e);function _f(e,t){if(Vd(e)||Vd(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:s}=n.pop();Object.keys(o).forEach(i=>{i!=="__proto__"&&(Jt(o[i])&&!Jt(s[i])&&(s[i]=Array.isArray(o[i])?[]:yn()),Vd(s[i])||Vd(o[i])?s[i]=o[i]:n.push({src:o[i],des:s[i]}))})}}/*!
|
|
25
|
+
* message-compiler v11.4.5
|
|
26
|
+
* (c) 2026 kazuya kawaguchi
|
|
27
|
+
* Released under the MIT License.
|
|
28
|
+
*/function y6(e,t,n){return{line:e,column:t,offset:n}}function Ev(e,t,n){return{start:e,end:t}}const rn={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},k6=17;function ah(e,t,n={}){const{domain:o,messages:s,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=o,l}function b6(e){throw e}const _i=" ",_6="\r",Ro=`
|
|
29
|
+
`,w6="\u2028",S6="\u2029";function C6(e){const t=e;let n=0,o=1,s=1,i=0;const r=$=>t[$]===_6&&t[$+1]===Ro,l=$=>t[$]===Ro,a=$=>t[$]===S6,c=$=>t[$]===w6,u=$=>r($)||l($)||a($)||c($),d=()=>n,f=()=>o,h=()=>s,p=()=>i,m=$=>r($)||a($)||c($)?Ro:t[$],b=()=>m(n),_=()=>m(n+i);function g(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function v(){return r(n+i)&&i++,i++,t[n+i]}function y(){n=0,o=1,s=1,i=0}function C($=0){i=$}function L(){const $=n+i;for(;$!==n;)g();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:m,currentChar:b,currentPeek:_,next:g,peek:v,reset:y,resetPeek:C,skipToPeek:L}}const Fi=void 0,x6=".",Db="'",A6="tokenizer";function T6(e,t={}){const n=t.location!==!1,o=C6(e),s=()=>o.index(),i=()=>y6(o.line(),o.column(),o.index()),r=i(),l=s(),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(j,G,re,...he){const Ce=c();if(G.column+=re,G.offset+=re,u){const Ee=n?Ev(Ce.startLoc,G):null,ae=ah(j,Ee,{domain:A6,args:he});u(ae)}}function f(j,G,re){j.endLoc=i(),j.currentType=G;const he={type:G};return n&&(he.loc=Ev(j.startLoc,j.endLoc)),re!=null&&(he.value=re),he}const h=j=>f(j,13);function p(j,G){return j.currentChar()===G?(j.next(),G):(d(rn.EXPECTED_TOKEN,i(),0,G),"")}function m(j){let G="";for(;j.currentPeek()===_i||j.currentPeek()===Ro;)G+=j.currentPeek(),j.peek();return G}function b(j){const G=m(j);return j.skipToPeek(),G}function _(j){if(j===Fi)return!1;const G=j.charCodeAt(0);return G>=97&&G<=122||G>=65&&G<=90||G===95}function g(j){if(j===Fi)return!1;const G=j.charCodeAt(0);return G>=48&&G<=57}function v(j,G){const{currentType:re}=G;if(re!==2)return!1;m(j);const he=_(j.currentPeek());return j.resetPeek(),he}function y(j,G){const{currentType:re}=G;if(re!==2)return!1;m(j);const he=j.currentPeek()==="-"?j.peek():j.currentPeek(),Ce=g(he);return j.resetPeek(),Ce}function C(j,G){const{currentType:re}=G;if(re!==2)return!1;m(j);const he=j.currentPeek()===Db;return j.resetPeek(),he}function L(j,G){const{currentType:re}=G;if(re!==7)return!1;m(j);const he=j.currentPeek()===".";return j.resetPeek(),he}function $(j,G){const{currentType:re}=G;if(re!==8)return!1;m(j);const he=_(j.currentPeek());return j.resetPeek(),he}function k(j,G){const{currentType:re}=G;if(!(re===7||re===11))return!1;m(j);const he=j.currentPeek()===":";return j.resetPeek(),he}function M(j,G){const{currentType:re}=G;if(re!==9)return!1;const he=()=>{const Ee=j.currentPeek();return Ee==="{"?_(j.peek()):Ee==="@"||Ee==="|"||Ee===":"||Ee==="."||Ee===_i||!Ee?!1:Ee===Ro?(j.peek(),he()):O(j,!1)},Ce=he();return j.resetPeek(),Ce}function E(j){m(j);const G=j.currentPeek()==="|";return j.resetPeek(),G}function O(j,G=!0){const re=(Ce=!1,Ee="")=>{const ae=j.currentPeek();return ae==="{"||ae==="@"||!ae?Ce:ae==="|"?!(Ee===_i||Ee===Ro):ae===_i?(j.peek(),re(!0,_i)):ae===Ro?(j.peek(),re(!0,Ro)):!0},he=re();return G&&j.resetPeek(),he}function S(j,G){const re=j.currentChar();return re===Fi?Fi:G(re)?(j.next(),re):null}function I(j){const G=j.charCodeAt(0);return G>=97&&G<=122||G>=65&&G<=90||G>=48&&G<=57||G===95||G===36}function P(j){return S(j,I)}function D(j){const G=j.charCodeAt(0);return G>=97&&G<=122||G>=65&&G<=90||G>=48&&G<=57||G===95||G===36||G===45}function H(j){return S(j,D)}function z(j){const G=j.charCodeAt(0);return G>=48&&G<=57}function U(j){return S(j,z)}function Q(j){const G=j.charCodeAt(0);return G>=48&&G<=57||G>=65&&G<=70||G>=97&&G<=102}function X(j){return S(j,Q)}function ue(j){let G="",re="";for(;G=U(j);)re+=G;return re}function me(j){let G="";for(;;){const re=j.currentChar();if(re==="\\"){const he=j.peek();he==="{"||he==="}"||he==="@"||he==="|"||he==="\\"?(G+=re+he,j.next(),j.next()):(j.resetPeek(),G+=re,j.next())}else{if(re==="{"||re==="}"||re==="@"||re==="|"||!re)break;if(re===_i||re===Ro)if(O(j))G+=re,j.next();else{if(E(j))break;G+=re,j.next()}else G+=re,j.next()}}return G}function Ae(j){b(j);let G="",re="";for(;G=H(j);)re+=G;const he=j.currentChar();if(he&&he!=="}"&&he!==Fi&&he!==_i&&he!==Ro&&he!==" "){const Ce=F(j);return d(rn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re+Ce),re+Ce}return j.currentChar()===Fi&&d(rn.UNTERMINATED_CLOSING_BRACE,i(),0),re}function be(j){b(j);let G="";return j.currentChar()==="-"?(j.next(),G+=`-${ue(j)}`):G+=ue(j),j.currentChar()===Fi&&d(rn.UNTERMINATED_CLOSING_BRACE,i(),0),G}function ze(j){return j!==Db&&j!==Ro}function qe(j){b(j),p(j,"'");let G="",re="";for(;G=S(j,ze);)G==="\\"?re+=Fe(j):re+=G;const he=j.currentChar();return he===Ro||he===Fi?(d(rn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),he===Ro&&(j.next(),p(j,"'")),re):(p(j,"'"),re)}function Fe(j){const G=j.currentChar();switch(G){case"\\":case"'":return j.next(),`\\${G}`;case"u":return Le(j,G,4);case"U":return Le(j,G,6);default:return d(rn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,G),""}}function Le(j,G,re){p(j,G);let he="";for(let Ce=0;Ce<re;Ce++){const Ee=X(j);if(!Ee){d(rn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${G}${he}${j.currentChar()}`);break}he+=Ee}return`\\${G}${he}`}function le(j){return j!=="{"&&j!=="}"&&j!==_i&&j!==Ro}function F(j){b(j);let G="",re="";for(;G=S(j,le);)re+=G;return re}function te(j){let G="",re="";for(;G=P(j);)re+=G;return re}function ee(j){const G=re=>{const he=j.currentChar();return he==="{"||he==="@"||he==="|"||he==="("||he===")"||!he||he===_i?re:(re+=he,j.next(),G(re))};return G("")}function q(j){b(j);const G=p(j,"|");return b(j),G}function Y(j,G){let re=null;switch(j.currentChar()){case"{":return G.braceNest>=1&&d(rn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),re=f(G,2,"{"),b(j),G.braceNest++,re;case"}":return G.braceNest>0&&G.currentType===2&&d(rn.EMPTY_PLACEHOLDER,i(),0),j.next(),re=f(G,3,"}"),G.braceNest--,G.braceNest>0&&b(j),G.inLinked&&G.braceNest===0&&(G.inLinked=!1),re;case"@":return G.braceNest>0&&d(rn.UNTERMINATED_CLOSING_BRACE,i(),0),re=de(j,G)||h(G),G.braceNest=0,re;default:{let Ce=!0,Ee=!0,ae=!0;if(E(j))return G.braceNest>0&&d(rn.UNTERMINATED_CLOSING_BRACE,i(),0),re=f(G,1,q(j)),G.braceNest=0,G.inLinked=!1,re;if(G.braceNest>0&&(G.currentType===4||G.currentType===5||G.currentType===6))return d(rn.UNTERMINATED_CLOSING_BRACE,i(),0),G.braceNest=0,ne(j,G);if(Ce=v(j,G))return re=f(G,4,Ae(j)),b(j),re;if(Ee=y(j,G))return re=f(G,5,be(j)),b(j),re;if(ae=C(j,G))return re=f(G,6,qe(j)),b(j),re;if(!Ce&&!Ee&&!ae)return re=f(G,12,F(j)),d(rn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re.value),b(j),re;break}}return re}function de(j,G){const{currentType:re}=G;let he=null;const Ce=j.currentChar();switch((re===7||re===8||re===11||re===9)&&(Ce===Ro||Ce===_i)&&d(rn.INVALID_LINKED_FORMAT,i(),0),Ce){case"@":return j.next(),he=f(G,7,"@"),G.inLinked=!0,he;case".":return b(j),j.next(),f(G,8,".");case":":return b(j),j.next(),f(G,9,":");default:return E(j)?(he=f(G,1,q(j)),G.braceNest=0,G.inLinked=!1,he):L(j,G)||k(j,G)?(b(j),de(j,G)):$(j,G)?(b(j),f(G,11,te(j))):M(j,G)?(b(j),Ce==="{"?Y(j,G)||he:f(G,10,ee(j))):(re===7&&d(rn.INVALID_LINKED_FORMAT,i(),0),G.braceNest=0,G.inLinked=!1,ne(j,G))}}function ne(j,G){let re={type:13};if(G.braceNest>0)return Y(j,G)||h(G);if(G.inLinked)return de(j,G)||h(G);switch(j.currentChar()){case"{":return Y(j,G)||h(G);case"}":return d(rn.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),f(G,3,"}");case"@":return de(j,G)||h(G);default:{if(E(j))return re=f(G,1,q(j)),G.braceNest=0,G.inLinked=!1,re;if(O(j))return f(G,0,me(j));break}}return re}function ce(){const{currentType:j,offset:G,startLoc:re,endLoc:he}=a;return a.lastType=j,a.lastOffset=G,a.lastStartLoc=re,a.lastEndLoc=he,a.offset=s(),a.startLoc=i(),o.currentChar()===Fi?f(a,13):ne(o,a)}return{nextToken:ce,currentOffset:s,currentPosition:i,context:c}}const M6="parser",E6=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,I6=/\\([\\@{}|])/g;function $6(e,t){return t}function N6(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function L6(e={}){const t=e.location!==!1,{onError:n}=e;function o(_,g,v,y,...C){const L=_.currentPosition();if(L.offset+=y,L.column+=y,n){const $=t?Ev(v,L):null,k=ah(g,$,{domain:M6,args:C});n(k)}}function s(_,g,v){const y={type:_};return t&&(y.start=g,y.end=g,y.loc={start:v,end:v}),y}function i(_,g,v,y){t&&(_.end=g,_.loc&&(_.loc.end=v))}function r(_,g){const v=_.context(),y=s(3,v.offset,v.startLoc);return y.value=g.replace(I6,$6),i(y,_.currentOffset(),_.currentPosition()),y}function l(_,g){const v=_.context(),{lastOffset:y,lastStartLoc:C}=v,L=s(5,y,C);return L.index=parseInt(g,10),_.nextToken(),i(L,_.currentOffset(),_.currentPosition()),L}function a(_,g){const v=_.context(),{lastOffset:y,lastStartLoc:C}=v,L=s(4,y,C);return L.key=g,_.nextToken(),i(L,_.currentOffset(),_.currentPosition()),L}function c(_,g){const v=_.context(),{lastOffset:y,lastStartLoc:C}=v,L=s(9,y,C);return L.value=g.replace(E6,N6),_.nextToken(),i(L,_.currentOffset(),_.currentPosition()),L}function u(_){const g=_.nextToken(),v=_.context(),{lastOffset:y,lastStartLoc:C}=v,L=s(8,y,C);return g.type!==11?(o(_,rn.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),L.value="",i(L,y,C),{nextConsumeToken:g,node:L}):(g.value==null&&o(_,rn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,wi(g)),L.value=g.value||"",i(L,_.currentOffset(),_.currentPosition()),{node:L})}function d(_,g){const v=_.context(),y=s(7,v.offset,v.startLoc);return y.value=g,i(y,_.currentOffset(),_.currentPosition()),y}function f(_){const g=_.context(),v=s(6,g.offset,g.startLoc);let y=_.nextToken();if(y.type===8){const C=u(_);v.modifier=C.node,y=C.nextConsumeToken||_.nextToken()}switch(y.type!==9&&o(_,rn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,wi(y)),y=_.nextToken(),y.type===2&&(y=_.nextToken()),y.type){case 10:y.value==null&&o(_,rn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,wi(y)),v.key=d(_,y.value||"");break;case 4:y.value==null&&o(_,rn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,wi(y)),v.key=a(_,y.value||"");break;case 5:y.value==null&&o(_,rn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,wi(y)),v.key=l(_,y.value||"");break;case 6:y.value==null&&o(_,rn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,wi(y)),v.key=c(_,y.value||"");break;default:{o(_,rn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const C=_.context(),L=s(7,C.offset,C.startLoc);return L.value="",i(L,C.offset,C.startLoc),v.key=L,i(v,C.offset,C.startLoc),{nextConsumeToken:y,node:v}}}return i(v,_.currentOffset(),_.currentPosition()),{node:v}}function h(_){const g=_.context(),v=g.currentType===1?_.currentOffset():g.offset,y=g.currentType===1?g.endLoc:g.startLoc,C=s(2,v,y);C.items=[];let L=null;do{const M=L||_.nextToken();switch(L=null,M.type){case 0:M.value==null&&o(_,rn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,wi(M)),C.items.push(r(_,M.value||""));break;case 5:M.value==null&&o(_,rn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,wi(M)),C.items.push(l(_,M.value||""));break;case 4:M.value==null&&o(_,rn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,wi(M)),C.items.push(a(_,M.value||""));break;case 6:M.value==null&&o(_,rn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,wi(M)),C.items.push(c(_,M.value||""));break;case 7:{const E=f(_);C.items.push(E.node),L=E.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const $=g.currentType===1?g.lastOffset:_.currentOffset(),k=g.currentType===1?g.lastEndLoc:_.currentPosition();return i(C,$,k),C}function p(_,g,v,y){const C=_.context();let L=y.items.length===0;const $=s(1,g,v);$.cases=[],$.cases.push(y);do{const k=h(_);L||(L=k.items.length===0),$.cases.push(k)}while(C.currentType!==13);return L&&o(_,rn.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i($,_.currentOffset(),_.currentPosition()),$}function m(_){const g=_.context(),{offset:v,startLoc:y}=g,C=h(_);return g.currentType===13?C:p(_,v,y,C)}function b(_){const g=T6(_,co({},e)),v=g.context(),y=s(0,v.offset,v.startLoc);return t&&y.loc&&(y.loc.source=_),y.body=m(g),e.onCacheKey&&(y.cacheKey=e.onCacheKey(_)),v.currentType!==13&&o(g,rn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,_[v.offset]||""),i(y,g.currentOffset(),g.currentPosition()),y}return{parse:b}}function wi(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 O6(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Bb(e,t){for(let n=0;n<e.length;n++)r0(e[n],t)}function r0(e,t){switch(e.type){case 1:Bb(e.cases,t),t.helper("plural");break;case 2:Bb(e.items,t);break;case 6:{r0(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 P6(e,t={}){const n=O6(e);n.helper("normalize"),e.body&&r0(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function R6(e){const t=e.body;return t.type===2?Fb(t):t.cases.forEach(n=>Fb(n)),e}function Fb(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 o=e.items[n];if(!(o.type===3||o.type===9)||o.value==null)break;t.push(o.value)}if(t.length===e.items.length){e.static=i0(t);for(let n=0;n<e.items.length;n++){const o=e.items[n];(o.type===3||o.type===9)&&delete o.value}}}}function xa(e){switch(e.t=e.type,e.type){case 0:{const t=e;xa(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let o=0;o<n.length;o++)xa(n[o]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let o=0;o<n.length;o++)xa(n[o]);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;xa(t.key),t.k=t.key,delete t.key,t.modifier&&(xa(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 D6(e,t){const{filename:n,breakLineCode:o,needIndent:s}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(m,b){r.code+=m}function c(m,b=!0){const _=b?o:"";a(s?_+" ".repeat(m):_)}function u(m=!0){const b=++r.indentLevel;m&&c(b)}function d(m=!0){const b=--r.indentLevel;m&&c(b)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function B6(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),oc(e,t.key),t.modifier?(e.push(", "),oc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function F6(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const s=t.items.length;for(let i=0;i<s&&(oc(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function H6(e,t){const{helper:n,needIndent:o}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(o());const s=t.cases.length;for(let i=0;i<s&&(oc(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function W6(e,t){t.body?oc(e,t.body):e.push("null")}function oc(e,t){const{helper:n}=e;switch(t.type){case 0:W6(e,t);break;case 1:H6(e,t);break;case 2:F6(e,t);break;case 6:B6(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 z6=(e,t={})=>{const n=ht(t.mode)?t.mode:"normal",o=ht(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
+
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=D6(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${i0(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),oc(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 U6(e,t={}){const n=co({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=L6(n).parse(e);return o?(i&&R6(l),s&&xa(l),{ast:l,code:""}):(P6(l,n),z6(l,n))}/*!
|
|
31
|
+
* core-base v11.4.5
|
|
32
|
+
* (c) 2026 kazuya kawaguchi
|
|
33
|
+
* Released under the MIT License.
|
|
34
|
+
*/function q6(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ll().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ll().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Ei(e){return Jt(e)&&l0(e)===0&&(Ks(e,"b")||Ks(e,"body"))}const zx=["b","body"];function j6(e){return tl(e,zx)}const Ux=["c","cases"];function V6(e){return tl(e,Ux,[])}const qx=["s","static"];function K6(e){return tl(e,qx)}const jx=["i","items"];function G6(e){return tl(e,jx,[])}const Vx=["t","type"];function l0(e){return tl(e,Vx)}const Kx=["v","value"];function Kd(e,t){const n=tl(e,Kx);if(n!=null)return n;throw Eu(t)}const Gx=["m","modifier"];function Y6(e){return tl(e,Gx)}const Yx=["k","key"];function X6(e){const t=tl(e,Yx);if(t)return t;throw Eu(6)}function tl(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(Ks(e,s)&&e[s]!=null)return e[s]}return n}const Xx=[...zx,...Ux,...qx,...jx,...Yx,...Gx,...Kx,...Vx];function Eu(e){return new Error(`unhandled node type: ${e}`)}function Ym(e){return n=>Q6(n,e)}function Q6(e,t){const n=j6(t);if(n==null)throw Eu(0);if(l0(n)===1){const i=V6(n);return e.plural(i.reduce((r,l)=>[...r,Hb(e,l)],[]))}else return Hb(e,n)}function Hb(e,t){const n=K6(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=G6(t).reduce((s,i)=>[...s,Iv(e,i)],[]);return e.normalize(o)}}function Iv(e,t){const n=l0(t);switch(n){case 3:return Kd(t,n);case 9:return Kd(t,n);case 4:{const o=t;if(Ks(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(Ks(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw Eu(n)}case 5:{const o=t;if(Ks(o,"i")&&ao(o.i))return e.interpolate(e.list(o.i));if(Ks(o,"index")&&ao(o.index))return e.interpolate(e.list(o.index));throw Eu(n)}case 6:{const o=t,s=Y6(o),i=X6(o);return e.linked(Iv(e,i),s?Iv(e,s):void 0,e.type)}case 7:return Kd(t,n);case 8:return Kd(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Z6=e=>e;let Gd=yn();function J6(e,t={}){let n=!1;const o=t.onError||b6;return t.onError=s=>{n=!0,o(s)},{...U6(e,t),detectError:n}}function eN(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&ht(e)){Zt(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||Z6)(e),s=Gd[o];if(s)return s;const{ast:i,detectError:r}=J6(e,{...t,location:!1,jit:!0}),l=Ym(i);return r?l:Gd[o]=l}else{const n=e.cacheKey;if(n){const o=Gd[n];return o||(Gd[n]=Ym(e))}else return Ym(e)}}let Iu=null;function tN(e){Iu=e}function nN(e,t,n){Iu&&Iu.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const oN=sN("function:translate");function sN(e){return t=>Iu&&Iu.emit(e,t)}const Gi={INVALID_ARGUMENT:k6,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},iN=24;function Yi(e){return ah(e,null,void 0)}function a0(e,t){return t.locale!=null?Wb(t.locale):Wb(e.locale)}let Xm;function Wb(e){if(ht(e))return e;if(Rn(e)){if(e.resolvedOnce&&Xm!=null)return Xm;if(e.constructor.name==="Function"){const t=e();if(g6(t))throw Yi(Gi.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Xm=t}else throw Yi(Gi.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Yi(Gi.NOT_SUPPORT_LOCALE_TYPE)}function rN(e,t,n){return[...new Set([n,...Qn(t)?t:Jt(t)?Object.keys(t):ht(t)?[t]:[n]])]}function $v(e,t,n){const o=ht(n)?n:$u,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;Qn(r);)r=zb(i,r,t);const l=Qn(t)||!Vt(t)?t:t.default?t.default:null;r=ht(l)?[l]:l,Qn(r)&&zb(i,r,!1),s.__localeChainCache.set(o,i)}return i}function zb(e,t,n){let o=!0;for(let s=0;s<t.length&&Zt(o);s++){const i=t[s];ht(i)&&(o=lN(e,t[s],n))}return o}function lN(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=aN(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function aN(e,t,n){let o=!1;if(!e.includes(t)&&(o=!0,t)){o=t[t.length-1]!=="!";const s=t.replace(/!/g,"");e.push(s),(Qn(n)||Vt(n))&&n[s]&&(o=n[s])}return o}const nl=[];nl[0]={w:[0],i:[3,0],"[":[4],o:[7]};nl[1]={w:[1],".":[2],"[":[4],o:[7]};nl[2]={w:[2],i:[3,0],0:[3,0]};nl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};nl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};nl[5]={"'":[4,0],o:8,l:[5,0]};nl[6]={'"':[4,0],o:8,l:[6,0]};const cN=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function uN(e){return cN.test(e)}function dN(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 fN(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 pN(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:uN(t)?dN(t):"*"+t}function hN(e){const t=[];let n=-1,o=0,s=0,i,r,l,a,c,u,d;const f=[];f[0]=()=>{r===void 0?r=l:r+=l},f[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),s++},f[3]=()=>{if(s>0)s--,o=4,f[0]();else{if(s=0,r===void 0||(r=pN(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(o===5&&p==="'"||o===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=fN(i),d=nl[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(o===7)return t}}const Ub=new Map;function mN(e,t){return Jt(e)?e[t]:null}function gN(e,t){if(!Jt(e))return null;let n=Ub.get(t);if(n||(n=hN(t),n&&Ub.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(Xx.includes(r)&&Ei(s)||!Jt(s)||!Ks(s,r))return null;const l=s[r];if(l===void 0||Rn(s))return null;s=l,i++}return s}const vN="11.4.5",ch=-1,$u="en-US",ip="",qb=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function yN(){return{upper:(e,t)=>t==="text"&&ht(e)?e.toUpperCase():t==="vnode"&&Jt(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&ht(e)?e.toLowerCase():t==="vnode"&&Jt(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&ht(e)?qb(e):t==="vnode"&&Jt(e)&&"__v_isVNode"in e?qb(e.children):e}}let Qx;function kN(e){Qx=e}let Zx;function bN(e){Zx=e}let Jx;function _N(e){Jx=e}let eA=null;const wN=e=>{eA=e},SN=()=>eA;let tA=null;const jb=e=>{tA=e},CN=()=>tA;let Vb=0;function xN(e={}){const t=Rn(e.onWarn)?e.onWarn:r6,n=ht(e.version)?e.version:vN,o=ht(e.locale)||Rn(e.locale)?e.locale:$u,s=Rn(o)?$u:o,i=Qn(e.fallbackLocale)||Vt(e.fallbackLocale)||ht(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=Vt(e.messages)?e.messages:Qm(s),l=Vt(e.datetimeFormats)?e.datetimeFormats:Qm(s),a=Vt(e.numberFormats)?e.numberFormats:Qm(s),c=co(yn(),e.modifiers,yN()),u=e.pluralRules||yn(),d=Rn(e.missing)?e.missing:null,f=Zt(e.missingWarn)||nc(e.missingWarn)?e.missingWarn:!0,h=Zt(e.fallbackWarn)||nc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,m=!!e.unresolving,b=Rn(e.postTranslation)?e.postTranslation:null,_=Vt(e.processor)?e.processor:null,g=Zt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,y=Rn(e.messageCompiler)?e.messageCompiler:Qx,C=Rn(e.messageResolver)?e.messageResolver:Zx||mN,L=Rn(e.localeFallbacker)?e.localeFallbacker:Jx||rN,$=Jt(e.fallbackContext)?e.fallbackContext:void 0,k=e,M=Jt(k.__datetimeFormatters)?k.__datetimeFormatters:new Map,E=Jt(k.__numberFormatters)?k.__numberFormatters:new Map,O=Jt(k.__meta)?k.__meta:{};Vb++;const S={version:n,cid:Vb,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:m,postTranslation:b,processor:_,warnHtmlMessage:g,escapeParameter:v,messageCompiler:y,messageResolver:C,localeFallbacker:L,fallbackContext:$,onWarn:t,__meta:O};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=M,S.__numberFormatters=E,__INTLIFY_PROD_DEVTOOLS__&&nN(S,n,O),S}const Qm=e=>({[e]:yn()});function c0(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return ht(l)?l:t}else return t}function Wc(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function AN(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function TN(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(AN(e,t[o]))return!0;return!1}function Kb(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!ht(t[0])&&!Hx(t[0])&&!ao(t[0]))return ip;const[a,c,u,d]=Nv(...t),f=Zt(u.missingWarn)?u.missingWarn:e.missingWarn;Zt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=a0(e,u),m=r(e,s,p);if(!ht(a)||a===""){const L=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?L.formatToParts(c):L.format(c)}let b={},_,g=null;const v="datetime format";for(let L=0;L<m.length&&(_=m[L],b=n[_]||{},g=b[a],!Vt(g));L++)c0(e,a,_,f,v);if(!Vt(g)||!ht(_))return o?ch:a;let y=`${_}__${a}`;lh(d)||(y=`${y}__${JSON.stringify(d)}`);let C=l.get(y);return C||(C=new Intl.DateTimeFormat(_,co({},g,d)),l.set(y,C)),h?C.formatToParts(c):C.format(c)}const nA=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Nv(...e){const[t,n,o,s]=e,i=yn();let r=yn(),l;if(ht(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Yi(Gi.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 Yi(Gi.INVALID_ISO_DATE_ARGUMENT)}}else if(Hx(t)){if(isNaN(t.getTime()))throw Yi(Gi.INVALID_DATE_ARGUMENT);l=t}else if(ao(t))l=t;else throw Yi(Gi.INVALID_ARGUMENT);return ht(n)?i.key=n:Vt(n)&&Object.keys(n).forEach(a=>{nA.includes(a)?r[a]=n[a]:i[a]=n[a]}),ht(o)?i.locale=o:Vt(o)&&(r=o),Vt(s)&&(r=s),[i.key||"",l,i,r]}function Gb(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function Yb(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!ao(t[0]))return ip;const[a,c,u,d]=Lv(...t),f=Zt(u.missingWarn)?u.missingWarn:e.missingWarn;Zt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=a0(e,u),m=r(e,s,p);if(!ht(a)||a===""){const L=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?L.formatToParts(c):L.format(c)}let b={},_,g=null;const v="number format";for(let L=0;L<m.length&&(_=m[L],b=n[_]||{},g=b[a],!Vt(g));L++)c0(e,a,_,f,v);if(!Vt(g)||!ht(_))return o?ch:a;let y=`${_}__${a}`;lh(d)||(y=`${y}__${JSON.stringify(d)}`);let C=l.get(y);return C||(C=new Intl.NumberFormat(_,co({},g,d)),l.set(y,C)),h?C.formatToParts(c):C.format(c)}const oA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Lv(...e){const[t,n,o,s]=e,i=yn();let r=yn();if(!ao(t))throw Yi(Gi.INVALID_ARGUMENT);const l=t;return ht(n)?i.key=n:Vt(n)&&Object.keys(n).forEach(a=>{oA.includes(a)?r[a]=n[a]:i[a]=n[a]}),ht(o)?i.locale=o:Vt(o)&&(r=o),Vt(s)&&(r=s),[i.key||"",l,i,r]}function Xb(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const MN=e=>e,EN=e=>"",IN="text",$N=e=>e.length===0?"":i0(e),NN=v6;function Zm(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function LN(e){const t=ao(e.pluralIndex)?e.pluralIndex:-1;return ao(e.named?.count)?e.named.count:ao(e.named?.n)?e.named.n:t}function ON(e={}){const t=e.locale,n=LN(e),o=ht(t)&&Rn(e.pluralRules?.[t])?e.pluralRules[t]:Zm,s=o===Zm?void 0:Zm,i=_=>_[o(n,_.length,s)],r=e.list||[],l=_=>r[_],a=e.named||yn();ao(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=_=>a[_];function u(_,g){const v=Rn(e.messages)?e.messages(_,!!g):Jt(e.messages)?e.messages[_]:!1;return v||(e.parent?e.parent.message(_):EN)}const d=_=>e.modifiers?e.modifiers[_]:MN,f=Rn(e.processor?.normalize)?e.processor.normalize:$N,h=Rn(e.processor?.interpolate)?e.processor.interpolate:NN,p=ht(e.processor?.type)?e.processor.type:IN,b={list:l,named:c,plural:i,linked:(_,...g)=>{const[v,y]=g;let C="text",L="";g.length===1?Jt(v)?(L=v.modifier||L,C=v.type||C):ht(v)&&(L=v||L):g.length===2&&(ht(v)&&(L=v||L),ht(y)&&(C=y||C));const $=u(_,!0)(b),k=$===""||$===void 0?_:$,M=C==="vnode"&&Qn(k)&&L?k[0]:k;return L?d(L)(M,C):M},message:u,type:p,interpolate:h,normalize:f,values:co(yn(),r,a)};return b}const Qb=()=>"",Us=e=>Rn(e);function Zb(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Ov(...t),u=Zt(c.missingWarn)?c.missingWarn:e.missingWarn,d=Zt(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=Zt(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=ht(c.default)||Zt(c.default)?Zt(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||p!=null&&(ht(p)||Rn(p)),b=a0(e,c);f&&PN(c);let[_,g,v]=h?[a,b,l[b]||yn()]:sA(e,a,b,r,d,u),y=_,C=a;if(!h&&!(ht(y)||Ei(y)||Us(y))&&m&&(y=p,C=y),!h&&(!(ht(y)||Ei(y)||Us(y))||!ht(g)))return s?ch:a;let L=!1;const $=()=>{L=!0},k=Us(y)?y:iA(e,a,g,y,C,$);if(L)return y;const M=BN(e,g,v,c),E=ON(M),O=RN(e,k,E);let S=o?o(O,a):O;if(f&&ht(S)&&(S=h6(S)),__INTLIFY_PROD_DEVTOOLS__){const I={timestamp:Date.now(),key:ht(a)?a:Us(y)?y.key:"",locale:g||(Us(y)?y.locale:""),format:ht(y)?y:Us(y)?y.source:"",message:S};I.meta=co({},e.__meta,SN()||{}),oN(I)}return S}function PN(e){Qn(e.list)?e.list=e.list.map(t=>ht(t)?Pb(t):t):Jt(e.named)&&Object.keys(e.named).forEach(t=>{ht(e.named[t])&&(e.named[t]=Pb(e.named[t]))})}function sA(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=yn(),f,h=null;const p="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||yn(),(h=a(d,t))===null&&(h=d[t]),!(ht(h)||Ei(h)||Us(h)));m++)if(!TN(f,u)){const b=c0(e,t,f,i,p);b!==t&&(h=b)}return[h,f,d]}function iA(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(Us(o)){const c=o;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>o);return c.locale=n,c.key=t,c}const a=r(o,DN(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function RN(e,t,n){return t(n)}function Ov(...e){const[t,n,o]=e,s=yn();if(!ht(t)&&!ao(t)&&!Us(t)&&!Ei(t))throw Yi(Gi.INVALID_ARGUMENT);const i=ao(t)?String(t):(Us(t),t);return ao(n)?s.plural=n:ht(n)?s.default=n:Vt(n)&&!lh(n)?s.named=n:Qn(n)&&(s.list=n),ao(o)?s.plural=o:ht(o)?s.default=o:Vt(o)&&co(s,o),[i,s]}function DN(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>l6(t,n,r)}}function BN(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:s,pluralRules:i,messages:(h,p)=>{let m=r(n,h);if(m==null&&(u||p)){const[b,,_]=sA(u||e,h,t,l,a,c);m=b??r(_,h)}if(ht(m)||Ei(m)){let b=!1;const g=iA(e,h,t,m,h,()=>{b=!0});return b?Qb:g}else return Us(m)?m:Qb}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),ao(o.plural)&&(f.pluralIndex=o.plural),f}q6();/*!
|
|
35
|
+
* vue-i18n v11.4.5
|
|
36
|
+
* (c) 2026 kazuya kawaguchi
|
|
37
|
+
* Released under the MIT License.
|
|
38
|
+
*/const FN="11.4.5";function HN(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Ll().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Ll().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ll().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ll().__INTLIFY_PROD_DEVTOOLS__=!1)}const Yo={UNEXPECTED_RETURN_TYPE:iN,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 cs(e,...t){return ah(e,null,void 0)}const Pv=el("__translateVNode"),Rv=el("__datetimeParts"),Dv=el("__numberParts"),rA=el("__setPluralRules"),lA=el("__injectWithOption"),$a=el("__dispose");function Nu(e){if(!Jt(e)||Ei(e))return e;for(const t in e)if(Ks(e,t))if(!t.includes("."))Jt(e[t])&&Nu(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,i=!1;for(let r=0;r<o;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in s||(s[n[r]]=yn()),!Jt(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(Ei(s)?Xx.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!Ei(s)){const r=s[n[o]];Jt(r)&&Nu(r)}}return e}function u0(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=Vt(n)?n:Qn(o)?yn():{[e]:yn()};if(Qn(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||yn(),_f(c,r[a])):_f(c,r)}else ht(l)&&_f(JSON.parse(l),r)}),s==null&&i)for(const l in r)Ks(r,l)&&Nu(r[l]);return r}function aA(e){return e.type}function cA(e,t,n){let o=Jt(t.messages)?t.messages:yn();"__i18nGlobal"in n&&(o=u0(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(Jt(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(Jt(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Jb(e){return se(Wr,null,e,0)}function Lu(){return Oo()}const e_="__INTLIFY_META__",t_=()=>[],WN=()=>!1;let n_=0;function o_(e){return((t,n,o,s)=>e(n,o,Lu()||void 0,s))}const zN=()=>{const e=Lu();let t=null;return e&&(t=aA(e)[e_])?{[e_]:t}:null};function rp(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=sp?Z:Yl;let r=Zt(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:ht(e.locale)?e.locale:$u),a=i(t&&r?t.fallbackLocale.value:ht(e.fallbackLocale)||Qn(e.fallbackLocale)||Vt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(u0(l.value,e)),u=i(Vt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Vt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:Zt(e.missingWarn)||nc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:Zt(e.fallbackWarn)||nc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:Zt(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,b=Rn(e.missing)?e.missing:null,_=Rn(e.missing)?o_(e.missing):null,g=Rn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:Zt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const C=t?t.modifiers:Vt(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,$;$=(()=>{o&&jb(null);const ae={version:FN,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:C,pluralRules:L,missing:_===null?void 0:_,missingWarn:f,fallbackWarn:h,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ae.datetimeFormats=u.value,ae.numberFormats=d.value,ae.__datetimeFormatters=Vt($)?$.__datetimeFormatters:void 0,ae.__numberFormatters=Vt($)?$.__numberFormatters:void 0;const xe=xN(ae);return o&&jb(xe),xe})(),Wc($,l.value,a.value);function M(){return[l.value,a.value,c.value,u.value,d.value]}const E=W({get:()=>l.value,set:ae=>{$.locale=ae,l.value=ae}}),O=W({get:()=>a.value,set:ae=>{$.fallbackLocale=ae,a.value=ae,Wc($,l.value,ae)}}),S=W(()=>c.value),I=W(()=>u.value),P=W(()=>d.value);function D(){return Rn(g)?g:null}function H(ae){g=ae,$.postTranslation=ae}function z(){return b}function U(ae){ae!==null&&(_=o_(ae)),b=ae,$.missing=_}const Q=(ae,xe,Ke,ot,_t,wt)=>{M();let It;try{__INTLIFY_PROD_DEVTOOLS__,o||($.fallbackContext=t?CN():void 0),It=ae($)}finally{__INTLIFY_PROD_DEVTOOLS__,o||($.fallbackContext=void 0)}if(Ke!=="translate exists"&&ao(It)&&It===ch||Ke==="translate exists"&&!It){const[Pt,bt]=xe();return t&&p?ot(t):_t(Pt)}else{if(wt(It))return It;throw cs(Yo.UNEXPECTED_RETURN_TYPE)}};function X(...ae){return Q(xe=>Reflect.apply(Zb,null,[xe,...ae]),()=>Ov(...ae),"translate",xe=>Reflect.apply(xe.t,xe,[...ae]),xe=>xe,xe=>ht(xe))}function ue(...ae){const[xe,Ke,ot]=ae;if(ot&&!Jt(ot))throw cs(Yo.INVALID_ARGUMENT);return X(xe,Ke,co({resolvedMessage:!0},ot||{}))}function me(...ae){return Q(xe=>Reflect.apply(Kb,null,[xe,...ae]),()=>Nv(...ae),"datetime format",xe=>Reflect.apply(xe.d,xe,[...ae]),()=>ip,xe=>ht(xe)||Qn(xe))}function Ae(...ae){return Q(xe=>Reflect.apply(Yb,null,[xe,...ae]),()=>Lv(...ae),"number format",xe=>Reflect.apply(xe.n,xe,[...ae]),()=>ip,xe=>ht(xe)||Qn(xe))}function be(ae){return ae.map(xe=>ht(xe)||ao(xe)||Zt(xe)?Jb(String(xe)):xe)}const qe={normalize:be,interpolate:ae=>ae,type:"vnode"};function Fe(...ae){return Q(xe=>{let Ke;const ot=xe;try{ot.processor=qe,Ke=Reflect.apply(Zb,null,[ot,...ae])}finally{ot.processor=null}return Ke},()=>Ov(...ae),"translate",xe=>xe[Pv](...ae),xe=>[Jb(xe)],xe=>Qn(xe))}function Le(...ae){return Q(xe=>Reflect.apply(Yb,null,[xe,...ae]),()=>Lv(...ae),"number format",xe=>xe[Dv](...ae),t_,xe=>ht(xe)||Qn(xe))}function le(...ae){return Q(xe=>Reflect.apply(Kb,null,[xe,...ae]),()=>Nv(...ae),"datetime format",xe=>xe[Rv](...ae),t_,xe=>ht(xe)||Qn(xe))}function F(ae){L=ae,$.pluralRules=L}function te(ae,xe){return Q(()=>{if(!ae)return!1;const Ke=ht(xe)?xe:l.value,ot=ht(xe)?[Ke]:$v($,a.value,Ke);for(let _t=0;_t<ot.length;_t++){const wt=Y(ot[_t]);let It=$.messageResolver(wt,ae);if(It===null&&(It=wt[ae]),Ei(It)||Us(It)||ht(It))return!0}return!1},()=>[ae],"translate exists",Ke=>Reflect.apply(Ke.te,Ke,[ae,xe]),WN,Ke=>Zt(Ke))}function ee(ae){let xe=null;const Ke=$v($,a.value,l.value);for(let ot=0;ot<Ke.length;ot++){const _t=c.value[Ke[ot]]||{},wt=$.messageResolver(_t,ae);if(wt!=null){xe=wt;break}}return xe}function q(ae){const xe=ee(ae);return xe??(t?t.tm(ae)||{}:{})}function Y(ae){return c.value[ae]||{}}function de(ae,xe){if(s){const Ke={[ae]:xe};for(const ot in Ke)Ks(Ke,ot)&&Nu(Ke[ot]);xe=Ke[ae]}c.value[ae]=xe,$.messages=c.value}function ne(ae,xe){c.value[ae]=c.value[ae]||{};const Ke={[ae]:xe};if(s)for(const ot in Ke)Ks(Ke,ot)&&Nu(Ke[ot]);xe=Ke[ae],_f(xe,c.value[ae]),$.messages=c.value}function ce(ae){return u.value[ae]||{}}function j(ae,xe){u.value[ae]=xe,$.datetimeFormats=u.value,Gb($,ae,xe)}function G(ae,xe){u.value[ae]=co(u.value[ae]||{},xe),$.datetimeFormats=u.value,Gb($,ae,xe)}function re(ae){return d.value[ae]||{}}function he(ae,xe){d.value[ae]=xe,$.numberFormats=d.value,Xb($,ae,xe)}function Ce(ae,xe){d.value[ae]=co(d.value[ae]||{},xe),$.numberFormats=d.value,Xb($,ae,xe)}n_++,t&&sp&&(Ge(t.locale,ae=>{r&&(l.value=ae,$.locale=ae,Wc($,l.value,a.value))}),Ge(t.fallbackLocale,ae=>{r&&(a.value=ae,$.fallbackLocale=ae,Wc($,l.value,a.value))}));const Ee={id:n_,locale:E,fallbackLocale:O,get inheritLocale(){return r},set inheritLocale(ae){r=ae,ae&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Wc($,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return C},get pluralRules(){return L||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(ae){f=ae,$.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(ae){h=ae,$.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(ae){p=ae},get fallbackFormat(){return m},set fallbackFormat(ae){m=ae,$.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(ae){v=ae,$.warnHtmlMessage=ae},get escapeParameter(){return y},set escapeParameter(ae){y=ae,$.escapeParameter=ae},t:X,getLocaleMessage:Y,setLocaleMessage:de,mergeLocaleMessage:ne,getPostTranslationHandler:D,setPostTranslationHandler:H,getMissingHandler:z,setMissingHandler:U,[rA]:F};return Ee.datetimeFormats=I,Ee.numberFormats=P,Ee.rt=ue,Ee.te=te,Ee.tm=q,Ee.d=me,Ee.n=Ae,Ee.getDateTimeFormat=ce,Ee.setDateTimeFormat=j,Ee.mergeDateTimeFormat=G,Ee.getNumberFormat=re,Ee.setNumberFormat=he,Ee.mergeNumberFormat=Ce,Ee[lA]=n,Ee[Pv]=Fe,Ee[Rv]=le,Ee[Dv]=Le,Ee}function UN(e){const t=ht(e.locale)?e.locale:$u,n=ht(e.fallbackLocale)||Qn(e.fallbackLocale)||Vt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=Rn(e.missing)?e.missing:void 0,s=Zt(e.silentTranslationWarn)||nc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Zt(e.silentFallbackWarn)||nc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Zt(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Vt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Rn(e.postTranslation)?e.postTranslation:void 0,d=ht(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=Zt(e.sync)?e.sync:!0;let p=e.messages;if(Vt(e.sharedMessages)){const C=e.sharedMessages;p=Object.keys(C).reduce(($,k)=>{const M=$[k]||($[k]={});return co(M,C[k]),$},p||{})}const{__i18n:m,__root:b,__injectWithOption:_}=e,g=e.datetimeFormats,v=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:y,datetimeFormats:g,numberFormats:v,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:m,__root:b,__injectWithOption:_}}function Bv(e={}){const t=rp(UN(e)),{__extender:n}=e,o={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},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(s){t.setMissingHandler(s)},get silentTranslationWarn(){return Zt(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=Zt(s)?!s:s},get silentFallbackWarn(){return Zt(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=Zt(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){return Reflect.apply(t.t,t,[...s])},rt(...s){return Reflect.apply(t.rt,t,[...s])},te(s,i){return t.te(s,i)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,i){t.setLocaleMessage(s,i)},mergeLocaleMessage(s,i){t.mergeLocaleMessage(s,i)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,i){t.setDateTimeFormat(s,i)},mergeDateTimeFormat(s,i){t.mergeDateTimeFormat(s,i)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,i){t.setNumberFormat(s,i)},mergeNumberFormat(s,i){t.mergeNumberFormat(s,i)}};return o.__extender=n,o}function qN(e,t,n){return{beforeCreate(){const o=Lu();if(!o)throw cs(Yo.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=s_(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Bv(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=s_(e,s);else{this.$i18n=Bv({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&cA(t,s,s),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(o,this.$i18n)},mounted(){},unmounted(){const o=Lu();if(!o)throw cs(Yo.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n}}}function s_(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[rA](t.pluralizationRules||e.pluralizationRules);const n=u0(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const d0={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function jN({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Oe?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},yn())}function uA(){return Oe}const VN=Ve({name:"i18n-t",props:co({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>ao(e)||!isNaN(e)}},d0),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||Nt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=yn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=ht(e.plural)?+e.plural:e.plural);const u=jN(t,a);return s[Pv](e.keypath,u,c)},r=co(yn(),o),l=ht(e.tag)||Jt(e.tag)?e.tag:uA();return Jt(l)?ln(l,r,{default:i}):ln(l,r,i())}}}),i_=VN;function KN(e){return Qn(e)&&!ht(e[0])}function dA(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=yn();e.locale&&(c.locale=e.locale),ht(e.format)?c.key=e.format:Jt(e.format)&&(ht(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?co(yn(),h,{[p]:e.format[p]}):h,yn()));const d=o(e.value,c,u);let f=[c.key];return Qn(d)?f=d.map((h,p)=>{const m=s[h.type],b=m?m({[h.type]:h.value,index:p,parts:d}):[h.value];return KN(b)&&(b[0].key=`${h.type}-${p}`),b}):ht(d)&&(f=[d]),f},l=co(yn(),i),a=ht(e.tag)||Jt(e.tag)?e.tag:uA();return Jt(a)?ln(a,l,{default:r}):ln(a,l,r())}}const GN=Ve({name:"i18n-n",props:co({value:{type:Number,required:!0},format:{type:[String,Object]}},d0),setup(e,t){const n=e.i18n||Nt({useScope:e.scope,__useComponent:!0});return dA(e,t,oA,(...o)=>n[Dv](...o))}}),r_=GN;function YN(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function XN(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw cs(Yo.UNEXPECTED_ERROR);const c=YN(e,l.$),u=l_(a);return[Reflect.apply(c.t,c,[...a_(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);sp&&(r.__i18nWatcher=Ge(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{sp&&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=l_(l);r.textContent=Reflect.apply(a.t,a,[...a_(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function l_(e){if(ht(e))return{path:e};if(Vt(e)){if(!("path"in e))throw cs(Yo.REQUIRED_VALUE,"path");return e}else throw cs(Yo.INVALID_VALUE)}function a_(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return ht(n)&&(r.locale=n),ao(s)&&(r.plural=s),ao(i)&&(r.plural=i),[t,l,r]}function QN(e,t,...n){const o=Vt(n[0])?n[0]:{};(Zt(o.globalInstall)?o.globalInstall:!0)&&([i_.name,"I18nT"].forEach(i=>e.component(i,i_)),[r_.name,"I18nN"].forEach(i=>e.component(i,r_)),[d_.name,"I18nD"].forEach(i=>e.component(i,d_))),e.directive("t",XN(t))}const ZN=el("global-vue-i18n");function JN(e={}){const t=__VUE_I18N_LEGACY_API__&&Zt(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Zt(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=e5(e,t),r=el("");function l(d){return o.get(d)||null}function a(d,f){o.set(d,f)}function c(d){o.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),Vt(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=l5(d,u.global)),__VUE_I18N_FULL_INSTALL__&&QN(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(qN(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Nt(e={}){const t=Lu();if(t==null)throw cs(Yo.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw cs(Yo.NOT_INSTALLED);const n=t5(t),o=o5(n),s=aA(t),i=n5(e,s);if(i==="global")return cA(o,e,s),o;if(i==="parent"){let a=c_(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw cs(Yo.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=co({},e),u=c_(n,t);c.__root=u||o;const d=rp(c);return a.__composerExtend&&(d[$a]=a.__composerExtend(d)),D1()&&B1(()=>{const h=d[$a];h&&(h(),delete d[$a])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=co({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=rp(a),r.__composerExtend&&(l[$a]=r.__composerExtend(l)),i5(r,t,l),r.__setInstance(t,l)}return l}function e5(e,t){const n=AE(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Bv(e)):n.run(()=>rp(e));if(o==null)throw cs(Yo.UNEXPECTED_ERROR);return[n,o]}function t5(e){const t=jt(e.isCE?ZN:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw cs(e.isCE?Yo.NOT_INSTALLED_WITH_PROVIDE:Yo.UNEXPECTED_ERROR);return t}function n5(e,t){return lh(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function o5(e){return e.mode==="composition"?e.global:e.global.__composer}function c_(e,t,n=!1){let o=null;const s=t.root;let i=s5(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")o=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(o=l.__composer,n&&o&&!o[lA]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function s5(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function i5(e,t,n){bn(()=>{},t),_n(()=>{const o=n;e.__deleteInstance(t);const s=o[$a];s&&(s(),delete o[$a])},t)}const r5=["locale","fallbackLocale","availableLocales"],u_=["t","rt","d","n","tm","te"];function l5(e,t){const n=Object.create(null);return r5.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw cs(Yo.UNEXPECTED_ERROR);const r=to(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,r)}),e.config.globalProperties.$i18n=n,u_.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw cs(Yo.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,u_.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const a5=Ve({name:"i18n-d",props:co({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},d0),setup(e,t){const n=e.i18n||Nt({useScope:e.scope,__useComponent:!0});return dA(e,t,nA,(...o)=>n[Rv](...o))}}),d_=a5;HN();kN(eN);bN(gN);_N($v);if(__INTLIFY_PROD_DEVTOOLS__){const e=Ll();e.__INTLIFY__=!0,tN(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const c5="modulepreload",u5=function(e){return"/"+e},f_={},Go=function(t,n,o){let s=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");s=r(n.map(c=>{if(c=u5(c),c in f_)return;f_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":c5,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(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 s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},$t={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",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",collapsedWorkspaces:"kimi-web.collapsed-workspaces",showWorkspacePaths:"kimi-web.show-workspace-paths",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme"};function p_(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function Jn(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function no(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function sc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function td(e){const t=Jn(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function fc(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function f0(){const e=Jn($t.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[o,s]of Object.entries(t))s===!0&&(n[o]=!0);return n}catch{return{}}}function p0(e){const n={...f0()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];no($t.unread,JSON.stringify(n))}function d5(){const e=td($t.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function Jm(e){fc($t.collapsedWorkspaces,Array.from(e))}function f5(){return td($t.showWorkspacePaths)===!0}function p5(e){fc($t.showWorkspacePaths,e)}function h5(){const e=td($t.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function fA(e){fc($t.workspaceOrder,Array.from(e))}function Yd(){const e=td($t.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))typeof o=="string"&&(t[n]=o);return t}function h_(e){fc($t.workspaceNameOverrides,e)}function m5(){return Jn($t.workspaceSort)}function pA(e){no($t.workspaceSort,e)}const m_=$t.clientId,g5="kimi-code-web",v5="web";function y5(){return{serverHttpUrl:b5(),clientId:C5(),clientName:g5,clientVersion:x5(),clientUiMode:v5}}function k5(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function b5(e){const t=k5(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function _5(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function w5(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return _5(e)}function lp(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function S5(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 C5(){const e=Jn(m_);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return no(m_,t),t}function x5(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function Wo(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return A5(e)}function A5(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}function T5(e,t){if(e.length===0)return null;const n=new Set(e),o=t.filter(i=>n.has(i)),s=e.filter(i=>!t.includes(i));return s.length===0&&o.length===t.length?null:[...s,...o]}function M5(e,t){const n=new Map(t.map((o,s)=>[o,s]));return e.toSorted((o,s)=>(n.get(o.id)??-1)-(n.get(s.id)??-1))}function E5(e,t,n,o="before"){const s=e.indexOf(t),i=e.indexOf(n);if(s===-1||i===-1||s===i)return e;const r=[...e];r.splice(s,1);const l=s<i?i-1:i,a=o==="before"?l:l+1;return r.splice(a,0,t),r}function I5(e,t){return e.toSorted((n,o)=>(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const $5={"&":"&","<":"<",">":">",'"':""","'":"'"};function g_(e){return e.replace(/[&<>"']/g,t=>$5[t]??t)}function N5(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function L5(e,t,n=40){const o=e.replace(/\s+/g," ").trim();if(o.length===0)return"";const s=t.trim();if(s.length===0)return v_(o,n*2);const i=o.toLowerCase().indexOf(s.toLowerCase());if(i<0)return v_(o,n*2);const r=Math.max(0,i-n),l=Math.min(o.length,i+s.length+n),a=r>0,c=l<o.length;return`${a?"…":""}${o.slice(r,l)}${c?"…":""}`}function v_(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function eg(e,t){const n=g_(e),o=t.trim();if(o.length===0)return n;const s=new RegExp(N5(g_(o)),"gi");return n.replace(s,i=>`<mark>${i}</mark>`)}const Aa=Z(0),O5=["type","disabled","aria-label"],P5=Ve({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=Z();return t({el:n}),(o,s)=>(w(),N("button",{ref_key:"el",ref:n,class:De(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[An(o.$slots,"default",{},void 0,!0)],10,O5))}}),ft=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},vn=ft(P5,[["__scopeId","data-v-321e56e3"]]),R5=Object.freeze({left:0,top:0,width:16,height:16}),hA=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),mA=Object.freeze({...R5,...hA}),Upe=Object.freeze({...mA,body:"",hidden:!1}),D5=Object.freeze({width:null,height:null}),B5=Object.freeze({...D5,...hA}),F5=/(-?[0-9.]*[0-9]+[0-9.]*)/g,H5=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function y_(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const o=e.split(F5);if(o===null||!o.length)return e;const s=[];let i=o.shift(),r=H5.test(i);for(;;){if(r){const l=parseFloat(i);isNaN(l)?s.push(i):s.push(Math.ceil(l*t*n)/n)}else s.push(i);if(i=o.shift(),i===void 0)return s.join("");r=!r}}function W5(e,t="defs"){let n="";const o=e.indexOf("<"+t);for(;o>=0;){const s=e.indexOf(">",o),i=e.indexOf("</"+t);if(s===-1||i===-1)break;const r=e.indexOf(">",i);if(r===-1)break;n+=e.slice(s+1,i).trim(),e=e.slice(0,o).trim()+e.slice(r+1)}return{defs:n,content:e}}function z5(e,t){return e?"<defs>"+e+"</defs>"+t:t}function U5(e,t,n){const o=W5(e);return z5(o.defs,t+o.content+n)}const q5=e=>e==="unset"||e==="undefined"||e==="none";function j5(e,t){const n={...mA,...e},o={...B5,...t},s={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,o].forEach(m=>{const b=[],_=m.hFlip,g=m.vFlip;let v=m.rotate;_?g?v+=2:(b.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),b.push("scale(-1 1)"),s.top=s.left=0):g&&(b.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),b.push("scale(1 -1)"),s.top=s.left=0);let y;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:y=s.height/2+s.top,b.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:b.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:y=s.width/2+s.left,b.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}v%2===1&&(s.left!==s.top&&(y=s.left,s.left=s.top,s.top=y),s.width!==s.height&&(y=s.width,s.width=s.height,s.height=y)),b.length&&(i=U5(i,'<g transform="'+b.join(" ")+'">',"</g>"))});const r=o.width,l=o.height,a=s.width,c=s.height;let u,d;r===null?(d=l===null?"1em":l==="auto"?c:l,u=y_(d,a/c)):(u=r==="auto"?a:r,d=l===null?y_(u,c/a):l==="auto"?c:l);const f={},h=(m,b)=>{q5(b)||(f[m]=b.toString())};h("width",u),h("height",d);const p=[s.left,s.top,a,c];return f.viewBox=p.join(" "),{attributes:f,viewBox:p,body:i}}const gA={plus:{body:'<path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/>',width:24,height:24},"chat-new":{body:'<path fill="currentColor" d="M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3z"/>',width:24,height:24},close:{body:'<path fill="currentColor" d="m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"/>',width:24,height:24},check:{body:'<path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/>',width:24,height:24},search:{body:'<path fill="currentColor" d="m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975z"/>',width:24,height:24},copy:{body:'<path fill="currentColor" d="M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"/>',width:24,height:24},link:{body:'<path fill="currentColor" d="m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"/>',width:24,height:24},"external-link":{body:'<path fill="currentColor" d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"/>',width:24,height:24},download:{body:'<path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/>',width:24,height:24},undo:{body:'<path fill="currentColor" d="m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"/>',width:24,height:24},send:{body:'<path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/>',width:24,height:24},image:{body:'<path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/>',width:24,height:24},settings:{body:'<path fill="currentColor" d="M3.34 17a10 10 0 0 1-.979-2.326a3 3 0 0 0 .003-5.347a10 10 0 0 1 2.5-4.337a3 3 0 0 0 4.632-2.674a10 10 0 0 1 5.007.003a3 3 0 0 0 4.632 2.671a10.06 10.06 0 0 1 2.503 4.336a3 3 0 0 0-.002 5.347a10 10 0 0 1-2.501 4.337a3 3 0 0 0-4.632 2.674a10 10 0 0 1-5.007-.002a3 3 0 0 0-4.631-2.672A10 10 0 0 1 3.339 17m5.66.196a5 5 0 0 1 2.25 2.77q.75.07 1.499.002a5 5 0 0 1 2.25-2.772a5 5 0 0 1 3.526-.564q.435-.614.748-1.298A5 5 0 0 1 18 12c0-1.26.47-2.437 1.273-3.334a8 8 0 0 0-.75-1.298A5 5 0 0 1 15 6.804a5 5 0 0 1-2.25-2.77q-.75-.071-1.5-.001A5 5 0 0 1 9 6.804a5 5 0 0 1-3.526.564q-.436.614-.747 1.298A5 5 0 0 1 6 12c0 1.26-.471 2.437-1.273 3.334a8 8 0 0 0 .75 1.298A5 5 0 0 1 9 17.196M12 15a3 3 0 1 1 0-6a3 3 0 0 1 0 6m0-2a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/>',width:24,height:24},sliders:{body:'<path fill="currentColor" d="M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/>',width:24,height:24},"log-in":{body:'<path fill="currentColor" d="M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"/>',width:24,height:24},"chevron-down":{body:'<path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/>',width:24,height:24},"chevron-right":{body:'<path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/>',width:24,height:24},"arrow-up":{body:'<path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/>',width:24,height:24},"arrow-down":{body:'<path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/>',width:24,height:24},"arrow-right":{body:'<path fill="currentColor" d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"/>',width:24,height:24},minus:{body:'<path fill="currentColor" d="M5 11v2h14v-2z"/>',width:24,height:24},"panel-collapse":{body:'<path fill="currentColor" d="m15.071 4.929l1.414 1.414L11.83 11H21v2h-9.17l4.656 4.657l-1.414 1.414L8.001 12zm-11.07 14.07V5h2v14z"/>',width:24,height:24},"panel-expand":{body:'<path fill="currentColor" d="m17.172 11l-4.657-4.657l1.414-1.414L21 12l-7.071 7.071l-1.414-1.414L17.172 13H8v-2zM4 19V5h2v14z"/>',width:24,height:24},expand:{body:'<path fill="currentColor" d="M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"/>',width:24,height:24},collapse:{body:'<path fill="currentColor" d="M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"/>',width:24,height:24},list:{body:'<path fill="currentColor" d="M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"/>',width:24,height:24},sort:{body:'<path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/>',width:24,height:24},grip:{body:'<path fill="currentColor" d="M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"/>',width:24,height:24},folder:{body:'<path fill="currentColor" d="M3 21a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2H20a1 1 0 0 1 1 1v3h-2V7h-7.414l-2-2H4v11.998L5.5 11h17l-2.31 9.243a1 1 0 0 1-.97.757zm16.938-8H7.062l-1.5 6h12.876z"/>',width:24,height:24},"folder-closed":{body:'<path fill="currentColor" d="M4 5v14h16V7h-8.414l-2-2zm8.414 0H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/>',width:24,height:24},"folder-plus":{body:'<path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"/>',width:24,height:24},"folder-solid":{body:'<path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/>',width:24,height:24},file:{body:'<path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/>',width:24,height:24},"file-text":{body:'<path fill="currentColor" d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"/>',width:24,height:24},"file-plus":{body:'<path fill="currentColor" d="M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"/>',width:24,height:24},"file-off":{body:'<path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/>',width:24,height:24},"image-off":{body:'<path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/>',width:24,height:24},code:{body:'<path fill="currentColor" d="m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"/>',width:24,height:24},terminal:{body:'<path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/>',width:24,height:24},pencil:{body:'<path fill="currentColor" d="m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"/>',width:24,height:24},glob:{body:'<path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"/>',width:24,height:24},globe:{body:'<path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"/>',width:24,height:24},"check-list":{body:'<path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/>',width:24,height:24},bolt:{body:'<path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/>',width:24,height:24},"git-pull-request":{body:'<path fill="currentColor" d="M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/>',width:24,height:24},message:{body:'<path fill="currentColor" d="M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"/>',width:24,height:24},mail:{body:'<path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"/>',width:24,height:24},user:{body:'<path fill="currentColor" d="M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"/>',width:24,height:24},info:{body:'<path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"/>',width:24,height:24},"help-circle":{body:'<path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"/>',width:24,height:24},"alert-triangle":{body:'<path fill="currentColor" d="m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"/>',width:24,height:24},clock:{body:'<path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"/>',width:24,height:24},sparkles:{body:'<path fill="currentColor" d="M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"/>',width:24,height:24},play:{body:'<path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"/>',width:24,height:24},stop:{body:'<path fill="currentColor" d="M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"/>',width:24,height:24},star:{body:'<path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"/>',width:24,height:24},"star-outline":{body:'<path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"/>',width:24,height:24},"dots-horizontal":{body:'<path fill="currentColor" d="M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5m15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5m-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5s1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5"/>',width:24,height:24}},vA={sm:14,md:16,lg:20};function V5(e){return`0 0 ${e.width??24} ${e.height??24}`}const K5=Object.fromEntries(Object.entries(gA).map(([e,t])=>[e,{body:t.body,viewBox:V5(t),fill:!0}]));function G5(e){return K5[e]}function Ta(e,t="md"){const n=vA[t],o=j5(gA[e],{width:n,height:n}),s=o.attributes.viewBox;return`<svg class="kw-icon" width="${n}" height="${n}" viewBox="${s}" fill="currentColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">${o.body}</svg>`}const Y5=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],X5=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],Je=Ve({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=W(()=>G5(t.name)),o=W(()=>vA[t.size]),s=W(()=>n.value.viewBox??"0 0 16 16");return(i,r)=>n.value.fill?(w(),N("svg",{key:0,class:"kw-icon",width:o.value,height:o.value,viewBox:s.value,fill:"currentColor","aria-label":e.label,"aria-hidden":e.label?void 0:!0,xmlns:"http://www.w3.org/2000/svg",innerHTML:n.value.body},null,8,Y5)):(w(),N("svg",{key:1,class:"kw-icon",width:o.value,height:o.value,viewBox:s.value,fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-label":e.label,"aria-hidden":e.label?void 0:!0,xmlns:"http://www.w3.org/2000/svg",innerHTML:n.value.body},null,8,X5))}}),Q5={key:0,class:"ui-dialog__head"},Z5={class:"ui-dialog__titles"},J5={key:0,class:"ui-dialog__title"},e8={key:1,class:"ui-dialog__desc"},t8={class:"ui-dialog__body"},n8={key:1,class:"ui-dialog__foot"},o8='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',s8=Ve({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,o=t,s=Z(null);let i=null;function r(){o("update:open",!1),o("close")}function l(){return s.value?Array.from(s.value.querySelectorAll(o8)):[]}function a(u){if(!n.open)return;if(u.key==="Escape"&&n.closeOnEsc){u.preventDefault(),r();return}if(u.key!=="Tab")return;const d=l(),f=d[0],h=d[d.length-1];if(!f||!h){u.preventDefault(),s.value?.focus();return}const p=document.activeElement;u.shiftKey&&p===f?(u.preventDefault(),h.focus()):!u.shiftKey&&p===h&&(u.preventDefault(),f.focus())}function c(u){n.closeOnOverlay&&u.target===u.currentTarget&&r()}return Ge(()=>n.open,async u=>{u?(Aa.value+=1,i=document.activeElement,await gt(),(l()[0]??s.value)?.focus()):(Aa.value=Math.max(0,Aa.value-1),i instanceof HTMLElement&&(i.focus(),i=null))},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",a),vo(()=>{typeof window<"u"&&window.removeEventListener("keydown",a),n.open&&(Aa.value=Math.max(0,Aa.value-1))}),(u,d)=>(w(),ge(oh,{to:"body"},[e.open?(w(),N("div",{key:0,class:"ui-dialog__overlay",onMousedown:c},[T("div",{ref_key:"panel",ref:s,class:De(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||u.$slots.head?(w(),N("div",Q5,[An(u.$slots,"head",{},()=>[T("div",Z5,[e.title?(w(),N("div",J5,R(e.title),1)):ie("",!0),e.description?(w(),N("div",e8,R(e.description),1)):ie("",!0)])],!0),se(vn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:ke(()=>[se(Je,{name:"close",size:"md"})]),_:1})])):ie("",!0),T("div",t8,[An(u.$slots,"default",{},void 0,!0)]),u.$slots.foot?(w(),N("div",n8,[An(u.$slots,"foot",{},void 0,!0)])):ie("",!0)],2)],32)):ie("",!0)]))}}),rr=ft(s8,[["__scopeId","data-v-7904ff48"]]),i8={class:"sd-head"},r8=["placeholder","aria-label"],l8=["aria-selected","onClick","onMousemove"],a8={class:"sd-meta"},c8=["innerHTML"],u8={class:"sd-time"},d8=["innerHTML"],f8=["innerHTML"],p8={key:1,class:"sd-empty"},h8={class:"sd-hint"},m8=200,g8=Ve({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=Z(!0),r=Z(""),l=Z(null),a=Z(null),c=W(()=>{const _=r.value.trim().toLowerCase(),g=[];for(const v of o.sessions){const y=v.title??"",C=v.lastPrompt??"",L=v.workspaceName??"",$=_.length>0&&y.toLowerCase().includes(_),k=_.length>0&&C.toLowerCase().includes(_),M=_.length>0&&L.toLowerCase().includes(_);if(!(_.length>0&&!$&&!k&&!M)&&(g.push({session:v,inTitle:$,inWorkspace:M,snippetText:C?L5(C,r.value):""}),g.length>=m8))break}return g}),u=Z(0);Ge(r,()=>{u.value=0});function d(_){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,_))}async function f(){await gt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(_){u.value=d(u.value+_),f()}function p(_){s("select",_),s("close")}function m(){const _=c.value[u.value];_&&p(_.session.id)}function b(_){_.key==="ArrowDown"?(_.preventDefault(),h(1)):_.key==="ArrowUp"?(_.preventDefault(),h(-1)):_.key==="Enter"&&(_.preventDefault(),m())}return bn(()=>{l.value?.focus()}),(_,g)=>(w(),ge(rr,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>s("close"))},{head:ke(()=>[T("div",i8,[se(Je,{class:"sd-search-icon",name:"search",size:"md"}),En(T("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:A(n)("sidebar.searchPlaceholder"),"aria-label":A(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:b},null,40,r8),[[ms,r.value]])])]),foot:ke(()=>[T("span",h8,R(A(n)("sidebar.searchHint")),1)]),default:ke(()=>[T("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(w(!0),N(Oe,{key:0},st(c.value,(v,y)=>(w(),N("button",{key:v.session.id,class:De(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:C=>p(v.session.id),onMousemove:C=>u.value=y},[T("span",a8,[se(Je,{class:"sd-folder",name:"folder-closed",size:"sm"}),T("span",{class:"sd-ws",innerHTML:A(eg)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,c8),T("span",u8,R(v.session.time),1)]),T("span",{class:"sd-title",innerHTML:A(eg)(v.session.title,v.inTitle?r.value:"")},null,8,d8),v.snippetText?(w(),N("span",{key:0,class:"sd-snippet",innerHTML:A(eg)(v.snippetText,r.value)},null,8,f8)):ie("",!0)],42,l8))),128)):(w(),N("div",p8,R(A(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),v8=ft(g8,[["__scopeId","data-v-a678f802"]]),y8=["aria-label"],k8=Ve({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(w(),N("span",{class:De(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[T("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[T("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),T("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,y8))}}),Zs=ft(k8,[["__scopeId","data-v-e5c5b17d"]]),b8={key:0,class:"ui-badge__dot","aria-hidden":"true"},_8=Ve({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(w(),N("span",{class:De(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(w(),N("span",b8)):ie("",!0),An(t.$slots,"default",{},void 0,!0)],2))}}),$o=ft(_8,[["__scopeId","data-v-5bc5cd6d"]]),Ou=Z(null);function yA(e){const t=Ou.value;t&&(Ou.value=null,t.resolve(e))}function w8(e){return Ou.value&&yA(!1),new Promise(t=>{Ou.value={...e,resolve:t}})}function ol(){return{current:Ou,confirm:w8,settle:yA}}const S8=Ve({__name:"Menu",setup(e,{expose:t}){const n=Z();return t({el:n}),(o,s)=>(w(),N("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[An(o.$slots,"default",{},void 0,!0)],512))}}),Fl=ft(S8,[["__scopeId","data-v-60e6cd8d"]]),C8={key:0,class:"ui-menu-sep",role:"separator"},x8=["disabled"],A8=Ve({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(w(),N("div",C8)):(w(),N("button",{key:1,class:De(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[An(t.$slots,"default",{},void 0,!0)],10,x8))}}),dn=ft(A8,[["__scopeId","data-v-eab8e277"]]),yr=6,kr=8,T8=150,M8=Ve({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=Z(),o=Z(),s=Z(!1),i=Z(!1),r=Z({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=o.value;if(!a||!m)return;const b=a.getBoundingClientRect(),_=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let C=t.placement;C==="top"&&b.top-yr-g<kr?C="bottom":C==="bottom"&&b.bottom+yr+g>y-kr?C="top":C==="left"&&b.left-yr-_<kr?C="right":C==="right"&&b.right+yr+_>v-kr&&(C="left");let L=0,$=0;C==="top"?(L=b.top-yr-g,$=b.left+b.width/2-_/2):C==="bottom"?(L=b.bottom+yr,$=b.left+b.width/2-_/2):C==="left"?(L=b.top+b.height/2-g/2,$=b.left-yr-_):(L=b.top+b.height/2-g/2,$=b.right+yr),$=Math.min(Math.max($,kr),v-kr-_),L=Math.min(Math.max(L,kr),y-kr-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(L)}px`,left:`${Math.round($)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{s.value=!0,i.value=!1,gt(()=>{u(),i.value=!0})},T8))}function f(){window.clearTimeout(l),s.value=!1,i.value=!1}function h(){s.value&&f()}function p(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return bn(()=>{const m=n.value??null;p(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const b=m.firstElementChild??null;b!==a&&(f(),p(b??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),vo(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,b)=>(w(),N(Oe,null,[T("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[An(m.$slots,"default",{},void 0,!0)],512),(w(),ge(oh,{to:"body"},[En(T("div",{ref_key:"bubble",ref:o,class:De(["ui-tip__bubble",{positioned:i.value}]),style:Yt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},R(e.text),7),[[Vs,s.value]])]))],64))}}),zt=ft(M8,[["__scopeId","data-v-4c261eb6"]]),E8={class:"row"},I8={class:"lead","aria-hidden":"true"},$8={key:1,class:"unread-dot"},N8={class:"left"},L8=["onKeydown"],O8={class:"act"},P8={class:"ts"},R8={class:"menu-time"},D8=Ve({__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:o}=Nt(),{confirm:s}=ol(),i=e,r=n;function l(S){const I=new Date(S);if(Number.isNaN(I.getTime()))return S;const P=D=>String(D).padStart(2,"0");return`${I.getFullYear()}-${P(I.getMonth()+1)}-${P(I.getDate())} ${P(I.getHours())}:${P(I.getMinutes())}`}const a=W(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=Z(!1),u=Z(null),d=Z(null),f=Z({});function h(S){const I=S.target;d.value?.el?.contains(I)||u.value?.el?.contains(I)||b()}function p(){const S=u.value?.el;if(!S)return;const I=d.value?.el,P=S.getBoundingClientRect(),D=4,H=8,z=I?.offsetHeight??0,U=I?.offsetWidth??0;let Q=P.bottom+D;Q+z>window.innerHeight-H&&(Q=Math.max(H,P.top-z-D));let X=P.right-U;X<H&&(X=H),f.value={top:`${Math.round(Q)}px`,left:`${Math.round(X)}px`}}async function m(S){if(S.stopPropagation(),c.value){b();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",h),0),window.addEventListener("resize",b),await gt(),p()}function b(){c.value=!1,document.removeEventListener("mousedown",h),window.removeEventListener("resize",b)}_n(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",b)});const _=Z(!1),g=Z(""),v=Z(null);async function y(){b(),_.value=!0,g.value=i.session.title,await gt();try{v.value?.focus(),v.value?.select()}catch{}}function C(){const S=g.value.trim();S&&r("rename",i.session.id,S),_.value=!1}function L(){_.value=!1}const $=Z(!1),k=Z(!1);async function M(){const S=await Wo(i.session.id);$.value=S,k.value=!S,setTimeout(()=>{$.value=!1,k.value=!1,b()},1500)}function E(){b(),r("fork",i.session.id)}async function O(){b(),await s({title:o("sidebar.archive"),message:o("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:b}),(S,I)=>(w(),N("div",{class:De(["se",{on:e.active}]),onClick:I[4]||(I[4]=P=>r("select",e.session.id))},[T("div",E8,[T("span",I8,[e.session.busy?(w(),ge(Zs,{key:0,size:"sm"})):e.unread?(w(),N("span",$8)):ie("",!0)]),T("div",N8,[_.value?En((w(),N("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":I[0]||(I[0]=P=>g.value=P),class:"rename-input",onClick:I[1]||(I[1]=yt(()=>{},["stop"])),onKeydown:[ai(yt(C,["stop"]),["enter"]),ai(yt(L,["stop"]),["esc"])],onBlur:C},null,40,L8)),[[ms,g.value]]):(w(),N("span",{key:1,class:"t",onDblclick:yt(y,["stop"])},R(e.session.title),33))]),se(zt,{text:A(o)("workspace.awaitingAnswerTitle")},{default:ke(()=>[!_.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(w(),ge($o,{key:0,variant:"info",size:"sm"},{default:ke(()=>[je(R(A(o)("workspace.awaitingAnswer")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),se(zt,{text:A(o)("workspace.awaitingPermissionTitle")},{default:ke(()=>[!_.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(w(),ge($o,{key:0,variant:"warning",size:"sm"},{default:ke(()=>[je(R(A(o)("workspace.awaitingPermission")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),se(zt,{text:A(o)("workspace.abortedTitle")},{default:ke(()=>[!_.value&&e.session.status==="aborted"?(w(),ge($o,{key:0,variant:"danger",size:"sm"},{default:ke(()=>[je(R(A(o)("workspace.aborted")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),T("span",O8,[T("span",P8,R(e.session.time),1),_.value?ie("",!0):(w(),ge(vn,{key:0,ref_key:"kebabRef",ref:u,class:De(["kebab",{open:c.value}]),size:"sm",label:A(o)("sidebar.options"),onClick:I[2]||(I[2]=yt(P=>m(P),["stop"]))},{default:ke(()=>[se(Je,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label"]))])]),(w(),ge(oh,{to:"body"},[c.value?(w(),ge(Fl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:Yt(f.value),onClick:I[3]||(I[3]=yt(()=>{},["stop"]))},{default:ke(()=>[se(dn,{danger:k.value,onClick:M},{default:ke(()=>[je(R(k.value?A(o)("sidebar.copyFailed"):$.value?A(o)("sidebar.copied"):A(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),se(dn,{separator:""}),se(dn,{onClick:y},{default:ke(()=>[je(R(A(o)("sidebar.rename")),1)]),_:1}),se(dn,{onClick:E},{default:ke(()=>[je(R(A(o)("sidebar.fork")),1)]),_:1}),se(dn,{danger:"",onClick:O},{default:ke(()=>[je(R(A(o)("sidebar.archive")),1)]),_:1}),se(dn,{separator:""}),T("div",R8,R(a.value),1)]),_:1},8,["style"])):ie("",!0)]))],2))}}),B8=ft(D8,[["__scopeId","data-v-be68e943"]]),F8={class:"gh-top"},H8={key:2,class:"gh-name"},W8={class:"gh-path"},z8=["inert"],U8=["disabled"],q8={class:"show-more-label"},j8={class:"show-more-label"},V8={key:2,class:"group-empty"},K8=Ve({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},showPath:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=W({get:()=>o.renameValue,set:f=>s("updateRenameValue",f)}),r=W(()=>{if(o.isExpanded(o.group.workspace.id))return o.group.sessions;const f=o.group.sessions.slice(0,o.group.initialCount);if(o.activeId&&!f.some(h=>h.id===o.activeId)){const h=o.group.sessions.find(p=>p.id===o.activeId);if(h)return[...f,h]}return f}),l=W(()=>o.group.sessions.length>o.group.initialCount);function a(){return Math.max(0,o.group.workspace.sessionCount-o.group.sessions.length)}function c(){return o.group.sessions.length-o.group.initialCount}function u(f){o.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}return(f,h)=>(w(),N("div",{class:De(["group",{dragging:e.dragging}])},[T("div",{class:De(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id),"show-path":e.showPath}]),draggable:"true",onClick:h[7]||(h[7]=yt(p=>s("groupClick",e.group.workspace.id,p),["stop"])),onContextmenu:h[8]||(h[8]=p=>s("groupContextmenu",e.group.workspace,p)),onDragstart:d,onDragend:h[9]||(h[9]=p=>s("wsDragend"))},[T("div",F8,[e.isCollapsed(e.group.workspace.id)?(w(),ge(Je,{key:0,class:"gh-folder",name:"folder-closed",size:"sm"})):(w(),ge(Je,{key:1,class:"gh-folder",name:"folder",size:"sm"})),e.renamingId!==e.group.workspace.id?(w(),N("span",H8,R(e.group.workspace.name),1)):En((w(),N("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=p=>i.value=p),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=ai(p=>s("confirmRename"),["enter"])),h[2]||(h[2]=ai(p=>s("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>s("cancelRename")),onClick:h[4]||(h[4]=yt(()=>{},["stop"]))},null,544)),[[ms,i.value]]),se(vn,{class:De(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:A(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=yt(p=>s("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:ke(()=>[se(Je,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label","aria-expanded"]),se(vn,{class:"gh-add",size:"sm",label:A(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=yt(p=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:ke(()=>[se(Je,{name:"chat-new"})]),_:1},8,["label"])]),se(zt,{text:e.group.workspace.root},{default:ke(()=>[T("div",W8,R(e.group.workspace.shortPath||e.group.workspace.root),1)]),_:1},8,["text"])],34),T("div",{class:De(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(w(!0),N(Oe,null,st(r.value,p=>(w(),ge(B8,{key:p.id,session:p,active:p.id===e.activeId,"approval-count":e.pendingBySession[p.id]?.approvals??0,"question-count":e.pendingBySession[p.id]?.questions??0,unread:e.unreadBySession[p.id]??!1,onSelect:h[10]||(h[10]=m=>s("selectSession",m)),onRename:h[11]||(h[11]=(m,b)=>s("renameSession",m,b)),onArchive:h[12]||(h[12]=m=>s("archiveSession",m)),onFork:h[13]||(h[13]=m=>s("forkSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(w(),N("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[14]||(h[14]=yt(p=>s("loadMore",e.group.workspace.id),["stop"]))},[h[16]||(h[16]=T("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),T("span",q8,R(e.group.loadingMore?A(n)("sidebar.loadingMore"):A(n)("sidebar.showMore",{count:a()})),1)],8,U8)):ie("",!0),l.value?(w(),N("button",{key:1,class:"show-more",onClick:h[15]||(h[15]=yt(p=>s("toggleExpand",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=T("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),T("span",j8,R(e.isExpanded(e.group.workspace.id)?A(n)("sidebar.showLess"):A(n)("sidebar.showAll",{count:c()})),1)])):ie("",!0),e.group.sessions.length===0?(w(),N("div",V8,R(A(n)("sidebar.noSessions")),1)):ie("",!0)],10,z8)],2))}}),G8=ft(K8,[["__scopeId","data-v-81fdc08d"]]),Y8="kimi_desktop",X8="platform",k_="kimi-desktop",b_="kimi-desktop-platform";function Q8(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(Y8)?(sessionStorage.setItem(k_,"1"),e=!0):e=e||sessionStorage.getItem(k_)==="1";const o=n.get(X8);o?(sessionStorage.setItem(b_,o),t=o):t=sessionStorage.getItem(b_)}catch{}return{isDesktop:e,platform:t}}const Fv=Q8(),Z8=Fv.isDesktop,kA=Fv.isDesktop&&Fv.platform==="darwin",J8=["aria-label"],eL=Ve({__name:"InternalBuildBanner",setup(e){const{t}=Nt(),n=Z8;return(o,s)=>A(n)?(w(),N("span",{key:0,class:"internal-build-tag",role:"note","aria-label":A(t)("app.internalBuildBanner")},[s[0]||(s[0]=T("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[T("path",{d:"M8 2 14 13H2L8 2Z"}),T("path",{d:"M8 6v3.5"}),T("path",{d:"M8 11.5h.01"})],-1)),T("span",null,R(A(t)("app.internalBuildBanner")),1)],8,J8)):ie("",!0)}}),tL=ft(eL,[["__scopeId","data-v-b5e70a09"]]),nL={class:"ch"},oL={class:"ch-brand"},sL={class:"ch-name"},iL={key:0,class:"ch-endpoint"},rL={class:"search-input"},lL={key:0,class:"empty"},aL={class:"side-section-label"},cL={class:"side-section-title"},uL={class:"side-section-actions"},dL=["onDragover","onDrop"],fL={class:"section-menu-check"},pL={class:"section-menu-check"},hL={class:"section-menu-check"},mL=1e3,gL=Ve({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Nt(),{confirm:o}=ol(),s=!1,i="",r=e,l=t,a=Z(!1);function c(){l("loadAllSessions"),a.value=!0}function u(Ye){(Ye.metaKey||Ye.ctrlKey)&&Ye.key.toLowerCase()==="k"&&(Ye.preventDefault(),c())}bn(()=>window.addEventListener("keydown",u)),vo(()=>window.removeEventListener("keydown",u));const d=Z(!1);function f(Ye){d.value=Ye.target.scrollTop>0}const h=Z(new Set(d5()));function p(Ye){return h.value.has(Ye)}function m(Ye){const Xe=new Set(h.value);Xe.has(Ye)?Xe.delete(Ye):Xe.add(Ye),h.value=Xe,Jm(Xe)}function b(){const Ye=new Set(r.groups.map(Xe=>Xe.workspace.id));h.value=Ye,Jm(Ye)}function _(){const Ye=new Set;h.value=Ye,Jm(Ye)}const g=W(()=>r.groups.length>0&&r.groups.every(Ye=>h.value.has(Ye.workspace.id))),v=Z(new Set);function y(Ye){return v.value.has(Ye)}function C(Ye){const Xe=new Set(v.value);Xe.has(Ye)?Xe.delete(Ye):Xe.add(Ye),v.value=Xe}function L(Ye){if(!v.value.has(Ye)){const Xe=new Set(v.value);Xe.add(Ye),v.value=Xe}l("loadMoreSessions",Ye)}const $=Z(f5());function k(){$.value=!$.value,p5($.value)}const M=Z(null),E=Z(null);function O(Ye){M.value=Ye}function S(){M.value=null,E.value=null}function I(Ye){const Xe=Ye.currentTarget.getBoundingClientRect();return Ye.clientY<Xe.top+Xe.height/2?"before":"after"}function P(Ye,Xe){M.value===null||M.value===Xe||(Ye.preventDefault(),Ye.dataTransfer&&(Ye.dataTransfer.dropEffect="move"),E.value={id:Xe,position:I(Ye)})}function D(Ye){const Xe=M.value,At=E.value?.id===Ye?E.value.position:"before";if(E.value=null,M.value=null,!Xe||Xe===Ye)return;const Lt=E5(r.groups.map($n=>$n.workspace.id),Xe,Ye,At);l("reorderWorkspaces",Lt)}function H(Ye,Xe){Xe.target.closest(".gh-more, .gh-add")||m(Ye)}function z(Ye){l("select",Ye)}const U=Z(null),Q=Z(""),X=Z(null);function ue(){return X}function me(Ye,Xe){U.value=Ye,Q.value=Xe,gt().then(()=>X.value?.focus())}function Ae(){const Ye=U.value,Xe=Q.value.trim();Ye&&Xe&&l("renameWorkspace",Ye,Xe),U.value=null}function be(){U.value=null}function ze(Ye){Q.value=Ye}const qe=Z(!1),Fe=Z(null),Le=Z({}),le=Z(null);function F(Ye){le.value?.el&&!le.value.el.contains(Ye.target)&&ee()}function te(Ye,Xe){Xe.preventDefault(),Xe.stopPropagation(),Fe.value=Ye,Le.value={top:`${Xe.clientY}px`,left:`${Xe.clientX}px`},qe.value=!0,document.addEventListener("mousedown",F,!0)}function ee(){qe.value=!1,document.removeEventListener("mousedown",F,!0),Fe.value=null}function q(){Fe.value&&Wo(Fe.value.root),ee()}function Y(){Fe.value&&me(Fe.value.id,Fe.value.name),ee()}async function de(){const Ye=Fe.value;Ye&&(ee(),await o({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ye.name}),variant:"danger"})&&l("deleteWorkspace",Ye.id))}const ne=Z(null),ce=Z(null),j=Z({}),G=Z(null);function re(Ye){const Xe=Ye.target;Xe.closest(".gh-more")||Xe.closest(".ws-menu")||Ce()}async function he(Ye,Xe){if(ne.value===Ye.id){Ce();return}const At=Xe.currentTarget;ce.value=Ye,ne.value=Ye.id,document.addEventListener("mousedown",re),window.addEventListener("resize",Ce),await gt();const Lt=G.value?.el,$n=At.getBoundingClientRect(),cn=4,Nn=8,Fn=Lt?.offsetHeight??0,eo=Lt?.offsetWidth??0;let Mt=$n.bottom+cn;Mt+Fn>window.innerHeight-Nn&&(Mt=Math.max(Nn,$n.top-Fn-cn));let Yn=$n.right-eo;Yn<Nn&&(Yn=Nn),j.value={top:`${Math.round(Mt)}px`,left:`${Math.round(Yn)}px`}}function Ce(){ne.value=null,ce.value=null,document.removeEventListener("mousedown",re),window.removeEventListener("resize",Ce)}function Ee(Ye){Wo(Ye.root),Ce()}function ae(Ye){me(Ye.id,Ye.name),Ce()}async function xe(Ye){Ce(),await o({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ye.name}),variant:"danger"})&&l("deleteWorkspace",Ye.id)}const Ke=Z(!1),ot=Z({}),_t=Z(null);function wt(Ye){const Xe=Ye.target;Xe.closest(".side-section-kebab")||Xe.closest(".section-menu")||Pt()}async function It(Ye){if(Ke.value){Pt();return}const Xe=Ye.currentTarget;Ke.value=!0,document.addEventListener("mousedown",wt),window.addEventListener("resize",Pt),await gt();const At=_t.value?.el,Lt=Xe.getBoundingClientRect(),$n=4,cn=8,Nn=At?.offsetHeight??0,Fn=At?.offsetWidth??0;let eo=Lt.bottom+$n;eo+Nn>window.innerHeight-cn&&(eo=Math.max(cn,Lt.top-Nn-$n));let Mt=Lt.right-Fn;Mt<cn&&(Mt=cn),ot.value={top:`${Math.round(eo)}px`,left:`${Math.round(Mt)}px`}}function Pt(){Ke.value=!1,document.removeEventListener("mousedown",wt),window.removeEventListener("resize",Pt)}function bt(Ye){l("setWorkspaceSortMode",Ye),Pt()}function Kt(){k(),Pt()}vo(()=>{document.removeEventListener("mousedown",F,!0),document.removeEventListener("mousedown",re),document.removeEventListener("mousedown",wt),window.removeEventListener("resize",Ce),window.removeEventListener("resize",Pt)});const Dn=Z(null);let In;function Dt(){const Ye=Dn.value;Ye&&(Ye.classList.remove("blink-now"),Ye.getBoundingClientRect(),Ye.classList.add("blink-now"),clearTimeout(In),In=setTimeout(()=>Ye.classList.remove("blink-now"),300))}const pn=li(()=>Go(()=>import("./DesignSystemView-2XTmljim.js"),__vite__mapDeps([0,1]))),Kn=Z(!1);let nt,wn=!1;function hn(Ye){wn=!1,clearTimeout(nt),Ye.currentTarget.setPointerCapture?.(Ye.pointerId),nt=setTimeout(()=>{wn=!0,Kn.value=!0},mL)}function Bn(Ye){clearTimeout(nt);const Xe=Ye.currentTarget;Xe.hasPointerCapture?.(Ye.pointerId)&&Xe.releasePointerCapture(Ye.pointerId)}function Gn(){if(wn){wn=!1;return}Dt()}return vo(()=>{clearTimeout(nt)}),(Ye,Xe)=>(w(),N(Oe,null,[T("aside",{class:De(["side",{"macos-desktop":A(kA)}])},[T("div",{class:"col",style:Yt({width:e.colWidth+"px"})},[T("div",nL,[T("div",oL,[(w(),N("svg",{ref_key:"logoRef",ref:Dn,class:De(["ch-logo",{"is-dev":A(s)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:Gn,onPointerdown:hn,onPointerup:Bn,onPointercancel:Bn},[...Xe[21]||(Xe[21]=[e0('<defs data-v-a64c5665><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-a64c5665><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-a64c5665></rect><g class="ch-eyes" fill="#000" data-v-a64c5665><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-a64c5665></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-a64c5665></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-a64c5665></rect>',2)])],34)),T("span",sL,[Xe[22]||(Xe[22]=je("Kimi Code",-1)),A(s)?(w(),N("span",iL," · "+R(A(i)),1)):ie("",!0)]),se(tL)]),se(vn,{size:"sm",label:A(n)("sidebar.collapseSidebar"),onClick:Xe[0]||(Xe[0]=yt(At=>l("collapse"),["stop"]))},{default:ke(()=>[se(Je,{name:"panel-collapse"})]),_:1},8,["label"]),se(vn,{size:"sm",label:A(n)("settings.title"),onClick:Xe[1]||(Xe[1]=yt(At=>l("openSettings"),["stop"]))},{default:ke(()=>[se(Je,{name:"settings"})]),_:1},8,["label"])]),T("button",{class:"search",type:"button",onClick:c},[se(Je,{class:"search-icon",name:"search"}),T("span",rL,R(A(n)("sidebar.searchShortcut")),1)]),T("div",{class:De(["btn-wrap",{"btn-wrap--scrolled":d.value}])},[T("button",{class:"btn-new-chat",type:"button",onClick:Xe[2]||(Xe[2]=yt(At=>l("create"),["stop"]))},[se(Je,{name:"chat-new"}),T("span",null,R(A(n)("sidebar.newChat")),1)]),ie("",!0)],2),T("div",{class:"sessions",onScroll:f},[e.groups.length===0?(w(),N("div",lL,R(A(n)("workspace.noWorkspace")),1)):(w(),N(Oe,{key:1},[T("div",aL,[T("span",cL,R(A(n)("sidebar.workspaces")),1),T("div",uL,[se(vn,{class:"side-section-toggle",size:"sm",label:g.value?A(n)("sidebar.expandAll"):A(n)("sidebar.collapseAll"),onClick:Xe[4]||(Xe[4]=yt(At=>g.value?_():b(),["stop"]))},{default:ke(()=>[g.value?(w(),ge(Je,{key:0,name:"expand"})):(w(),ge(Je,{key:1,name:"collapse"}))]),_:1},8,["label"]),se(vn,{class:"side-section-toggle side-section-kebab",size:"sm",label:A(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":Ke.value,onClick:Xe[5]||(Xe[5]=yt(At=>It(At),["stop"]))},{default:ke(()=>[se(Je,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(w(!0),N(Oe,null,st(e.groups,At=>(w(),N("div",{key:At.workspace.id,class:De(["ws-drop-target",{"drop-before":E.value?.id===At.workspace.id&&E.value.position==="before","drop-after":E.value?.id===At.workspace.id&&E.value.position==="after"}]),onDragover:Lt=>P(Lt,At.workspace.id),onDrop:Lt=>D(At.workspace.id)},[se(G8,{group:At,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":U.value,"rename-value":Q.value,"rename-input-ref":ue(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":ne.value,dragging:M.value===At.workspace.id,"is-collapsed":p,"is-expanded":y,"show-path":$.value,onGroupClick:H,onGroupContextmenu:te,onToggleWsMenu:he,onCreateInWorkspace:Xe[6]||(Xe[6]=Lt=>l("createInWorkspace",Lt)),onSelectSession:z,onRenameSession:Xe[7]||(Xe[7]=(Lt,$n)=>l("rename",Lt,$n)),onArchiveSession:Xe[8]||(Xe[8]=Lt=>l("archive",Lt)),onForkSession:Xe[9]||(Xe[9]=Lt=>l("fork",Lt)),onLoadMore:L,onToggleExpand:C,onConfirmRename:Ae,onCancelRename:be,onUpdateRenameValue:ze,onWsDragstart:O,onWsDragend:S},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging","show-path"])],42,dL))),128))],64))],32)],4),qe.value?(w(),ge(Fl,{key:0,ref_key:"ghMenuRef",ref:le,class:"gh-menu",style:Yt(Le.value),onClick:Xe[10]||(Xe[10]=yt(()=>{},["stop"]))},{default:ke(()=>[se(dn,{onClick:q},{default:ke(()=>[je(R(A(n)("sidebar.copyPath")),1)]),_:1}),se(dn,{onClick:Y},{default:ke(()=>[je(R(A(n)("sidebar.rename")),1)]),_:1}),se(dn,{danger:"",onClick:de},{default:ke(()=>[je(R(A(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),ne.value!==null&&ce.value?(w(),ge(Fl,{key:1,ref_key:"wsMenuRef",ref:G,class:"ws-menu",style:Yt(j.value),onClick:Xe[14]||(Xe[14]=yt(()=>{},["stop"]))},{default:ke(()=>[se(dn,{onClick:Xe[11]||(Xe[11]=At=>Ee(ce.value))},{default:ke(()=>[je(R(A(n)("sidebar.copyPath")),1)]),_:1}),se(dn,{separator:""}),se(dn,{onClick:Xe[12]||(Xe[12]=At=>ae(ce.value))},{default:ke(()=>[je(R(A(n)("sidebar.rename")),1)]),_:1}),se(dn,{separator:""}),se(dn,{danger:"",onClick:Xe[13]||(Xe[13]=At=>xe(ce.value))},{default:ke(()=>[je(R(A(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),Ke.value?(w(),ge(Fl,{key:2,ref_key:"sectionMenuRef",ref:_t,class:"section-menu",style:Yt(ot.value),onClick:Xe[18]||(Xe[18]=yt(()=>{},["stop"]))},{default:ke(()=>[se(dn,{onClick:Xe[15]||(Xe[15]=At=>bt("manual"))},{default:ke(()=>[T("span",fL,[e.workspaceSortMode==="manual"?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),je(" "+R(A(n)("sidebar.sortManual")),1)]),_:1}),se(dn,{onClick:Xe[16]||(Xe[16]=At=>bt("recent"))},{default:ke(()=>[T("span",pL,[e.workspaceSortMode==="recent"?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),je(" "+R(A(n)("sidebar.sortRecent")),1)]),_:1}),se(dn,{separator:""}),se(dn,{onClick:Xe[17]||(Xe[17]=At=>Kt())},{default:ke(()=>[T("span",hL,[$.value?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),je(" "+R(A(n)("sidebar.showWorkspacePaths")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),a.value?(w(),ge(v8,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:z,onClose:Xe[19]||(Xe[19]=At=>a.value=!1)},null,8,["sessions","active-id"])):ie("",!0)],2),(w(),ge(oh,{to:"body"},[Kn.value?(w(),ge(A(pn),{key:0,onClose:Xe[20]||(Xe[20]=At=>Kn.value=!1)})):ie("",!0)]))],64))}}),vL=ft(gL,[["__scopeId","data-v-a64c5665"]]);function yL(e){try{const t=Jn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function kL(e,t){try{no(e,String(t))}catch{}}function bL(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(_){return Number.isFinite(_)?Math.min(EC(s),Math.max(o,Math.round(_))):n}const l=Z(r(yL(t)??n)),a=Z(!1);function c(_){const g=r(_);l.value=g,kL(t,g)}let u=0,d=0,f=null,h=-1;function p(_){if(!a.value)return;const g=_.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,h=-1}}function b(_){_.preventDefault(),a.value=!0,u=_.clientX,d=r(l.value),f=_.currentTarget,h=_.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(h)}catch{}f.addEventListener("pointermove",p),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return vo(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:b}}const _L=["aria-label"],wL=Ve({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),{width:i,dragging:r,onPointerDown:l}=bL({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),Ge(i,a=>o("update:width",a)),Ge(r,a=>o("update:dragging",a)),(a,c)=>(w(),N("div",{class:De(["rh",{dragging:A(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??A(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>A(l)&&A(l)(...u))},[...c[1]||(c[1]=[T("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,_L))}}),__=ft(wL,[["__scopeId","data-v-ad762f1c"]]),SL={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},CL={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…",internalBuildBanner:"Internal testing only"},xL={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",showWorkspacePaths:"Show workspace paths",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive session?",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",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:"Load more ({count})",showLess:"Show less",showAll:"Show all ({count})",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchShortcut:"Search sessions (⌘K)",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},AL={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",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward 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.",addFailed:"Couldn't open this folder. Check the path and try again.",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"},TL={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?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…"},ML={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",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",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"},EL={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",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",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking"},IL={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"},$L={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?",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"},NL={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"},LL={justNow:"just now"},OL={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",plan_review:"Ready to build with this plan?",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",approvePlan:"Approve plan",revise:"Revise",rejectAndExit:"Reject and Exit"},PL={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},RL={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",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",openDetail:"Open",collapse:"Collapse",expand:"Expand"},DL={panelTitle:"Thinking",close:"Close"},BL={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"},FL={},HL={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"}},WL={searching:"Searching…",noMatch:"No matches"},zL={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},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."}},UL={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},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"}},qL={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"}},jL={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},VL={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",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"},KL={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},GL={preview:"预览",confirm:"确认",cancel:"取消"},YL={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",internalBuildBanner:"仅供内部测试"},XL={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",showWorkspacePaths:"显示工作区路径",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"归档会话?",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"加载更多 ({count})",showLess:"收起",showAll:"展开 ({count})",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchShortcut:"搜索会话 (⌘K)",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},QL={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},ZL={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:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…"},JL={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",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:"进行中"},eO={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking"},tO={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 后重试"},nO={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",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 关闭"},oO={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},sO={justNow:"刚刚"},iO={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},rO={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},lO={tag:"任务",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",collapse:"折叠",expand:"展开"},aO={panelTitle:"思考过程",close:"关闭"},cO={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},uO={},dO={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:"无法读取这个文件"}},fO={searching:"搜索中…",noMatch:"无匹配"},pO={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},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:"目标描述太长了,请精简后重试。"}},hO={help:{desc:"显示可用命令列表"},new:{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:"撤销上一条消息"}},mO={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"}},gO={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},vO={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式"},yO={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},kO={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},bO={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},_O={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",soundOnComplete:"Play a sound when a turn completes or needs an answer",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",notifyQuestionBody:"A question is waiting for your answer",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",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:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",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",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages"},wO={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",soundOnComplete:"会话完成或待回答时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",notifyQuestionBody:"有提问等待你回答",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录"},SO={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"},CO={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档"},xO={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"},AO={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},TO={en:{common:SL,app:CL,sidebar:xL,workspace:AL,conversation:TL,status:ML,composer:EL,login:IL,providers:$L,model:NL,sessions:LL,approval:OL,question:PL,tasks:RL,thinking:DL,diff:BL,fileTree:FL,filePreview:HL,mention:WL,warnings:zL,commands:UL,tools:qL,layout:jL,mobile:VL,theme:KL,onboarding:kO,settings:_O,header:SO,sideChat:xO},zh:{common:GL,app:YL,sidebar:XL,workspace:QL,conversation:ZL,status:JL,composer:eO,login:tO,providers:nO,model:oO,sessions:sO,approval:iO,question:rO,tasks:lO,thinking:aO,diff:cO,fileTree:uO,filePreview:dO,mention:fO,warnings:pO,commands:hO,tools:mO,layout:gO,mobile:vO,theme:yO,onboarding:bO,settings:wO,header:CO,sideChat:AO}},bA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function MO(){const e=Jn($t.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const qn=JN({legacy:!1,locale:MO(),fallbackLocale:"en",messages:TO});function _A(e){qn.global.locale.value=e,no($t.locale,e)}const ja=qn.global.t,EO={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"},IO={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 Xl(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return IO[t]??t}function nd(e){const t=EO[Xl(e)];return t?ja(t):e}const $O={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles"};function h0(e){const t=Xl(e);let n=$O[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n?Ta(n,"sm"):""}const wA=80;function NO(e,t=wA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function LO(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function OO(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 en(e){return typeof e=="string"&&e.length>0?e:void 0}function _l(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function PO(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 tg(e){return en(e.path)??en(e.file_path)??en(e.filePath)??en(e.filename)}const RO=64;function Pu(e,t,n=!1){const o=(s,i=wA)=>n?s.trim():NO(s,i);try{const s=OO(t);if(!n&&LO(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(Xl(e)){case"read":{const r=tg(s);if(!r)return i();const l=_l(s.offset)??_l(s.line_start)??_l(s.start_line),a=_l(s.limit)??_l(s.length),c=_l(s.line_end)??_l(s.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return o(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=tg(s);return r?o(`${r} ${ja("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=tg(s);return r?o(r):i()}case"bash":{const r=en(s.command)??en(s.cmd)??en(s.script);return r?o(r,RO):i()}case"grep":case"search":{const r=en(s.pattern)??en(s.query)??en(s.regex),l=en(s.path)??en(s.glob)??en(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=en(s.pattern)??en(s.glob)??en(s.query),l=en(s.path)??en(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):en(s.path)?o(en(s.path)):i()}case"ls":{const r=en(s.path)??en(s.dir)??en(s.directory)??en(s.cwd);return r?o(r):i()}case"web_fetch":{const r=en(s.url)??en(s.uri);return r?o(PO(r)):i()}case"todo":case"task":{const r=en(s.description)??en(s.title)??en(s.prompt)??en(s.name)??en(s.subagent_type);if(r)return o(r);const l=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return l?o(ja("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function DO(e){try{switch(Xl(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return ja("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const o=n.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),o=t.match(/[-−](\d+)/);if(n||o)return`${n?`+${n[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(e.status!=="error")return ja("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?ja("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const BO=Ve({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(s){switch(s){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const o=W(()=>n(t.status));return(s,i)=>(w(),N("span",{class:De(["kw-dot",`kw-dot--${o.value}`]),"aria-hidden":"true"},null,2))}}),Ru=ft(BO,[["__scopeId","data-v-e36198e5"]]),FO=["innerHTML"],HO={class:"a"},WO={key:0,class:"p"},zO={class:"rt"},UO=["aria-label"],qO={key:0,class:"tm"},jO=["inert"],VO={class:"bb-pad"},KO=Ve({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e){return(t,n)=>(w(),N("div",{class:De(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[T("div",{class:"bh",onClick:n[0]||(n[0]=o=>t.$emit("toggle"))},[e.icon?(w(),N("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,FO)):ie("",!0),T("span",HO,R(e.name),1),se(zt,{text:e.arg},{default:ke(()=>[e.arg?(w(),N("span",WO,R(e.arg),1)):ie("",!0)]),_:1},8,["text"]),T("span",zO,[T("span",{class:De(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(w(),ge(Je,{key:0,name:"check",size:"sm"})):e.status==="error"?(w(),ge(Je,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(w(),ge(Ru,{key:2,status:"suspended"})):(w(),ge(Ru,{key:3,status:"running"}))],10,UO),An(t.$slots,"trailing"),e.time?(w(),N("span",qO,R(e.time),1)):ie("",!0)]),e.expandable?(w(),ge(Je,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ie("",!0)]),T("div",{class:De(["bb",{open:e.open}]),inert:!e.open},[T("div",VO,[An(t.$slots,"default")])],10,jO)],2))}}),m0=ft(KO,[["__scopeId","data-v-92e82f68"]]),GO={key:0,class:"at-type"},YO={key:1,class:"at-task"},XO={key:2,class:"bb-code"},QO=Ve({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t;function i(_){if(!_)return{};try{const g=JSON.parse(_);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=W(()=>i(o.tool.arg)),l=W(()=>!!o.tool.output&&o.tool.output.length>0),a=W(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=Z(o.tool.defaultExpanded===!0&&a.value),u=W(()=>o.tool.status),d=W(()=>nd(o.tool.name)),f=W(()=>h0(o.tool.name)),h=W(()=>r.value.description||r.value.subagentType||""),p=jt("resolveAgentTaskId"),m=W(()=>p?p(o.tool.id)!==void 0:!0);function b(){a.value&&(c.value=!c.value)}return Ge(()=>[o.tool.defaultExpanded,o.tool.output?.length,o.tool.status],()=>{o.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(_,g)=>(w(),ge(m0,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":h.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:b},{trailing:ke(()=>[m.value?(w(),N("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=yt(v=>s("openAgent",e.tool.id),["stop"]))},R(A(n)("tasks.openDetail")),1)):ie("",!0)]),default:ke(()=>[r.value.subagentType?(w(),N("div",GO,R(r.value.subagentType),1)):ie("",!0),r.value.prompt?(w(),N("div",YO,R(r.value.prompt),1)):ie("",!0),l.value?(w(),N("div",XO,[(w(!0),N(Oe,null,st(e.tool.output??[],(v,y)=>(w(),N("div",{key:y},R(v),1))),128))])):ie("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),ZO=ft(QO,[["__scopeId","data-v-14ef8750"]]),JO=1e6,w_=5e3;function S_(e){if(e==="")return[];const t=e.split(`
|
|
39
|
+
`);return t.at(-1)===""&&t.pop(),t}function eP(e,t){const n=S_(e),o=S_(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>w_||i>w_||(s+1)*(i+1)>JO)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=s;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===o[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=s,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===o[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:o[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:f}),f++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function tP(e){let t=0,n=0;for(const o of e)o.type==="add"?t++:o.type==="del"&&n++;return{added:t,removed:n}}function SA(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 CA(e){const t=Xl(e.name);if(t!=="edit"&&t!=="write")return null;const n=SA(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const o=typeof n.old_string=="string"?n.old_string:void 0,s=typeof n.new_string=="string"?n.new_string:void 0;return o===void 0||s===void 0?null:eP(o,s)}return null}function nP(e){const t=SA(e);return t&&typeof t.path=="string"?t.path:void 0}function oP(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const sP={key:0,class:"chip"},iP={key:0,class:"bb-summary"},rP={class:"bb-code"},lP={key:0,class:"bb-empty"},aP=Ve({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,o=t,s=W(()=>n.tool.status),i=W(()=>nd(n.tool.name)),r=W(()=>h0(n.tool.name)),l=W(()=>Pu(n.tool.name,n.tool.arg)),a=W(()=>Pu(n.tool.name,n.tool.arg,!0)),c=W(()=>CA(n.tool)),u=W(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:b,removed:_}=tP(m);if(b||_)return`+${b} −${_}`}return""}),d=W(()=>!!n.tool.output&&n.tool.output.length>0),f=Z(!1),h=W(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){o("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,b)=>(w(),ge(m0,{status:s.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:h.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:p},{trailing:ke(()=>[u.value?(w(),N("span",sP,R(u.value),1)):ie("",!0)]),default:ke(()=>[a.value?(w(),N("div",iP,R(a.value),1)):ie("",!0),T("div",rP,[d.value?ie("",!0):(w(),N("div",lP,"Waiting for output…")),(w(!0),N(Oe,null,st(e.tool.output??[],(_,g)=>(w(),N("div",{key:g},R(_),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),cP=ft(aP,[["__scopeId","data-v-69861679"]]),uP={key:0,class:"chip"},dP={key:0,class:"bb-summary"},fP={class:"bb-code"},pP={key:0,class:"bb-empty"},hP=Ve({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=W(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),o=W(()=>!!t.tool.output&&t.tool.output.length>0),s=W(()=>o.value||n.value),i=Z(t.tool.defaultExpanded===!0&&s.value),r=W(()=>t.tool.status),l=W(()=>nd(t.tool.name)),a=W(()=>h0(t.tool.name)),c=W(()=>Pu(t.tool.name,t.tool.arg)),u=W(()=>Pu(t.tool.name,t.tool.arg,!0)),d=W(()=>DO({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){s.value&&(i.value=!i.value)}return Ge(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&s.value&&(i.value=!0)}),(h,p)=>(w(),ge(m0,{status:r.value,icon:a.value,name:l.value,arg:i.value?"":c.value,time:e.tool.name!=="bash"?e.tool.timing:"",open:i.value,expandable:s.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:ke(()=>[d.value?(w(),N("span",uP,R(d.value),1)):ie("",!0)]),default:ke(()=>[u.value?(w(),N("div",dP,R(u.value),1)):ie("",!0),T("div",fP,[o.value?ie("",!0):(w(),N("div",pP,"Waiting for output…")),(w(!0),N(Oe,null,st(e.tool.output??[],(m,b)=>(w(),N("div",{key:b},R(m),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),mP=ft(hP,[["__scopeId","data-v-f3c4ee38"]]),gP={class:"media-title"},vP=["src","alt"],yP=["src"],kP=["src"],bP=Ve({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,o=t,s=W(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=W(()=>{const c=s.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=s.value;c?.kind==="image"&&o("openMedia",c)}return(c,u)=>s.value?(w(),N("div",{key:0,class:De(["media-tool",{mob:e.mobile}])},[se(zt,{text:s.value.path||l.value},{default:ke(()=>[T("div",gP,R(l.value),1)]),_:1},8,["text"]),s.value.kind==="image"?(w(),ge(zt,{key:0,text:s.value.path||l.value},{default:ke(()=>[T("button",{type:"button",class:"media-image-button",onClick:a},[T("img",{class:"media-image",src:s.value.url,alt:s.value.path?i(s.value.path):l.value,loading:"lazy"},null,8,vP)])]),_:1},8,["text"])):s.value.kind==="video"?(w(),N("video",{key:1,class:"media-video",src:s.value.url,controls:"",preload:"metadata"},null,8,yP)):(w(),N("audio",{key:2,class:"media-audio",src:s.value.url,controls:""},null,8,kP))],2)):ie("",!0)}}),_P=ft(bP,[["__scopeId","data-v-bec13b73"]]);function wP(e){if(e.media&&e.status==="ok")return _P;const t=Xl(e.name);return t==="edit"||t==="write"||t==="multi_edit"?cP:t==="task"?ZO:mP}const xA=Ve({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=W(()=>wP(n.tool));return(i,r)=>(w(),ge(Fo(s.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:r[0]||(r[0]=l=>o("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>o("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>o("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>o("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel"]))}});function C_(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function SP(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=(e%6e4/1e3).toFixed(1);return`${t}m${n}s`}function uh(e){if(e.blocks)return e.blocks;const t=[];e.thinking&&t.push({kind:"thinking",thinking:e.thinking}),e.text&&t.push({kind:"text",text:e.text});for(const n of e.tools??[])t.push({kind:"tool",tool:n});return t}function CP(e){return!(e.tool.status==="ok"&&e.tool.media)}function xP(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function AP(e){const t=uh(e),n=[];let o=[];const s=()=>{if(o.length===1){const[i]=o;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else o.length>1&&n.push({kind:"tool-stack",tools:o});o=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(CP(i)){o.push({tool:i.tool,sourceIndex:r});return}s(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}s(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),s(),n}function TP(e){return uh(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
40
|
+
|
|
41
|
+
`)}function MP(e){const t=[];for(const n of uh(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
42
|
+
> ${n.thinking.split(`
|
|
43
|
+
`).join(`
|
|
44
|
+
> `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const o=n.tool.output.join(`
|
|
45
|
+
`);t.push(`\`\`\`
|
|
46
|
+
[${n.tool.name}]
|
|
47
|
+
${o}
|
|
48
|
+
\`\`\``)}return t.join(`
|
|
49
|
+
|
|
50
|
+
`)}function AA(e){return e.tool.id||`tool-${e.sourceIndex}`}function EP(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?AA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const IP=["aria-expanded"],$P={class:"tg-title"},NP={class:"tg-meta"},LP={class:"tool-group-body"},OP=Ve({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=Z(!0),i=W(()=>n.tools.length),r=W(()=>n.tools.some(u=>u.tool.status==="running")?"running":n.tools.some(u=>u.tool.status==="error")?"error":"done"),{t:l}=Nt(),a=W(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){s.value=!s.value}return(u,d)=>(w(),N("div",{class:De(["tool-group",{open:s.value}])},[T("button",{class:"tool-group-head",type:"button","aria-expanded":s.value,onClick:c},[se(Ru,{status:r.value},null,8,["status"]),se(Je,{class:"tg-ic",name:"list",size:"sm"}),T("span",$P,R(A(l)("tools.group.title",i.value)),1),T("span",NP,"· "+R(a.value),1),se(Je,{class:"tg-car",name:"chevron-right",size:"sm"})],8,IP),En(T("div",LP,[(w(!0),N(Oe,null,st(e.tools,(f,h)=>(w(),ge(xA,{key:A(AA)(f),tool:f.tool,mobile:e.mobile,"stack-position":A(xP)(h,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:d[0]||(d[0]=p=>o("openMedia",p)),onOpenFile:d[1]||(d[1]=p=>o("openFile",p)),onOpenToolDiff:d[2]||(d[2]=p=>o("openToolDiff",p)),onOpenAgent:d[3]||(d[3]=p=>o("openAgent",p))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))],512),[[Vs,s.value]])],2))}}),PP=ft(OP,[["__scopeId","data-v-79e21bc7"]]);var RP=Object.create,g0=Object.defineProperty,DP=Object.getOwnPropertyDescriptor,TA=Object.getOwnPropertyNames,BP=Object.getPrototypeOf,FP=Object.prototype.hasOwnProperty,MA=(e,t)=>function(){return t||(0,e[TA(e)[0]])((t={exports:{}}).exports,t),t.exports},EA=e=>{let t={};for(var n in e)g0(t,n,{get:e[n],enumerable:!0});return t},HP=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=TA(t),i=0,r=s.length,l;i<r;i++)l=s[i],!FP.call(e,l)&&l!==n&&g0(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=DP(t,l))||o.enumerable});return e},IA=(e,t,n)=>(n=e!=null?RP(BP(e)):{},HP(g0(n,"default",{value:e,enumerable:!0}),e));function WP(e,t,n,o){const s=Number(e[t].meta.id+1).toString();let i="";return typeof o.docId=="string"&&(i=`-${o.docId}-`),i+s}function zP(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function UP(e,t,n,o,s){const i=s.rules.footnote_anchor_name(e,t,n,o,s),r=s.rules.footnote_caption(e,t,n,o,s);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 qP(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
51
|
+
`:`<hr class="footnotes-sep">
|
|
52
|
+
`)+`<section class="footnotes">
|
|
53
|
+
<ol class="footnotes-list">
|
|
54
|
+
`}function jP(){return`</ol>
|
|
55
|
+
</section>
|
|
56
|
+
`}function VP(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function KP(){return`</li>
|
|
57
|
+
`}function GP(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function YP(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=UP,e.renderer.rules.footnote_block_open=qP,e.renderer.rules.footnote_block_close=jP,e.renderer.rules.footnote_open=VP,e.renderer.rules.footnote_close=KP,e.renderer.rules.footnote_anchor=GP,e.renderer.rules.footnote_caption=zP,e.renderer.rules.footnote_anchor_name=WP;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h<f;h++){if(l.src.charCodeAt(h)===32)return!1;if(l.src.charCodeAt(h)===93)break}if(h===d+2||h+1>=f||l.src.charCodeAt(++h)!==58)return!1;if(u)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const p=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${p}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:p},m.level=l.level++,l.tokens.push(m);const b=l.bMarks[a],_=l.tShift[a],g=l.sCount[a],v=l.parentType,y=h,C=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let L=C;for(;h<f;){const k=l.src.charCodeAt(h);if(n(k))k===9?L+=4-L%4:L++;else break;h++}l.tShift[a]=h-y,l.sCount[a]=L-C,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=v,l.blkIndent-=4,l.tShift[a]=_,l.sCount[a]=g,l.bMarks[a]=b;const $=new l.Token("footnote_reference_close","",-1);return $.level=--l.level,l.tokens.push($),!0}function s(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,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,p=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,p);const m=l.push("footnote_ref","",0);m.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:p}}return l.pos=f+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 f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const p=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const m=l.push("footnote_ref","",0);m.meta={id:h,subId:p,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(p){return p.type==="footnote_reference_open"?(d=!0,c=[],u=p.meta.label,!1):p.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(p),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let p=0,m=h.length;p<m;p++){const b=new l.Token("footnote_open","",1);if(b.meta={id:p,label:h[p].label},l.tokens.push(b),h[p].tokens){a=[];const v=new l.Token("paragraph_open","p",1);v.block=!0,a.push(v);const y=new l.Token("inline","",0);y.children=h[p].tokens,y.content=h[p].content,a.push(y);const C=new l.Token("paragraph_close","p",-1);C.block=!0,a.push(C)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let _;l.tokens[l.tokens.length-1].type==="paragraph_close"?_=l.tokens.pop():_=null;const g=h[p].count>0?h[p].count:1;for(let v=0;v<g;v++){const y=new l.Token("footnote_anchor","",0);y.meta={id:p,subId:v,label:h[p].label},l.tokens.push(y)}_&&l.tokens.push(_),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",o,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",s),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function XP(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==43)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){let i;const r=[],l=s.length;for(let a=0;a<l;a++){const c=s[a];if(c.marker!==43||c.end===-1)continue;const u=s[c.end];i=o.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=o.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",o.tokens[u.token-1].type==="text"&&o.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<o.tokens.length&&o.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=o.tokens[c],o.tokens[c]=o.tokens[a],o.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(o){const s=o.tokens_meta,i=(o.tokens_meta||[]).length;n(o,o.delimiters);for(let r=0;r<i;r++)s[r]&&s[r].delimiters&&n(o,s[r].delimiters)})}function QP(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==61)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){const i=[],r=s.length;for(let l=0;l<r;l++){const a=s[l];if(a.marker!==61||a.end===-1)continue;const c=s[a.end],u=o.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=o.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",o.tokens[c.token-1].type==="text"&&o.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<o.tokens.length&&o.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=o.tokens[a];o.tokens[a]=o.tokens[l],o.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(o){let s;const i=o.tokens_meta,r=(o.tokens_meta||[]).length;for(n(o,o.delimiters),s=0;s<r;s++)i[s]&&i[s].delimiters&&n(o,i[s].delimiters)})}const ZP=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function JP(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==126||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(ZP,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function eR(e){e.inline.ruler.after("emphasis","sub",JP)}const tR=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function nR(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==94||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(tR,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function oR(e){e.inline.ruler.after("emphasis","sup",nR)}var sR=MA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,b){b=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},b),m.core.ruler.after("inline","github-task-lists",function(_){for(var g=_.tokens,v=0,y=2;y<g.length;y++)s(g,y)&&(i(g[y],v,b,_.Token),v+=1,n(g[y-2],"class",b.liClass),n(g[o(g,y-2)],"class",b.ulClass))})};function n(m,b,_){var g=m.attrIndex(b),v=[b,_];g<0?m.attrPush(v):m.attrs[g]=v}function o(m,b){for(var _=m[b].level-1,g=b-1;g>=0;g--)if(m[g].level===_)return g;return-1}function s(m,b){return d(m[b])&&f(m[b-1])&&h(m[b-2])&&p(m[b])}function i(m,b,_,g){var v=_.idPrefix+b;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(v,g)),m.children.push(a(g)),m.children.unshift(r(m,v,_,g)),_.divWrap&&(m.children.unshift(c(_,g)),m.children.push(u(g)))}function r(m,b,_,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",b]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),_.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,b){var _=new b("label_open","label",1);return _.attrs=[["for",m]],_}function a(m){return new m("label_close","label",-1)}function c(m,b){var _=new b("checkbox_open","div",0);return _.attrs=[["class",m.divClass]],_}function u(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function f(m){return m.type==="paragraph_open"}function h(m){return m.type==="list_item_open"}function p(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),iR=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))),rR=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),ng;const lR=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]]),aR=(ng=String.fromCodePoint)!==null&&ng!==void 0?ng: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 cR(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=lR.get(e))!==null&&t!==void 0?t:e}var _o;(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"})(_o||(_o={}));const uR=32;var Dr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Dr||(Dr={}));function Hv(e){return e>=_o.ZERO&&e<=_o.NINE}function dR(e){return e>=_o.UPPER_A&&e<=_o.UPPER_F||e>=_o.LOWER_A&&e<=_o.LOWER_F}function fR(e){return e>=_o.UPPER_A&&e<=_o.UPPER_Z||e>=_o.LOWER_A&&e<=_o.LOWER_Z||Hv(e)}function pR(e){return e===_o.EQUALS||fR(e)}var bo;(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"})(bo||(bo={}));var Or;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Or||(Or={}));var hR=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=bo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Or.Strict}startEntity(e){this.decodeMode=e,this.state=bo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case bo.EntityStart:return e.charCodeAt(t)===_o.NUM?(this.state=bo.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=bo.NamedEntity,this.stateNamedEntity(e,t));case bo.NumericStart:return this.stateNumericStart(e,t);case bo.NumericDecimal:return this.stateNumericDecimal(e,t);case bo.NumericHex:return this.stateNumericHex(e,t);case bo.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|uR)===_o.LOWER_X?(this.state=bo.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=bo.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,o){if(t!==n){const s=n-t;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(t,s),o),this.consumed+=s}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(Hv(o)||dR(o))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(Hv(o))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(o,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===_o.SEMI)this.consumed+=1;else if(this.decodeMode===Or.Strict)return 0;return this.emitCodePoint(cR(this.result),this.consumed),this.errors&&(e!==_o.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let o=n[this.treeIndex],s=(o&Dr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=mR(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===Or.Attribute&&(s===0||pR(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&Dr.VALUE_LENGTH)>>14,s!==0){if(i===_o.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Or.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,o=(n[t]&Dr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:o}=this;return this.emitCodePoint(t===1?o[e]&~Dr.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case bo.NamedEntity:return this.result!==0&&(this.decodeMode!==Or.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case bo.NumericDecimal:return this.emitNumericEntity(0,2);case bo.NumericHex:return this.emitNumericEntity(0,3);case bo.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case bo.EntityStart:return 0}}};function $A(e){let t="";const n=new hR(e,o=>t+=aR(o));return function(s,i){let r=0,l=0;for(;(l=s.indexOf("&",l))>=0;){t+=s.slice(r,l),n.startEntity(i);const c=n.write(s,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+s.slice(r);return t="",a}}function mR(e,t,n,o){const s=(t&Dr.BRANCH_LENGTH)>>7,i=t&Dr.JUMP_TABLE;if(s===0)return i!==0&&o===i?n:-1;if(i){const a=o-i;return a<0||a>=s?-1:e[n+a]-1}let r=n,l=r+s-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<o)r=a+1;else if(c>o)l=a-1;else return e[a+s]}return-1}const gR=$A(iR);$A(rR);function v0(e,t=Or.Legacy){return gR(e,t)}var vR=IA(sR());const x_={};function yR(e){let t=x_[e];if(t)return t;t=x_[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);t.push(o)}for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);t[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return t}function dh(e,t){typeof t!="string"&&(t=dh.defaultChars);const n=yR(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let s="";for(let i=0,r=o.length;i<r;i+=3){const l=parseInt(o.slice(i+1,i+3),16);if(l<128){s+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(o.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?s+="��":s+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.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?s+="���":s+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16),u=parseInt(o.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?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}s+="�"}return s})}dh.defaultChars=";/?:@&=+$,#";dh.componentChars="";var Wv=dh;const A_={};function kR(e){let t=A_[e];if(t)return t;t=A_[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):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 fh(e,t,n){typeof t!="string"&&(n=t,t=fh.defaultChars),typeof n>"u"&&(n=!0);const o=kR(t);let s="";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))){s+=e.slice(i,i+3),i+=2;continue}if(l<128){s+=o[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){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}fh.defaultChars=";/?:@&=+$,-_.!~*'()#";fh.componentChars="-_.!~*'()";var NA=fh;function y0(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 ap(){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 bR=/^([a-z0-9.+-]+:)/i,_R=/:[0-9]*$/,wR=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,SR=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
58
|
+
`," "]),CR=["'"].concat(SR),T_=["%","/","?",";","#"].concat(CR),M_=["/","?","#"],xR=255,E_=/^[+a-z0-9A-Z_-]{0,63}$/,AR=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,I_={javascript:!0,"javascript:":!0},$_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function TR(e,t){if(e&&e instanceof ap)return e;const n=new ap;return n.parse(e,t),n}ap.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=wR.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=bR.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=i.substr(0,2)==="//",s&&!(r&&I_[r])&&(i=i.substr(2),this.slashes=!0)),!I_[r]&&(s||r&&!$_[r])){let c=-1;for(let p=0;p<M_.length;p++)o=i.indexOf(M_[p]),o!==-1&&(c===-1||o<c)&&(c=o);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 p=0;p<T_.length;p++)o=i.indexOf(T_[p]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const f=i.slice(0,c);i=i.slice(c),this.parseHost(f),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let m=0,b=p.length;m<b;m++){const _=p[m];if(_&&!_.match(E_)){let g="";for(let v=0,y=_.length;v<y;v++)_.charCodeAt(v)>127?g+="x":g+=_[v];if(!g.match(E_)){const v=p.slice(0,m),y=p.slice(m+1),C=_.match(AR);C&&(v.push(C[1]),y.unshift(C[2])),y.length&&(i=y.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>xR&&(this.hostname=""),h&&(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),$_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ap.prototype.parseHost=function(e){let t=_R.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 k0=TR,LA=EA({decode:()=>Wv,encode:()=>NA,format:()=>y0,parse:()=>k0}),OA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PA=/[\0-\x1F\x7F-\x9F]/,MR=/[\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]/,RA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,ER=/[\$\+<->\^`\|~\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]/,DA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,IR=EA({Any:()=>OA,Cc:()=>PA,Cf:()=>MR,P:()=>RA,S:()=>ER,Z:()=>DA}),$R=Object.defineProperty,BA=e=>{let t={};for(var n in e)$R(t,n,{get:e[n],enumerable:!0});return t},lo=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,o=t.length;n<o;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),o=[e,t];n<0?this.attrPush(o):this.attrs[n]=o}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}`}},NR=BA({arrayReplaceAt:()=>FR,assign:()=>DR,countLines:()=>Xn,escapeHtml:()=>GR,escapeRE:()=>XR,fromCodePoint:()=>Bu,has:()=>RR,isMdAsciiPunct:()=>dp,isPunctChar:()=>up,isPunctCode:()=>zv,isSpace:()=>BR,isString:()=>OR,isValidEntityCode:()=>hh,isWhiteSpace:()=>Du,lib:()=>QR,mdurl:()=>LA,normalizeReference:()=>ph,ucmicro:()=>cp,unescapeAll:()=>Fu,unescapeMd:()=>UR});const cp=IR;function LR(e){return Object.prototype.toString.call(e)}function OR(e){return LR(e)==="[object String]"}const PR=Object.prototype.hasOwnProperty;function RR(e,t){return PR.call(e,t)}function DR(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(o=>{e[o]=n[o]})}}),e}function BR(e){return e===9||e===32}function Du(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 up(e){return cp.P.test(e)||cp.S.test(e)}const N_=new Map;function zv(e){if(dp(e))return!0;const t=N_.get(e);if(t!==void 0)return t;const n=up(String.fromCharCode(e));return N_.set(e,n),n}function dp(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 ph(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function FR(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function hh(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 Bu(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 FA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,HR=new RegExp(`${FA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),WR=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function zR(e,t){if(t.charCodeAt(0)===35&&WR.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return hh(o)?Bu(o):e}const n=v0(e);return n!==e?n:e}function UR(e){return e.includes("\\")?e.replace(FA,"$1"):e}function Fu(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(HR,(t,n,o)=>n||zR(t,o))}const qR=/[&<>"]/,jR=/[&<>"]/g,VR={"&":"&","<":"<",">":">",'"':"""};function KR(e){return VR[e]}function GR(e){return qR.test(e)?e.replace(jR,KR):e}const YR=/[.?*+^$[\]\\(){}|-]/g;function XR(e){return e.replace(YR,"\\$&")}const QR={mdurl:LA,ucmicro:cp};function Xn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
59
|
+
`,n+1))!==-1;)t++;return t}const ZR=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,JR=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,e7=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,b0=["references","footnotes","abbreviations","abbr","abbrs"],_0=Symbol.for("markdown-it-ts.global-state"),w0=Object.prototype.hasOwnProperty;function L_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function ci(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function zr(e){if(Array.isArray(e))return e.map(t=>zr(t));if(ci(e)){const t={};for(const n of Object.keys(e))t[n]=zr(e[n]);return t}return e}function fp(e){return Array.isArray(e)?e.map((t,n)=>String(n)):ci(e)?Object.keys(e):[]}function Uv(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(!Uv(e[n],t[n]))return!1;return!0}if(ci(e)||ci(t)){if(!ci(e)||!ci(t))return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const s of n)if(!w0.call(t,s)||!Uv(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function HA(e,t){if(Array.isArray(e))return e[Number(t)];if(ci(e))return e[t]}function t7(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=zr(t[n]);return e}if(ci(e)&&ci(t)){for(const n of Object.keys(e))w0.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=zr(t[n]);return e}return zr(t)}function n7(e,t,n){const o=n.ownedKeys??[],s=e[t];if(ci(s)||Array.isArray(s)){const i=new Set(fp(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=zr(HA(n.value,r)):delete s[r];!n.existed&&fp(s).length===0&&delete e[t];return}n.existed?e[t]=zr(n.value):delete e[t]}function S0(e){const t=e[_0];return L_(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&L_(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function o7(e,t){Object.defineProperty(e,_0,{value:t,enumerable:!1,configurable:!0,writable:!0})}function is(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:ZR.test(e)?"footnote-definition":JR.test(e)?"abbreviation-definition":e7.test(e)?"reference-definition":null}function od(e){return S0(e)?.reason??null}function Va(e,t,n){if(od(e)&&sr(e),!t)return n();C0(e,t);try{const o=n();return x0(e),o}catch(o){throw sr(e),o}}function C0(e,t){try{sr(e);const n={};for(const o of b0)n[o]=w0.call(e,o)?{existed:!0,value:zr(e[o])}:{existed:!1};o7(e,{reason:t,snapshot:n})}catch{}}function x0(e){const t=S0(e);if(t)for(const n of b0){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!ci(s)&&!Array.isArray(s))continue;const i=new Set(fp(o.existed?o.value:void 0));o.ownedKeys=fp(s).filter(r=>i.has(r)?!Uv(s[r],HA(o.value,r)):!0)}}function sr(e){const t=S0(e);if(t){for(const n of b0){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){n7(e,n,o);continue}o.existed?e[n]=t7(e[n],o.value):delete e[n]}delete e[_0]}}const qv=Symbol.for("markdown-it-ts.diagnostics");function mh(e,t){if(e)try{const n=e[qv];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[qv]=o,o}catch{return}}function zi(e){return mh(e,!1)}function s7(e){if(e)try{const t=e[qv];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function jo(e){s7(e)}function io(e,t){const n=mh(e,!0);n&&(n.strategy=t)}function og(e,t){const n=mh(e,!0);n&&(n.chunk=t)}function WA(e,t){const n=mh(e,!0);n&&(n.unbounded=t)}function i7(e){const t={};e=e||{},t.src_Any=OA.source,t.src_Cc=PA.source,t.src_Z=DA.source,t.src_P=RA.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 jv(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function gh(e){return Object.prototype.toString.call(e)}function r7(e){return gh(e)==="[object String]"}function l7(e){return gh(e)==="[object Object]"}function a7(e){return gh(e)==="[object RegExp]"}function O_(e){return gh(e)==="[object Function]"}function c7(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const zA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function u7(e){return Object.keys(e||{}).reduce(function(t,n){return t||zA.hasOwnProperty(n)},!1)}const d7={"http:":{validate:function(e,t,n){const o=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(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=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(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=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(o)?o.match(n.re.mailto)[0].length:0}}},f7="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]",p7="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function h7(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function P_(){return function(e,t){t.normalize(e)}}function pp(e){const t=e.re=i7(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(f7),n.push(t.src_xn),t.src_tlds=n.join("|");function o(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(o(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(o(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(o(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const s=[];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,l7(a)){a7(a.validate)?c.validate=h7(a.validate):O_(a.validate)?c.validate=a.validate:i(l,a),O_(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=P_();return}if(r7(a)){s.push(l);return}i(l,a)}),s.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:P_()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(c7).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")}function UA(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}function $s(e,t){if(!(this instanceof $s))return new $s(e,t);t||u7(e)&&(t=e,e={}),this.__opts__=jv({},zA,t),this.__schemas__=jv({},d7,e),this.__compiled__={},this.__tlds__=p7,this.__tlds_replaced__=!1,this.re={},pp(this)}$s.prototype.add=function(t,n){return this.__schemas__[t]=n,pp(this),this};$s.prototype.set=function(t){return this.__opts__=jv(this.__opts__,t),this};$s.prototype.test=function(t){if(!t.length)return!1;let n,o;if(this.re.schema_test.test(t)){for(o=this.re.schema_search,o.lastIndex=0;(n=o.exec(t))!==null;)if(this.testSchemaAt(t,n[2],o.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};$s.prototype.pretest=function(t){return this.re.pretest.test(t)};$s.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};$s.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(f,h){return f?h?f.index!==h.index?f.index<h.index?f:h:f.lastIndex>=h.lastIndex?f:h:f:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const f=[o[u[0]],i[u[1]],s[u[2]]],h=c(c(f[0],f[1]),f[2]);if(!h)break;if(h===f[0]?u[0]++:h===f[1]?u[1]++:u[2]++,h.index<d)continue;const p=new UA(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=h.lastIndex}return n.length?n:null};$s.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);if(!o)return null;const s=new UA(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};$s.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,s,i){return o!==i[s-1]}).reverse(),pp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,pp(this),this)};$s.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};$s.prototype.onCompile=function(){};var qA=$s,m7=MA({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,b=Math.floor,_=String.fromCharCode;function g(D){throw new RangeError(p[D])}function v(D,H){const z=[];let U=D.length;for(;U--;)z[U]=H(D[U]);return z}function y(D,H){const z=D.split("@");let U="";z.length>1&&(U=z[0]+"@",D=z[1]),D=D.replace(h,".");const Q=v(D.split("."),H).join(".");return U+Q}function C(D){const H=[];let z=0;const U=D.length;for(;z<U;){const Q=D.charCodeAt(z++);if(Q>=55296&&Q<=56319&&z<U){const X=D.charCodeAt(z++);(X&64512)==56320?H.push(((Q&1023)<<10)+(X&1023)+65536):(H.push(Q),z--)}else H.push(Q)}return H}const L=D=>String.fromCodePoint(...D),$=function(D){return D>=48&&D<58?26+(D-48):D>=65&&D<91?D-65:D>=97&&D<123?D-97:36},k=function(D,H){return D+22+75*(D<26)-((H!=0)<<5)},M=function(D,H,z){let U=0;for(D=z?b(D/700):D>>1,D+=b(D/H);D>m*26>>1;U+=36)D=b(D/m);return b(U+(m+1)*D/(D+38))},E=function(D){const H=[],z=D.length;let U=0,Q=128,X=72,ue=D.lastIndexOf("-");ue<0&&(ue=0);for(let me=0;me<ue;++me)D.charCodeAt(me)>=128&&g("not-basic"),H.push(D.charCodeAt(me));for(let me=ue>0?ue+1:0;me<z;){const Ae=U;for(let ze=1,qe=36;;qe+=36){me>=z&&g("invalid-input");const Fe=$(D.charCodeAt(me++));Fe>=36&&g("invalid-input"),Fe>b((2147483647-U)/ze)&&g("overflow"),U+=Fe*ze;const Le=qe<=X?1:qe>=X+26?26:qe-X;if(Fe<Le)break;const le=36-Le;ze>b(2147483647/le)&&g("overflow"),ze*=le}const be=H.length+1;X=M(U-Ae,be,Ae==0),b(U/be)>2147483647-Q&&g("overflow"),Q+=b(U/be),U%=be,H.splice(U++,0,Q)}return String.fromCodePoint(...H)},O=function(D){const H=[];D=C(D);const z=D.length;let U=128,Q=0,X=72;for(const Ae of D)Ae<128&&H.push(_(Ae));const ue=H.length;let me=ue;for(ue&&H.push("-");me<z;){let Ae=2147483647;for(const ze of D)ze>=U&&ze<Ae&&(Ae=ze);const be=me+1;Ae-U>b((2147483647-Q)/be)&&g("overflow"),Q+=(Ae-U)*be,U=Ae;for(const ze of D)if(ze<U&&++Q>2147483647&&g("overflow"),ze===U){let qe=Q;for(let Fe=36;;Fe+=36){const Le=Fe<=X?1:Fe>=X+26?26:Fe-X;if(qe<Le)break;const le=qe-Le,F=36-Le;H.push(_(k(Le+le%F,0))),qe=b(le/F)}H.push(_(k(qe,0))),X=M(Q,be,me===ue),Q=0,++me}++Q,++U}return H.join("")},P={version:"2.3.1",ucs2:{decode:C,encode:L},decode:E,encode:O,toASCII:function(D){return y(D,function(H){return f.test(H)?"xn--"+O(H):H})},toUnicode:function(D){return y(D,function(H){return d.test(H)?E(H.slice(4).toLowerCase()):H})}};t.exports=P})}),jA=IA(m7());function A0(e,t,n){let o,s=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){for(s++;s<n;){if(o=e.charCodeAt(s),o===10||o===60)return i;if(o===62)return i.pos=s+1,i.str=Fu(e.slice(t+1,s)),i.ok=!0,i;if(o===92&&s+1<n){s+=2;continue}s++}return i}let r=0;for(;s<n&&(o=e.charCodeAt(s),!(o===32||o<32||o===127));){if(o===92&&s+1<n){if(e.charCodeAt(s+1)===32)break;s+=2;continue}if(o===40&&(r++,r>32))return i;if(o===41){if(r===0)break;r--}s++}return t===s||r!==0||(i.str=Fu(e.slice(t,s)),i.pos=s,i.ok=!0),i}var VA=A0;const wf=-2;function g7(e,t,n,o){let s=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(s--,s===0)return i;if(o){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return wf}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return wf;if(r===91){s++,i++;continue}i++}return-1}function T0(e,t,n){let o=1,s=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=g7(l,t,a,n);if(f!==wf)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=c,-1}}let h=-1;return s&&(h=e.pos),e.pos=c,h}var hp=T0;function M0(e,t,n,o){let s,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)r.str=o.str,r.marker=o.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(s=e.charCodeAt(i),s===r.marker)return r.pos=i+1,r.str+=Fu(e.slice(t,i)),r.ok=!0,r;if(s===40&&r.marker===41)return r;s===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Fu(e.slice(t,i)),r}var KA=M0;function vh(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 E0(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function v7(e,t,n){const o=vh(e,t),s=[t,n];o<0?E0(e,s):e.attrs[o]=s}function y7(e,t){const n=vh(e,t);return n>=0?e.attrs[n][1]:null}function k7(e,t,n){const o=vh(e,t);o<0?E0(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var b7=BA({attrGet:()=>y7,attrIndex:()=>vh,attrJoin:()=>k7,attrPush:()=>E0,attrSet:()=>v7,parseLinkDestination:()=>A0,parseLinkLabel:()=>T0,parseLinkTitle:()=>M0});function _7(e){return e.includes("\r")||e.includes("\0")}function GA(e){return typeof e=="string"?e:e.toString()}function w7(e){if(e.inlineMode){const t=new lo("inline","",0);t.content=GA(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 S7=/^([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])?)*)$/,C7=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function x7(e,t){let n=e.pos;const o=e.src;if(o.charCodeAt(n)!==60)return!1;const s=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=o.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=o.slice(s+1,n);if(C7.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(S7.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 A7=x7;function T7(e,t){const n=e.src;let o=e.pos;if(n.charCodeAt(o)!==96)return!1;const s=o;o++;const i=e.posMax;for(;o<i&&n.charCodeAt(o)===96;)o++;const r=n.slice(s,o),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=s)return t||(e.pending+=r),e.pos+=l,!0;let a=o,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 f=n.slice(o,c);f.includes(`
|
|
60
|
+
`)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var M7=T7;function R_(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[o].marker!==l.marker||s!==l.token-1)&&(o=r),s=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=o-i[o]-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 f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+h,i[c]=h,l.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function E7(e){const t=e.tokens_meta,n=e.tokens_meta.length;R_(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&R_(t[o].delimiters)}var I7=E7;function $7(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==95&&o!==42)return!1;const s=e.scanDelims(e.pos,o===42);if(!s||s.length===0)return!1;for(let i=0;i<s.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return e.pos+=s.length,!0}function D_(e,t){const n=t.length;for(let o=n-1;o>=0;o--){const s=t[o];if(s.marker!==95&&s.marker!==42||s.end===-1)continue;const i=t[s.end],r=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===s.marker&&t[o-1].token===s.token-1&&t[s.end+1].token===i.token+1,l=String.fromCharCode(s.marker),a=e.tokens[s.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[o-1].token].content="",e.tokens[t[s.end+1].token].content="",o--)}}function N7(e){const t=e.tokens_meta,n=e.tokens_meta.length;D_(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&D_(e,t[o].delimiters)}const B_={tokenize:$7,postProcess:N7};function YA(e){return v0(e)}function I0(e){return e>=48&&e<=57}function L7(e){const t=e|32;return I0(e)||t>=97&&t<=102}function XA(e){const t=e|32;return t>=97&&t<=122}function O7(e){return XA(e)||I0(e)}function P7(e,t,n){let o=t+2;if(o>=n)return null;let s=!1,i=7,r=o;for((e.charCodeAt(o)|32)===120&&(s=!0,i=6,o++,r=o);o<n&&o-r<i;){const l=e.charCodeAt(o);if(!(s?L7(l):I0(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function R7(e,t,n){let o=t+1;if(o>=n||!XA(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&O7(e.charCodeAt(o));)o++;if(o-t-1<2||o>=n||e.charCodeAt(o)!==59)return null;const s=e.slice(t,o+1);return YA(s)!==s?s:null}function D7(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const s=P7(e.src,n,o);if(s){if(!t){const i=(s.charCodeAt(2)|32)===120?Number.parseInt(s.slice(3,-1),16):Number.parseInt(s.slice(2,-1),10),r=e.push("text_special","",0);r.content=hh(i)?Bu(i):Bu(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=R7(e.src,n,o);if(s){const i=YA(s);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var B7=D7;const QA=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Vv=new Array(128),ZA=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Vv[e]=`\\${t}`,ZA[e]=QA[e]?t:Vv[e]}function F_(e,t,n){e.pending&&e.pushPending();const o=new lo("text_special","",0);o.level=e.level,o.content=t,o.markup=n,o.info="escape",e.pendingLevel=e.level,e.tokens.push(o),e.tokens_meta.push(null)}function F7(e,t){let n=e.pos;const o=e.posMax,s=e.src;if(s.charCodeAt(n)!==92||(n++,n>=o))return!1;let i=s.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(i=s.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(F_(e,ZA[i],Vv[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=s.charAt(n);if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=s.charAt(n+1),n++)}const l=`\\${r}`;return F_(e,i<256&&QA[i]?r:l,l),e.pos=n+1,!0}var H7=F7;function W7(e){let t,n,o=0;const s=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=s[t];r&&(r.nesting&&r.nesting<0&&o--,r.level=o,r.nesting&&r.nesting>0&&o++,r.type==="text"&&t+1<i&&s[t+1]?.type==="text"?s[t+1].content=r.content+s[t+1].content:(t!==n&&(s[n]=r),n++))}t!==n&&(s.length=n)}var z7=W7;const JA=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,eT="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",U7=new RegExp(`^(?:${JA}|${eT}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),q7=new RegExp(`^(?:${JA}|${eT})`);function tT(e){return e===32||e===9||e===10||e===12||e===13}function j7(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||tT(t)}function V7(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(!tT(n))return!1}return!1}function K7(e){const t=e|32;return t>=97&&t<=122}function G7(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos,s=e.src;if(s.charCodeAt(o)!==60||o+2>=n)return!1;const i=s.charCodeAt(o+1);if(i!==33&&i!==63&&i!==47&&!K7(i))return!1;const r=s.slice(o).match(U7);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,j7(l)&&e.linkLevel++,V7(l)&&e.linkLevel--}return e.pos+=l.length,!0}var Y7=G7;function X7(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=hp(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=VA(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<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=KA(e.src,i,e.posMax),i<f&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<f&&e.src.charCodeAt(i)===91?(c=i+1,i=hp(e,i),i>=0?s=e.src.slice(c,i++):i=p+1):i=p+1,s||(s=e.src.slice(h,p)),r=e.env.references[ph(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(h,p);const m=[];e.md.inline.parse(o,e.md,e.env,m);const b=e.push("image","img",0);b.attrs=[["src",u],["alt",""]],b.children=m,b.content=o,a&&b.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var Q7=X7;function Z7(e,t){let n,o,s,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=hp(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&e.src.charCodeAt(p)===40){for(c=!1,p++;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(p>=d)return!1;if(s=VA(e.src,p,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?p=s.pos:r="",a=p;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(s=KA(e.src,p,e.posMax),p<d&&a!==p&&s.ok)for(l=s.str,p=s.pos;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);}(p>=d||e.src.charCodeAt(p)!==41)&&(c=!0),p++}if(c){if(typeof e.env.references>"u")return!1;if(p<d&&e.src.charCodeAt(p)===91?(a=p+1,p=hp(e,p),p>=0?o=e.src.slice(a,p++):p=h+1):p=h+1,o||(o=e.src.slice(f,h)),i=e.env.references[ph(o)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=h;const m=e.push("link_open","a",1),b=[["href",r]];m.attrs=b,l&&b.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var J7=Z7;function nT(e){const t=e|32;return t>=97&&t<=122}function eD(e){return e>=48&&e<=57}function tD(e){return nT(e)||eD(e)||e===43||e===45||e===46}function nD(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&tD(e.charCodeAt(t));)t--;return t++,t>=e.length||!nT(e.charCodeAt(t))?null:e.slice(t)}function oD(e,t,n){let o=t;for(;o<n;){const s=e.charCodeAt(o);if(s<=32||s===127||s===60)break;o++}return e.slice(t,o)}function sD(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=nD(e.pending);if(!s)return!1;const i=oD(e.src,n-s.length,o),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=s.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,-s.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 f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-s.length,!0}function iD(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,s=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-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<s;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var rD=iD;function lD(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const s=e.scanDelims(e.pos,!0);if(!s)return!1;let i=s.length;const r=String.fromCharCode(o);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:o,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}function H_(e,t){let n;const o=[],s=t.length;for(let i=0;i<s;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==="~"&&o.push(l.token-1)}for(;o.length;){const i=o.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 aD(e){const t=e.delimiters;H_(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&H_(e,n[o].delimiters)}const W_={tokenize:lD,postProcess:aD};function z_(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 cD(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||z_(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!z_(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var uD=cD;function $0(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function dD(e){if(e.length===0)return 0;const t=e.slice().sort((o,s)=>o-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function fD(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 oT(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,o={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:$0(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function Ka(e,t,n,o,s,i){const r=oT(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=fD(t,n));a.calls++,a.inclusiveMs+=o,o>a.maxMs&&(a.maxMs=o),a.samples.push(o),i?(a.silentCalls++,s&&a.silentHits++):(a.normalCalls++,s&&a.normalHits++),s&&a.hits++,r.completedAt=$0()}function pD(e){const t=oT(e);if(!t)return null;const n=Object.keys(t.records);for(let o=0;o<n.length;o++){const s=t.records[n[o]];s.medianMs=dD(s.samples)}return t.completedAt=$0(),t}var U_=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const o=this.rules.findIndex(s=>s.name===e);o>=0&&this.rules.splice(o,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const o=this.rules.findIndex(s=>s.name===e);if(t===void 0){if(o<0)return;const s=this.rules[o];return Object.freeze({name:s.name,fn:s.fn,alt:s.alt?Object.freeze(s.alt.slice()):void 0,enabled:s.enabled})}if(o<0)throw new Error(`Parser rule not found: ${e}`);this.rules[o].fn=t,n?.alt!==void 0&&(this.rules[o].alt=n.alt),this.invalidateCache()}before(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<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(s,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<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(s+1,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,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 o of this.rules)if(o.enabled&&o.alt)for(const s of o.alt)e.add(s);const t=new Map,n=new Map;for(const o of e){const s=[],i=[];for(const r of this.rules)r.enabled&&(o!==""&&!r.alt?.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(o,s),n.set(o,i)}this.cache=t,this.namedCache=n}},sT=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,this.tokens_meta=new Array(o.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.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new lo("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 lo(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 o=new lo(e,t,n);let s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(s),o}scanDelims(e,t){const{src:n,posMax:o}=this,s=n.charCodeAt(e);let i=e;for(;i<o&&n.charCodeAt(i)===s;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<o?n.charCodeAt(i):32,c=Du(l),u=Du(a),d=zv(l),f=zv(a),h=!u&&(!f||c||d),p=!c&&(!d||u||f);return{can_open:h&&(t||!p||d),can_close:p&&(t||!h||f),length:r}}};sT.prototype.Token=lo;const hD=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function iT(e){return!hD.test(e)}var mD=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new U_,this.ruler2=new U_,this.ruler.push("text",uD),this.ruler.push("linkify",sD),this.ruler.push("newline",rD),this.ruler.push("escape",H7),this.ruler.push("backticks",M7),this.ruler.push("strikethrough",W_.tokenize),this.ruler.push("emphasis",B_.tokenize),this.ruler.push("link",J7),this.ruler.push("image",Q7),this.ruler.push("autolink",A7),this.ruler.push("html_inline",Y7),this.ruler.push("entity",B7),this.ruler2.push("balance_pairs",I7),this.ruler2.push("strikethrough",W_.postProcess),this.ruler2.push("emphasis",B_.postProcess),this.ruler2.push("fragments_join",z7),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),o=n.length,s=e.cache,i=s[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<o;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(Ka(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<o;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++,s[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,o=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<o;){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>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const s=this.ruler.getNamedRules("");for(;e.pos<o;){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=s[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Ka(e.env,"inline",s[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>=o)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,o){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&iT(e)){const a=new lo("text","",0);a.content=e,o.push(a);return}const s=new sT(e,t,n,o);this.tokenize(s);const i=this.getRules2(),r=i.length;if(!(s.env&&(Object.prototype.hasOwnProperty.call(s.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(s.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](s,!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(s,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Ka(s.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,o){this.parseSource(e,t,n,o)}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 gD(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let o=0,s=t.length;o<s;o++){const i=t[o];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&iT(i.content)){const r=new lo("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const vD=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,yD=/[0-9a-z]/i;function kD(e){return/^<a[>\s]/i.test(e)}function bD(e){return/^<\/a\s*>/i.test(e)}function _D(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const o=t.raw[n-1],s=t.raw[n];if(!vD.test(o)||!yD.test(s))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 wD(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const o=t[n];if(o.type!=="inline"||!e.md.linkify.pretest(o.content))continue;let s=o.children;s||(s=[],o.children=s);let i=0;for(let r=s.length-1;r>=0;r--){const l=s[r];if(l.type==="link_close"){for(r--;r>=0&&s[r].level!==l.level&&s[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(kD(l.content)&&i>0&&i--,bD(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(h=>_D(e.md.linkify,h));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],m=e.md.normalizeLink(p.url);if(!e.md.validateLink(m))continue;let b=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText(`mailto:${b}`).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText(`http://${b}`).replace(/^http:\/\//,"");const _=p.index;if(_>f){const C=new lo("text","",0);C.content=a.slice(f,_),C.level=d,u.push(C)}const g=new lo("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new lo("text","",0);v.content=b,v.level=d,u.push(v);const y=new lo("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new lo("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}s.splice(r,1,...u)}}}}const SD=/\r\n?|\n/g,CD=/\0/g;function xD(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),o=t.includes("\0");if(!n&&!o)return;let s=t;n&&(s=s.replace(SD,`
|
|
61
|
+
`)),o&&(s=s.replace(CD,"�")),e.src=s}const rT=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,AD=/\((?:c|tm|r)\)/i,TD=/\((c|tm|r)\)/gi,MD={c:"©",r:"®",tm:"™"};function ED(e,t){return MD[t.toLowerCase()]}function ID(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(TD,ED)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function $D(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&rT.test(o.content)&&(o.content=o.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–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function ND(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 o=n.content||(Array.isArray(n.children)?n.children.map(s=>s.type==="text"?s.content:"").join(""):"");AD.test(o)&&ID(n.children||[]),rT.test(o)&&$D(n.children||[])}}var LD=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(o=>o.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(o=>o.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 o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,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 OD=/['"]/,q_=/['"]/g,j_="’";function Xd(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function PD(e,t){let n;const o=[],s=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=o.length-1;n>=0&&!(o[n].level<=l);n--);if(o.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){q_.lastIndex=c;const d=q_.exec(a);if(!d)break;let f=!0,h=!0;c=d.index+1;const p=d[0]==="'";let m=32;if(d.index-1>=0)m=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){m=e[n].content.charCodeAt(e[n].content.length-1);break}let b=32;if(c<u)b=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){b=e[n].content.charCodeAt(0);break}const _=dp(m)||up(String.fromCharCode(m)),g=dp(b)||up(String.fromCharCode(b)),v=Du(m),y=Du(b);if(y?f=!1:g&&(v||_||(f=!1)),v?h=!1:_&&(y||g||(h=!1)),b===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=_,h=g),!f&&!h){p&&(r.content=Xd(r.content,d.index,j_));continue}if(h)for(n=o.length-1;n>=0;n--){let C=o[n];if(o[n].level<l)break;if(C.single===p&&o[n].level===l){C=o[n];let L,$;p?(L=s[2]||"‘",$=s[3]||"’"):(L=s[0]||"“",$=s[1]||"”"),r.content=Xd(r.content,d.index,$),e[C.token].content=Xd(e[C.token].content,C.pos,L),c+=$.length-1,C.token===i&&(c+=L.length-1),a=r.content,u=a.length,o.length=n;continue e}}f?o.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=Xd(r.content,d.index,j_))}}}function RD(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 o=typeof n.content=="string"?n.content:(n.children||[]).map(s=>s.content||"").join("");!OD.test(o)||!n.children||PD(n.children,e)}}function DD(e){const t=e.tokens||[],n=t.length;for(let o=0;o<n;o++){const s=t[o];if(s.type!=="inline"||!Array.isArray(s.children))continue;const i=s.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 BD=/^(?:vbscript|javascript|file|data):/,FD=/^data:image\/(?:gif|png|jpeg|webp);/,lT=["http:","https:","mailto:"];function aT(e){const t=e.trim().toLowerCase();return BD.test(t)?FD.test(t):!0}function cT(e){const t=k0(e,!0);if(t.hostname&&(!t.protocol||lT.includes(t.protocol)))try{t.hostname=jA.default.toASCII(t.hostname)}catch{}return NA(y0(t))}function uT(e){const t=k0(e,!0);if(t.hostname&&(!t.protocol||lT.includes(t.protocol)))try{t.hostname=jA.default.toUnicode(t.hostname)}catch{}return Wv(y0(t),`${Wv.defaultChars}%`)}function HD(e){switch(e){case 9:case 32:return!0}return!1}function WD(e,t,n,o){const s=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 f=e.lineMax;if(a[t]-e.blkIndent>=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const h=[],p=[],m=[],b=[],_=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let v=!1,y;for(y=t;y<n;y++){const M=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(s.charCodeAt(u++)===62&&!M){let O=a[y]+1,S,I;s.charCodeAt(u)===32?(u++,O++,I=!1,S=!0):s.charCodeAt(u)===9?(S=!0,(c[y]+O)%4===3?(u++,O++,I=!1):I=!0):S=!1;let P=O;for(h.push(i[y]),i[y]=u;u<d;){const D=s.charCodeAt(u);if(HD(D))D===9?P+=4-(P+c[y]+(I?1:0))%4:P++;else break;u++}v=u>=d,p.push(c[y]),c[y]=a[y]+1+(S?1:0),m.push(a[y]),a[y]=P-O,b.push(l[y]),l[y]=u-i[y];continue}if(v)break;let E=!1;for(let O=0,S=_.length;O<S;O++)if(_[O](e,y,n,!0)){E=!0;break}if(E){e.lineMax=y,e.blkIndent!==0&&(h.push(i[y]),p.push(c[y]),b.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}h.push(i[y]),p.push(c[y]),b.push(l[y]),m.push(a[y]),a[y]=-1}const C=e.blkIndent;e.blkIndent=0;const L=e.push("blockquote_open","blockquote",1);L.markup=">";const $=[t,0];L.map=$,e.md.block.tokenize(e,t,y);const k=e.push("blockquote_close","blockquote",-1);k.markup=">",e.lineMax=f,e.parentType=g,$[1]=e.line;for(let M=0;M<b.length;M++)i[M+t]=h[M],l[M+t]=b[M],a[M+t]=m[M],c[M+t]=p[M];return e.blkIndent=C,!0}function zD(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,s=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,s=o;continue}break}e.line=s;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,s,4+e.blkIndent,!1)}
|
|
62
|
+
`,i.map=[t,e.line],!0}function UD(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,f=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-l<a)&&(s=e.skipSpaces(s),!(s<i)))){f=!0;break}a=e.sCount[t],e.line=d+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,a,!0),h.markup=c,h.map=[t,e.line],!0}const V_=["","h1","h2","h3","h4","h5","h6"],K_=["","#","##","###","####","#####","######"];function G_(e){switch(e){case 9:case 32:return!0}return!1}function qD(e,t,n,o){const s=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=s.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=s.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=s.charCodeAt(++a);if(d>6||a<c&&!G_(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&G_(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",V_[d],1);h.markup=K_[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=s.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const m=e.push("heading_close",V_[d],-1);return m.markup=K_[d],!0}function jD(e){switch(e){case 9:case 32:return!0}return!1}function VD(e,t,n,o){const s=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<s;){const c=e.src.charCodeAt(i++);if(c!==r&&!jD(c))return!1;c===r&&l++}if(l<3)return!1;if(o)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 va=[[/^<(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(`${q7.source}\\s*$`),/^$/,!1]];function KD(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,i),l=0;for(;l<va.length&&!va[l][0].test(r);l++);if(l===va.length)return!1;if(o)return va[l][2];let a=t+1;if(!va[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(s=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(s,i),va[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 Y_(e){switch(e){case 9:case 32:return!0}return!1}const lu={Pipe:1,ParagraphTerminator:2};function GD(e){switch(e){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 124:case 126:return!0}return e>=48&&e<=57}var dT=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=s.length;u<d;u++){const f=s.charCodeAt(u);if(f===124&&(c|=lu.Pipe|lu.ParagraphTerminator),!a)if(Y_(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,GD(f)&&(c|=lu.ParagraphTerminator);(f===10||u===d-1)&&(f!==10&&u++,this.bMarks.push(l),this.eMarks.push(u),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),this.lineFlags.push(c),a=!1,i=0,r=0,c=0,l=u+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineFlags.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const s=new lo(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new lo(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,o=this.eMarks;for(let s=this.lineMax;e<s&&!(t[e]+n[e]<o[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const o=t.charCodeAt(e);if(o!==9&&o!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const o=n.charCodeAt(--e);if(o!==9&&o!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let o=n.length;e<o&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const o=this.src;for(;e>n;)if(t!==o.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=o?this.eMarks[u]+1:this.eMarks[u];let p=0;const m=this.src,b=this.bsCount,_=this.tShift;for(;f<h&&p<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?p+=4-(p+b[u])%4:p++;else if(f-d<_[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+m.slice(f,h):m.slice(f,h)}const s=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 f=0;const h=r[d];let p=h,m;for(d+1<t||o?m=l[d]+1:m=l[d];p<m&&f<n;){const b=i.charCodeAt(p);if(Y_(b))b===9?f+=4-(f+a[d])%4:f++;else if(p-h<c[d])f++;else break;p++}f>n?s[u]=new Array(f-n+1).join(" ")+i.slice(p,m):s[u]=i.slice(p,m)}return s.join("")}};dT.prototype.Token=lo;function YD(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function fT(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function pT(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&lu.ParagraphTerminator)===0||o>=s)return!1;const i=n.charCodeAt(o);switch(i){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return i>=48&&i<=57?!0:YD(n,o,s)}const X_=["","h1","h2"];function XD(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=fT(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,p=t+1;for(;p<n;p++){const y=i[p]+r[p],C=l[p];if(y>=C)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=s.charCodeAt(y),h===45||h===61)){let $=y+1,k=$;for(;$<C&&s.charCodeAt($)===h;)$++;for(k=$;$<C;){const M=s.charCodeAt($);if(M!==9&&M!==32)break;$++}if($>=C){f=h===61?1:2;break}if(k-y>1)continue}if(a[p]<0||u&&!pT(e,p,s,y,C))continue;let L=!1;for(let $=0,k=o.length;$<k;$++)if(o[$](e,p,n,!0)){L=!0;break}if(L)break}if(!f)return!1;let m;if(p===t+1){const y=i[t]+r[t];let C=l[t];for(;C>y;){const L=s.charCodeAt(C-1);if(L!==9&&L!==32)break;C--}m=s.slice(y,C)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const b=h===61?"=":"-",_=e.push("heading_open",X_[f],1);_.markup=b,_.map=[t,e.line];const g=e.push("inline","",0);g.content=m,g.map=[t,e.line-1],g.children=[];const v=e.push("heading_close",X_[f],-1);return v.markup=b,e.parentType=d,!0}function hT(e){switch(e){case 9:case 32:return!0}return!1}function Q_(e,t){const n=e.eMarks,o=e.bMarks,s=e.tShift,i=e.src,r=n[t];let l=o[t]+s[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!hT(i.charCodeAt(l))?-1:l}function Z_(e,t){const n=e.bMarks,o=e.tShift,s=e.eMarks,i=e.src,r=n[t]+o[t],l=s[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),!hT(c))?-1:a}function QD(e,t,n){const o=e.bMarks,s=e.tShift,i=e.src,r=o[t]+s[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const ZD=["0","1","2","3","4","5","6","7","8","9"];function JD(e,t){const n=e.level+2,o=e.tokens;for(let s=t+2,i=o.length-2;s<i;s++){const r=o[s];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,o[s+2].hidden=!0,s+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++s<i;)l+=o[s].nesting}}}}function e9(e,t,n,o){let s,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;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,m=e.tShift,b=e.eMarks,_=e.sCount,g=e.bsCount,v=p[l]+m[l];if(v>=b[l])return!1;const y=h.charCodeAt(v);if(y>=48&&y<=57){if(f=Z_(e,l),f<0||(u=!0,r=v,d=QD(e,l,f),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(f=Q_(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=b[l])return!1;if(o)return!0;const C=h.charCodeAt(f-1),L=String.fromCharCode(C);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const $=[l,0];e.tokens[e.tokens.length-1].map=$,e.tokens[e.tokens.length-1].markup=L;let k=!1;const M=e.tokens.length-1,E=e.md.block.ruler.getRulesForState(e,"list"),O=e.parentType;for(e.parentType="list";l<n;){i=f,s=b[l];const S=_[l]+f-(p[l]+m[l]);let I=S;for(;i<s;){const be=h.charCodeAt(i);if(be===9)I+=4-(I+g[l])%4;else if(be===32)I++;else break;i++}const P=i;let D;P>=s?D=1:D=I-S,D>4&&(D=1);const H=S+D,z=e.push("list_item_open","li",1);z.markup=L;const U=[l,0];z.map=U,u&&(z.info=f-r-1===1?ZD[h.charCodeAt(r)-48]:h.slice(r,f-1));const Q=e.tight,X=e.tShift[l],ue=e.sCount[l],me=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=H,e.tight=!0,e.tShift[l]=P-p[l],e.sCount[l]=I,P>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||k)&&(a=!1),k=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=me,e.tShift[l]=X,e.sCount[l]=ue,e.tight=Q,e.push("list_item_close","li",-1).markup=L,l=e.line,U[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let Ae=!1;for(let be=0,ze=E.length;be<ze;be++)if(E[be](e,l,n,!0)){Ae=!0;break}if(Ae)break;if(u){if(f=Z_(e,l),f<0)break;r=p[l]+m[l]}else if(f=Q_(e,l),f<0)break;if(C!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=L:e.push("bullet_list_close","ul",-1).markup=L,$[1]=l,e.line=l,e.parentType=O,a&&JD(e,M),!0}function J_(e){return e===9||e===32}function t9(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=fT(e);let f=t+1;for(e.parentType="paragraph";f<n&&!e.isEmpty(f);f++){if(c[f]-u>3||c[f]<0)continue;if(s==="list"&&c[f]>=u){const v=r[f]+l[f],y=a[f];if(v<y){const C=i.charCodeAt(v);if(C===42||C===45||C===43){if(v+1>=y||J_(i.charCodeAt(v+1)))break}else if(C>=48&&C<=57&&v+1<y){let L=v+1;for(;;){if(L>=y){L=-1;break}const $=i.charCodeAt(L++);if($>=48&&$<=57){if(L-v>=10){L=-1;break}continue}if(($===41||$===46)&&(L>=y||J_(i.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const b=r[f]+l[f],_=a[f];if(d&&!pT(e,f,i,b,_))continue;let g=!1;for(let v=0,y=o.length;v<y;v++)if(o[v](e,f,n,!0)){g=!0;break}if(g)break}const h=e.getLines(t,f,u,!1).trim();e.line=f;const p=e.push("paragraph_open","p",1);p.map=[t,e.line];const m=e.push("inline","",0);return m.content=h,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function Qd(e){switch(e){case 9:case 32:return!0}return!1}function n9(e,t,n,o){let s=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(s)!==91)return!1;function a(v){const y=e.lineMax;if(v>=y||e.isEmpty(v))return null;let C=!1;if(e.sCount[v]-e.blkIndent>3&&(C=!0),e.sCount[v]<0&&(C=!0),!C){const k=e.parentType;e.parentType="reference";let M=!1;for(let E=0,O=l.length;E<O;E++)if(l[E](e,v,y,!0)){M=!0;break}if(e.parentType=k,M)return null}const L=e.bMarks[v]+e.tShift[v],$=e.eMarks[v];return e.src.slice(L,$+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const v=c.charCodeAt(s);if(v===91)return!1;if(v===93){u=s;break}else if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(v===92&&(s++,s<i&&c.charCodeAt(s)===10)){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const v=c.charCodeAt(s);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!Qd(v))break}const d=e.md.helpers.parseLinkDestination(c,s,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;s=d.pos;const h=s,p=r,m=s;for(;s<i;s++){const v=c.charCodeAt(s);if(v===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!Qd(v))break}let b=e.md.helpers.parseLinkTitle(c,s,i);for(;b.can_continue;){const v=a(r);if(v===null)break;c+=v,s=i,i=c.length,r++,b=e.md.helpers.parseLinkTitle(c,s,i,b)}let _;for(s<i&&m!==s&&b.ok?(_=b.str,s=b.pos):(_="",s=h,r=p);s<i&&Qd(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&_)for(_="",s=h,r=p;s<i&&Qd(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const g=ph(c.slice(1,u));return g?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[g]>"u"&&(e.env.references[g]={title:_,href:f}),e.line=r),!0):!1}function sg(e){switch(e){case 9:case 32:return!0}return!1}const o9=65536;function ig(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function s9(e,t){if(e.lineFlags)return(e.lineFlags[t]&lu.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];n<o;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function ew(e){const t=[],n=e.length;let o=0,s=e.charCodeAt(o),i=!1,r=0,l="";for(;o<n;)s===124&&(i?(l+=e.substring(r,o-1),r=o):(t.push(l+e.substring(r,o)),l="",r=o+1)),i=s===92,o++,s=e.charCodeAt(o);return t.push(l+e.substring(r)),t}function i9(e,t,n,o){if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[s])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!sg(l)||r===45&&sg(l)||!s9(e,t))return!1;for(;i<e.eMarks[s];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!sg(y))return!1;i++}let a=ig(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const C=c[y].trim();if(!C){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(C))return!1;C.charCodeAt(C.length-1)===58?u.push(C.charCodeAt(0)===58?"center":"right"):C.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=ig(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=ew(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(o)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),m=[t,0];p.map=m;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const _=e.push("tr_open","tr",1);_.map=[t,t+1];for(let y=0;y<c.length;y++){const C=e.push("th_open","th",1);u[y]&&(C.attrs=[["style",`text-align:${u[y]}`]]);const L=e.push("inline","",0);L.content=c[y].trim(),L.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,v=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let y=!1;for(let L=0,$=h.length;L<$;L++)if(h[L](e,s,n,!0)){y=!0;break}if(y||(a=ig(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=ew(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>o9))break;if(s===t+2){const L=e.push("tbody_open","tbody",1);L.map=g=[t+2,0]}const C=e.push("tr_open","tr",1);C.map=[s,s+1];for(let L=0;L<d;L++){const $=e.push("td_open","td",1);u[L]&&($.attrs=[["style",`text-align:${u[L]}`]]);const k=e.push("inline","",0);k.content=c[L]?c[L].trim():"",k.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=s),e.push("table_close","table",-1),m[1]=s,e.parentType=f,e.line=s,!0}var r9=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,o){const s=this._rules.findIndex(r=>r.name===e);if(s<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(s,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}after(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<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(s+1,0,{name:t,enabled:!0,fn:n,alt:o?.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:o,fn:s})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=s(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return Ka(i?.env,"block",o,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const o=this._rules.findIndex(s=>s.name===e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[o].fn=t,n?.alt&&(this._rules[o].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}`)}o.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,s=!0)}),s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!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}`)}o.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,s=!0)}),s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this._rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const o of this._rules)if(o.enabled)for(const s of o.alt)e.add(s);const t=Object.create(null),n=Object.create(null);for(const o of e){const s=[],i=[];for(const r of this._rules)r.enabled&&(o!==""&&!r.alt.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t[o]=s,n[o]=i}this.cache=t,this.namedCache=n}};const Zd=[["table",i9,["paragraph","reference"]],["code",zD],["fence",UD,["paragraph","reference","blockquote","list"]],["blockquote",WD,["paragraph","reference","blockquote","list"]],["hr",VD,["paragraph","reference","blockquote","list"]],["list",e9,["paragraph","reference","blockquote"]],["reference",n9],["html_block",KD,["paragraph","reference","blockquote"]],["heading",qD,["paragraph","reference","blockquote"]],["lheading",XD],["paragraph",t9]];var l9=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new r9;for(let e=0;e<Zd.length;e++)this.ruler.push(Zd[e][0],Zd[e][1],{alt:(Zd[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const o=this.getRules(),s=o.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 h=e.line;let p=!1;for(let m=0;m<s;m++)if(p=o[m](e,u,n,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}if(!p)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 f=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 h=e.line;let p=!1;for(let m=0;m<s;m++){const b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[m].fn(e,u,n,!1);const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Ka(e.env,"block",f[m].name,_-b,p,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!p)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,o){if(!e||e.length===0)return;const s=new dT(e,t,n,o);this.tokenize(s,s.line,s.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},mT=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}};mT.prototype.Token=lo;const tw=[["normalize",xD],["block",w7],["inline",gD],["linkify",wD],["replacements",ND],["smartquotes",RD],["text_join",DD]],a9={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},c9={parseLinkLabel:T0,parseLinkDestination:A0,parseLinkTitle:M0};function u9(){return{...a9}}function d9(){return{...c9}}var f9=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new l9,this.inline=new mD,this.ruler=new LD;for(let e=0;e<tw.length;e++){const[t,n]=tw[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:u9(),helpers:d9(),normalizeLink:cT,normalizeLinkText:uT,validateLink:aT,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new qA),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 mT(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 o=0;o<n.length;o++)n[o](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Ka(e.env,"core",t[n].name,s-o,!0,!1)}pD(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&_7(e))return this.parse(GA(e),t,n);const o=this.createState(e,t,n);return this.process(o),this.lastState=o,o}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 p9=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function mp(e){return!p9.test(e)}function Xc(e,t){const n=e.indexOf(`
|
|
63
|
+
`,t);return n===-1?e.length:n}function Sf(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function nw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function rg(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function h9(e){if(e.length>3)return mp(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){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!1}return!0}const m9=["","h1","h2","h3","h4","h5","h6"],g9=["","#","##","###","####","#####","######"],ow=0,lg=1,ag=2;function Ss(e,t,n,o){const s=new lo(e,t,n);return s.level=o,s.block=!0,s}function gT(e,t,n){const o=Ss("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new lo("text","",0);return s.content=e,o.children=[s],o}function v9(e,t,n,o,s){let i=0,r=n;for(;r<o&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=o||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<o&&t.charCodeAt(l)===32;)l++;let a=o;for(;a>l&&t.charCodeAt(a-1)===32;)a--;let c=a;for(;c>l&&t.charCodeAt(c-1)===35;)c--;if(c>l&&t.charCodeAt(c-1)===32)for(a=c-1;a>l&&t.charCodeAt(a-1)===32;)a--;const u=t.slice(l,a);if(!mp(u))return!1;const d=m9[i],f=g9[i],h=Ss("heading_open",d,1,0);h.map=[s,s+1],h.markup=f,e.push(h),e.push(gT(u,s,1));const p=Ss("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function y9(e,t,n){const o=Ss("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(gT(t,n,1)),e.push(Ss("paragraph_close","p",-1,0))}function k9(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function cg(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function b9(e,t){const n=Ss("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function _9(e,t,n){const o=Ss("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=Ss("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=Ss("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new lo("text","",0);r.content=t,i.children=[r],e.push(i);const l=Ss("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Ss("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function w9(e){const t=Ss("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function S9(e,t,n,o){if(!nw(e,t,n))return null;const s=e.slice(t+3,n);if(s.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=o+1;for(;l<e.length;){const c=Xc(e,l);if(nw(e,l,c)&&Sf(e,l+3,c)){const u=Ss("fence","code",0,0);return u.map=[o,a+1],u.markup="```",u.info=s,u.content=e.slice(i,r),{token:u,nextPos:c<e.length?c+1:c,nextLine:a+1}}l=c<e.length?c+1:c,r=l,a++}return null}function C9(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?ow:ag,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=Xc(e,r);if(r===a){r=a<e.length?a+1:a,l++;continue}const c=e.charCodeAt(r);if(c===32||c===9){if(!Sf(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!v9(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=cg(e,h),l+=1+r-h;continue}if(c===45){if(!rg(e,r,a))return null;const h=l;let p=r,m=l,b=null,_=null;for(;p<e.length;){const y=Xc(e,p);if(!rg(e,p,y))break;const C=p+2,L=y===C+1?e[C]:e.slice(C,y);if(!h9(L))return null;b===null&&(b=b9(t,h)),_=_9(t,L,m),p=y<e.length?y+1:y,m++}if(b===null||_===null)return null;let g=p,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const y=Xc(e,g);if(!Sf(e,g,y)){if(rg(e,g,y))return null;break}g=y<e.length?y+1:y,v++}b.map[1]=v,_.map[1]=v,w9(t),r=g,l=v;continue}if(c===96){const h=S9(e,r,a,l);if(!h)return null;t.push(h.token),r=cg(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=k9(e,r,a);let d;if(n===ag?d=mp(u):n===lg&&u===o?d=s:(d=mp(u),n===ow?(i&&(n=u===o?lg:ag),o=u,s=d,i=!0):n===lg&&(o=u,s=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!Sf(e,f,Xc(e,f)))return null;y9(t,u,l),r=cg(e,f),l+=1+r-f}return t}const x9=/[&<>"]/,sw=/[&<>"]/g,A9=/&/g,T9=/[<>"]/g,M9={"&":"&","<":"<",">":">",'"':"""};function ug(e){return M9[e]||e}function xn(e){if(e.length===0)return"";if(e.length<32)return x9.test(e)?e.replace(sw,ug):e;const t=e.includes("&"),n=e.includes("<"),o=e.includes(">"),s=e.includes('"');return!t&&!n&&!o&&!s?e:t&&!n&&!o&&!s?e.replace(A9,"&"):t?e.replace(sw,ug):e.replace(T9,ug)}const E9=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),I9=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function vT(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(E9,(t,n,o)=>{if(n)return n;if(I9.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return hh(i)?Bu(i):"�"}const s=v0(t);return s!==t?s:t})}const $9=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,N9=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,L9=/"/g;function Na(e,t){const n=e.indexOf(`
|
|
64
|
+
`,t);return n===-1?e.length:n}function gp(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function Jd(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function O9(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!gp(e,t,Na(e,t))}function iw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function P9(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function N0(e){return N9.test(e)?$9.test(e)?null:e.replace(L9,"""):e}function R9(e,t,n){let o=0,s=t;for(;s<n&&e.charCodeAt(s)===35&&o<6;)s++,o++;if(o===0||s>=n||e.charCodeAt(s)!==32)return null;let i=s+1;for(;i<n&&e.charCodeAt(i)===32;)i++;let r=n;for(;r>i&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>i&&e.charCodeAt(l-1)===35;)l--;if(l>i&&e.charCodeAt(l-1)===32)for(r=l-1;r>i&&e.charCodeAt(r-1)===32;)r--;const a=N0(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
|
|
65
|
+
`}function rw(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function D9(e,t){switch(e.charCodeAt(t)){case 34:return`<li>"</li>
|
|
66
|
+
`;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 null}return`<li>${e[t]}</li>
|
|
67
|
+
`}function B9(e,t,n){const o=t+2;if(n===o+1)return D9(e,o);const s=N0(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
|
|
68
|
+
`}function F9(e,t,n){for(;t<n;){const s=e.charCodeAt(t);if(s!==32&&s!==9)break;t++}for(;n>t;){const s=e.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}let o=n;for(let s=t;s<n;s++){const i=e.charCodeAt(s);if(i===96)return null;if(i===32||i===9){o=s;break}}return e.slice(t,o)}function H9(e,t,n,o){if(!iw(e,t,n))return null;const s=F9(e,t+3,n);if(s===null)return null;const i=n<e.length?n+1:n;let r=i,l=i;for(;l<e.length;){const a=Na(e,l);if(iw(e,l,a)&&gp(e,l+3,a)){const c=e.slice(i,r);let u;return s===o.lang?u=o.open:(u=s?`<pre><code class="language-${xn(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${xn(c)}</code></pre>
|
|
69
|
+
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function lw(e){if(e.length===0)return"";if(e.includes("\r")||e.includes("\0"))return null;let t=0,n="";const o=e.length>=25e4,s=[],i={lang:"",open:"<pre><code>"};let r="",l="",a="",c="";for(;t<e.length;){const u=Na(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!gp(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=R9(e,t,u);if(m===null)return null;o?s.push(m):n+=m,t=Jd(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=Na(e,m);if(!rw(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const b=e.slice(t,m);let _;if(b===r)_=l;else{let v=t;for(_=`<ul>
|
|
70
|
+
`;v<m;){const y=Na(e,v),C=B9(e,v,y);if(C===null)return null;_+=C,v=y<e.length?y+1:y}_+=`</ul>
|
|
71
|
+
`,r=b,l=_}let g=Jd(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=Na(e,g);if(!gp(e,g,v)){if(rw(e,g,v))return null;break}g=v<e.length?v+1:v}o?s.push(_):n+=_,t=g;continue}if(d===96){const m=H9(e,t,u,i);if(!m)return null;o?s.push(m.html):n+=m.html,t=Jd(e,m.nextPos);continue}const f=P9(e,t,u);let h;if(f===a)h=c;else{const m=N0(f);if(m===null)return null;h=`<p>${m}</p>
|
|
72
|
+
`,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&O9(e,p))return null;o?s.push(h):n+=h,t=Jd(e,p)}return o?s.join(""):n}const W9={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function vp(e,t,n={},o){jo(n);const s={...W9,...o||{}},i=is(t);if(s.fallbackOnGlobalState!==!1&&i)return og(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Va(n,i,()=>e.core.parse(t,n,e).tokens);let r=Cf(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=j9(r,s.maxChunks)),xf(t,r))return og(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Va(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return og(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),Va(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),f=e.core.parse(d,n,e).tokens;l!==0&&f.length&&U9(f,l),q9(a,f),l+=u.lineCount}return a})}function Cf(e,t,n=!0){const o=[];let s=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(o.push({start:r,end:f,lineCount:l}),r=f,s=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
|
|
73
|
+
`,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const m=V9(e,f,h);if(t.fenceAware){let g=f;for(;g<h;){const y=e.charCodeAt(g);if(y===32||y===9)g++;else break}const v=e[g];if(v==="`"||v==="~"){let y=g;for(;y<h&&e[y]===v;)y++;const C=y-g;C>=3&&(u?u.marker===v&&C>=u.length&&(u=null):u={marker:v,length:C})}}const b=p-f;s+=b,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=b);const _=m;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(_)d(p);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=g||c>=v)&&d(p)}f=p}return n&&d(e.length),o}function xf(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!z9(e,t[s].end))return!0;return!1}function z9(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 o=n+1;o<t-1;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function U9(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function q9(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function j9(e,t){if(e.length<=t)return e;const n=[];let o=0;for(let s=0;s<t;s++){const i=t-s,r=e.length-o,l=Math.ceil(r/i),a=e.slice(o,o+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}),o+=l}return n}function V9(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}const yT=4e6,kT=8e4,K9=1e4,G9=200,Y9=1e4,X9=200;function bT(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Q9(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function br(e){return e.length===0?0:Xn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Z9(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function J9(e,t){if(!t||e.length===0)return!1;let n=null;for(let o=0;o<e.length;){let s=e.indexOf(`
|
|
74
|
+
`,o);s===-1&&(s=e.length);let i=o;for(;i<s;){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<s&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}o=s===e.length?e.length:s+1}return n!==null}function eB(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 Z9(e,n+1,e.length-1)?!J9(e,t):!1}function tB(e,t,n,o={}){const s=o.mode??"full",i=o.fenceAware??(s==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(o.maxChunkChars!==void 0||o.maxChunkLines!==void 0||o.autoTune===!1){const r=o.maxChunkChars??(s==="stream"?e.options.streamChunkSizeChars??Y9:e.options.fullChunkSizeChars??K9),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??X9:e.options.fullChunkSizeLines??G9);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return s==="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 sd=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=br(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=Cf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(xf(this.pending,o,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const s=this.commitRanges(o,e);return this.pending=this.pending.slice(s),this.updateEnvDiagnostics(e,t,br(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!eB(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,br(this.pending)),null;const n=Cf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,br(this.pending)),null;const o=xf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:br(this.pending)}]:n;return this.commitRanges(o,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const o=this.resolveWindow();return this.updateEnvDiagnostics(e,o,0),this.tokens}const t=this.resolveWindow(),n=Cf(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=xf(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:br(this.pending)}]:n;this.commitRanges(o,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:br(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+br(this.pending);return tB(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(od(e)&&sr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=is(t);n&&(C0(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let o=0;o<e.length;o++){const s=e[o],i=this.pending.slice(s.start,s.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&Q9(r,a),this.options.retainTokens!==!1&&bT(this.tokens,r),this.committedChars+=i.length,this.committedLines+=s.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:s.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=s.end}return this.markedGlobalStateReason&&x0(t),n}catch(o){throw this.markedGlobalStateReason&&(sr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){WA(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 nB(e,t,n={},o={}){jo(n);const s=new sd(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function oB(e,t,n={},o={}){jo(n);const s=new sd(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function sB(e,t,n,o={},s={}){jo(o);const i=new sd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}async function iB(e,t,n,o={},s={}){jo(o);const i=new sd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}function _T(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??yT,s=e.options.autoUnboundedThresholdLines??kT;return t>=o||n>=s}function wT(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??yT))return"yes";const o=e.options.autoUnboundedThresholdLines??kT;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function au(e,t,n={},o={}){jo(n);const s=is(t);if(od(n)&&sr(n),o.fallbackOnGlobalState!==!1&&s)return WA(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:Xn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),Va(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new sd(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){bT(i,l)}});if(s&&C0(n,s),r.feed(t),r.flushForce(n),s&&(x0(n),o.fallbackOnGlobalState===!1)){const l=zi(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const Ga=(e,t,n)=>e<t?t:e>n?n:e;function ST(e){return e.experimental?{...e,...e.experimental}:e}const aw=[{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"}],cw=[{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 CT(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function rB(e,t=Math.max(0,e/40|0),n={}){const o=ST(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<aw.length;l++){const a=aw[l];if(e<=a.max){if(a.strategy!=="adaptive")return CT(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Ga(Math.ceil(e/i),8e3,64e3),maxChunkLines:Ga(Math.ceil(t/i),150,700),maxChunks:Ga(Math.ceil(e/64e3),i,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.fullChunkSizeChars??1e4,maxChunkLines:o.fullChunkSizeLines??200,fenceAware:s,maxChunks:o.fullChunkMaxChunks}}function uw(e,t=Math.max(0,e/40|0),n={}){const o=ST(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<cw.length;l++){const a=cw[l];if(e<=a.max){if(a.strategy!=="adaptive")return CT(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Ga(Math.ceil(e/i),8e3,64e3),maxChunkLines:Ga(Math.ceil(t/i),150,700),maxChunks:Ga(Math.ceil(e/64e3),i,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.streamChunkSizeChars??1e4,maxChunkLines:o.streamChunkSizeLines??200,maxChunks:o.streamChunkMaxChunks,fenceAware:s}}var lB={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"]}}},aB={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},cB={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"]}}};function yh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Af(e,t){if(yh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const dw=e=>yh(e)?e:Promise.resolve(e);function cu(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 xn(e)}}function Yr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${cu(t[0])}="${xn(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${cu(s[0])}="${xn(s[1])}"`}return n}function xT(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const o=e.charCodeAt(t);if(o===32||o===9||o===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const o=e.charCodeAt(n);if(o!==32&&o!==9&&o!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function uu(e,t,n,o,s){if(t.indexOf("<pre")===0)return`${t}
|
|
75
|
+
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${xn(`${s.langPrefix??"language-"}${o}`)}">${t}</code></pre>
|
|
76
|
+
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${o}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${Yr(r)}>${t}</code></pre>
|
|
77
|
+
`}return`<pre><code${Yr(e.attrs)}>${t}</code></pre>
|
|
78
|
+
`}function yp(e){return!e.attrs||e.attrs.length===0?`<code>${xn(e.content)}</code>`:`<code${Yr(e.attrs)}>${xn(e.content)}</code>`}function Kv(e){const t=xn(e.content);return e.attrs?`<pre${Yr(e.attrs)}><code>${t}</code></pre>
|
|
79
|
+
`:`<pre><code>${t}</code></pre>
|
|
80
|
+
`}function uB(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="${xn(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${xn(n[0][1])}">`}return null}function fw(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${cu(t[0][0])}="${xn(t[0][1])}">`:t.length===2?`<a ${cu(t[0][0])}="${xn(t[0][1])}" ${cu(t[1][0])}="${xn(t[1][1])}">`:`<a${Yr(t)}>`}function dB(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 pw(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 kp(e,t){if(e.hidden)return"";const n=e.attrs,o=e.nesting,s=e.tag;if(!n||n.length===0)return o===0?t?`<${s} />`:`<${s}>`:o===-1?`</${s}>`:`<${s}>`;let i=(o===-1?"</":"<")+s+Yr(n);return o===0&&t&&(i+=" /"),`${i}>`}const fB={langPrefix:"language-",xhtmlOut:!1,breaks:!1},ef=Object.prototype.hasOwnProperty,Cn={code_inline(e,t){return yp(e[t])},code_block(e,t){return Kv(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?vT(i.info).trim():"",{langName:l,langAttrs:a}=xT(r),c=n.highlight,u=xn(i.content);if(!c)return uu(i,u,r,l,n);const d=c(i.content,l,a);return yh(d)?d.then(f=>uu(i,f||u,r,l,n)):uu(i,d||u,r,l,n)},image(e,t,n,o,s){const i=e[t],r=s.renderInlineAsText(i.children||[],n,o),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]],kp(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
81
|
+
`:`<br>
|
|
82
|
+
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
83
|
+
`:`<br>
|
|
84
|
+
`:`
|
|
85
|
+
`},text(e,t){return xn(e[t].content)},text_special(e,t){return xn(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function hw(e,t,n){const o=e.info?vT(e.info).trim():"",{langName:s,langAttrs:i}=xT(o),r=t.highlight,l=xn(e.content);if(!r)return uu(e,l,o,s,t);const a=r(e.content,s,i);if(yh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return uu(e,a||l,o,s,t)}function tf(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===Cn.text)return l.content.length===0?"":xn(l.content);break;case"text_special":if(s.text_special===Cn.text_special)return l.content.length===0?"":xn(l.content);break;case"softbreak":if(s.softbreak===Cn.softbreak)return r;break;case"hardbreak":if(s.hardbreak===Cn.hardbreak)return i;break;case"html_inline":if(s.html_inline===Cn.html_inline)return l.content;break;case"code_inline":if(s.code_inline===Cn.code_inline)return yp(l);break}const a=s[l.type];if(!a)return kp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:Af(c,l.type)}var pB=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Cn}}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 o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",m=!1,b="";for(let _=0;_<e.length;_++){const g=e[_],v=g.type,y=_>0&&e[_-1].hidden?`
|
|
86
|
+
`:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&_+3<e.length){const $=e[_+1],k=e[_+2],M=e[_+3];if($.type==="paragraph_open"&&$.hidden&&k.type==="inline"&&M.type==="paragraph_close"&&M.hidden){b+=`${y}<li>${this.renderInlineTokens(k.children||[],o,s)}`,_+=3;continue}}if(_+2<e.length){const $=e[_+1],k=e[_+2];if($.type==="inline"&&k.nesting===-1&&k.tag===g.tag&&!k.hidden){const M=uB(g,y);if(M!==null){b+=`${M+this.renderInlineTokens($.children||[],o,s)}</${g.tag}>
|
|
87
|
+
`,_+=2;continue}}}if(v==="inline"){const $=g.children||[];if($.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=o.xhtmlOut?`<br />
|
|
88
|
+
`:`<br>
|
|
89
|
+
`,p=o.breaks?h:`
|
|
90
|
+
`,m=!0);const k=$[0];switch(k.type){case"text":if(l===Cn.text){b+=xn(k.content);continue}break;case"text_special":if(a===Cn.text_special){b+=xn(k.content);continue}break;case"softbreak":if(c===Cn.softbreak){b+=p;continue}break;case"hardbreak":if(u===Cn.hardbreak){b+=h;continue}break;case"html_inline":if(d===Cn.html_inline){b+=k.content;continue}break;case"code_inline":if(f===Cn.code_inline){b+=yp(k);continue}break}}b+=this.renderInlineTokens($,o,s);continue}const C=i[v];if(!C){const $=g.attrs;if(!g.hidden){if(!$||$.length===0)switch(v){case"hr":b+=r?`<hr />
|
|
91
|
+
`:`<hr>
|
|
92
|
+
`;continue;case"heading_open":b+=`<${g.tag}>`;continue;case"heading_close":b+=`</${g.tag}>
|
|
93
|
+
`;continue;case"paragraph_open":b+=`${y}<p>`;continue;case"paragraph_close":b+=`</p>
|
|
94
|
+
`;continue;case"list_item_open":{const k=e[_+1];b+=y+(k&&(k.type==="inline"||k.hidden||k.nesting===-1&&k.tag==="li")?"<li>":`<li>
|
|
95
|
+
`);continue}case"list_item_close":b+=`</li>
|
|
96
|
+
`;continue;case"bullet_list_open":b+=`${y}<ul>
|
|
97
|
+
`;continue;case"bullet_list_close":b+=`</ul>
|
|
98
|
+
`;continue;case"blockquote_open":b+=y+(e[_+1]&&e[_+1].nesting===-1&&e[_+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
99
|
+
`);continue;case"blockquote_close":b+=`</blockquote>
|
|
100
|
+
`;continue;case"ordered_list_open":b+=`${y}<ol>
|
|
101
|
+
`;continue;case"ordered_list_close":b+=`</ol>
|
|
102
|
+
`;continue;case"table_open":b+=`${y}<table>
|
|
103
|
+
`;continue;case"table_close":b+=`</table>
|
|
104
|
+
`;continue;case"thead_open":b+=`${y}<thead>
|
|
105
|
+
`;continue;case"thead_close":b+=`</thead>
|
|
106
|
+
`;continue;case"tbody_open":b+=`${y}<tbody>
|
|
107
|
+
`;continue;case"tbody_close":b+=`</tbody>
|
|
108
|
+
`;continue;case"tr_open":b+=`${y}<tr>
|
|
109
|
+
`;continue;case"tr_close":b+=`</tr>
|
|
110
|
+
`;continue;case"td_open":b+=`${y}<td>`;continue;case"td_close":b+=`</td>
|
|
111
|
+
`;continue;case"th_open":b+=`${y}<th>`;continue;case"th_close":b+=`</th>
|
|
112
|
+
`;continue}else if($.length===1){const k=$[0];if(v==="ordered_list_open"&&k[0]==="start"){b+=`${y}<ol start="${xn(k[1])}">
|
|
113
|
+
`;continue}if(v==="td_open"&&k[0]==="style"){b+=`${y}<td style="${xn(k[1])}">`;continue}if(v==="th_open"&&k[0]==="style"){b+=`${y}<th style="${xn(k[1])}">`;continue}}}b+=this.renderToken(e,_,o);continue}if(v==="code_block"&&C===Cn.code_block){b+=Kv(g);continue}if(v==="fence"&&C===Cn.fence){b+=hw(g,o);continue}if(v==="html_block"&&C===Cn.html_block){b+=g.content;continue}const L=C(e,_,o,s,this);typeof L=="string"?b+=L:b+=Af(L,g.type)}return b}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=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||[],o,s);continue}const c=i[a.type];c?r+=await dw(c(e,l,o,s,this)):r+=this.renderToken(e,l,o)}return r}renderInline(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokens(e,o,s)}async renderInlineAsync(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokensAsync(e,o,s)}renderInlineAsText(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineAsTextInternal(e,o,s)}renderAttrs(e){return Yr(e.attrs)}renderToken(e,t,n){const o=e[t];if(o.hidden)return"";const s=o.block,i=o.nesting,r=o.tag,l=o.attrs;let a=!1;if(s&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=s&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
114
|
+
`:"",u=a?`>
|
|
115
|
+
`:">";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+Yr(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 o=()=>(n||(n={...t}),n);if(ef.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),ef.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(ef.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(ef.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...fB,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===Cn.code_block)return Kv(t);if(i==="html_block"&&s.html_block===Cn.html_block)return t.content;const r=this.mergeOptions(n),l=o??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=s[i];if(!a)return t.block?this.renderToken(e,0,r):kp(t,r.xhtmlOut===!0);if(i==="fence"&&a===Cn.fence)return hw(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Af(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules,s=o.text,i=o.text_special,r=o.softbreak,l=o.hardbreak,a=o.html_inline,c=o.code_inline,u=o.link_open,d=o.link_close,f=o.em_open,h=o.em_close,p=o.strong_open,m=o.strong_close,b=t.xhtmlOut===!0,_=b?`<br />
|
|
116
|
+
`:`<br>
|
|
117
|
+
`,g=t.breaks?_:`
|
|
118
|
+
`;if(e.length===1)return tf(e,t,n,this,o,_,g);let v="";for(let y=0;y<e.length;y++){const C=e[y];if(C.type==="link_open"&&!u&&!d&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="link_close"&&dB(k)){const M=`${fw(C)+tf([k],t,n,this,o,_,g)}</a>`;if(r===Cn.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){v+=M+g,y+=3;continue}v+=M,y+=2;continue}}if(C.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){v+=`${fw(C)}</a>`,y+=1;continue}if(C.type==="em_open"&&!f&&!h&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="em_close"&&pw(k)){v+=`<em>${tf([k],t,n,this,o,_,g)}</em>`,y+=2;continue}}if(C.type==="strong_open"&&!p&&!m&&y+2<e.length){const k=e[y+1];if(e[y+2].type==="strong_close"&&pw(k)){v+=`<strong>${tf([k],t,n,this,o,_,g)}</strong>`,y+=2;continue}}switch(C.type){case"text":if(s===Cn.text){const k=C.content.length===0?"":xn(C.content);if(a===Cn.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(v+=k+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}v+=k;continue}break;case"text_special":if(i===Cn.text_special){C.content.length!==0&&(v+=xn(C.content));continue}break;case"softbreak":if(r===Cn.softbreak){v+=g;continue}break;case"hardbreak":if(l===Cn.hardbreak){v+=_;continue}break;case"html_inline":if(a===Cn.html_inline){for(v+=C.content;y+1<e.length&&e[y+1].type==="html_inline";)v+=e[++y].content;continue}break;case"code_inline":if(c===Cn.code_inline){v+=yp(C);continue}break}const L=o[C.type];if(!L){v+=C.block?this.renderToken(e,y,t):kp(C,b);continue}const $=L(e,y,t,n,this);typeof $=="string"?v+=$:v+=Af($,C.type)}return v}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const o=this.rules;let s="";for(let i=0;i<e.length;i++){const r=o[e[i].type];r?s+=await dw(r(e,i,t,n,this)):s+=this.renderToken(e,i,t)}return s}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let o="";for(let s=0;s<e.length;s++){const i=e[s];switch(i.type){case"text":case"text_special":o+=i.content;break;case"image":o+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":o+=i.content;break;case"softbreak":case"hardbreak":o+=`
|
|
119
|
+
`;break}}return o}},hB=pB;const mB=[],dg=4096;function gB(e){const t=e.length;let n=0;for(;n<=t;){let o=e.indexOf(`
|
|
120
|
+
`,n);o===-1&&(o=t);const s=o<t;let i=n,r=0;for(;i<o;){const l=e.charCodeAt(i);if(l===32){if(r++,i++,r>=4)return!0;continue}if(l===9){if(r+=4-r%4,i++,r>=4)return!0;continue}break}if(i<o){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<o&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<o){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===o&&s)return!0}break}case 62:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 96:case 126:{let a=i;for(;a<o&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<o;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<o&&e.charCodeAt(a)===46){const c=a+1;if(c<o){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===o&&s)return!0}}break}}if(o===t)break;n=o+1}return!1}function vB(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return!1;return!0}function yB(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!AT(e[n],t[n]))return!1;return!0}function AT(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,o=t.map;return!!n!=!!o||n&&o&&(n[0]!==o[0]||n[1]!==o[1])||e.tag!==t.tag||e.nesting!==t.nesting||e.markup!==t.markup||e.info!==t.info||e.block!==t.block||e.hidden!==t.hidden||!vB(e.attrs,t.attrs)||!yB(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function mw(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var kB=class{core;cache=null;stats=mw();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=mw(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(jo(o??s?.env),!s||o&&o!==s.env){const I=o??{},P=!!n.__explicitStreamChunkFallbackSetting,D=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,H=!!n.options?.streamChunkedFallback,z=!P&&D,U=H||z,Q=n.options?.streamChunkAdaptive!==!1,X=n.options?.streamChunkTargetChunks??8,ue=n.options?.streamChunkSizeChars,me=n.options?.streamChunkSizeLines,Ae=n.options?.streamChunkMaxChunks,be=!!n.__explicitStreamChunkConfig,ze=n.options?.autoTuneChunks!==!1,qe=n.options?.streamChunkFenceAware??!0,Fe=n.options?.streamLargeCachePolicy??"retain",Le=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,le=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let F,te=!1;if(Fe==="skip"&&(te=e.length>=Le,!te&&le!==void 0&&(F=Xn(e),te=F>=le)),te){const q=this.parseFullDocument(e,I,n,F,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",io(I,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!zi(I)?.unbounded}),q.tokens}else if(U){const q=(re,he,Ce)=>re<he?he:re>Ce?Ce:re;F===void 0&&(F=Xn(e));const Y=ze&&!be?uw(e.length,F,n.options):null,de=Y?.maxChunkChars??(Q?q(Math.ceil(e.length/X),8e3,64e3):ue??1e4),ne=Y?.maxChunkLines??(Q?q(Math.ceil(F/X),150,700):me??200),ce=Y?.maxChunks??(Q?q(Math.ceil(e.length/64e3),X,32):Ae),j=e.length>0&&e.charCodeAt(e.length-1)===10,G=z&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Y?.strategy!=="plain";if((H||G)&&(e.length>=de*2||F>=ne*2)&&j){const re=vp(n,e,I,{maxChunkChars:de,maxChunkLines:ne,fenceAware:Y?.fenceAware??qe,maxChunks:ce});return this.cache={src:e,tokens:re,env:I,lineCount:F,lastSegment:void 0,globalStateReason:is(e)},this.updateCacheLineCount(this.cache,F),this.recordChunkedParseResult(I,H?"explicit-initial-large-doc":"default-initial-large-doc"),re}}const ee=this.parseFullDocument(e,I,n,F);return F=ee.lineCount,this.cache={src:e,tokens:ee.tokens,env:I,lineCount:F,lastSegment:void 0,globalStateReason:is(e)},this.updateCacheLineCount(this.cache,F),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",io(I,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!zi(I)?.unbounded}),ee.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",io(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const i=e.startsWith(s.src)?e.slice(s.src.length):null;let r=s.globalStateReason;r===void 0&&(r=is(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):is(e),a=r||l;if(a){const I=o??s.env;sr(I);const P=is(e),D=this.parseFullDocument(e,I,n),H=D.tokens,z=D.lineCount;return this.cache={src:e,tokens:H,env:I,lineCount:z,lastSegment:void 0,globalStateReason:P},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",io(I,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!zi(I)?.unbounded}),H}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length<c&&e.length<c*1.5&&!e.startsWith(s.src)){const I=o??s.env,P=this.parseFullDocument(e,I,n),D=P.tokens,H=P.lineCount;return this.cache={src:e,tokens:D,env:I,lineCount:H,lastSegment:void 0,globalStateReason:is(e)},this.updateCacheLineCount(this.cache,H),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",io(I,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!zi(I)?.unbounded}),D}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const I=s.lineCount??Xn(s.src);let P=3;u.length>5e3?P=8:u.length>1e3?P=6:u.length>200&&(P=4),P=Math.min(P,I);let D=null;const H=n.options?.streamContextParseStrategy??"chars",z=n.options?.streamContextParseMinChars??200,U=n.options?.streamContextParseMinLines??2;let Q;const X=()=>(Q===void 0&&(Q=Xn(u)),Q),ue=this.canDirectlyParseAppend(s),me=ue&&this.shouldUseUnboundedAppend(e,s,u);let Ae=!1;if(!ue)switch(H){case"lines":Ae=X()>=U;break;case"constructs":if(u.length>=z){Ae=!0;break}if(gB(u)){Ae=!0;break}Ae=X()>=U;break;case"chars":default:Ae=u.length>=z}if(P>0&&Ae){const qe=this.getTailLines(s.src,P)+u;try{const Fe=this.core.parse(qe,s.env,n).tokens,Le=Fe.findIndex(le=>le.map&&typeof le.map[1]=="number"&&le.map[1]>P);if(Le!==-1){const le=Fe.slice(Le),F=I-P;F!==0&&this.shiftTokenLines(le,F),D={tokens:le}}}catch{D=null}}else D=null;if(!D){const qe=I;if(me)D={tokens:au(n,u,s.env,{mode:"stream"})},qe>0&&this.shiftTokenLines(D.tokens,qe);else{const Fe=this.core.parse(u,s.env,n);qe>0&&this.shiftTokenLines(Fe.tokens,qe),D=Fe}}let be=0;if(s.tokens.length>0&&D.tokens.length>0){const qe=s.tokens[s.tokens.length-1],Fe=D.tokens[0];try{qe.type==="inline"&&Fe.type==="inline"&&(Fe.children&&Fe.children.length>0&&(qe.children||(qe.children=[]),this.appendTokens(qe.children,Fe.children)),qe.content=(qe.content||"")+(Fe.content||""),be=1)}catch{be=0}}const ze=s.tokens.length;if(D.tokens.length>be){const qe=s.tokens,Fe=D.tokens,Le=Math.min(qe.length,Fe.length-be);let le=0;for(let F=Le;F>0;F--){let te=!0;for(let ee=0;ee<F;ee++){const q=qe[qe.length-F+ee],Y=Fe[be+ee];if(!AT(q,Y)){te=!1;break}}if(te){le=F;break}}le>0&&(be+=le),Fe.length>be&&this.appendTokens(s.tokens,Fe,be)}if(s.src=e,s.globalStateReason=null,s.lineCount=I+(Q??X()),s.tokens.length>ze){const qe=this.getLastSegment(s.tokens,e,ze,s.tokens.length,e.length-u.length,I);qe?s.lastSegment=qe:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,me&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",io(s.env,{area:"stream",path:me?"stream-unbounded-append":"stream-append",reason:me?"large-delta":"safe-append",unbounded:me}),s.tokens}const d=o??s.env,f=this.tryTailSegmentReparse(e,s,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",io(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,b=!h&&!u&&p,_=m||b,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,C=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,$=!!n.__explicitStreamChunkConfig,k=n.options?.autoTuneChunks!==!1,M=n.options?.streamChunkFenceAware??!0;let E=u&&s.lineCount!==void 0?s.lineCount+Xn(u):void 0;if(_){E===void 0&&(E=Xn(e));const I=(X,ue,me)=>X<ue?ue:X>me?me:X,P=k&&!$?uw(e.length,E,n.options):null,D=P?.maxChunkChars??(g?I(Math.ceil(e.length/v),8e3,64e3):y??1e4),H=P?.maxChunkLines??(g?I(Math.ceil(E/v),150,700):C??200),z=P?.maxChunks??(g?I(Math.ceil(e.length/64e3),v,32):L),U=e.length>0&&e.charCodeAt(e.length-1)===10,Q=b&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&P?.strategy!=="plain";if((m||Q)&&(e.length>=D*2||E>=H*2)&&U){const X=vp(n,e,d,{maxChunkChars:D,maxChunkLines:H,fenceAware:P?.fenceAware??M,maxChunks:z});return this.cache={src:e,tokens:X,env:d,lineCount:E,lastSegment:void 0,globalStateReason:is(e)},this.updateCacheLineCount(this.cache,E),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),X}}const O=this.parseFullDocument(e,d,n,E),S=O.tokens;return E=O.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:E,lastSegment:void 0,globalStateReason:is(e)},this.updateCacheLineCount(this.cache,E),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",io(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!zi(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=zi(e)?.chunk,o=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,o){this.stats.fullParses+=1,this.stats.lastMode="full",io(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!zi(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",io(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=is(e);od(t)&&sr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?wT(n,e.length,o):"no";if(r==="yes"){const a=au(n,e,t);return io(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?Xn(e):0)}}let l=o;if(r==="need-lines"&&(l=Xn(e),_T(n,e.length,l))){const a=au(n,e,t);return io(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?Xn(e):0),{tokens:Va(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:Xn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
|
|
121
|
+
`))return null;const o=n??t.slice(e.length);if(!o)return null;const s=o.length;if(o.charCodeAt(s-1)!==10)return null;let i=0,r=-1;for(let a=0;a<s&&!(o.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?o:o.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
|
|
122
|
+
`);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(o)?null:o}tryTailSegmentReparse(e,t,n,o){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const i=t.src.slice(0,s.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(s.srcOffset),l=e.slice(s.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,o,s,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,o),u=this.getLastSegment(c.tokens,l);return s.lineStart>0&&this.shiftTokenLines(c.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=s.lineStart+Xn(l),u?t.lastSegment={tokenStart:s.tokenStart+u.tokenStart,tokenEnd:s.tokenStart+u.tokenEnd,lineStart:s.lineStart+u.lineStart,lineEnd:s.lineStart+u.lineEnd,srcOffset:s.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let o=e.length-1;o>=0;o--)if(e.charCodeAt(o)===10&&(n--,n===0))return e.slice(o+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,o=e.slice(n),s=o.length;let i=null,r=0;for(;r<=s;){let l=o.indexOf(`
|
|
123
|
+
`,r);l===-1&&(l=s);let a=r;for(;a<l;){const c=o.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=o.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&o.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===s)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??mB}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;s<o;s++)e.push(t[s])}updateCacheLineCount(e,t){e.lineCount=t??Xn(e.src),e.lastSegment=void 0,e.globalStateCarry=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-dg))+t,o=is(n);return e.globalStateCarry=n.length>dg?n.slice(n.length-dg):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,i){if(o<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,i=-1;for(;s>0;){if(i=e.indexOf(`
|
|
124
|
+
`,i+1),i===-1)return e.length;s--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let o=n,s=t-1;for(;o>0;){if(s=e.indexOf(`
|
|
125
|
+
`,s+1),s===-1)return e.length;o--}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,o,s,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[s.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,o,s,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,o,s,i,r);default:return null}}tryListTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.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,o).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 f=t.lineCount??Xn(t.src);f>0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),p=this.getListParagraphMode(u,0,u.length,0);(h==="loose"||p==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.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=null;const m=f+Xn(i);t.lineCount=m;const b=this.getDocLineCount(e,m);return r.map&&(r.map[1]=b),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:b,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.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(s.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),h=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!f||!h||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const p=h.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(p.length===0)return null;const m=s.lineEnd-2;m!==0&&this.shiftTokenLines(p,m);const b=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,_=t.lineCount??Xn(t.src);t.tokens.splice(b,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const g=_+Xn(i);t.lineCount=g;const v=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=v),h.tbodyOpenIndex>=0){const y=t.tokens[h.tbodyOpenIndex];y?.map&&(y.map[1]=v)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:v,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
126
|
+
`);if(t<0)return null;const n=e.indexOf(`
|
|
127
|
+
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,o){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===o){s=l;break}}if(s<0)return null;let i=-1,r=-1;for(let l=t+1;l<s;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===o+1){i=l;break}}if(i>=0){for(let l=s-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===o+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,o){if(e.length<2)return!1;const s=e[0],i=e[e.length-1];if(s.type!==t||i.type!==n||s.level!==0||i.level!==0||o!==void 0&&s.markup!==o)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,o){let s=!1,i=!1;const r=o+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?s=!0:i=!0,s&&i))return"loose"}return i?"loose":s?"tight":"none"}setListParagraphVisibility(e,t,n,o,s){const i=o+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=s)}}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 o=e.charCodeAt(n);if(o===32||o===9){n--;continue}return o===10}return!0}getDocLineCount(e,t=Xn(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let o=0;o<e.length;o++){const s=e[o];if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children){n??=[];for(let i=s.children.length-1;i>=0;i--)n.push(s.children[i]);for(;n.length>0;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let r=i.children.length-1;r>=0;r--)n.push(i.children[r])}}}}};const gw={default:aB,zero:cB,commonmark:lB};function bB(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function _B(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 vw(e){return e.experimental?{...e,...e.experimental}:e}function Hs(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 yw(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(Hs(t,s)||Hs(e,s))return!0}return!1}function kw(e,t,n){return Hs(t,n)||Hs(e,n)}function bw(e,t){const n=zi(e)?.chunk;if(n?.fallback){io(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}io(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function wB(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,streamLargeCachePolicy:"retain",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},o="default",s;!t&&typeof e!="string"?(s=e,o="default"):typeof e=="string"&&(o=e,s=t);const i=gw[o];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${o}", check name`);if(i?.options&&(n={...n,...i.options}),s&&(n={...n,...s}),n=vw(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=yw(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=yw(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=kw(i?.options,s,"fullChunkedFallback"),c=kw(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new f9;let p=null;const m=()=>(p||(p=new hB(n)),p);let b=null;const _=()=>(b||(b=new kB(h)),b);let g=null;const v=()=>(g||(g=new qA),g),y=k=>!u&&!!d&&!_B(k,d),C=(k,M)=>o==="default"&&!u&&p===null&&f!==null&&k.parse===f&&y(k)&&!k.stream.enabled&&M<(k.options.autoUnboundedThresholdChars??4e6)&&k.options.html===!1&&k.options.xhtmlOut===!1&&k.options.breaks===!1&&k.options.langPrefix==="language-"&&k.options.linkify===!1&&k.options.typographer===!1&&k.options.highlight===null,L=(k,M)=>o==="default"&&!u&&y(k)&&!k.stream.enabled&&!k.options.fullChunkedFallback&&M<(k.options.autoUnboundedThresholdChars??4e6)&&k.options.html===!1&&k.options.linkify===!1&&k.options.typographer===!1,$={core:h,block:h.block,inline:h.inline,get linkify(){const k=v();return Object.defineProperty(this,"linkify",{value:k,writable:!0,configurable:!0}),k},get renderer(){const k=m();return Object.defineProperty(this,"renderer",{value:k,writable:!0,configurable:!0}),k},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return y(this)},set(k){const M=vw(k);return this.options={...this.options,...M},(Hs(k,"fullChunkSizeChars")||Hs(k,"fullChunkSizeLines")||Hs(k,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(Hs(k,"streamChunkSizeChars")||Hs(k,"streamChunkSizeLines")||Hs(k,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),Hs(k,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),Hs(k,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(M),typeof M.stream=="boolean"&&(this.stream.enabled=M.stream,b&&(b.reset(),b.resetStats())),this},configure(k){const M=typeof k=="string"?gw[k]:k;if(!M)throw new Error("Wrong `markdown-it` preset, can't be empty");if(M.options&&this.set(M.options),M.components){const E=M.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,M){const E=Array.isArray(k)?k:[k],O=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of O){if(!I)continue;const P=I.enable(E,!0);for(let D=0;D<P.length;D++)S.add(P[D])}if(!M){const I=E.filter(P=>!S.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(k,M){const E=Array.isArray(k)?k:[k],O=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const I of O){if(!I)continue;const P=I.disable(E,!0);for(let D=0;D<P.length;D++)S.add(P[D])}if(!M){const I=E.filter(P=>!S.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(k,...M){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 O=[this,...M],S=k;return u=!0,E.apply(S,O),this},render(k,M){if(C(this,k.length)){M!==void 0&&jo(M);const S=lw(k);if(S!==null)return M!==void 0&&io(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const E=M??{},O=this.parse(k,E);return m().render(O,this.options,E)},async renderAsync(k,M){if(C(this,k.length)){M!==void 0&&jo(M);const S=lw(k);if(S!==null)return M!==void 0&&io(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const E=M??{},O=this.parse(k,E);return m().renderAsync(O,this.options,E)},renderIterable(k,M={}){const E=this.parseIterable(k,M);return m().render(E,this.options,M)},async renderAsyncIterable(k,M={}){const E=await this.parseAsyncIterable(k,M);return m().renderAsync(E,this.options,M)},renderInline(k,M={}){const E=this.parseInline(k,M);return m().render(E,this.options,M)},validateLink:aT,normalizeLink:cT,normalizeLinkText:uT,utils:NR,helpers:{...b7},parse(k,M){if(typeof k!="string")throw new TypeError("Input data should be a String");if(M!==void 0&&jo(M),L(this,k.length)){const I=C9(k);if(I!==null)return M!==void 0&&io(M,{area:"parse",path:"stock-fast",reason:"stock-subset"}),I}const E=M??{};let O;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const I=wT(this,k.length);if(I==="yes"){const P=au(this,k,E);return io(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),P}I==="need-lines"&&(O=Xn(k))}if(!this.stream.enabled){const I=k.length,P=this.options.autoTuneChunks!==!1,D=r,H=!a&&y(this),z=!!this.options.fullChunkedFallback,U=H&&I>=2e5;let Q;(z||U||O!==void 0)&&(Q=O??Xn(k));const X=(z||U)&&P&&!D?rB(I,Q,this.options):null;if(z||U){const ue=Q??0;if(z?I>=(this.options.fullChunkThresholdChars??2e4)||ue>=(this.options.fullChunkThresholdLines??400):U){if(X&&X.strategy!=="plain"){const me=vp(this,k,E,{maxChunkChars:X.maxChunkChars,maxChunkLines:X.maxChunkLines,fenceAware:X.fenceAware,maxChunks:X.maxChunks});return M&&bw(M,z?"explicit-full-chunk":"default-large-string"),me}if(z){const me=(te,ee,q)=>te<ee?ee:te>q?q:te,Ae=this.options.fullChunkAdaptive!==!1,be=this.options.fullChunkTargetChunks??8,ze=me(Math.ceil(I/be),8e3,64e3),qe=me(Math.ceil(ue/be),150,700),Fe=Ae?ze:this.options.fullChunkSizeChars??1e4,Le=Ae?qe:this.options.fullChunkSizeLines??200,le=Ae?me(Math.ceil(I/64e3),be,32):this.options.fullChunkMaxChunks,F=vp(this,k,E,{maxChunkChars:Fe,maxChunkLines:Le,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:le});return M&&bw(M,"explicit-full-chunk"),F}}}if(O!==void 0&&y(this)&&_T(this,I,Q??O)){const ue=au(this,k,E);return io(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),ue}}const S=is(k);return io(M,{area:"parse",path:"plain",reason:"default-plain"}),Va(E,S,()=>h.parse(k,E,this).tokens)},parseIterable(k,M={}){return jo(M),nB(this,k,M)},parseAsyncIterable(k,M={}){return jo(M),oB(this,k,M)},parseIterableToSink(k,M,E={}){return jo(E),sB(this,k,M,E)},parseAsyncIterableToSink(k,M,E={}){return jo(E),iB(this,k,M,E)},parseInline(k,M={}){if(typeof k!="string")throw new TypeError("Input data should be a String");jo(M),od(M)&&sr(M);const E=h.createState(k,M,this);return E.inlineMode=!0,h.process(E),E.tokens}};if($.stream={enabled:!!n.stream,parse(k,M){return $.stream.enabled?_().parse(k,M,$):$.parse(k,M??{})},reset(){_().reset()},peek(){return b?b.peek():[]},stats(){return b?b.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){b&&b.resetStats()}},i?.components){const k=i.components;k.core?.rules&&$.core.ruler.enableOnly(k.core.rules),k.block?.rules&&$.block.ruler.enableOnly(k.block.rules),k.inline?.rules&&$.inline.ruler.enableOnly(k.inline.rules),k.inline2?.rules&&$.inline.ruler2.enableOnly(k.inline2.rules)}return d=bB($),f=$.parse,$}var SB=wB;const TT=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],CB=["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"],MT=["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"],xB=["svg","g","path"],AB=["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"],TB=["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"],MB=["action","data","href","src","srcset","poster","xlink:href","formaction"],EB=["script"],IB=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Ql=new Set(TT),$B=new Set(MT),Hu=new Set([...TT,...CB,...MT,...xB]),ET=new Set([...Hu,...AB]),NB=new Set(TB),LB=new Set(MB),id=new Set(EB),IT=new Set(IB);function $T(e){let t="";for(const n of e){const o=n.charCodeAt(0);o<=31||o>=127&&o<=159||/\s/u.test(n)||(t+=n)}return t}const OB={amp:"&",bsol:"\\",colon:":",newline:`
|
|
128
|
+
`,sol:"/",tab:" "};function NT(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,o,s)=>{const i=n??o;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return OB[String(s??"").toLowerCase()]??t})}const nf=new Set(["http","https","mailto","tel"]),PB=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),wl=new Set(["http","https"]);function LT(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function RB(e,t,n){if(!du(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function du(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function DB(e,t){return t==="href"||t==="xlink:href"?du(e,t)?nf:wl:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?wl:(du(e,t),nf)}function Hl(e,t={}){const n=$T(NT(e)).toLowerCase(),o=String(t.tagName??"").toLowerCase(),s=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 o==="img"&&s==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=LT(n);return i?i==="file"?!RB(n,o,s):du(o,s)?PB.has(i):!DB(o,s).has(i):!1}function BB(e){const t=NT(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=LT($T(t).toLowerCase());return n==="http"||n==="https"}function FB(e,t={}){const n=String(e??"").trim();return n?Hl(n,t)?"":n:""}function _w(e){return FB(e,{tagName:"img",attrName:"src"})}function HB(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,h,p,m,b){return f[h].nesting===1&&f[h].attrJoin("class",t),b.renderToken(f,h,p,m,b)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(f,h,p,m){let b,_=!1,g=f.bMarks[h]+f.tShift[h],v=f.eMarks[h];if(l!==f.src.charCodeAt(g))return!1;for(b=g+1;b<=v&&r[(b-g)%a]===f.src[b];b++);const y=Math.floor((b-g)/a);if(y<i)return!1;b-=(b-g)%a;const C=f.src.slice(g,b),L=f.src.slice(b,v);if(!c(L,C))return!1;if(m)return!0;let $=h;for(;$++,!($>=p||(g=f.bMarks[$]+f.tShift[$],v=f.eMarks[$],g<v&&f.sCount[$]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[$]-f.blkIndent>=4)){for(b=g+1;b<=v&&r[(b-g)%a]===f.src[b];b++);if(!(Math.floor((b-g)/a)<y)&&(b-=(b-g)%a,b=f.skipSpaces(b),!(b<v))){_=!0;break}}const k=f.parentType,M=f.lineMax;f.parentType="container",f.lineMax=$;const E=f.push("container_"+t+"_open","div",1);E.markup=C,E.block=!0,E.info=L,E.map=[h,$],f.md.block.tokenize(f,h+1,$);const O=f.push("container_"+t+"_close","div",-1);return O.markup=f.src.slice(g,b),O.block=!0,f.parentType=k,f.lineMax=M,f.line=$+(_?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 WB(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 o=[];let s="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){s+=c,a+1<n.length&&(s+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,s+=c;continue}if(!i&&c==='"'){r=!r,s+=c;continue}if(!i&&!r&&c===","){o.push(s.trim()),s="";continue}s+=c}s.trim()&&o.push(s.trim());const l={};for(const a of o){if(!a)continue;let c=!1,u=!1,d=-1;for(let b=0;b<a.length;b++){const _=a[b];if(_==="\\"){b++;continue}if(!u&&_==="'"){c=!c;continue}if(!c&&_==='"'){u=!u;continue}if(!c&&!u&&_===":"){d=b;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),h=a.slice(d+1).trim();if(!f)return null;let p=f;if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{p=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(p))return null;let m;if(!h)m="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{m=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=h}else/^-?\d+(?:\.\d+)?$/.test(h)?m=Number(h):h==="true"||h==="false"?m=h==="true":h==="null"?m=null:m=h;l[p]=m}return l}function zB(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(HB,t,{render(n,o){return n[o].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
129
|
+
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{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 f,h;const p=d.indexOf("{"),m=p>=0?d.slice(p).trimStart():void 0;if(p===-1)f=d||void 0;else{if(f=d.slice(0,p).trim()||void 0,m?.startsWith("{")){let C=0,L=-1;for(let $=0;$<m.length;$++)if(m[$]==="{"?C++:m[$]==="}"&&C--,C===0){L=$+1;break}L>0&&(h=m.slice(0,L))}h||(f=d||void 0)}if(s)return!0;const b=!!i.env.__markstreamFinal;let _=n+1,g=!1;for(;_<=o;){const C=i.bMarks[_]+i.tShift[_],L=i.eMarks[_];if(i.src.slice(C,L).trim()===":::"){g=!0;break}_++}g||(_=o);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.meta={...v.meta??{},unclosed:!g&&!b},f&&v.attrSet("data-args",f),h)try{const C=JSON.parse(h);for(const[L,$]of Object.entries(C)){const k=$!=null&&typeof $=="object";v.attrSet(`data-${L}`,k?JSON.stringify($):String($))}}catch{const C=WB(h);if(C)for(const[L,$]of Object.entries(C)){const k=$!=null&&typeof $=="object";v.attrSet(`data-${L}`,k?JSON.stringify($):String($))}else v.attrSet("data-attrs",h)}const y=[];for(let C=n+1;C<_;C++){const L=i.bMarks[C]+i.tShift[C],$=i.eMarks[C];y.push(i.src.slice(L,$))}if(y.some(C=>C.trim().length>0)){let C=y.join(`
|
|
130
|
+
`);C.endsWith(`
|
|
131
|
+
`)||(C+=`
|
|
132
|
+
`),C.endsWith(`
|
|
133
|
+
|
|
134
|
+
`)||(C+=`
|
|
135
|
+
`);const L=i.tokens[i.tokens.length-1];L&&(L.raw=C);const $=[];i.md.block.parse(C,i.md,i.env,$),i.tokens.push(...$)}return g&&i.push("vmr_container_close","div",-1),i.line=g?_+1:_,!0},{alt:["paragraph","reference","blockquote","list"]})}function xs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jn(e){let t=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="\\"){o++;continue}if(!n&&s==="'"){t=!t;continue}if(!t&&s==='"'){n=!n;continue}if(!t&&!n&&s===">")return o}return-1}function kh(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=o[2]||o[3]||o[4]||"";t.push([s,i])}return t}const UB=/^[a-z][a-z0-9_-]*$/;function ww(e){return UB.test(String(e??"").trim().toLowerCase())}function Js(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return ww(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 o=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const s=t.slice(o,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":ww(s)?s:""}function pc(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=Js(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function qB(...e){const t=new Set,n=[];for(const o of e)for(const s of pc(o))t.has(s)||(t.add(s),n.push(s));return n}function jB(e){const t=pc(e);return{key:t.join(","),tags:t}}function OT(e){return Js(e)}function VB(e,t){const n=String(e??""),o=Js(t);if(!o)return!1;const s=xs(o),i=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function PT(e,t){const n=Js(t);return!!n&&!Hu.has(n)&&!VB(e,n)}function KB(e,t){const n=String(e??""),o=Js(t);if(!o)return n;const s=xs(o),i=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const RT=Ql,GB=Hu,DT=new Set($B);DT.delete("details");const YB=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,XB=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Gv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,QB=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function bp(e){return(e.match(Gv)?.[1]??"").toLowerCase()}function L0(e){return/^\s*<\s*\//.test(e)}function O0(e,t){return RT.has(t)||/\/\s*>\s*$/.test(e)}function ZB(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(!s||s.type!=="html_inline")continue;const i=String(s.content??""),r=bp(i);if(r===t){if(L0(i)){if(n===0)return o;n--;continue}O0(i,r)||n++}}return-1}function JB(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=bp(s);if(i===t){if(L0(s)){n>0&&n--;continue}O0(s,i)||n++}}return n}function Sw(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${xs(t)}(?=[\s>/])[^>]*>`,"gi");o.lastIndex=Math.max(0,n);let s=0,i;for(;(i=o.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(s===0)return{start:i.index,end:i.index+r.length};s--;continue}a||s++}return null}function eF(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${xs(t)}(?=[\s>/])[^>]*>`,"gi");let o=0,s;for(;(s=n.exec(e))!==null;){const i=s[0]??"",r=!!s[1],l=!r&&/\/\s*>$/.test(i);if(r){o>0&&o--;continue}l||o++}return o}function _p(e){const t=e;return String(t.raw??t.content??t.markup??"")}function tF(e){const t=e;return t.meta||(t.meta={}),t.meta}function fg(e,t,n){const o=tF(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function nF(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${xs(h)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!o.length))for(const p of o)p.raw+=h,p.inner+=h},l=()=>{!o.length||!s||(r(`
|
|
136
|
+
`),s=!1)},a=h=>{r(h)},c=h=>{for(let m=0;m<o.length;m++)o[m].raw+=h,m<o.length-1&&(o[m].inner+=h);const p=o.pop();fg(p.token,p.raw,p.inner)},u=h=>{const p=o[o.length-1]?.tag;if(!p)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${xs(p)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),f=(h,p,m)=>{const b=m??(h.type==="html_inline"?bp(p):"");if(!(b&&t.has(b))){r(p);return}const _=L0(p),g=!_&&O0(p,b);if(_){if(!o.length||o[o.length-1].tag!==b){r(p);return}c(p);return}if(r(p),g){fg(h,p,"");return}o.push({tag:b,token:h,raw:p,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const p=String(h.content??"");if(d(p)?s=!1:l(),!o.length&&!i(p)){s=!1;continue}let m=0,b=!0;for(const _ of h.children){const g=_p(_),v=_.type==="html_inline"?bp(g):"",y=v&&t.has(v);let C=g;if(b&&p&&g&&(o.length||y)){const L=p.indexOf(g,m);if(L!==-1)a(p.slice(m,L)),C=p.slice(L,L+g.length),m=L+g.length;else{if(o.length&&!y)continue;b=!1}}f(_,C,v)}b&&p&&m<p.length&&o.length&&a(p.slice(m)),s=o.length>0;continue}if(o.length&&typeof h.content=="string"){const p=_p(h),m=h.type==="html_block"?u(p):null;if(m){c(`${s?`
|
|
137
|
+
`:""}${m}`),s=o.length>0;continue}if(!h.content)continue;l(),r(h.content),s=!0}}for(const h of o)fg(h.token,h.raw,h.inner)}function oF(e){return/^\s*<\s*[!?]/.test(e)}function sF(e){const t=new Set(GB);if(e&&Array.isArray(e))for(const n of e){const o=String(n??"").trim();if(!o)continue;const s=o.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function Cw(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function iF(e,t){let n=null;for(const i of e.matchAll(YB)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Cw(l,t)&&jn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(XB)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Cw(l,t)&&jn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const o=/<\/\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const s=/<\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function rF(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function lF(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(rF(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 f=a.slice(d),h=f.match(Gv);if(!h){i("<",c),u=d+1;continue}const p=jn(f);if(p===-1){i("<",c),u=d+1;continue}const m=f.slice(0,p+1),b=(h[1]??"").toLowerCase();t.has(b)?n.push({type:"html_inline",tag:"",content:m,raw:m}):i(m,c),u=d+m.length}}function l(a,c){if(!a)return;const u=iF(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),o={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},s=o.buffer}for(const a of e){if(o){o.buffer+=_p(a),s=o.buffer;const c=jn(o.buffer);if(c===-1)continue;const u=o.buffer.slice(0,c+1),d=o.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),o=null,s=null,d&&l(d);continue}if(a.type==="html_inline"){const c=_p(a),u=(c.match(Gv)?.[1]??"").toLowerCase();if(u&&t.has(u)&&jn(c)===-1){o={tag:u,buffer:c,closing:/^<\s*\//.test(c)},s=o.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:s??void 0}}const aF=["a","span","strong","em","b","i","u"];function cF(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=Js(f);h&&n.add(h)}const o=f=>{const h=f,p=new Set(n),m=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const v of m){const y=Js(String(v??""));y&&p.add(y)}const b=sF(Array.from(p)),_=new Set(aF);for(const v of p)_.add(v);return{autoCloseInlineTagSet:_,commonHtmlTags:b,customTagSet:p,shouldMergeHtmlBlockTag:v=>p.has(v)||!b.has(v)||DT.has(v)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},i=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,h)=>{const p=r(f);if(!/\S/.test(p))return[];if(l(p))return[{type:"code_block",content:a(p),raw:p}];const m=p.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const b={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},b,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[b]},u=(f,h,p)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":p,d=(f,h)=>{const p=r(h);return!/\S/.test(p)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${p}`,f.children.push({type:"text",content:p,raw:p}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:p,customTagSet:m}=o(f);for(const b of h){const _=b;if(_.type!=="inline"||!Array.isArray(_.children))continue;const g=String(_.content??""),v=_.children.length?_.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const y=lF(v,p);if(_.children=y.children,y.pendingBuffer){const C=g.lastIndexOf(y.pendingBuffer);if(C!==-1){const L=g.slice(0,C);_.content=L,typeof _.raw=="string"&&(_.raw=L)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}nF(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:m,shouldMergeHtmlBlockTag:b}=o(f),_=[];for(let g=0;g<h.length;g++){const v=h[g];if(_.length>0){const[C,L]=_[_.length-1];if(g!==L){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const $=String(v.content??v.raw??"");if($){const k=h[L],M=`${String(k.content||"")}
|
|
138
|
+
${$}`,E=jn(M),O=E===-1?null:Sw(M,C,E+1);if(O){const S=M.slice(0,O.end),I=M.slice(O.end);k.content=S,k.loading=!1,h.splice(g,1),_.pop();const P=d(k,I)?[]:c(I,u(h,g,"paragraph"));P.length&&h.splice(g,0,...P),g--;continue}k.content=M,k.loading!==!1&&(k.loading=!0)}h.splice(g,1),g--;continue}}const y=s(v);if(y){if(oF(y))continue;const C=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(y);if(!C||!b(C))continue;if(i(v,y),!L)C&&!new RegExp(`^\\s*<\\s*${C}\\b[^>]*\\/\\s*>`,"i").test(y)&&eF(y,C)>0&&_.push([C,g]);else if(_.length>0&&C&&_[_.length-1][0]===C){const[,$]=_[_.length-1],k=h[$];k.content=`${String(k.content||"")}
|
|
139
|
+
${y}`,k.loading=!1,_.pop(),h.splice(g,1),g--}continue}else if(_.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const C=v.content||"",L=new RegExp(`<\\s*\\/\\s*${_[_.length-1][0]}\\s*>`,"i").test(C);if(C){const[,$]=_[_.length-1],k=h[$];k.content=`${k.content||""}
|
|
140
|
+
${C}`,k.loading!==!1&&(k.loading=!L)}L&&_.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,y=$=>{let k=g.get($);return k||(k=new RegExp(`<\\s*${$}\\b`,"i"),g.set($,k)),k},C=$=>{let k=v.get($);return k||(k=new RegExp(`<\\s*\\/\\s*${$}\\s*>`,"i"),v.set($,k)),k},L=[];for(let $=0;$<h.length;$++){const k=h[$],M=String(k.content??"");if(L.length>0){const O=L[L.length-1],S=h[O.index],I=k.type==="html_block"?C(O.tag).exec(M):null;if(I){const H=I.index+I[0].length,z=M.slice(0,H),U=M.slice(H);S.content=`${String(S.content??"")}
|
|
141
|
+
${z}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${O.tag}>`,raw:`</${O.tag}>`}),L.pop();const Q=d(S,U)?[]:c(U,u(h,$,"paragraph"));Q.length?h.splice($,1,...Q):(h.splice($,1),$--);continue}if(k.type!=="inline")continue;const P=Array.isArray(k.children)?k.children:[],D=ZB(P,O.tag);if(D!==-1){const H=P.slice(0,D+1),z=P.slice(D+1),U=H.map(Q=>String(Q?.content??Q?.raw??"")).join("");if(S.content=`${String(S.content??"")}
|
|
142
|
+
${U}`,Array.isArray(S.children)&&S.children.push(...H),z.length){const Q=z.map(X=>String(X.content??X.raw??"")).join("");if(Q.trim()){const X=Q.replace(/^\s+/,"");if(d(S,Q))h.splice($,1),$--;else if(X.startsWith("<"))h.splice($,1,{type:"html_block",content:X});else{const ue=c(Q,u(h,$,"paragraph"));h.splice($,1,...ue)}}else h.splice($,1),$--}else h.splice($,1),$--;L.pop();continue}S.content=`${String(S.content??"")}
|
|
143
|
+
${M}`,Array.isArray(S.children)&&S.children.push(...P),h.splice($,1),$--;continue}if(k.type!=="inline")continue;const E=Array.isArray(k.children)?k.children:[];for(const O of m)if((E.length?JB(E,O):y(O).test(M)&&!C(O).test(M)?1:0)>0){L.push({tag:O,index:$});break}}}{let g=0;for(let v=0;v<h.length;v++){const y=h[v];if(y.type==="paragraph_open"){g++;continue}y.type==="paragraph_close"&&(g>0?g--:(h.splice(v,1),v--))}}for(let g=0;g<h.length;g++){const v=h[g];if(v.type==="html_block"){const k=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(k.startsWith("!")||k.startsWith("?")){v.loading=!1;continue}if(m.has(k)){const D=String(v.content??""),H=jn(D),z=H===-1?null:Sw(D,k,H+1);v.loading=z?!1:v.loading!==void 0?v.loading:!0;const U=z?.start??-1,Q=z?z.end-z.start:0;if(U!==-1){const X=D.slice(0,U+Q);let ue="";H!==-1&&H<U&&(ue=D.slice(H+1,U)),v.children=[{type:k,content:ue,raw:X,attrs:[],tag:k,loading:!1}],v.content=X,v.raw=X;const me=c(D.slice(U+Q)||"","text");me.length&&h.splice(g+1,0,...me)}else v.children=[{type:k,content:"",raw:D,attrs:[],tag:k,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(k))continue;v.type="inline";const M=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let E;for(;(E=M.exec(v.content||""))!==null;)E[1],E[2]||E[3]||E[4];const O=String(v.content??""),S=new RegExp(`<\\/\\s*${k}\\s*>`,"i").exec(O),I=S?S.index:-1,P=S?S[0].length:0;if(I!==-1){const D=O.slice(0,I+P),H=(O.slice(I+P)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:D,tag:k,loading:!1}],v.content=D,v.raw=D,H&&h.splice(g+1,0,H.startsWith("<")?{type:"html_block",content:H}:{type:"text",content:H,raw:H})}else v.children=[{type:"html_block",content:v.content,tag:k,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const k=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),M=v.children[1],E=String(M?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(M?.type==="html_inline"&&E===k)continue;p.has(k)?(v.children[0].loading=!0,v.children[0].tag=k,v.children.push({type:"html_inline",tag:k,loading:!0,content:`</${k}>`})):v.children=[{type:"html_block",loading:!0,tag:k,content:String(v.children[0]?.content??"")+String(v.children[1]?.content??"")}];continue}else if(v.children.length===3&&v.children[0].type==="html_inline"&&v.children[2].type==="html_inline"){const k=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(k))continue;v.children=[{type:"html_block",loading:!1,tag:k,content:v.children.map(M=>M.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const y=String(v.content),C=v,L=C.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(C.children.length=0);continue}const $=String(L.content??y).match(QB)?.[1]?.toLowerCase()??"";if($){if(/\/\s*>\s*$/.test(y)||RT.has($)){C.children=[{type:"html_inline",content:y}];continue}C.children.length=0}}})}function uF(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 dF(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const o=n.tokens??[];for(let s=0;s<o.length;s++){const i=o[s];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&&!uF(l[0]??"")){const a=l[0]??"",c=i.level??0;o.splice(s,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}),s+=2}}})}const BT=/\.([a-z0-9]{1,15})$/i,fF=/[_()[\]{}<>]/u,pF=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,hF=/[?#@]/u,mF=/[\\/]/u,gF=/^[\p{L}\p{N}./\\-]+$/u,vF=/^[A-Za-z0-9-]{1,63}$/u,yF=/^xn--[a-z0-9-]{2,59}$/i,kF=/^(?:[A-Z]{1,6}|\d{1,8})$/u,bF=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,_F=/文件名\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,wF=/文件名\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,SF=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,CF=new Set(["ai","md","py","rs","sh","zip"]),FT=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),xF=new Set([...FT,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),AF=new Set(["com","dev","io","page","site"]),TF=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),MF=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 Wu(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function pg(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Wu(n)?n:void 0}function xw(e,t){if(!Wu(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 Aw(e){const t=rd(e);return Wu(t)?t:void 0}function EF(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Tw(e,t){if(!Wu(t))return;const n=String(e??"").trim().split(/\s+/u).map(EF).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>wp(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>wp(s,{marketTicker:!0}))&&(o.marketTicker=!0),Wu(o)?o:void 0}function sl(e,t=!1){let n;return{options(o){return t||o==null?xw(e,n):xw(e,pg(Aw(o),Tw(o,n)))},remember(o){const s=Aw(o);n=t?pg(n,s):pg(s,Tw(o,n))},reset(){n=void 0}}}function Mw(e){return vF.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function IF(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return Mw(n)||yF.test(n)?t.every(Mw):!1}function HT(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function $F(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function NF(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function WT(e,t,n){const o=$F(t);return HT(e)&&NF(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function rd(e){const t=String(e??"");return{explicitFilename:_F.test(t),filename:wF.test(t),marketTicker:SF.test(t)}}function LF(e){return IF(e.split(/[\\/]/)[0]??"")}function OF(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function PF(e){if(fF.test(e)||!gF.test(e))return!0;if(mF.test(e))return!LF(e);const t=e.replace(BT,"");return HT(t)?!0:t.split(".").filter(Boolean).some(OF)}function RF(e,t,n){if(!(n?xF:FT).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?bF:kF).test(o)}function wp(e,t={}){if(!e||pF.test(e)||hF.test(e))return!1;const n=e.match(BT);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return RF(e,o,t.marketTicker===!0)?!0:MF.has(o)?!CF.has(o)||t.filename?!0:PF(e):!!(t.explicitFilename&&AF.has(o)||t.filename&&TF.has(o))}const Ew=["!"];function os(e){return{type:"text",content:e,raw:e}}function Sl(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 Cl(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 _r(e,t,n){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return{type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function DF(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(os(t))}}function Iw(e,t){let n=-1;for(const o of t){const s=e.indexOf(o);s!==-1&&(n===-1||s<n)&&(n=s)}return n}function BF(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function FF(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(o=>o?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function HF(e,t,n){let o="";for(let s=t+1;s<n;s++){const i=e[s];if(i?.type!=="text"||typeof i.content!="string")return null;o+=i.content}return o||null}function WF(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=zF(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function zF(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=rd(t);for(let o=0;o<=e.length-1;o++){o<0&&(o=0);const s=e[o];if(!s)break;if(s.type==="link_open"&&(s.markup==="linkify"||s.markup==="autolink")){let i=-1;for(let r=o+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=HF(e,o,i),l=BF(s);if(s.markup==="linkify"&&r&&!WT(r,l,t)&&wp(r,n)){e.splice(o,i-o+1,os(r));continue}const a=Iw(l,Ew);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=Iw(u.content,Ew);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let _=c+1;_<i;_++){const g=e[_];g?.type==="text"&&typeof g.content=="string"&&(p+=g.content)}u.content=h,u.raw=h;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let b=l;if(a!==-1)b=l.slice(0,a);else if(p){const _=encodeURI(p);if(_&&l.endsWith(_))b=l.slice(0,l.length-_.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(b=l.slice(0,v))}}b!==l&&FF(s,b),p&&e.splice(i+1,0,os(p));break}}}if(s?.type==="em_open"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("*")){const i=e[o-1].content?.replace(/(\*+)$/,"")||"";e[o-1].content=i,s.type="strong_open",s.tag="strong",s.markup="**";for(let r=o+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(s?.type==="text"&&s.content?.endsWith("(")&&e[o+1]?.type==="link_open"){const i=s.content.match(/\[([^\]]+)\]/);if(i){let r=s.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(os(r));const c=i[1],u=l[1].length;Sl(a,u);let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(_r(c,d,!e[o+4]?.content?.startsWith(")"))),Cl(a,u),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)\**/,"");f&&a.push(os(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(os(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(h+=e[o+4]?.content||"",e[o+4].content=""),Sl(a,f),a.push(_r(c,h,!e[o+4]?.content?.startsWith(")"))),Cl(a,f),e[o+4]?.type==="text"){const p=e[o+4].content?.replace(/^\)/,"");p&&a.push(os(p)),e.splice(o,5,...a)}else e.splice(o,4,...a);o===0?o=a.length-1:o-=a.length+1;continue}let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(_r(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(os(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}o-=a.length+1;continue}}else if(s.type==="link_open"&&s.markup==="linkify"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("(")){if(e[o-2]?.type==="link_close"){const i=[],r=e[o-3].content||"";let l=s.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[o+3]?.type==="text"){const a=(e[o+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[o+3]?.content?.slice(0,a)||"",e[o+3].content=""),i.push(_r(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(os(u)),e.splice(o-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(o-4,7,...i);continue}else if(e[o-1].content==="]("&&e[o-3]?.type==="text"&&e[o-3].content?.endsWith(")"))if(e[o-2]?.type==="strong_open"){const[i,r]=e[o-3].content?.split("[**")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else if(e[o-2]?.type==="em_open"){const[i,r]=e[o-3].content?.split("[*")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else{const[i,r]=e[o-3].content?.split("[")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}}if(s.type==="link_close"&&s.nesting===-1&&e[o-2]?.type==="link_open"&&e[o+1]?.type==="text"&&e[o-1]?.type==="text"){const i=e[o-1].content||"",r=e[o-2].attrs||[],l=r.find(p=>p[0]==="href")?.[1]||"",a=r.find(p=>p[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;Sl(f,p)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let p=o+1;p<e.length;p++){const m=d?d[1].length:e[o-3].markup.length,b=e[p];if(m===1&&b.type==="em_close")break;if(m===2&&b.type==="strong_close")break;if(m===3&&(b.type==="em_close"||b.type==="strong_close"))break;c+=1}}const h={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(h),d){const p=d[1].length;Cl(f,p)}e.splice(o-u,c,...f),o-=f.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].markup?.includes("*")&&e[o-4]?.type==="text"&&e[o-4].content?.endsWith("[")){const i=e[o-1].markup.length,r=[],l=e[o-4].content.slice(0,e[o-4].content.length-i);l&&r.push(os(l)),Sl(r,i);const a=e[o-2].content||"";let c=s.content.slice(2),u=!0;if(e[o+1]?.type==="text"){const d=(e[o+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[o+1]?.content?.slice(0,d)||"",e[o+1].content="")}if(r.push(_r(a,c,u)),Cl(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(os(d)),e.splice(o-4,8,...r)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...r):e.splice(o-4,7,...r);o-=r.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].type==="strong_close"&&e[o-4]?.type==="text"&&e[o-4]?.content?.includes("**[")){const i=[],r=e[o-4].content.split("**[")[0];r&&i.push(os(r)),Sl(i,2);const l=e[o-2].content||"";let a=s.content.slice(2),c=!0;if(e[o+1]?.type==="text"){const u=(e[o+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[o+1]?.content?.slice(0,u)||"",e[o+1].content="")}if(i.push(_r(l,a,c)),Cl(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(os(u)),e.splice(o-4,8,...i)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...i):e.splice(o-4,7,...i);o-=i.length+1;continue}else if(s.type==="strong_close"&&e[o+1]?.type==="text"&&e[o+1].content?.includes("](")&&e[o-1].type==="text"&&/\[.*$/.test(e[o-1].content||"")){const i=[],[r,l]=e[o-1].content?.split("[")||["",""];r&&i.push(os(r)),Sl(i,2);let[a,c]=e[o+1].content.split("](");a=l+a;let u=4;if(e[o+2]?.type==="link_open"){const f=e[o+2].attrs?.find(h=>h[0]==="href")?.[1];e[o+5]?.type==="text"&&e[o+5].content==="."?(c=(f||c)+e[o+5].content,e[o+5].content=""):c=f||c,u+=3}let d=!0;if(s.nesting===-1&&(a=a.replace(/\*+$/,"")),e[o+2]?.type==="text"){const f=(e[o+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[o+2]?.content?.slice(0,f)||"",e[o+2].content="")}i.push(_r(a,c,d)),Cl(i,2),e.splice(o-2,u,...i)}if(s.type==="text"&&/\*+\[[^\]]*$/.test(s.content||"")&&e[o+1]?.type==="strong_open"&&e[o+2]?.type==="text"&&e[o+2].content==="]("&&e[o+3]?.type==="link_open"&&e[o+5]?.type==="link_close"&&e[o+6]?.type==="text"&&e[o+6].content===")"&&e[o+7]?.type==="strong_close"){const i=(s.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[o+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[o+4]?.type==="text"&&(l=e[o+4].content||"");const a=[];Sl(a,2),a.push(_r(r,l,!1)),Cl(a,2),e.splice(o,9,...a),o-=a.length-1;continue}}}for(let o=0;o<e.length-1;o++){const s=e[o],i=e[o+1];if(s?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(s.href??"");if(String(s.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;DF(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function UF(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=qF(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function qF(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 jF(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=VF(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function VF(e){let t=0;const n=new Set,o=new Set;let s=0;for(let u=0;u<e.length;u++){const d=e[u],f=d.type;if(f==="strong_open"){t++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const _=e[b];h==="__"&&(m?.content?.endsWith("_")||_?.content?.startsWith("_")||_?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="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(f==="em_open"){s++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const _=e[b];h==="_"&&(m?.content?.endsWith("_")||_?.content?.startsWith("_")||_?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,o.add(s))}else f==="em_close"&&(o.has(s)&&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),s--,s<0&&(s=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,f=[{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:""}],h=c.slice(0,-1);h&&f.unshift({type:"text",content:h,raw:h}),l.splice(i,d,...f)}return l=KF(l),l}function KF(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(o?.type==="strong_open"&&s?.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 f=u.slice(0,d),h=u.slice(d+2);t.push(o),t.push(s),t.push(l),f&&t.push({...c,type:"text",content:f,raw:f}),t.push(a),h&&t.push({...c,type:"text",content:h,raw:h}),n+=6;continue}}if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=GF(e,n+6);if(u){t.push(o),t.push(s),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(o)}return t}function GF(e,t){for(let n=t;n<e.length;n++){const o=e[n];if(o?.type==="strong_open")return null;if(o?.type!=="text")continue;const s=String(o.content??""),i=s.indexOf("**");if(i!==-1)return{index:n,beforeClose:s.slice(0,i),afterClose:s.slice(i+2)}}return null}function YF(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=tH(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(o)&&(n.tokens=o)}catch(o){console.error("[applyFixTableTokens] failed to fix table tokens",o)}})}function $w(){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 Nw(){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 Lw(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 zT(e,t){if(!e.startsWith("|")||e.includes(`
|
|
144
|
+
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(o=>o.trim().length>0)?n:null}function hg(e){return zT(e)!==null}function UT(e){return/^:?-+:?$/.test(e.trim())}function XF(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(UT)}function QF(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function ZF(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(UT)&&QF(n)}function JF(e){return e==="|"||e==="|:"}function eH(e){const t=zT(e);return t!==null&&t.every(n=>!n.includes(":"))}function tH(e,t=!1,n=""){const o=[...e];if(e.length<3)return o;const s=e.length-2,i=e[s];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
145
|
+
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
146
|
+
`),d=!t&&!r.includes(`
|
|
147
|
+
`)&&/\r?\n$/.test(n)&&hg(r);if(!t&&(r.includes(`
|
|
148
|
+
`)&&u.length===0&&hg(a)&&ZF(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>Lw(p)),h=[...$w(),...f,...Nw()];o.splice(s-1,3,...h)}else if(r.includes(`
|
|
149
|
+
`)&&u.length===0&&hg(a)&&XF(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>Lw(p)),h=[...$w(),...f,...Nw()];o.splice(s-1,3,...h)}else r.includes(`
|
|
150
|
+
`)&&u.length===0&&eH(a)&&JF(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function nH(e,t,n,o){const s=e.length;if(n==="$$"&&o==="$$"){let c=t;for(;c<s-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=o;let l=0,a=t;for(;a<s;){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 oH=nH;const sH=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Sp=sH.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),iH=/\\[a-z]+/i,qT="(?:\\\\|\\u0008)",rH=new RegExp(String.raw`${qT}(?:${Sp})\s*\{[^}]+\}`,"i"),lH=new RegExp(String.raw`(?:${qT})?(?:${Sp})\s*\{`,"i"),aH=/\\(?:text|frac|left|right|times)/,cH=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,uH=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,dH=/[A-Z]+\s*\([^)]+\)/i,fH=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,pH=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,hH=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,mH={"\b":"\\b","\v":"\\v","\f":"\\f"};function gH(e){let t="";for(const n of e)t+=mH[n]??n;return t}function La(e){if(!e)return!1;const t=gH(e),n=t.trim();if(hH.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=iH.test(t),s=rH.test(t),i=lH.test(t),r=aH.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=cH.test(t)&&!uH.test(t),c=dH.test(t),u=fH.test(n),d=pH.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||h}const jT="__markstreamMathPluginApplied",Yv=80,VT=2e4,Ow=VT+4096;function KT(e){return!!e[jT]}function vH(e){e[jT]=!0}const GT=["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"],yH=["cdot","mathbf{","partial","mu_{"],YT=GT.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),XT="[ \r\b\f\v]",kH=new RegExp(`([^\\\\])(${yH.map(e=>e).join("|")})+`,"g"),bH=/span\{([^}]+)\}/,_H=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,wH=/(^|[^\\])\\\r?\n/g,SH=/(^|[^\\])\\$/g,CH=new RegExp(`(${XT})|(${YT})\\b`,"g"),Pw=new Map,Rw=new Map;function xH(e){if(!e)return CH;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=Pw.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${XT})|(${s})\\b`,"g");return Pw.set(n,i),i}function AH(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=Rw.get(o);if(s)return s;const i=e?[Sp,YT].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Sp].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return Rw.set(o,r),r}const Dw={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Bw(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Fw(e){const t=/(^|[^\\])(__|\*\*)/g;let n,o=null;for(;(n=t.exec(e))!==null;)o={marker:n[2],index:n.index+(n[1]?.length??0)};return o}function wr(e,t){const n=t?.commands??GT,o=t?.escapeExclamation??!0,s=t?.commands==null,i=xH(s?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&Dw[u]!==void 0)return`\\${Dw[u]}`;if(d&&n.includes(d)){const p=h&&typeof f=="number"?h[f-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${d}`}return c});o&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=AH(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(bH,"span\\{$1\\}").replace(_H,"\\operatorname{span}\\{$1\\}"),l=l.replace(wH,`$1\\\\
|
|
151
|
+
`),l=l.replace(SH,"$1\\\\"),l=l.replace(kH,"$1\\$2"),l}function Hw(e){const t=e.trim();return!(!La(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 QT(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const o=n;let s=1;for(;o+s<e.length&&e[o+s]==="`";)s++;let i=o+s,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===s){r=i;break}i+=l}if(r!==-1){t.push([o,r+s]),n=r+s;continue}n=o+s}return t}function Cp(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function TH(e,t=!1){const n=[];let o=0;for(;o<e.length-1;){if(e[o]==="!"&&e[o+1]==="["){const s=o;let i=o+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([s,l]),o=l;continue}if(t){n.push([s,e.length]),o=e.length;continue}}}o++}return n}function ld(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function Xv(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(ld(e,o)){n=o+1;continue}return o}return-1}function mg(e,t){let n=t;for(;n<e.length;){const o=Xv(e,n);if(o===-1)return-1;if(o>0&&e[o-1]==="$"||o+1<e.length&&e[o+1]==="$"){n=o+1;continue}return o}return-1}function Qc(e,t,n=0){let o=Math.max(0,n);for(;o<e.length;){const s=e.indexOf(t,o);if(s===-1)return-1;if(!ld(e,s))return s;o=s+Math.max(1,t.length)}return-1}function Ww(e,t,n=0,o=e.length,s=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,o));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=Cp(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}ld(e,a)||i++,r=a+Math.max(1,t.length)}return i}function P0(e,t,n){const o=Uu(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!Uu(o.slice(0,s)).trim()||ld(o,s))return-1;const i=QT(o);if(Cp(i,s))return-1;const r=Ww(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>Ww(o,n,0,s,i))return-1;return s}function zu(e){return e===" "||e===" "}function Uu(e){let t=e.length;for(;t>0&&zu(e[t-1]);)t--;return e.slice(0,t)}function zw(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
152
|
+
`&&t++;return t}function Uw(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function MH(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(s===t){n++;continue}if(!zu(s))return!1}return n>=3}function EH(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let o=0;for(;t[n]==="-";)o++,n++;return o<3?!1:(t[n]===":"&&n++,n===t.length)}function IH(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(EH)}function $H(e){let t=0;if(!Uw(e[t]))return!1;for(;Uw(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:zu(e[t+1])}function ZT(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&zu(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&zu(t[1])||$H(t)||MH(t)||IH(t))}function qw(e,t){return e?t?`${e}
|
|
153
|
+
${t}`:e:t}function Qv(e){const t=String(e??"").trim();return t?La(t):!1}function jw(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function JT(e){if(e.length<=Ow)return{source:e,lineOffset:0};let t=e.length-Ow;const n=e.indexOf(`
|
|
154
|
+
`,t);return n===-1?{source:"",lineOffset:zw(e)}:(t=n+1,{source:e.slice(t),lineOffset:zw(e.slice(0,t))})}function eM(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=JT(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-Yv-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=Uu(o[r]);if(l&&!ZT(l)){for(const[a,c]of i)if(P0(l,a,c)!==-1)return!0}}return!1}function NH(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=JT(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-Yv-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=Uu(s[l]);for(const[c,u]of r){const d=P0(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<s.length;p++){if(p-l>Yv){h=!0;break}const m=s[p],b=Qc(m,u);if(b!==-1){const _=qw(f,m.slice(0,b));if(!Qv(_)){h=!0;break}const g=m.slice(b+u.length),v=g.trim()?`suffix:${jw(g)}`:"nosuffix";return["closed",c,o+l,d,o+p,b,jw(_),v].join(":")}if(ZT(m)){h=!0;break}if(f=qw(f,m),f.length>VT){h=!0;break}}if(!h&&Qv(f))return["pending",c,o+l,d].join(":")}}return null}function gg(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function LH(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const o=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(o)?!1:o===""||/^[)\s,.!?;:]/.test(o)}function vg(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function OH(e,t){vH(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},o=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(g,v)=>{let y=v;for(;y<g.length&&(g[y]===" "||g[y]===" ");)y++;if(y===v||!(g[y]===`
|
|
155
|
+
`||g[y]==="\r"&&g[y+1]===`
|
|
156
|
+
`))return v;const C=g.slice(v,y),L=a.push("text","",0);return L.content=C,y};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let g=a.pos+1;for(;a.src[g]==="$";)g++;const v=g-a.pos,y=a.src[g];if(v>=3&&(!y||/\s/.test(y))){const C=a.push("text","",0);return C.content=a.src.slice(a.pos,g),a.pos=g,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let m=p,b=p;const _=p;for(const[g,v]of f){const y=a.src,C=QT(y),L=TH(y,u);let $=!1;g==="$$"&&m!==_&&(m=_);let k=-1,M=-1,E=0;const O=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const D=a.push("text_special","",0);D.content=S==="\\)"?")":"(",D.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let D=0;for(;D<S.length;){const H=Xv(S,D);if(H===-1){const qe=S.slice(D);if(qe){const Fe=a.push("text","",0);Fe.content=qe,a.pos=a.pos+qe.length,m=a.pos}break}if(H>0&&S[H-1]==="$"||H+1<S.length&&S[H+1]==="$"){const qe=S.slice(D,H+1);if(qe){const Fe=a.push("text","",0);Fe.content=qe,a.pos=a.pos+qe.length,m=a.pos}D=H+1;continue}const z=S.slice(D,H);if(z){const qe=a.push("text","",0);qe.content=z,a.pos=a.pos+z.length,m=a.pos}const U=mg(S,H+1);if(U===-1){const qe=S.slice(H),Fe=a.push("text","",0);Fe.content=qe,a.pos=a.pos+qe.length,m=a.pos;break}const Q=S.slice(H+1,U),X=Q.includes("`"),ue=!Q||!Q.trim(),me=S[U+1],Ae=gg(Q,me),be=vg(Q);if(!X&&!ue&&!Ae&&!be){const qe=a.push("math_inline","math",0);qe.content=wr(Q,t),qe.markup="$",qe.raw=`$${Q}$`,qe.loading=!1,a.pos=a.pos+(U-H+1),m=a.pos,D=U+1;continue}const ze=a.push("text","",0);ze.content="$",a.pos=a.pos+1,m=a.pos,D=H+1}return}const I=S.indexOf("![");if(I!==-1){if(I>0){const z=S.slice(0,I),U=a.push("text","",0);U.content=z,a.pos=a.pos+z.length,m=a.pos}const D=S.slice(I).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(D){const[,z,U]=D,Q=U.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),X=Q?Q[1]:U,ue=Q&&Q[2]?Q[2]:null,me=a.push("image","img",0);me.attrs=[["src",X],["alt",z]],ue&&me.attrs.push(["title",ue]),me.content=z,me.children=[{type:"text",content:z,tag:""}],a.pos=a.pos+D[0].length,m=a.pos;const Ae=S.slice(I+D[0].length);Ae&&O(Ae);return}const H=a.push("text","",0);H.content=S,a.pos=a.pos+S.length,m=a.pos;return}const P=a.push("text","",0);P.content=S,a.pos=a.pos+S.length,m=a.pos};for(;!(m>=y.length);){const S=y.indexOf(g,m);if(S===-1)break;if(ld(y,S)){m=S+Math.max(1,g.length);continue}const I=Cp(C,S);if(I){m=I[1];continue}const P=Cp(L,S);if(P){m=P[1];continue}if(S===k&&m===M){if(E++,E>2){m=S+Math.max(1,g.length);continue}}else E=0,k=S,M=m;if(g==="("&&S>0){let Ae=S-1;for(;Ae>=0&&y[Ae]===" ";)Ae--;if(Ae>=0&&y[Ae]==="]"){m=S+g.length;continue}}if(g==="$"&&S>0&&y[S-1]==="$"){m=S+1;continue}if(g==="$"&&S<y.length-1&&y[S+1]==="$"){m=S+2;continue}const D=g==="$"?mg(y,S+g.length):oH(y,S+g.length,g,v);if(D===-1){const Ae=y.slice(S+g.length);if(Ae.includes(g)){m=y.indexOf(g,S+g.length);continue}if(D===-1){const be=g==="$"&&LH(Ae);if(u&&!c&&!be&&La(Ae)&&!Ae.includes("`")){if(m=S+g.length,$=!0,!l){a.pending="";const ze=b?y.slice(b,m):y.slice(0,m),qe=Bw(ze)%2===1;if(b)O(y.slice(b,m));else{let Fe=y.slice(0,m);Fe.endsWith(g)&&(Fe=Fe.slice(0,Fe.length-g.length)),O(Fe)}if(qe){const Fe=Fw(ze)?.marker??"**",Le=a.push("strong_open","",0);Le.markup=Fe;const le=a.push("math_inline","math",0);le.content=wr(Ae,t),le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",le.raw=`${g}${Ae}${v}`,le.loading=!0,Le.content=Ae,a.push("strong_close","",0)}else{const Fe=a.push("math_inline","math",0);Fe.content=wr(Ae,t),Fe.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Fe.raw=`${g}${Ae}${v}`,Fe.loading=!0}a.pos=y.length}m=y.length,b=m}break}}const H=y.slice(S+g.length,D),z=H.includes("`"),U=!H||!H.trim(),Q=g==="$",X=y[D+v.length],ue=Q&&gg(H,X),me=Q&&vg(H);if(c?z||U||ue||me:z||U||ue||me||!Q&&!La(H)){m=D+v.length;const Ae=y.slice(a.pos,m);a.pending||(O(Ae),b=m);continue}if($=!0,!l){const Ae=y.slice(a.pos-(a.pending??"").length,S);let be=y.slice(0,m)?y.slice(b,S):Ae;const ze=Bw(be)%2===1;S!==a.pos&&ze&&(be=a.pending+y.slice(a.pos,S));const qe=ze?Fw(be):null,Fe=qe?.marker??"**";if(a.pending!==be)if(a.pending="",ze)if(qe){const Le=be.slice(qe.index+Fe.length);O(be.slice(0,qe.index));const le=a.push("strong_open","",0);le.markup=Fe;const F=a.push("text","",0);F.content=Le,a.push("strong_close","",0)}else O(be);else O(be);if(ze){const Le=a.push("strong_open","",0);Le.markup=Fe;const le=a.push("math_inline","math",0);le.content=wr(H,t),le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",le.raw=`${g}${H}${v}`,le.loading=!1;const F=y.slice(D+v.length).startsWith(Fe);return F&&a.push("strong_close","",0),a.pos=d(y,D+v.length),m=a.pos,b=m,F||a.push("strong_close","",0),!0}else{const Le=a.push("math_inline","math",0);Le.content=wr(H,t),Le.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Le.raw=`${g}${H}${v}`,Le.loading=!1}}return m=d(y,D+v.length),b=m,a.pos=m,!0}if($){if(l)a.pos=m;else{if(g==="$$"&&m<y.length&&y.slice(m).includes("$")){let S=m;for(;!(S>=y.length);){const I=Xv(y,S);if(I===-1)break;if(I+1<y.length&&y[I+1]==="$"){S=I+2;continue}if(I>0&&y[I-1]==="$"){S=I+1;continue}const P=mg(y,I+1);if(P===-1)break;const D=y.slice(I+1,P),H=D.includes("`"),z=!D||!D.trim(),U=y[P+1],Q=gg(D,U),X=vg(D);if(!H&&!z&&!Q&&!X){const ue=y.slice(m,I);ue&&O(ue);const me=a.push("math_inline","math",0);me.content=wr(D,t),me.markup="$",me.raw=`$${D}$`,me.loading=!1,m=P+1,S=P+1}else O("$"),S=I+1}S<y.length&&O(y.slice(S))}else m<y.length&&O(y.slice(m));a.pos=y.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let m=u.src.slice(p,u.eMarks[l]).trim(),b=!1,_="",g="",v=!1,y="",C=!1;for(const[ue,me]of h)if(m.startsWith(ue))if(ue.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){b=!0,_=ue,g=me;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){b=!0,_=ue,g=me;break}continue}else{const Ae=u.tokens[u.tokens.length-1];if(Ae&&Ae.type==="list_item_open"&&Ae.mark==="-"&&m.slice(ue.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const be=m.indexOf("]");if(m.slice(be).trim()!=="]")continue;const ze=m.slice(ue.length,be);if(ue==="["?Hw(ze):La(ze)){b=!0,_=ue,g=me;break}continue}}else{b=!0,_=ue,g=me;break}else if((ue==="$$"||ue==="\\[")&&m.endsWith(ue)&&l+1<a){const Ae=P0(m,ue,me);if(Ae===-1)continue;y=Uu(m.slice(0,Ae)),C=!0;const be=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(be,u.eMarks[l+1]).trim(),v=!0,b=!0,_=ue,g=me;break}if(!b)return!1;if(c&&!C)return!0;const L=m.indexOf(_),$=L+_.length,k=!f&&_==="["?m.indexOf("\\]",$):-1,M=k>=0?"\\]":g,E=k>=0?k:Qc(m,g,$);if(!v&&E>_.length){const ue=m.slice(L+_.length,E),me=u.push("math_block","math",0);me.content=wr(ue),me.markup=_==="$$"?"$$":_==="["?"[]":"\\[\\]",me.map=[l,l+1],me.raw=`${_}${ue}${M}`,me.block=!0,me.loading=!1,u.line=l+1;const Ae=m.slice(E+M.length);return Ae.trim()&&n(u,Ae,l),!0}let O=l,S="",I=!1,P="",D=l;const H=v?m:m===_?"":m.slice(_.length),z=!f&&_==="\\["?"]":"",U=Qc(H,g);if(U!==-1){const ue=U;S=H.slice(0,ue),P=H.slice(ue+g.length),D=v?l+1:l,I=!0,O=D}else for(H&&!v&&(S=H),O=l+1;O<a;O++){const ue=u.bMarks[O]+u.tShift[O],me=u.eMarks[O],Ae=u.src.slice(ue,me),be=Ae.trim();if(!f&&_==="["&&be==="\\]"){g="\\]",I=!0;break}if(z&&Ae.trim()===z){g=z,I=!0;break}if(be===g){I=!0;break}else if(!f&&_==="["&&Ae.includes("\\]")){I=!0;const ze=Ae.indexOf("\\]");g="\\]";const qe=Ae.slice(0,ze);qe&&(S+=(S?`
|
|
157
|
+
`:"")+qe),P=Ae.slice(ze+g.length),D=O;break}else if(Qc(Ae,g)!==-1){I=!0;const ze=Qc(Ae,g),qe=Ae.slice(0,ze);qe&&(S+=(S?`
|
|
158
|
+
`:"")+qe),P=Ae.slice(ze+g.length),D=O;break}S+=(S?`
|
|
159
|
+
`:"")+Ae}if((!d||f)&&!I)return!1;const Q=/^\s*!\[/.test(S);if(!(C?!Q&&Qv(S):_==="$$"?!Q:_==="["?Hw(S):La(S)))return!1;if(c)return!0;y&&n(u,y,l);const X=u.push("math_block","math",0);return X.content=wr(S),X.markup=_==="$$"?"$$":_==="["?"[]":"\\[\\]",X.raw=`${_}${S}${S.startsWith(`
|
|
160
|
+
`)?`
|
|
161
|
+
`:""}${g}`,X.map=[l,O+1],X.block=!0,X.loading=!I,u.line=O+1,P.trim()&&n(u,P,D),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function PH(e){const t=e.renderer.rules.image||function(n,o,s,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,o,s):""};e.renderer.rules.image=(n,o,s,i,r)=>{const l=n;return l[o].attrSet?.("loading","lazy"),t(l,o,s,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,o)=>{const s=n[o],i=String(s.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(s.content??""))}</code></pre>`})}function RH(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},o=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new SB({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!Hl(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&OH(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&zB(i),e.enableFixIndentedCodeBlock!==!1&&dF(i),WF(i),jF(i),UF(i),YF(i),PH(i),cF(i,{customHtmlTags:e.customHtmlTags}),i}function Wl(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=>Wl(n))),t}function DH(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function BH(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,o=n===""||n==="true";return{type:"checkbox_input",checked:o,raw:o?"[x]":"[ ]"}}function FH(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function of(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];s+=String(e[i].content??l.text??""),r.push(e[i]),i++}return o.push(...Vn(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const Vw=/\r?\n[ \t]*`+\s*$/,tM=["diff ","index ","--- ","+++ ","@@ "],HH=/\r?\n/;function WH(e){const t=String(e??"");return t?tM.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function Kw(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function zH(e,t){const n=[],o=[],s=[],i=[],r=e.split(HH),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!tM.some(m=>p.startsWith(m)))if(p.startsWith("-")){const m=p.slice(1);s.push(!a&&m.startsWith(" ")?` ${m}`:m)}else if(p.startsWith("+")){const m=p.slice(1);i.push(!a&&m.startsWith(" ")?` ${m}`:m)}else{Kw(n,o,s,i);const m=a&&p.startsWith(" ")?p.slice(1):p;n.push(m),o.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let h=0;h<u;h++){const p=r[h]??"";!t&&!l&&h===u-1&&WH(p)||c(p)}(t||s.length>0||i.length>0)&&Kw(n,o,s,i);const d=n.join(`
|
|
162
|
+
`),f=o.join(`
|
|
163
|
+
`);return{original:t&&l&&d?`${d}
|
|
164
|
+
`:d,updated:t&&l&&f?`${f}
|
|
165
|
+
`:f}}function R0(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},o=typeof n.closed=="boolean"?n.closed:void 0,s=o===!0||o!==!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(Vw.test(a)&&(a=a.replace(Vw,"")),r){const{original:c,updated:u}=zH(a,s===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t}}function UH(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function qH(){return{type:"hardbreak",raw:`\\
|
|
166
|
+
`}}function jH(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...Vn(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let yg=null;const kg=new WeakMap;function Gw(){return yg||(yg={customTagSet:null,allowedTagSet:wh()}),yg}function nM(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function oM(e){return/^<\s*\//.test(e)}function sM(e,t){return/\/\s*>\s*$/.test(t)||Ql.has(e)}function VH(e){if(!e||e.length===0)return Gw();const t=kg.get(e);if(t)return t;const n=e.map(Js).filter(Boolean);if(!n.length){const s=Gw();return kg.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:wh({customHtmlTags:e})};return kg.set(e,o),o}function iM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function KH(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function xp(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function GH(e,t,n){const o=e.slice();return xp(o,"href")||o.push(["href",t]),n!=null&&!xp(o,"title")&&o.push(["title",n]),o}function Zv(e){return e.map(iM).join("")}function Tf(e){const t=[],n=o=>{const s=String(o??"");if(!s)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${s}`,i.raw=`${i.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const o of e)if(o){if(o.type==="reference"||o.type==="footnote_reference"){n(String(o.raw??""));continue}if("children"in o&&Array.isArray(o.children)){t.push({...o,children:Tf(o.children)});continue}t.push(o)}return t}function YH(e,t,n){let o=0;for(let s=t;s<e.length;s++){const i=e[s];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=nM(r),a=oM(r),c=sM(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function bg(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?YH(e,t+1,n):-1;return l!==-1?(s=e.slice(t+1,l),o.push(...s,e[l]),i=l+1,r=!0):(s=e.slice(t+1),s.length&&o.push(...s),i=e.length),{closed:r,html:Zv(o),innerTokens:s,nextIndex:i}}function XH(e,t,n,o,s,i,r){const l=String(e.content??""),a=nM(l),{customTagSet:c,allowedTagSet:u}=VH(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!bg(t,n,a).closed){const C=iM(e);return[{type:"text",content:C,raw:C},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=oM(l),f=sM(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const C=bg(t,n,a),L=kh(l),$=C.innerTokens,k=String(xp(L,"href")??""),M=xp(L,"title"),E=M==null?null:String(M),O=GH(L,k,E),S=Tf($.length?o($,s,i,r):[]),I=$.length?Zv($):k||"";return!S.length&&I&&S.push({type:"text",content:I,raw:I}),[{type:"link",href:k,title:E,text:I,attrs:O,children:S,loading:!C.closed,raw:C.html||l},C.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=bg(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Tf(h.innerTokens.length?o(h.innerTokens,s,i,r):[]),raw:h.html},h.nextIndex];const p=Tf(h.innerTokens.length?o(h.innerTokens,s,i,r):[]);let m=h.html||l,b=!h.closed,_=!1;if(!h.closed){const C=`</${a}>`;m.toLowerCase().includes(C.toLowerCase())||(m+=C),_=!0,b=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(l))!==null;){const C=y[1],L=y[2]||y[3]||y[4]||"";g.push([C,L])}if(c?.has(a)){const C=KH(e);return[{type:a,tag:a,attrs:g,content:C?C.inner:h.innerTokens.length?Zv(h.innerTokens):"",children:h.innerTokens.length?o(h.innerTokens,s,i,r):[],raw:C?.raw??m,loading:e.loading||b,autoClosed:_},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:p,raw:m,loading:b,autoClosed:_},h.nextIndex]}function rM(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=>rM(t)).join(""):String(e.content??"")}function QH(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>rM(t)).join("")}function Yw(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=QH(o??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):o?.content!=null&&String(o.content).length>0?l=String(o.content):Array.isArray(o?.children)&&o.children[0]?.content?l=String(o.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:s,alt:l,title:c,raw:u,loading:t}}function ZH(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function JH(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...Vn(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function eW(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const o=n?.[0];o&&t.push([String(o),String(n?.[1]??"")])}return t}function Ap(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function tW(e,t,n){const o=e.slice();return Ap(o,"href")||o.push(["href",t]),n!=null&&!Ap(o,"title")&&o.push(["title",n]),o}function sf(e,t,n){const o=e[t],s=eW(o.attrs),i=String(Ap(s,"href")??""),r=Ap(s,"title"),l=r==null?null:String(r),a=tW(s,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 f=u;const h=u[u.length-1];if(n?.__insideStrong&&h?.type==="text"&&String(h.content??"").endsWith("**")&&!u.some(b=>b.type==="strong_open")){const b=String(h.content??""),_=String(h.raw??b),g=Wl(h);g.content=b.slice(0,-2),g.raw=_.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const p=Vn(f,void 0,void 0,n),m=p.map(b=>{const _=b;return"content"in b?String(_.content??""):String(_.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:p,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function Xw(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 nW(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function Qw(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...Vn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const oW=/\\([\\()[\]`$|*_\-!])/g;function sW(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(oW,"$1")===t))return n}function zc(e,t,n,o){const s=[];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={...o,__insideStrong:!0};return s.push(...Vn(l,sW(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function iW(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)s+=String(e[i].content??""),r.push(e[i]),i++;o.push(...Vn(r,void 0,void 0,n));const l=String(e[t].content??""),a=s||l;return{node:{type:"subscript",children:o.length>0?o:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function rW(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...Vn(r,void 0,void 0,n)),{node:{type:"superscript",children:o.length>0?o:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function lW(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const aW=/[^~]*~{2,}[^~]+/,cW=/\*\*/,uW=/[[_*^~]/,dW=/\\([\\()[\]`$|*_\-!])/g,D0=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),fW=/\s/u,pW=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,hW=/\p{P}/u,mW=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,gW=/:\/\//;function vW(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 lM(e,t=0){if(!e)return-1;let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&D0.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function Xr(e){return!!e&&fW.test(e)}function Qr(e){return!!e&&(pW.test(e)||hW.test(e))}function yW(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||Xr(o)?!1:!(Qr(o)&&n&&!Xr(n)&&!Qr(n))}function kW(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||Xr(n)?!1:!(Qr(n)&&o&&!Xr(o)&&!Qr(o))}function bW(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?lM(e,o):t.indexOf("*",o);if(i===-1)break;if(kW(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function _W(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||Xr(o)?!1:!(Qr(o)&&n&&!Xr(n)&&!Qr(n))}function wW(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||Xr(n)?!1:!(Qr(n)&&o&&!Xr(o)&&!Qr(o))}function SW(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(wW(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function CW(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let o=0;for(;n+o<e.length&&e[n+o]==="\\";)o++;const s=e[n+o];if(t+="\\".repeat(Math.floor(o/2)),o%2===1){if(s&&D0.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function xW(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&D0.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function AW(e,t,n){const o=xW(e,t);if(o===-1||e[o]!==n)return!1;let s=0;for(let i=o-1;i>=0&&e[i]==="\\";i--)s++;return s%2===1}const TW=/[\p{L}\p{N}]/u,MW=/^[\p{L}\p{N}]+$/u;function Jv(e){return e?TW.test(e):!1}function aM(e){return e?MW.test(e):!1}function fu(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const o=t>0?e[t-1]:void 0,s=n<e.length?e[n]:void 0;return{len:n-t,prev:o,next:s,intraword:Jv(o)&&Jv(s)}}function EW(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=fu(e,n),s=n+o.len;o.len>=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n<t.length-1;n++){const o=t[n],s=t[n+1];if(!aM(e.slice(o.end,s.start)))return s.end}return-1}function IW(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function $W(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=fu(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function NW(e){return e?mW.test(e)||gW.test(e):!1}function LW(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Vn(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=rd(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function p(){c=null}function m(F,te){const ee=e.length===1?t:String(te.content??""),q=[],Y=EW(F);if(Y!==-1){C(F.slice(0,Y),F.slice(0,Y));const ne=F.slice(Y);return ne&&(E({type:"text",content:ne,raw:ne}),u--),u++,!0}if(aW.test(F)){const ne=F.indexOf("~~");ne!==-1&&q.push({type:"strikethrough",index:ne})}if(cW.test(F)){const ne=F.indexOf("**");ne!==-1&&q.push({type:"strong",index:ne})}if(/[^*]*\*[^*]+/.test(F)){const ne=ee?lM(ee,0):F.indexOf("*");if(ee&&ne===-1)return!1;ne!==-1&&q.push({type:"emphasis",index:ne})}q.sort((ne,ce)=>ne.index!==ce.index?ne.index-ce.index:ne.type===ce.type?0:ne.type==="strong"?-1:ce.type==="strong"?1:0);const de=q[0];if(!de)return!1;if(de.type==="strikethrough"){const ne=de.index,ce=ne>-1?F.slice(0,ne):"";if(ce&&C(ce,ce),ne===-1)return u++,!0;const j=F.indexOf("~~",ne+2),G=j===-1?F.slice(ne+2):F.slice(ne+2,j),re=j===-1?"":F.slice(j+2),{node:he}=Qw([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:G,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return p(),y(he),re&&(E({type:"text",content:re,raw:re}),u--),u++,!0}if(de.type==="strong"){const ne=de.index,ce=ne>-1?F.slice(0,ne):"";if(ce&&C(ce,ce),ne===-1)return u++,!0;if(t&&ne===0){let Ee=!1,ae=0;for(;ae<F.length&&F[ae]==="*";)ae++;if(t.startsWith("\\*")&&(Ee=!0),Ee){let xe=0,Ke=0;for(;Ke<t.length&&xe<ae;)if(t[Ke]==="\\"&&Ke+1<t.length&&t[Ke+1]==="*")xe+=1,Ke+=2;else{if(t[Ke]==="*")break;Ke++}if(xe>=2)return C(F,F),u++,!0}}if(t&&(F.match(/\*/g)||[]).length>vW(t))return C(F.slice(ce.length),F.slice(ce.length)),u++,!0;const j=fu(F,ne);if(j.len>=3){const Ee=$W(F,ne+j.len);if(Ee!==-1){const ae=F.slice(ne+j.len,Ee);if(IW(ae)){const{node:xe}=zc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ae,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,o);p(),y(xe);const Ke=F.slice(Ee+3);return Ke&&(E({type:"text",content:Ke,raw:Ke}),u--),u++,!0}}}if(!_W(F,ne)){const Ee=F.slice(ne,ne+j.len);C(Ee,Ee);const ae=F.slice(ne+j.len);return ae&&(E({type:"text",content:ae,raw:ae}),u--),u++,!0}const G=SW(F,ne+2);let re="",he="";if(G.index!==-1){re=F.slice(ne+2,G.index),he=F.slice(G.index+2);const Ee=G.index,ae=fu(F,Ee);if(j.intraword&&ae.intraword&&!aM(re)||!re&&j.len>=4&&j.intraword)return C(F.slice(ce.length),F.slice(ce.length)),u++,!0}else{if(d||G.sawInvalidClose||j.intraword)return C(F.slice(ce.length),F.slice(ce.length)),u++,!0;re=F.slice(ne+2),he=""}if(!re&&/^\*+$/.test(he))return C(F,F),u++,!0;const{node:Ce}=zc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:re,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return p(),y(Ce),he&&(E({type:"text",content:he,raw:he}),u--),u++,!0}if(de.type==="emphasis"){let ne=de.index;ne===-1&&(ne=0);const ce=F.slice(0,ne);if(ce&&C(ce,ce),!yW(F,ne)){C(F[ne],F[ne]);const Ee=F.slice(ne+1);return Ee&&(E({type:"text",content:Ee,raw:Ee}),u--),u++,!0}const j=fu(F,ne),G=bW(ee,F,ne+1),re=G.index,he=e[u+1];if(o?.final&&he?.type==="em_open"&&re!==-1&&F.slice(ne+1,re).trim()!==F.slice(ne+1,re)||re===-1&&(G.sawInvalidClose||o?.final||j.intraword||!Jv(F[ne+1])))return C(F.slice(ne),F.slice(ne)),u++,!0;const{node:Ce}=of([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:re>-1?F.slice(ne+1,re):F.slice(ne+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(p(),y(Ce),re!==-1&&re<F.length-1){const Ee=F.slice(re+1);Ee&&(E({type:"text",content:Ee,raw:Ee}),u--)}return u++,!0}return!1}function b(F,te){if(!F.includes("`"))return!1;const q=(he=>{for(let Ce=0;Ce<he.length;Ce++){if(he[Ce]!=="`")continue;let Ee=0;for(let ae=Ce-1;ae>=0&&he[ae]==="\\";ae--)Ee++;if(Ee%2===0)return Ce}return-1})(F);if(q===-1)return!1;let Y=1;for(let he=q+1;he<F.length&&F[he]==="`";he++)Y++;const de="`".repeat(Y),ne=q+Y,ce=F.indexOf(de,ne);if(ce===-1){if(Y===1){const Ce=F.slice(0,q),Ee=F.slice(q+1);return Ce&&(m(Ce,te)?u--:C(Ce,Ce)),g({type:"inline_code",code:Ee,raw:String(Ee)}),u++,!0}let he=F;for(let Ce=u+1;Ce<e.length;Ce++)he+=String((e[Ce].content??"")+(e[Ce].markup??""));return u=e.length-1,C(he,he),u++,!0}p();const j=F.slice(0,q),G=F.slice(q+Y,ce),re=F.slice(ce+Y);return j&&(m(j,te)?u--:C(j,j)),g({type:"inline_code",code:G,raw:String(G??"")}),re&&(E({type:"text",content:re,raw:re}),u--),u++,!0}function _(F){const te=l?.__markdownIt;if(!te||e.length<=1||!e.some(de=>de?.type==="math_inline")||!uW.test(F))return null;const ee=te.parseInline(F,{__markstreamFinal:!!o?.final});if(!Array.isArray(ee)||ee.length===0)return null;const q=(ee.find(de=>de?.type==="inline")?.children??[]).filter(de=>!(de?.type==="text"&&String(de.content??"")===""));if(!q.length||!q.some(de=>de?.type!=="text")||q.length===1&&q[0]?.type==="text"&&String(q[0].content??"")===F)return null;const Y=Vn(q,F,n,o);return Y.length?Y:null}function g(F){p(),a.push(F)}function v(F){p();const te=Wl(F);a.push(te)}function y(F){g(F)}function C(F,te){c?(c.content+=F,c.raw+=te??F):(c={type:"text",content:String(F??""),raw:String(te??F??"")},a.push(c))}function L(F,te){if(!F)return;const ee=Vn([{...te,type:"text",content:F,raw:F}],F,n,o);if(ee.length===1&&ee[0]?.type==="text"){const q=ee[0];C(String(q.content??""),String(q.raw??q.content??""));return}for(const q of ee)y(q)}function $(F,te){return String(F.markup??"").startsWith(te)}function k(F){return F.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 M(F,te){let ee=F;const q=String(te.content??"");return ee.endsWith("\\")&&!$(te,"\\\\")&&!q.endsWith("\\\\")&&(ee=ee.slice(0,-1)),ee.endsWith("(")&&!$(te,"\\(")&&!q.endsWith("\\(")&&(ee=ee.slice(0,-1)),/\*+$/.test(ee)&&!$(te,"\\*")&&!q.endsWith("\\*")&&(ee=ee.replace(/\*+$/,"")),ee}for(;u<e.length;){const F=e[u];E(F)}function E(F){switch(F.type){case"text":S(F);break;case"softbreak":c?(c.content+=`
|
|
167
|
+
`,c.raw+=`
|
|
168
|
+
`):(c={type:"text",content:`
|
|
169
|
+
`,raw:`
|
|
170
|
+
`},a.push(c)),u++;break;case"code_inline":y(ZH(F)),u++;break;case"html_inline":{const[te,ee]=XH(F,e,u,Vn,t,n,o);y(te),u=ee;break}case"link_open":I(F);break;case"image":Ae(F)||(p(),y(Yw(F)),u++);break;case"strong_open":{p();const{node:te,nextIndex:ee}=zc(e,u,F.content,o);y(te),u=ee;break}case"em_open":{p();const{node:te,nextIndex:ee}=of(e,u,o);y(te),u=ee;break}case"s_open":{p();const{node:te,nextIndex:ee}=Qw(e,u,o);y(te),u=ee;break}case"mark_open":{p();const{node:te,nextIndex:ee}=jH(e,u,o);y(te),u=ee;break}case"ins_open":{p();const{node:te,nextIndex:ee}=JH(e,u,o);y(te),u=ee;break}case"sub_open":{p();const{node:te,nextIndex:ee}=iW(e,u,o);y(te),u=ee;break}case"sup_open":{p();const{node:te,nextIndex:ee}=rW(e,u,o);y(te),u=ee;break}case"sub":p(),y({type:"subscript",children:[{type:"text",content:String(F.content??""),raw:String(F.content??"")}],raw:`~${String(F.content??"")}~`}),u++;break;case"sup":p(),y({type:"superscript",children:[{type:"text",content:String(F.content??""),raw:String(F.content??"")}],raw:`^${String(F.content??"")}^`}),u++;break;case"emoji":{p();const te=e[u-1];te?.type==="text"&&/\|:-+/.test(String(te.content??""))?C("",""):y(FH(F)),u++;break}case"checkbox":p(),y(DH(F)),u++;break;case"checkbox_input":p(),y(BH(F)),u++;break;case"footnote_ref":p(),y(UH(F)),u++;break;case"footnote_anchor":{p();const te=F.meta??{};g({type:"footnote_anchor",id:String(te.label??F.content??""),raw:String(F.content??"")}),u++;break}case"hardbreak":p(),y(qH()),u++;break;case"fence":p(),y(R0(e[u])),u++;break;case"math_inline":p(),!F.content&&F.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(Xw({...F,content:e[u+1].content})),u+=2):y(Xw(F)),u++;break;case"reference":D(F);break;case"text_special":C(String(F.content??""),String(F.content??"")),u++;break;default:{const te=F;if(F.type==="link"&&te.href!=null&&o?.validateLink&&!o.validateLink(String(te.href))){p();const ee=String(te.text??"");C(ee,ee),u++}else be(F)||z(F)||Q(F)||H(F)||v(F),u++;break}}}function O(F,te,ee,q){const Y=lW({...te,content:F});if(c){c.content+=M(Y.content,te),c.raw+=Y.raw;return}const de=ee?.tag==="br"&&e[u-2]?.content==="[";q||(Y.content=M(Y.content,te)),c=Y,c.center=de,a.push(c)}function S(F){const te=String(F.content??""),ee=e.length===1&&te.includes("\\")&&typeof t=="string"?String(t):"";let q=ee?CW(ee):te.replace(dW,"$1");if(F.content==="<"||q==="1"&&e[u-1]?.tag==="br"){u++;return}const Y=q.indexOf("$");Y!==-1&&Y===q.lastIndexOf("$")&&q.endsWith("$")&&(q=q.slice(0,-1)),q.endsWith("undefined")&&!t?.endsWith("undefined")&&(q=q.slice(0,-9));let de=a.length,ne="";for(let re=a.length-1;re>=0;re--){const he=a[re];if(he.type!=="text")break;de=re,ne=String(he.content??"")+ne}de<a.length&&(q.startsWith(ne)?(c=null,a.length=de):c=a[a.length-1]);const ce=e[u+1];if((q==="`"||q==="|"||q==="$")&&!$(F,`\\${q}`)||/^\*+$/.test(q)&&!$(F,"\\*")){u++;return}if(!ce&&/[^\]]\s*\(\s*$/.test(q)&&(q=q.replace(/\(\s*$/,"")),!q){u++;return}if(me(q)||ze(q))return;if(!(q.includes("*")||q.includes("_")||q.includes("~")||q.includes("`")||q.includes("[")||q.includes("!")||q.includes("$")||q.includes("|")||q.includes("("))){O(q,F,e[u-1],ce),u++;return}if(le(q))return;const j=e[u-1];if(q==="["&&!ce?.markup?.includes("*")&&!$(F,"\\[")||q==="]"&&!j?.markup?.includes("*")&&!$(F,"\\]")){u++;return}if(b(te,F)||Le(q)||(e[u+1]?.type!=="link_open"||k(q))&&Fe(q,F))return;const G=_(te);if(G){p();for(const re of G)y(re);u++;return}m(q,F)||(O(q,F,j,ce),u++)}function I(F){if(P(F))return;if(qe()){const{node:ce,nextIndex:j}=sf(e,u,o),G=String(ce.text||ce.href||"");C(G,G),u=j;return}p();const{node:te,nextIndex:ee}=sf(e,u,o);u=ee;const q=te.text||te.href||"";if(F.markup==="linkify"&&!WT(q,te.href,t)&&wp(q,l?.__linkifyDemotionContext)){C(q,q);return}const Y=te.children.length===1&&te.children[0]?.type==="text";if(te.loading&&t&&te.text===te.href&&Y){const ce=LW(t,te.href);ce&&(te.text=ce,te.children=[{type:"text",content:ce,raw:ce}],te.raw=`[${ce}](${te.href}${te.title?` "${te.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(te.href)){C(te.text,te.text);return}const de=F.attrs?.find(([ce])=>ce==="href")?.[1],ne=String(de??"");if(t&&ne){const ce=t.indexOf("](");if(ce!==-1){const j=t.indexOf(")",ce+2);j===-1?te.loading=!0:te.loading&&t.slice(ce+2,j).includes(ne)&&(te.loading=!1)}}H(te)||g(te)}function P(F){if(F.markup!=="linkify")return!1;const{node:te,nextIndex:ee}=sf(e,u,o);return U(te,ee)?(u=ee,!0):!1}function D(F){p(),y(nW(F)),u++}function H(F){if(F.type!=="link")return!1;const te=a[a.length-1];if(!te||te.type!=="text")return!1;const ee=String(te.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!ee)return!1;const q=F,Y=String(q.href??""),de=String(q.text??""),ne=String(ee[2]??""),ce=Y.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!Y||!(de===Y||de===ce||NW(de)))return!1;const j=String(ee[1]??"");return j?(te.content=j,te.raw=j):a.pop(),g({...F,text:ne,children:[{type:"text",content:ne,raw:ne}],raw:`[${ne}](${Y}${q.title?` "${q.title}"`:""})`}),!0}function z(F){if(F.type!=="link")return!1;const te=F,ee=String(te.href??"");return ee?U({href:ee,title:te.title==null||te.title===""?null:String(te.title),loading:!!te.loading},u+1):!1}function U(F,te){const ee=a[a.length-1];if(ee?.type!=="image"||ee.src||!ee.loading||!String(ee.raw??"").endsWith("]("))return!1;const q=e[te],Y=String(q?.content??"");if(q?.type!=="text"||!Y.startsWith(")"))return!1;a.pop(),c=null;const de=String(ee.alt??"");g({type:"image",src:F.href,alt:de,title:F.title,raw:``,loading:!!F.loading});const ne=Y.slice(1),ce=Wl(q);return ce.content=ne,ce.raw=ne,h()[te]=ce,!0}function Q(F){if(F.type!=="link")return!1;const te=a[a.length-1],ee=e[u-1];if(!te||te.type!=="text"||ee?.type!=="text")return!1;const q=String(te.content??""),Y=String(ee.content??"");if(!q.endsWith("!")||!Y.endsWith("!")||$(ee,"\\!"))return!1;const de=q.slice(0,-1);de?(te.content=de,te.raw=de,c=te):(a.pop(),c=null);const ne=F,ce=String(ne.text??ne.children?.map(re=>String(re?.content??re?.raw??"")).join("")??""),j=String(ne.href??""),G=ne.title==null||ne.title===""?null:String(ne.title);return g({type:"image",src:j,alt:ce,title:G,raw:``,loading:!!ne.loading}),!0}function X(F,te="",ee=null){const q=String(F.alt??F.raw??"");return{type:"link",href:te,title:ee,text:q,children:[F],raw:`[${q}](${te}${ee?` "${ee}"`:""})`,loading:!0}}function ue(F){const te=F.startsWith(";return{type:"image",src:"",alt:q===-1?ee.replace(/\]$/,""):ee.slice(0,q),title:null,raw:te,loading:!0}}function me(F){const te=F.indexOf("[![");if(te===-1||typeof t=="string"&&e.length===1&&AW(t,te,"["))return!1;const ee=F.slice(0,te);return ee&&C(ee,ee),g(X(ue(F.slice(te+1)))),u++,!0}function Ae(F){if(o?.final)return!1;const te=e[u-1];if(te?.type!=="text"||!String(te.content??"").endsWith("[")||$(te,"\\["))return!1;const ee=a[a.length-1];if(ee?.type==="text"&&ee.content.endsWith("[")){const q=ee.content.slice(0,-1);q?(ee.content=q,ee.raw=q,c=ee):(a.pop(),c=null)}return g(X(Yw(F))),u++,!0}function be(F){if(F.type!=="link")return!1;const te=F,ee=String(te.raw??""),q=String(te.text??"");if(!ee.startsWith("[![")&&!q.startsWith("!["))return!1;const Y=te.title==null||te.title===""?null:String(te.title);return g(X({type:"image",src:String(te.href??""),alt:q.replace(/^!\[/,"").replace(/\]$/,""),title:Y,raw:ee.startsWith("[)return!1;const te=e[u-2];if(te?.type==="text"&&String(te.content??"").endsWith("[")&&$(te,"\\["))return!1;const ee=a[a.length-1];if(ee?.type!=="image"&&ee?.type!=="link")return!1;const q=ee,Y=ee?.type==="link"&&Array.isArray(q.children)&&q.children.length===1&&q.children[0]?.type==="image"?a.pop():null,de=Y?Y.children[0]:a.pop();if(!de||de.type!=="image")return!1;const ne=e[u+1];let ce=String(Y?.href??""),j=Y?.title==null?null:String(Y.title),G=!0;if(ne?.type==="link_open"){const{node:he,nextIndex:Ce}=sf(e,u+1,o);ce=he.href,j=he.title,G=!0,u=Ce}else{if(ce=F.slice(2),ce.includes('"')){const he=ce.split('"');ce=String(he[0]??"").trim(),j=he[1]==null?null:String(he[1]).trim()}u++}const re=X(de,ce,j);return re.loading=G,g(re),!0}function qe(){const F=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&F?.type==="text"&&String(F.content??"").endsWith("[")&&$(F,"\\[")}function Fe(F,te){const ee=F.indexOf("[");if(ee===-1)return!1;let q=F.slice(0,ee);const Y=F.indexOf("](",ee);if(Y!==-1){const de=e[u+2];let ne=F.slice(ee+1,Y);if(ne.includes("[")){const Ee=ne.indexOf("[");q+=F.slice(0,ee+Ee+1);const ae=ee+Ee+1;ne=F.slice(ae+1,Y)}const ce=e[u+1];if(F.endsWith("](")&&ce?.type==="link_open"&&de){const Ee=e[u+4];let ae=4,xe=!0;if(Ee?.type==="text"){const ot=String(Ee.content??"");if(ot.startsWith(")")){xe=!1;const _t=ot.slice(1);if(_t){const wt=Wl(Ee);wt.content=_t,wt.raw=_t,h()[u+4]=wt}else ae++}else ot==="."&&ae++}L(q,te);const Ke=String(de.content??"");return o?.validateLink&&!o.validateLink(Ke)?C(ne,ne):g({type:"link",href:Ke,title:null,text:ne,children:[{type:"text",content:ne,raw:ne}],loading:xe}),u+=ae,!0}const j=F.indexOf(")",Y),G=j!==-1?F.slice(Y+2,j):"",re=j===-1;let he=q.match(/\*+$/);if(he&&(q=q.replace(/\*+$/,"")),L(q,te),he||(he=ne.match(/^\*+/)),!d&&he){const Ee=he[0].length;ne=ne.replace(/^\*+/,"").replace(/\*+$/,"");const ae=[];if(Ee===1?ae.push({type:"em_open",tag:"em",nesting:1}):Ee===2?ae.push({type:"strong_open",tag:"strong",nesting:1}):Ee===3&&(ae.push({type:"strong_open",tag:"strong",nesting:1}),ae.push({type:"em_open",tag:"em",nesting:1})),ae.push({type:"link",href:G,title:null,text:ne,children:[{type:"text",content:ne,raw:ne}],loading:re}),Ee===1){ae.push({type:"em_close",tag:"em",nesting:-1});const{node:xe}=of(ae,0,o);y(xe)}else if(Ee===2){ae.push({type:"strong_close",tag:"strong",nesting:-1});const{node:xe}=zc(ae,0,void 0,o);y(xe)}else if(Ee===3){ae.push({type:"em_close",tag:"em",nesting:-1}),ae.push({type:"strong_close",tag:"strong",nesting:-1});const{node:xe}=zc(ae,0,void 0,o);y(xe)}else{const{node:xe}=of(ae,0,o);y(xe)}}else o?.validateLink&&!o.validateLink(G)?C(ne,ne):g({type:"link",href:G,title:null,text:ne,children:[{type:"text",content:ne,raw:ne}],loading:re});const Ce=j!==-1?F.slice(j+1):"";return Ce&&(E({type:"text",content:Ce,raw:Ce}),u--),u++,!0}return!1}function Le(F){const te=F.indexOf("![");if(te===-1)return!1;const ee=F.slice(0,te);return ee&&!c?c={type:"text",content:ee,raw:ee}:ee&&c&&(c.content+=ee),c&&(a.push(c),c=null),g(ue(F.slice(te))),u++,!0}function le(F){if(!(F?.startsWith("[")&&n?.type==="list_item_open"))return!1;const te=F.slice(1).match(/[^\s\]]/);if(te===null)return u++,!0;if(te&&/x/i.test(te[0])){const ee=te[0]==="x"||te[0]==="X";return g({type:"checkbox_input",checked:ee,raw:ee?"[x]":"[ ]"}),u++,!0}return!1}return a}function OW(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){s.content=r;break}o.pop();continue}break}}function PW(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 o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){o.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?s.content=r:o.pop())}break}}function RW(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function hc(e,t,n){const o=e[t],s=[],i=sl(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=RW(c)?Wl(c):c,d=e[a-1];u!==c&&(PW(u),OW(u));const f=String(u.content??"");l.push({type:"paragraph",children:Vn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=mc(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]=hc(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=F0(e,a,i.options(),B0);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}s.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const l=o.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:s,raw:s.map(l=>l.raw).join(`
|
|
171
|
+
`)},r+1]}function DW(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=sl(o,!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:Vn(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]=hc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=mc(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=bh(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:s,title:i,children:r,raw:`:::${s} ${i}
|
|
172
|
+
${r.map(c=>c.raw).join(`
|
|
173
|
+
`)}
|
|
174
|
+
:::`},a+1]}const BW=new Set(["warning","info","note","tip","danger","caution"]);function FW(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 o=n.search(/\s/),s=(o===-1?n:n.slice(0,o)).toLowerCase();return BW.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function HW(e,t,n){const o=e[t];let s="note",i="";const r=o.type.match(/^container_(\w+)_open$/);if(r){s=r[1];const d=String(o.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(s)){const f=d.slice(s.length).trim();f&&(i=f)}}else{const d=FW(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=sl(n,!0);let c=t+1;const u=new RegExp(`^container_${s}_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 f=d.children||[];let h=-1;for(let m=f.length-1;m>=0;m--){const b=f[m];if(b.type==="text"&&/:+/.test(b.content)){h=m;break}}const p={type:"paragraph",children:Vn((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=hc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=mc(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=bh(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:s,title:i,children:l,raw:`:::${s} ${i}
|
|
175
|
+
${l.map(d=>d.raw).join(`
|
|
176
|
+
`)}
|
|
177
|
+
:::`},c+1]}const WW=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function zW(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=WW.exec(String(o.info??""));return s?DW(e,t,s,n):null}const B0={parseContainer:(e,t,n)=>HW(e,t,n),matchAdmonition:zW};function mc(e,t,n){const o=[],s=sl(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:Vn(r.children||[],String(r.content??""),void 0,s.options()),raw:String(r.content??"")};o.push(l),s.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=hc(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=mc(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}default:{const r=F0(e,i,s.options(),B0);r?(o.push(r[0]),s.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:o,raw:o.map(r=>r.raw).join(`
|
|
178
|
+
`)},i+1]}function UW(e){if(e.info?.startsWith("diff"))return R0(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let o=t;n?.[1]&&(o=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const s=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:o,raw:o,loading:!s}}function qW(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=sl(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=Vn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+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:Vn(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&&(o.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
179
|
+
`)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
|
|
180
|
+
`)},s+1]}function jW(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=sl(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:Vn(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:s,children:i,raw:`[^${s}]: ${i.map(a=>a.raw).join(`
|
|
181
|
+
`)}`},l+1]}function VW(e,t,n){const o=e[t],s=o.attrs,i=Array.isArray(s)&&s.length?Object.fromEntries(s.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(o.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:Vn(a.children||[],c,void 0,n),raw:c}}function KW(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${o}(?=\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=jn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(s.test(c)){const u=jn(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 cM(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 o=jn(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=Ql.has(n),l=kh(s),a=(o===-1?-1:KW(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
182
|
+
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function GW(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 YW(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,o]=t;if(!o)continue;const s=String(o).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(s);if(i)return i[1].toLowerCase()}}return"left"}function uM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function dM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return uM(n)?n:void 0}function XW(e,t,n){const o=dM(rd(t),n);if(!uM(o))return e;const s=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:s?.filename||o?.filename,explicitFilename:s?.explicitFilename||o?.explicitFilename,marketTicker:s?.marketTicker||o?.marketTicker}}}function QW(e,t,n){let o=t+1,s=null;const i=[];let r=!1;for(;o<e.length&&e[o].type!=="table_close";)if(e[o].type==="thead_open")r=!0,o++;else if(e[o].type==="thead_close")r=!1,o++;else if(e[o].type==="tbody_open"||e[o].type==="tbody_close")o++;else if(e[o].type==="tr_open"){const a=[];let c=o+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",h=e[c+1],p=String(h.content??""),m=YW(e[c].attrs),b=a.length,_=!f&&!r,g=_?s?.cells[b]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:Vn(h.children||[],p,void 0,XW(n,g,_?u:void 0)),raw:p,align:m}),_&&(u=dM(u,rd(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?s=d:i.push(d),o=c+1}else o++;s||(s={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:s,rows:i,loading:l&&!n?.final&&i.length===0,raw:[s,...i].map(a=>a.raw).join(`
|
|
183
|
+
`)},o+1]}function ZW(){return{type:"thematic_break",raw:"---"}}let _g=null;const wg=new WeakMap;function Zw(){return _g||(_g={allowedTagSet:wh(),customTagSet:null}),_g}function JW(e){if(!e||e.length===0)return Zw();const t=wg.get(e);if(t)return t;const n=e.map(Js).filter(Boolean);if(!n.length){const s=Zw();return wg.set(e,s),s}const o={allowedTagSet:wh({customHtmlTags:e}),customTagSet:new Set(n)};return wg.set(e,o),o}function ez(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[h,p]of s)if(h==="class"){const m=p.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(h.startsWith("data-")){const m=h.slice(5);try{r[m]=JSON.parse(p)}catch{r[m]=p}}}const l=[],a=sl(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const h=e[c+1];if(h){const p={type:"paragraph",children:Vn(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[h,p]=hc(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=mc(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=bh(e,c,a.options());h?(l.push(h[0]),a.remember(h[0].raw),c=h[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
|
|
184
|
+
`,l.length>0&&(f+=o.raw??l.map(h=>h.raw).join(`
|
|
185
|
+
`),f+=`
|
|
186
|
+
`),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function tz(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function nz(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function oz(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${xs(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${xs(o)}(?=\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=jn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(s.test(c)){const u=jn(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 sz(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${o}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n||0);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=jn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const p=c+1;return{raw:e.slice(r,p),end:p}}let u=1,d=c+1;const f=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),end:e.length};if(h(p)){const m=e.indexOf(">",p);if(m===-1)return null;if(u--,u===0){const b=m+1;return{raw:e.slice(r,b),end:b}}d=m+1;continue}if(f(p)){const m=jn(e.slice(p));if(m===-1)return null;u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),end:e.length}}function e1(e){return Number.isFinite(e)&&e>0?e:0}function iz(e,t){const n=e1(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
|
|
187
|
+
`&&(o++,o===n))return s+1;return e.length}function bh(e,t,n){const o=e[t];switch(o.type){case"heading_open":return[VW(e,t,n),t+3];case"code_block":return[UW(o),t+1];case"fence":return[R0(o),t+1];case"math_block":return[GW(o),t+1];case"html_block":{const s=cM(o),i=s.tag?JW(n?.customHtmlTags):null;if(s.tag&&s.loading&&i&&!i.allowedTagSet.has(s.tag)){const r=String(o.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(s.tag&&i?.customTagSet?.has(s.tag)){const r=s.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(o.map)?iz(l,Number(o.map?.[0]??0)):0,u=sz(l,r,Math.max(e1(a),e1(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??s.raw??""),f=jn(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),m=f===-1?null:oz(d,r,f+1),b=m?.start??-1;let _="";f!==-1&&(b!==-1&&f<b?_=d.slice(f+1,b):_=d.slice(f+1)),b===-1&&(_=nz(_,r));const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=v.exec(h))!==null;){const L=y[1];if(!L||L.toLowerCase()===r)continue;const $=y[2]||y[3]||y[4]||"";g.push([L,$])}const C=!n?.final&&!p&&m==null;return[{type:r,tag:r,content:tz(_),raw:String(u?.raw??s.raw??d),loading:C,attrs:g.length?g:void 0},t+1]}return[s,t+1]}case"table_open":{const[s,i]=QW(e,t,n);return[s,i]}case"dl_open":{const[s,i]=qW(e,t,n);return[s,i]}case"footnote_open":{const[s,i]=jW(e,t,n);return[s,i]}case"hr":return[ZW(),t+1]}return null}function F0(e,t,n,o){const s=bh(e,t,n);if(s)return s;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(o?.parseContainer)return o.parseContainer(e,t,n);break;case"container_open":if(o?.matchAdmonition){const i=o.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return ez(e,t,n)}return null}function rz(){return{type:"hardbreak",raw:`\\
|
|
188
|
+
`}}function lz(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:Vn(o.children||[],s,void 0,n),raw:s}}const Jw=new WeakMap,_h=new WeakMap,az=["$$","\\["];function ic(){return typeof performance<"u"?performance.now():Date.now()}function H0(e,t,n){e&&(e[t]=(e[t]??0)+n)}function fM(e){return e.__timing}function Sg(e,t,n){return t&&H0(t,"parseMarkdownToStructureTotalMs",ic()-n),e}function e2(e,t,n){if(!n)return a2(e,t);const o=ic(),s=a2(e,t);return H0(n,"processTokensMs",ic()-o),s}function cz(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=pc(t);return n.length?new Set(n):null}function uz(e,t){const n=e;let o=Jw.get(n);o||(o=new Map,Jw.set(n,o));const s=t.__markstreamFinal===!0?"final":"streaming";let i=o.get(s);i||(i={},o.set(s,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function dz(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function rf(e,t,n){for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!("value"in s))continue;const i=Object.getOwnPropertyDescriptor(t,o);i&&(!("value"in i)||i.writable===!1)||(t[o]=El(s.value,n))}}function El(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,o=t.get(n);if(o)return o;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(El(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(El(l,t),El(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(El(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),rf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),rf(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),rf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!dz(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),rf(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=El(i[r],t);return s}function pM(e,t=!0){if(!t)return Wl(e);const n=Object.create(Object.getPrototypeOf(e)),o=new WeakMap;for(const s of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,s);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,s,i);continue}const r=i.value;let l=r;s==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):s==="map"&&Array.isArray(r)?l=[...r]:s==="children"&&Array.isArray(r)?l=r.map(a=>pM(a,t)):t&&r&&typeof r=="object"&&(l=El(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function t2(e,t=!0){return e.map(n=>pM(n,t))}function hM(e,t){const n=t,o=e.stream,s=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(s===!0||s==="auto"&&t.final!==!0)&&o?.enabled===!0&&typeof o.parse=="function"}function fz(e,t){const n=t,o=t.streamParse??"auto",s=e.stream;return t.final===!0&&o==="auto"&&n.__disableStreamParse!==!0&&s?.enabled===!0&&typeof s.reset=="function"}function pz(e){_h.delete(e)}function hz(e,t,n){_h.set(e,{source:t,key:n,pendingCandidate:n===null&&eM(t)})}function mz(e){return e.endsWith("$")||e.endsWith("\\")}function gz(e){const t=Math.max(e.lastIndexOf(`
|
|
189
|
+
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return az.some(o=>n.endsWith(o))}function vz(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||gz(e)&&/[\r\n]/.test(t)):!1}function yz(e,t){if(!KT(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=_h.get(o);if(s?.source===t)return;if(s&&t.startsWith(s.source)){const l=t.slice(s.source.length);if(s.key===null&&s.pendingCandidate===!1&&!vz(s.source,l)&&!mz(t)){s.source=t;return}}const i=NH(t),r=s?!t.startsWith(s.source):!1;(s&&(r||s.key!==i)||!s&&i)&&n.reset(),hz(e,t,i)}function kz(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function bz(e,t){const n=e?.map,o=t?.map;return n===o?!0:!Array.isArray(n)||!Array.isArray(o)?!1:n.length===o.length&&n.every((s,i)=>s===o[i])}function Cg(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&bz(e,t)}function n2(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function _z(e){for(let t=0;t+5<e.length;t++)if(n2(e,t)&&n2(e,t+3)&&Cg(e[t],e[t+3])&&Cg(e[t+1],e[t+4])&&Cg(e[t+2],e[t+5]))return!0;return!1}function wz(e,t,n){return KT(e)&&eM(t)&&_z(n)}function Sz(e){const t=_h.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function o2(e,t,n,o){if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!hM(e,o)||(yz(e,t),Sz(e)))return e.parse(t,n);const s=e.stream.parse(t,uz(e,n));if(wz(e,t,s))return e.stream?.reset?.(),e.parse(t,n);if(!kz(o))return s;const i=fM(o);if(!i)return t2(s,!0);const r=ic(),l=t2(s,!0);return H0(i,"tokenCloneMs",ic()-r),l}function wh(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Hu;const n=new Set(Hu);for(const o of pc(t))o&&n.add(o);return n}function Cz(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 s2(e){return{type:"paragraph",children:e,raw:e.map(Cz).join("")}}function i2(e,t){if(e.type!=="paragraph")return null;const n=e.children,o=Array.isArray(n)?n:[];if(o.length===0)return null;const s=cz(t);if(!s?.size)return null;let i=-1;for(let u=0;u<o.length;u++){const d=o[u];if(!s.has(String(d?.type??"").toLowerCase()))continue;const f=o.slice(0,u);if(String(d.content??"").trim()&&f.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=o.slice(0,i),l=o[i];if(!l)return null;const a=[];r.length&&a.push(s2(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(s2(c)),a}function xz(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),o=/<\/html>\s*$/i.test(t);return!n||!o?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function pu(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function Az(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*${xs(t)}\s*>\s*$`,"i").test(n)}function W0(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${xs(o)}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=jn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(Ql.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${xs(o)}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${xs(o)}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(h(p)){const m=jn(e.slice(p));if(m===-1)return null;u--;const b=p+m+1;if(u===0)return{raw:e.slice(r,b),start:r,end:b,closed:!0};d=b;continue}if(f(p)){const m=jn(e.slice(p));if(m===-1)return null;const b=e.slice(p,p+m+1);/\/\s*>$/.test(b)||u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function Tz(e,t){if(!t)return 0;let n=0,o=0;for(;n<e.length&&o<t.length;){if(e[n]===t[o]){n++,o++;continue}if(e[n]==="\r"||e[n]===`
|
|
190
|
+
`){n++;continue}return-1}return o===t.length?n:-1}function Mz(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
191
|
+
</${t}>`}function r2(e){return e.replace(/\r\n/g,`
|
|
192
|
+
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function Ez(e,t,n){return n?e.includes(n,t)?!0:r2(e.slice(Math.max(0,t))).includes(r2(n)):!1}function Iz(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
193
|
+
`&&n++,n):e[n]===`
|
|
194
|
+
`?n+1:t}function l2(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 $z(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function z0(e,t){const n=new RegExp(String.raw`<\s*\/\s*${xs(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function mM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const Nz=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),Lz=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function Oz(e){return/\n\s*\n/.test(e)||Lz.test(e)}function Pz(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>Nz.has(String(o?.type??"").toLowerCase()))||t.some(o=>{if(o?.type!=="html_block")return!1;const s=o;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!Oz(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function Rz(e,t,n,o){return e.map(s=>{if(s?.type!=="html_block")return s;const i=s,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||IT.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=jn(l);if(a===-1)return s;const c=z0(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return s;const d=hu(u,t,mM(n,o));return Pz(u,d)?{...s,children:d}:s})}function hu(e,t,n){return e.trim()?vM(e,t,{...n,__disableStreamParse:!0}):[]}function Dz(e,t,n){const o=hu(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function Bz(e,t,n){const o=cM({content:e}),s=jn(e),i=z0(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=Dz(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function Fz(e,t,n){const o=jn(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=W0(s,"summary",0);if(!i)return hu(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...hu(r,t,n),Bz(i.raw,t,n),...hu(l,t,n)]}function gM(e,t,n,o,s,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=pu(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!l2(c)){r.push(c);continue}const f=String(c.raw??pu(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,m=-1;for(let Q=a+1;Q<e.length;Q++){const X=e[Q];if(l2(X)){p++;continue}if($z(X)&&(p--,p===0)){m=Q;break}}const b=W0(t,"details",h),_=m===-1&&b?.closed===!0,g=_?(()=>{const Q=z0(f,"details");return Q!==-1?f.slice(0,Q):f})():f,[v]=gM(_?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,o,s,h+f.length),y=Fz(g,n,mM(o,s)),C=m===-1?"</details>":String(e[m].raw??pu(e[m])??"</details>"),L=_||m!==-1&&b?.closed===!0,$=C.replace(/[\t\r\n ]+$/,""),k=L?(()=>{const Q=(b?.raw??"").lastIndexOf($);return Q===-1?t.length:h+Q})():t.length,M=jn(f),E=_&&M!==-1?h+M+1:h+f.length,O=t.slice(E,k===-1?t.length:k),S=n.parse(O,{__markstreamFinal:s}),I=n.renderer.render(S,n.options,{__markstreamFinal:s}),P=k+$.length,D=L?Math.max(k+C.length,Iz(t,P)):t.length,H=L?t.slice(k,D):C,z=L?t.slice(h,D):t.slice(h),U=_&&M!==-1?f.slice(0,M+1):f;if(r.push({...c,tag:"details",attrs:kh(f.slice(0,M+1)),raw:z,content:`${U}${I}${H}`,children:[...y,...v],loading:!s&&!L}),l=L?D:t.length,m===-1&&!_)break;m!==-1&&(a=m)}return[r,l]}function Hz(e,t,n){if(!n)return e;const o=e.slice();let s=0;for(let i=0;i<o.length;i++){const r=o[i],l=pu(r),a=l?n.indexOf(l,s):-1;if(r?.type!=="html_block"){a!==-1&&(s=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(s=a+l.length);continue}const u=W0(n,c,a!==-1?a:s);if(!u)continue;s=u.end;const d=String(r.content??l),f=String(r.raw??d),h=Mz(u.raw,c,u.closed),p=!t&&!u.closed,m=d!==h||f!==u.raw||!!r.loading!==p,b=jn(u.raw),_=b===-1?"":u.raw.slice(0,b+1),g=_?kh(_):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=g.length?g:void 0,!m)continue;let v=Tz(u.raw,f);v===-1&&(v=0);const y=i+1;for(;y<o.length;){if(u.closed&&Az(o[y],c)){o.splice(y,1);continue}const C=pu(o[y]);if(!C)break;const L=u.raw.indexOf(C,v);if(L===-1){if(Ez(n,u.end,C))break;o.splice(y,1);continue}v=L+C.length,o.splice(y,1)}}return o}function Wz(e){const t=l=>l===" "||l===" "||l===`
|
|
195
|
+
`||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=m=>{const b=m.charCodeAt(0);return b>=65&&b<=90||b>=97&&b<=122},u=m=>{const b=m.charCodeAt(0);return b>=48&&b<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",h=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",p=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&f(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(!h(l[a]))return!1;for(a++;a<l.length&&p(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 m=l[a];if(m==='"'||m==="'"){for(a++;a<l.length&&l[a]!==m;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const b=l[a];if(t(b)||b==="<"||b===">"||b==='"'||b==="'"||b==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=g=>g===" "||g===" ",h=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;const y=g[v];if(y!=="`"&&y!=="~")return null;let C=v;for(;C<g.length&&g[C]===y;)C++;const L=C-v;return L<3?null:{markerChar:y,markerLen:L,rest:g.slice(C)}},p=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;let y=!1;for(;v<g.length&&g[v]===">";)for(y=!0,v++;v<g.length&&f(g[v]);)v++;return y?g.slice(v):null},m=g=>{const v=h(g);if(v)return v;const y=p(g);return y==null?null:h(y)};let b=0;const _=l.split(/\r?\n/);for(const g of _){const v=b,y=b+g.length;if(a<v)break;const C=m(g);if(C){const L=C.markerChar,$=C.markerLen;c?L===u&&$>=d&&/^\s*$/.test(C.rest)&&(c=!1,u="",d=0):(c=!0,u=L,d=$)}if(a<=y)break;b=y+1}return c},s=String(e??""),i=s.lastIndexOf("<");if(i===-1||o(s,i))return s;if(i>0){const l=s[i-1],a=l===" "||l===" "||l===`
|
|
196
|
+
`||l==="\r",c=s[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return s}const r=s.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
197
|
+
`||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function zz(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=p=>p===" "||p===" ",s=p=>{const m=p.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let m=0;for(let b=0;b<p.length;b++){const _=p[b];if(_===" "){if(m++,m>=4)return!0;continue}if(_===" ")return!0;break}return!1},r=p=>{let m=!1,b=!1;for(let _=0;_<p.length;_++){const g=p[_];if(g==="\\"){_++;continue}if(!b&&g==="'"){m=!m;continue}if(!m&&g==='"'){b=!b;continue}if(!m&&!b&&g===">")return _}return-1},l=p=>{let m=0;for(;m<p.length&&o(p[m]);)m++;const b=p[m];if(b!=="`"&&b!=="~")return null;let _=m;for(;_<p.length&&p[_]===b;)_++;const g=_-m;return g<3?null:{markerChar:b,markerLen:g,rest:p.slice(_)}},a=(p,m)=>{if(i(p))return-1;const b=p.replace(/^[ \t]+/,"");if(!b||b.startsWith(">")||b.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(b))return-1;let _=!1,g=0;for(;g<p.length;){const v=p[g];if(v!=="<"){o(v)||(_=!0),g++;continue}const y=r(p.slice(g));if(y===-1){_=!0,g++;continue}const C=p.slice(g,g+y+1);let L=1;for(;L<C.length&&o(C[L]);)L++;if(L>=C.length){_=!0,g++;continue}const $=C[L];if($==="!"||$==="?"){_=!0,g+=y+1;continue}if($==="/"){_=!0,g+=y+1;continue}const k=L;for(;L<C.length&&s(C[L]);)L++;if(L===k){_=!0,g++;continue}const M=C.slice(k,L).toLowerCase(),E=C[L];if(E&&E!==" "&&E!==" "&&E!==">"&&E!=="/"){_=!0,g++;continue}const O=new RegExp(String.raw`<\s*\/\s*${M}\s*>`,"i"),S=/\/\s*>$/.test(C),I=O.test(p.slice(g+y+1)),P=O.test(e.slice(m+g+y+1)),D=/[\r\n]/.test(e.slice(m+g+y+1));if(_&&n.has(M)&&!S&&!I&&(P||D))return g;_=!0,g+=y+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
|
|
198
|
+
`,h),m=p!==-1,b=m&&p>h&&e[p-1]==="\r",_=m?b?p-1:p:e.length,g=e.slice(h,_),v=m?b?`\r
|
|
199
|
+
`:`
|
|
200
|
+
`:"",y=l(g);let C=g;if(!c&&!y){const L=a(g,h);if(L!==-1){const $=v||`
|
|
201
|
+
`;C=`${g.slice(0,L).replace(/[ \t]+$/,"")}${$}${$}${g.slice(L).replace(/^[ \t]+/,"")}`}}f+=C,f+=v,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)),h=m?p+1:e.length}return f}function Uz(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},i=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,h=!1;for(let p=0;p<d.length;p++){const m=d[p];if(m==="\\"){p++;continue}if(!h&&m==="'"){f=!f;continue}if(!f&&m==='"'){h=!h;continue}if(!f&&!h&&m===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let b=m+1;for(;b<d.length&&o(d[b]);)b++;if(b>=d.length||d[b]!=="/"){m=d.indexOf("<",m+1);continue}for(b++;b<d.length&&o(d[b]);)b++;if(b+p.length>d.length){m=d.indexOf("<",m+1);continue}let _=!0;for(let v=0;v<p.length;v++){const y=d[b+v];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==p[v]){_=!1;break}}if(!_){m=d.indexOf("<",m+1);continue}let g=b+p.length;if(g<d.length&&s(d[g])){m=d.indexOf("<",m+1);continue}for(;g<d.length&&o(d[g]);)g++;if(g<d.length&&d[g]===">")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const h=f;for(;f<d.length&&s(d[f]);)f++;if(f===h)return d;const p=d.slice(h,f).toLowerCase();if(!n.has(p))return d;const m=r(d.slice(f));if(m===-1)return d;const b=f+m;if(l(d,b+1,p))return d;const _=i(d.slice(b+1));return _?`${d.slice(0,b+1)}
|
|
202
|
+
${_}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
203
|
+
`,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",h=f?d-1:d,p=e.slice(u,h);c+=a(p),c+=f?`\r
|
|
204
|
+
`:`
|
|
205
|
+
`,u=d+1}return c}function qz(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{let h=0,p=!1,m=0;for(;h<f.length;){for(;h<f.length&&o(f[h]);)h++;if(h>=f.length||f[h]!==">")break;for(p=!0,h++;h<f.length&&o(f[h]);)h++;m=h}return p?{prefix:f.slice(0,m),content:f.slice(m)}:null},i=f=>{let h=0;for(;h<f.length&&o(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let m=h;for(;m<f.length&&f[m]===p;)m++;const b=m-h;return b<3?null:{markerChar:p,markerLen:b,rest:f.slice(m)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\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 f=e.indexOf(`
|
|
206
|
+
`,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",m=h?p?f-1:f:e.length,b=e.slice(d,m),_=h?p?`\r
|
|
207
|
+
`:`
|
|
208
|
+
`:"",g=s(b),v=g?.prefix??"",y=g?.content??b,C=i(y);C&&(l?C.markerChar===a&&C.markerLen>=c&&/^\s*$/.test(C.rest)&&(l=!1,a="",c=0):(l=!0,a=C.markerChar,c=C.markerLen));let L=y;if(!l&&L.includes("</"))for(const $ of r)L=L.replace($,(k,M,E,O)=>{if(O.replace(/^[\t ]+/,"").startsWith("|"))return k;const S=O.slice(0,E).replace(/^[\t ]+/,"");if(S.length>0){const I=M.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",P=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!I||!P||I!==P)return k}return`${M}
|
|
209
|
+
|
|
210
|
+
`});if(v){const $=v+L.split(`
|
|
211
|
+
`).join(`
|
|
212
|
+
${v}`);u+=$}else u+=L;u+=_,d=h?f+1:e.length}return u}function jz(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const o=S=>S===" "||S===" ",s=S=>{if(!S)return!1;if(S[0]===" ")return!0;let I=0;for(let P=0;P<S.length;P++){const D=S[P];if(D===" "){if(I++,I>=4)return!0;continue}if(D===" ")return!0;break}return!1},i=S=>{const I=S.charCodeAt(0);return I>=65&&I<=90||I>=97&&I<=122||I>=48&&I<=57||S==="_"||S==="-"||S===":"},r=S=>{let I=0;for(;I<S.length&&o(S[I]);)I++;return S.slice(I)},l=S=>{let I=0,P=!1,D=0;for(;I<S.length;){for(;I<S.length&&o(S[I]);)I++;if(I>=S.length||S[I]!==">")break;for(P=!0,I++;I<S.length&&o(S[I]);)I++;D=I}if(!P)return null;const H=S.slice(0,D);return{prefix:H,key:H.replace(/[ \t]+$/,""),content:S.slice(D)}},a=S=>r(S).startsWith("<"),c=S=>{for(let I=0;I<S.length;I++){const P=S[I];if(P!==" "&&P!==" ")return!1}return!0},u=S=>{if(s(S))return"";const I=r(S);if(!I.startsWith("<"))return"";let P=1;for(;P<I.length&&o(I[P]);)P++;if(P>=I.length||I[P]==="/"||I[P]==="!"||I[P]==="?")return"";const D=P;for(;P<I.length&&i(I[P]);)P++;if(P===D)return"";const H=I.slice(D,P).toLowerCase();if(!n.has(H))return"";const z=I[P];return z&&z!==" "&&z!==" "&&z!==">"&&z!=="/"?"":H},d=S=>{if(s(S))return null;const I=r(S);if(!I.startsWith("<"))return null;let P=1;for(;P<I.length&&o(I[P]);)P++;if(P>=I.length)return null;const D=I[P]==="/";if(D)for(P++;P<I.length&&o(I[P]);)P++;const H=I[P];if(!H||H==="!"||H==="?")return null;const z=P;for(;P<I.length&&i(I[P]);)P++;if(P===z)return null;const U=I.slice(z,P).toLowerCase();if(!n.has(U))return null;const Q=I[P];if(Q&&Q!==" "&&Q!==" "&&Q!==">"&&Q!=="/")return null;if(D)return{type:"close",name:U};if(/\/\s*>\s*$/.test(I))return{type:"open",name:U,complete:!0};const X=I.indexOf(">",P);if(X!==-1){const ue=I.slice(X+1);if(new RegExp(`<\\s*\\/\\s*${U}\\s*>`,"i").test(ue))return{type:"open",name:U,complete:!0}}return{type:"open",name:U,complete:!1}},f=S=>{if(s(S))return null;const I=r(S).replace(/[ \t]+$/,"");if(!I.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(I))return null;const P=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(P?.[1])return P[1].toLowerCase();const D=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!D?.[1]||!D[2])return null;const H=D[1].toLowerCase();return H===D[2].toLowerCase()?H:null};let h=!1,p="",m=0;const b=S=>{let I=0;for(;I<S.length&&o(S[I]);)I++;const P=S[I];if(P!=="`"&&P!=="~")return null;let D=I;for(;D<S.length&&S[D]===P;)D++;const H=D-I;return H<3?null:{markerChar:P,markerLen:H,rest:S.slice(D)}},_=S=>b(S),g=S=>{const I=r(S);return I?s(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(I):!1},v=(S,I,P)=>{let D=S,H=0;for(;D<e.length;){const z=e.indexOf(`
|
|
213
|
+
`,D),U=z!==-1,Q=U&&z>D&&e[z-1]==="\r",X=U?Q?z-1:z:e.length,ue=e.slice(D,X),me=l(ue),Ae=me?.key??"";if(H>0&&I&&Ae!==I)break;const be=me?.content??ue,ze=d(be);if(ze?.name===P){if(ze.type==="open")ze.complete||H++;else if(H>0&&(H--,H===0))return!1}else if(H>0&&(c(be)||g(be)))return!0;if(U)D=z+1;else break}return!1};let y="",C=0,L=!0,$=!1,k=!1,M=`
|
|
214
|
+
`;const E=[];let O="";for(;C<e.length;){const S=e.indexOf(`
|
|
215
|
+
`,C),I=S!==-1,P=I&&S>C&&e[S-1]==="\r",D=I?P?S-1:S:e.length,H=e.slice(C,D),z=I?P?`\r
|
|
216
|
+
`:`
|
|
217
|
+
`:"",U=l(H),Q=U?.key??"",X=U?.content??H,ue=_(X);ue&&(h?ue.markerChar===p&&ue.markerLen>=m&&/^\s*$/.test(ue.rest)&&(h=!1,p="",m=0):(h=!0,p=ue.markerChar,m=ue.markerLen));const me=E.length>0;if(!h&&!me){const be=u(X),ze=!!be&&!L&&$&&k&&v(C,Q,be);be&&!L&&(!$||ze)&&(Q&&O&&Q===O?y+=`${Q}${M}`:Q||(y+=M))}if(y+=H,y+=z,z&&(M=z),!h){const be=d(X);if(be){if(be.type==="open")be.complete||E.push(be.name);else for(let ze=E.length-1;ze>=0;ze--)if(E[ze]===be.name){E.length=ze;break}}}const Ae=c(X);L=Ae,$=!Ae&&a(X),k=!Ae&&!!f(X),O=Q,C=I?S+1:e.length}return y}function vM(e,t,n={}){const o=fM(n),s=o?ic():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(fz(t,n)&&(t.stream.reset(),pz(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,b=>b.startsWith(`
|
|
218
|
+
`)?`
|
|
219
|
+
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,b=>b.startsWith(`
|
|
220
|
+
`)?`
|
|
221
|
+
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,b=>b.startsWith(`
|
|
222
|
+
`)?`
|
|
223
|
+
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
224
|
+
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,b=>b.startsWith(`
|
|
225
|
+
`)?`
|
|
226
|
+
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(b,_,g)=>`${_}${g.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,b=>b.startsWith(`
|
|
227
|
+
`)?`
|
|
228
|
+
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
229
|
+
`))),n.customHtmlTags?.length&&r.includes("<")){const b=pc(n.customHtmlTags);if(b.length&&(r=zz(r,b),r=Uz(r,b),r=jz(r,b),r=qz(r,b),r.includes("</")))for(const _ of b){const g=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${_}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(g,"$1$2$2")}}i||(r=Wz(r));const l=xz(r);if(l){const b=n.preTransformTokens,_=n.postTransformTokens;if(hM(t,n)||typeof b=="function"||typeof _=="function"){const g=o2(t,r,{__markstreamFinal:i},n),v=typeof b=="function"&&b(g)||g;typeof _=="function"&&_(v)}return Sg(l,o,s)}const a=o2(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return Sg([],o,s);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,h=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),p={...n,validateLink:h,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let m=e2(d,p,o);if(u&&typeof u=="function"){const b=u(d);if(Array.isArray(b)){const _=b[0],g=_?.type;_&&typeof g=="string"?m=e2(b,void 0,o):m=b}}if(m=Hz(m,i,r),m=gM(m,r,t,n,i)[0],m=Rz(m,t,n,i),i){const b=new WeakSet,_=g=>{if(!g||typeof g!="object"||b.has(g))return;if(b.add(g),Array.isArray(g)){for(const y of g)_(y);return}const v=g;v.type==="html_block"&&v.loading===!0&&(v.loading=!1);for(const y of Object.values(v))_(y)};_(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),Sg(m,o,s)}function a2(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=sl(t);let s=0;for(;s<e.length;){const i=F0(e,s,o.options(),B0);if(i){n.push(i[0]),o.remember(i[0].raw),s=i[1];continue}const r=e[s];switch(r.type){case"paragraph_open":{const l=String(e[s+1]?.content??""),a=lz(e,s,o.options(l)),c=i2(a,t);c?n.push(...c):n.push(a),o.remember(a.raw),s+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=hc(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"blockquote_open":{const[l,a]=mc(e,s,o.options());n.push(l),o.remember(l.raw),s=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??"")}),o.remember(String(r.content??"")),s++;break}case"hardbreak":n.push(rz()),o.reset(),s++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),o.remember(l),s++;break}case"inline":{const l=String(r.content??""),a=Vn(r.children||[],l,void 0,o.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=i2(c,t);u?n.push(...u):n.push(c)}o.remember(l)}s+=1;break;default:s+=1;break}}return n}const Vz=new Set([...id,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),Kz=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"]),c2=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function u2(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Gz(e){return typeof e=="string"?e:e==null?"":String(e)}function yM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Pr(e){return Gz(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function kM(e){return Pr(e).replace(/`/g,"`")}function Sh(e){return String(e??"").trim().toLowerCase()}function U0(e,t="safe"){const n=Sh(e);return n?t==="escape"?!0:t==="trusted"?id.has(n):!Kz.has(n):!1}function bM(e,t="safe"){const n=Sh(e);return n?t==="escape"?!0:t==="trusted"?id.has(n):Vz.has(n):!1}function d2(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${kM(o)}"`).join("")}function Yz(e,t){const n=e.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.some(o=>{const s=o.split(/\s+/,1)[0]??"";return!s||Hl(s,{tagName:t,attrName:"srcset"})})}function _M(e,t,n,o){return NB.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?Yz(t,o):!!(LB.has(e)&&t&&Hl(t,{tagName:o,attrName:e}))}function Il(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function wM(e,t,n,o=!1){if(t!=="safe"||Sh(n)!=="a")return e;const s=Il(e,"href");if(o&&(!s||!e[s])){const a=Il(e,"target"),c=Il(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Il(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Il(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 f2(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!yM(r)||_M(l,i,t,n)||(o[r]=i)}return wM(o,t,n,!!Il(e,"href"))}function SM(e,t){const n=e.toLowerCase();return ET.has(n)?!1:u2(t,n)||u2(t,e)}function q0(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!yM(r)||_M(l,i,t,n)||(o[r]=i)}return wM(o,t,n,!!Il(e,"href"))}function Tp(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,o]of e)n&&(t[String(n)]=o==null?"":String(o));return t}function t1(e,t="safe",n){const o=q0(Tp(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function Xz(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 o=Number(e);if(e!==""&&!Number.isNaN(o))return o}return e}function Qz(e){const t={};for(const[n,o]of Object.entries(e))t[n]=Xz(o,n);return t}function p2(e){return e.trim().length>0}function Zz(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 o=e.indexOf("<",n);if(o===-1){if(n<e.length){const a=e.slice(n);p2(a)&&t.push({type:"text",content:a})}break}if(o>n){const a=e.slice(n,o);p2(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",o+1)){const a=e.indexOf("]]>",o);if(a!==-1){t.push({type:"text",content:e.slice(o,a+3)}),n=a+3;continue}break}if(e.startsWith("!",o+1)){const a=e.indexOf(">",o);if(a!==-1){n=a+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).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 f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],m=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=m)}}t.push({type:l||Ql.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=s+1}return t}function Jz(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const f=e.indexOf("-->",n);if(f!==-1){n=f+3;continue}break}const o=e.indexOf("<",n);if(o===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(o>n&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const f=e.indexOf("]]>",o);if(f!==-1){t.push({type:"text",content:e.slice(o,f+3)}),n=f+3;continue}break}if(e.startsWith("!",o+1)){const f=e.indexOf(">",o);if(f!==-1){n=f+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim();if(!i){n=s+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=s+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 f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],m=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=m)}}t.push({type:l||Ql.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=s+1}return t}function eU(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Pr(t)}>`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${Pr(o)}`:` ${Pr(o)}="${kM(s)}"`).join("");return e.type==="self_closing"?`<${Pr(t)}${n} />`:`<${Pr(t)}${n}>`}function tU(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;c2.lastIndex=0;let n;for(;(n=c2.exec(e))!==null;)if(SM(n[1],t))return!0;return!1}function Ya(e,t="safe"){if(!e)return"";if(t==="escape")return Pr(e);const n=Jz(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(Pr(r.content??""));continue}const l=Sh(r.tagName);if(!l)continue;if(bM(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"&&U0(l,t)){s.push(eU(r));continue}if(r.type==="self_closing"){s.push(`<${l}${d2(f2(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${d2(f2(r.attrs??{},t,l))}>`),Ql.has(l)||o.push(l);continue}const a=o.lastIndexOf(l);if(a===-1)continue;for(;o.length>a+1;){const u=o.pop();u&&s.push(`</${u}>`)}const c=o.pop();c&&s.push(`</${c}>`)}for(;o.length>0;){const r=o.pop();r&&s.push(`</${r}>`)}return s.join("")}const nU=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],h2="http://www.w3.org/2000/svg",oU=new Set(["script","style","iframe","object","embed","link","meta"]),sU=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"]),iU=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),rU=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),lU=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function aU(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function cU(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function uU(e){const t=e.nodeName.toLowerCase();return t==="use"?aU(e):t==="image"?cU(e):t==="text"||t==="tspan"?!!e.textContent?.trim():lU.has(t)}function dU(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 fU(e,t,n){const o=e.toLowerCase(),s=t.toLowerCase(),i=String(n??"").trim();return i?(o==="use"||o==="marker"||o==="clippath"||o==="mask")&&(s==="href"||s==="xlink:href")?i.startsWith("#")?i:"":o==="a"&&(s==="href"||s==="xlink:href")?Hl(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?Hl(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":Hl(i,{tagName:o,attrName:s})?"":i:""}function pU(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const o=e[n];if(o==='"'||o==="'"){const i=n+1,r=e.indexOf(o,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 s=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(s,n)}}function CM(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const o=n.trim();if(/^[0-9a-f]+$/i.test(o)){const s=Number.parseInt(o,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function xM(e){const t=CM(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=pU(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function m2(e){const t=CM(e);return nU.some(n=>n.test(t))||xM(t)}function hU(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 lf(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function AM(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!oU.has(o)){if(o==="br"){t.push(`
|
|
230
|
+
`);return}for(const s of Array.from(n.childNodes))AM(s,t)}}function mU(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];AM(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=lf(t.getAttribute("width")),i=lf(t.getAttribute("height")),r=lf(t.getAttribute("x")),l=lf(t.getAttribute("y")),a=e.ownerDocument.createElementNS(h2,"text");a.setAttribute("x",String(r+s/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")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,f]of o.entries()){const h=e.ownerDocument.createElementNS(h2,"tspan");h.setAttribute("x",String(r+s/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function gU(e){mU(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!sU.has(o)){n.remove();continue}if(o==="style"&&m2(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const i of s){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&m2(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(iU.has(r)&&i.value){const l=fU(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(rU.has(r)&&i.value&&xM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=dU(i.value);l!==i.value&&n.setAttribute(i.name,l)}}hU(n)}}function qpe(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 gU(n),vU(n)?null:n}catch{return null}}function vU(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const i=Number.parseFloat(s[2]||""),r=Number.parseFloat(s[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let o=!1;for(const s of n){uU(s)&&(o=!0);for(const i of Array.from(s.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!o}const g2=[];function xg(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function yU(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function kU(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function v2(e=`editor-${Date.now()}`,t={}){const n=RH(t),o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;s=h=>f[h]??o[h]??h}else s=f=>o[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const h=f;if(Array.isArray(h)){const[p,...m]=h;typeof p=="function"&&n.use(p,...m)}else typeof h=="function"&&n.use(h)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(h){console.error("[getMarkdown] apply function threw an error",h)}if(g2.length)for(const f of g2)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(eR),n.use(oR),n.use(QP);const i=vR,r=i.default??i;n.use(r),n.use(XP),n.use(YP),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,m=!!h.env?.__markstreamFinal,b=p.split(/\r?\n/);for(const _ of h.tokens){if(_.type!=="fence"||!_.map||!_.markup)continue;const g=_.map[0],v=_.map[1],y=_.markup,C=y[0],L=y.length,$=b[Math.max(0,v-1)]??"";let k=0;for(;k<$.length&&($[k]===" "||$[k]===" ");)k++;let M=0;for(;k+M<$.length&&$[k+M]===C;)M++;let E=k+M;for(;E<$.length&&($[E]===" "||$[E]===" ");)E++;const O=m?!0:v>g+1&&M>=L&&E===$.length,S=_;S.meta=S.meta??{},S.meta.unclosed=!O,S.meta.closed=!!O}});const l=(f,h)=>{const p=f,m=p.pos;if(p.src[m]!=="~")return!1;const b=p.src[m-1],_=p.src[m+1];if(/\d/.test(b)&&/\d/.test(_)){if(!h){const g=p.push("text","",0);g.content="~"}return p.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,h)=>{const p=f[h],m=String(p.info??"").trim(),b=String(p.content??""),_=btoa(unescape(encodeURIComponent(b))),g=yU(m),v=xg(g),y=kU(`editor-${e}-${h}-${g}`),C=xg(s("common.copy"));return`<div class="code-block" data-code="${_}" data-lang="${v}" id="${y}">
|
|
231
|
+
<div class="code-header">
|
|
232
|
+
<span class="code-lang">${xg(g.toUpperCase())}</span>
|
|
233
|
+
<button class="copy-button" data-code="${_}">${C}</button>
|
|
234
|
+
</div>
|
|
235
|
+
<div class="code-editor"></div>
|
|
236
|
+
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const h=c.exec(f);if(!h)return f!=="["&&!/^\[\d+$/.test(f);const p=String(h[1]??"");return f.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(p)},d=(f,h)=>{const p=f;if(p.src[p.pos]!=="[")return!1;const m=a.exec(p.src.slice(p.pos));if(!m)return!1;const b=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const _=p.src.slice(p.pos+m[0].length);if(_.startsWith("](")||_.startsWith("(")||u(_))return!1;if(!h){const g=m[1],v=p.push("reference","span",0);v.content=g,v.markup=m[0],v.raw=m[0]}return p.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,h)=>{const m=String(f[h].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}function bU({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 TM({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&i===e?s?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:bU({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const y2=new WeakMap;function _U(e){let t=y2.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},y2.set(e,t)),t}function k2(e,t){if(!t?.length)return[...e];const n=[...e],o=new Set(n);for(const s of t)o.has(s)||(o.add(s),n.push(s));return n}function j0(e){return!!(e.themes?.length||e.langs?.length)}function MM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(o=>n.has(o))}function wU(e,t){return!t?.length||e.registeredAllLangs?!0:MM(e.registeredLangs,t)}function Ag(e,t){return j0(t)&&MM(e.registeredThemes,t.themes)&&wU(e,t.langs)}function SU(e,t){if(!j0(t))return t;const n=k2(e.registeredThemes,t.themes),o=e.registeredAllLangs?[]:k2(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...o.length?{langs:o}:{}}}const CU={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function xU(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function EM(e){const t=xU(e);return CU[t]??t}function IM(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>EM(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function $M(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function AU(e){return $M(e)?.join("\0")??""}function NM(e,t){const n=$M(e),o=IM(t);return{...n?.length?{themes:n}:{},...o?.length?{langs:o}:{}}}function Mp(e,t){return`${AU(e)}\0\0${IM(t)?.join("\0")??""}`}function jpe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const o=NM(e,t),s={...o},i=!!(s.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete o.langs,delete s.langs),{key:Mp(s.themes,s.langs),registerOptions:o,rendererOptions:s,ignoredLangs:i}}async function Vpe(e,t={},n){if(!e)return"ready";const o=NM(t.themes,t.langs),s=Mp(o.themes,o.langs),i=n&&n===s?n:s,r=_U(e);if(r.completed.has(i))return"ready";if(Ag(r,o))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||Ag(r,o))return r.completed.add(i),"ready";const c=SU(r,o),u=Mp(c.themes,c.langs);return r.completed.has(u)||Ag(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(j0(c)?(r.registeredThemes=c.themes?[...c.themes]:r.registeredThemes,r.registeredLangs=c.langs?[...c.langs]:r.registeredLangs):r.registeredAllLangs=!0,r.completed.add(u),"ready"))}).then(()=>(r.completed.add(i),"ready")).finally(()=>{r.inFlight.get(i)===a&&r.inFlight.delete(i)});return r.inFlight.set(i,a),r.tail=a.catch(()=>{}),a}function ya(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function b2(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var TU=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 f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const p=_2();this.startedAt=f&&this.hasStarted?p-this.normalizedStartDelayMs:p,this.lastTick=p,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=_2();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 f=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const p=this.pendingChars,m=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,b=$U(p/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(b-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const _=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=IU(this.source.slice(this.visible.length),_,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=ya(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,ya(o,1e3,1)),this.normalizedTargetLatencyMs=ya(s,900,1),this.normalizedCatchUpLatencyMs=ya(i,350,1),this.normalizedCatchUpThreshold=b2(r,600),this.normalizedStartDelayMs=b2(a,80),this.maxCommitFps=Math.trunc(ya(l,30,1)),this.maxCharsPerCommit=Math.trunc(ya(c,80,1)),this.flushOnFinish=u,this.segmenter=EU(),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 MU(e={},t){const n=new TU(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 EU(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function IU(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 o="",s=0;for(const i of n.segment(e)){if(s>=t)break;o+=i.segment,s++}return{text:o,graphemeCount:s}}function _2(){return typeof performance<"u"?performance.now():Date.now()}function $U(e,t,n){return Math.min(n,Math.max(t,e))}var NU=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const n1=Symbol.for("markstream-vue:node-lifecycle"),w2='<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>',S2='<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>',LU={id:"material",core:{"":S2,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:S2,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:w2,csharp:w2,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:()=>Go(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},o1=new Map;let C2="material";const Oa=new Map,x2=new Map;let s1=null;function OU(e){o1.set(e.id,e)}function PU(e){return NU(this,null,function*(){var t,n,o;if(Oa.has(e.id))return(t=Oa.get(e.id))!=null?t:null;let s=x2.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(Oa.set(e.id,i),s1?.(),i)).catch(()=>(Oa.set(e.id,null),null)),x2.set(e.id,s)),s})}const RU=Yl(0);s1=()=>{RU.value++},OU(LU);const DU={"":"",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",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function V0(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[i]=s.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=DU[n])!=null?t:n}function Kpe(e){const t=V0(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Gpe(e){return(function(o){const s=o1.get(C2);if(!s)return;const i=s.core[o];if(i)return i;const r=Oa.get(s.id);if(r){const l=r[o];if(l)return l}s.loadExtended&&!Oa.has(s.id)&&PU(s)})(V0(e))||((n=(t=o1.get(C2))==null?void 0:t.fallback)!=null?n:"");var t,n}const Ype={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#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};let LM=!1;function Xpe(){return LM}function Qpe(){LM=!0}var Ch=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let ws=null,Mf=!1,xh=G0;function Ah(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function K0(){try{const e=globalThis;return Ah(e?.katex)}catch{return null}}function G0(){return Ch(null,null,function*(){const e=K0();if(e)return e;const t=yield Go(()=>import("./katex-DnlPpQZa.js"),[]);try{yield Go(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Ah(t)})}function BU(e){xh=e,ws=null,Mf=!1}function FU(e){BU(G0)}function OM(){return typeof xh=="function"}function Zpe(){var e;const t=xh;if(!t||t===G0)return null;if(ws)return ws;const n=K0();if(n)return ws=n,ws;try{const o=t();return o&&typeof o?.then!="function"?(ws=(e=Ah(o))!=null?e:o,ws):null}catch{return null}}function Y0(){return Ch(this,null,function*(){var e;const t=K0();if(t)return ws=t,ws;if(ws)return ws;if(Mf)return null;const n=xh;if(!n)return Mf=!0,null;try{const o=yield n();if(o)return ws=(e=Ah(o))!=null?e:o,ws}catch{}return Mf=!0,null})}function PM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Br=null,Ir=null;const qs=new Map,Xi=new Map;let Ep=5;const Ol=new Set;function qu(){if(qs.size<Ep&&Ol.size){const e=Array.from(Ol);Ol.clear();for(const t of e)try{t()}catch{}}}function HU(e){Br=e,Ir=null,Br.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=qs.get(n);if(i)if(qs.delete(n),clearTimeout(i.timeoutId),qu(),s)i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Xi.set(a,o),Xi.size>200){const c=Xi.keys().next().value;Xi.delete(c)}}i.resolve(o)}},Br.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of qs.entries())clearTimeout(o.timeoutId),o.reject(new Error(`Worker error: ${t.message}`));qs.clear(),qu()}}function WU(){var e;Br&&((e=Br.terminate)==null||e.call(Br)),Br=null,Ir=null}function zU(e,t=!0,n=2e3,o){return Ch(this,null,function*(){performance.now();const s=PM(e);if(!OM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Ir)return Promise.reject(Ir);const i=`${t?"d":"i"}:${s}`,r=Xi.get(i);if(r)return Promise.resolve(r);const l=Br||(Ir=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ir.name="WorkerInitError",Ir.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Ir);if(qs.size>=Ep){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=qs.size,a.max=Ep,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const p=new Error("Aborted");return p.name="AbortError",void c(p)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{qs.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),qu()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(d),qs.has(u)&&qs.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),qu()},{once:!0});const f=a,h=c;qs.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:s,displayMode:t})})})}function Jpe(e,t=!0,n){const o=`${t?"d":"i"}:${PM(e)}`;if(Xi.set(o,n),Xi.size>200){const s=Xi.keys().next().value;Xi.delete(s)}}const UU="WORKER_BUSY";function qU(e=2e3,t){return qs.size<Ep?Promise.resolve():new Promise((n,o)=>{let s,i=!1;const r=()=>{i||(i=!0,s&&globalThis.clearTimeout(s),Ol.delete(r),n())};if(Ol.add(r),s=globalThis.setTimeout(()=>{if(i)return;i=!0,Ol.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",o(l)},e),queueMicrotask(()=>qu()),t){const l=()=>{if(i)return;i=!0,s&&globalThis.clearTimeout(s),Ol.delete(r);const a=new Error("Aborted");a.name="AbortError",o(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Uc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function ehe(e){return Ch(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!OM()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(s=o.timeout)!=null?s:Uc.timeout,c=(i=o.waitTimeout)!=null?i:Uc.waitTimeout,u=(r=o.backoffMs)!=null?r:Uc.backoffMs,d=(l=o.maxRetries)!=null?l:Uc.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Uc.maxRetries,h=o.signal;let p=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield zU(t,n,a,h)}catch(m){if(m?.code!==UU||p>=f)throw m;if(p++,yield qU(c,h).catch(()=>{}),h?.aborted){const b=new Error("Aborted");throw b.name="AbortError",b}u>0&&(yield new Promise(b=>globalThis.setTimeout(b,u*p)))}}})}function Pa(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function jU(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function i1(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=jU(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function r1(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 RM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function l1(e,t=360,n=500){return RM(e,t,n)}function a1(e,t=360,n=500){return RM(e,t,n)}var VU=Object.defineProperty,KU=Object.defineProperties,GU=Object.getOwnPropertyDescriptors,A2=Object.getOwnPropertySymbols,YU=Object.prototype.hasOwnProperty,XU=Object.prototype.propertyIsEnumerable,T2=(e,t,n)=>t in e?VU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DM=(e,t)=>{for(var n in t||(t={}))YU.call(t,n)&&T2(e,n,t[n]);if(A2)for(var n of A2(t))XU.call(t,n)&&T2(e,n,t[n]);return e},X0=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Q0=()=>Go(()=>import("./mermaid.core-COCaMagj.js").then(e=>e.bn),[]);let Hi=null,Z0=Q0;function QU(e){Z0=e,Hi=null}function ZU(e){QU(Q0)}function JU(){return typeof Z0=="function"}function M2(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=DM({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):s.initialize?s.initialize(i):void 0},KU(n,GU(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function E2(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=DM({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function the(){return X0(this,null,function*(){if(Hi)return Hi;const e=(function(){try{const o=globalThis;return M2(o?.mermaid)}catch{return null}})();if(e)return Hi=e,E2(Hi),Hi;const t=Z0;if(!t)return null;let n;try{n=yield t()}catch(o){throw t===Q0?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):o}return n?(Hi=M2(n),E2(Hi),Hi):null})}let Vo=null,$r=null;const Mo=new Map;let I2=5,$2=!1;const eq="WORKER_BUSY",tq="MERMAID_DISABLED";function nq(e){Vo=e,$r=null;const t=e;Vo.onmessage=n=>{if(Vo!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=Mo.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Vo.onerror=n=>{var o,s;if(Vo===t)if(Mo.size!==0){try{$2?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of Mo.entries())r.reject(new Error(`Worker error: ${n.message}`));Mo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Vo.onmessageerror=n=>{var o,s;if(Vo===t)if(Mo.size!==0){try{$2?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Mo.entries())r.reject(new Error("Worker messageerror"));Mo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function oq(){var e;if(Vo)try{for(const[t,n]of Mo.entries())n.reject(new Error("Worker cleared"));Mo.clear(),(e=Vo.terminate)==null||e.call(Vo)}catch{}Vo=null,$r=null}function BM(e,t,n=1400){if(!JU()){const s=new Error("Mermaid rendering disabled");return s.name="MermaidDisabled",s.code=tq,Promise.reject(s)}if($r)return Promise.reject($r);const o=Vo||($r=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),$r.name="WorkerInitError",$r.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject($r);if(Mo.size>=I2){const s=new Error("Worker busy");return s.name="WorkerBusy",s.code=eq,s.inFlight=Mo.size,s.max=I2,Promise.reject(s)}return new Promise((s,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),Mo.delete(r))},u={resolve:d=>{c(),s(d)},reject:d=>{c(),i(d)}};Mo.set(r,u);try{o.postMessage({id:r,action:e,payload:t})}catch(d){return Mo.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const f=Mo.get(r);f&&f.reject(d)},n)})}function nhe(e,t,n=1400){return X0(this,null,function*(){try{return yield BM("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function ohe(e,t,n=1400){return X0(this,null,function*(){try{return yield BM("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function she(){if(Vo)try{for(const[e,t]of Mo.entries())t.reject(new Error("Worker terminated"));Mo.clear(),Vo.terminate()}finally{Vo=null}}var sq=Object.defineProperty,iq=Object.defineProperties,rq=Object.getOwnPropertyDescriptors,N2=Object.getOwnPropertySymbols,lq=Object.prototype.hasOwnProperty,aq=Object.prototype.propertyIsEnumerable,L2=(e,t,n)=>t in e?sq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rt=(e,t)=>{for(var n in t||(t={}))lq.call(t,n)&&L2(e,n,t[n]);if(N2)for(var n of N2(t))aq.call(t,n)&&L2(e,n,t[n]);return e},Ot=(e,t)=>iq(e,rq(t)),Un=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const cq="__global__",Tg="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",c1=(()=>{const e=globalThis;if(e[Tg])return e[Tg];const t={scopedCustomComponents:{},revision:Yl(0)};return e[Tg]=t,t})(),O2=c1.revision,uq=Symbol("markstreamCustomComponents"),dq=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 ad(e){return dq.has(String(e).trim().toLowerCase())}function fq(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Mg(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([Js(n),Js(fq(n))]))!s||ad(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function uo(e){const t=jt(uq,null);return W(()=>{var n;return O2.value,(function(o,s={}){return O2.value,rt(rt(rt({},Mg(c1.scopedCustomComponents[cq]||{})),Mg(s)),Mg((function(i){return i&&c1.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const pq=["aria-label"],hq={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"},mq={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"},an=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},As=an(Ve({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(w(),N("svg",mq,[...n[1]||(n[1]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),T("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(w(),N("svg",hq,[...n[0]||(n[0]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,pq))}),[["__scopeId","data-v-be21ab83"]]);As.install=e=>{e.component(As.__name,As)};const gq={class:"emoji-node"},us=an(Ve({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("span",gq,R(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);us.install=e=>{e.component(us.__name,us)};const vq=["id"],yq=["title"],Ts=an(Ve({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(w(),N("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[T("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+R(e.node.id)+"]",9,yq)],8,vq))}}),[["__scopeId","data-v-c1463a29"]]);Ts.install=e=>{e.component(Ts.__name,Ts)};const FM=(()=>{try{return!1}catch{}return!1})();function Eg(e){FM&&console.warn(e)}function P2(e,t="safe",n){return q0(e,t,n)}function HM(e){return Qz(e)}function Ig(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function J0(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=t1((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),Ig(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Ig(r.value)]):Object.entries(s).map(([r,l])=>[r,Ig(l)]):null,t,n);var s;if(!o)return;const i=HM(Tp(o));return Object.keys(i).length>0?i:void 0}function R2(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function qc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function $g(e,t,n,o,s,i,r=!1){const l=(function(d,f){return SM(d,f)})(e,o);if(id.has(e.toLowerCase())||!l&&bM(e,i))return null;if(!l&&U0(e,i))return r?[R2(e,t,!0)]:[R2(e,t),...n,`</${e}>`];const a=q0(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=HM(a);return ln(d,Ot(rt({},f),{key:u}),n.length>0?n:void 0)}return ln(e,Ot(rt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function WM(e,t){return tU(e,t)}function Ip(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 f=$g(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);qc(c.length>0?c[c.length-1].children:u,f)}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 f=d.tagName.toLowerCase();let h=-1;for(let p=c.length-1;p>=0;p--)if(c[p].tagName.toLowerCase()===f){h=p;break}if(h!==-1)for(;c.length>h;){const p=c.pop(),m=$g(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?qc(c[c.length-1].children,m):qc(u,m),p.tagName.toLowerCase()!==f&&c.length>h&&Eg(`Auto-closing unclosed tag: <${p.tagName}>`)}else Eg(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=$g(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?qc(c[c.length-1].children,f):qc(u,f),Eg(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(Zz(e),t,n)}catch(s){return o=s,FM&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const kq=["innerHTML"],Ms=an(Ve({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=jt("markstreamHtmlPolicy",void 0),o=W(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=uo(()=>t.customId),i=Ve({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=W(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:Ya(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Ip(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!WM(l,s.value))return{mode:"html",content:Ya(l,o.value)};const a=Ip(l,s.value,o.value);return a===null?{mode:"html",content:Ya(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(w(),N("span",{key:0,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[se(A(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(w(),N("span",{key:1,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},R(r.value.content),3)):(w(),N("span",{key:2,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,kq))}}),[["__scopeId","data-v-d17f12b0"]]);Ms.install=e=>{e.component(Ms.__name,Ms)};const bq={class:"inline-code"},_q={key:0},zo=an(Ve({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Ju(),o=jt("markstreamFade",void 0),s=jt("markstreamTextStreamState",void 0),i=jt("markstreamStreamVersion",void 0),r=W(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=W(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=W(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=W(()=>!l.value),u=W(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=Z(t.node.code),f=Z("");let h=i?.value;const p=Z(0);function m(){return d.value+f.value}function b(){f.value&&(d.value=m(),f.value="")}Ge([()=>t.node.code,u,l,()=>i?.value],([g,v,y,C])=>{const L=String(g??""),$=u.value,k=C!==h;h=C;const M=TM({nextContent:L,persistedContent:$?s?.get($):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:k});d.value=M.settledContent,f.value=M.streamedDelta,M.appended&&(p.value+=1),$&&s?.set($,L)},{immediate:!0}),Ge(l,g=>{var v;g||(v=m(),d.value=v,f.value="")});const _=W(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(w(),N("code",bq,[c.value?(w(),N(Oe,{key:0},[je(R(a.value),1)],64)):(w(),N(Oe,{key:1},[d.value?(w(),N("span",_q,R(d.value),1)):ie("",!0),f.value?(w(),N("span",{key:1,class:De(["inline-code-stream-delta",[_.value]]),onAnimationend:b},R(f.value),35)):ie("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);zo.install=e=>{e.component(zo.__name,zo)};const u1=Z(!1),D2=Z(""),B2=Z("top"),mu=Z(null),gu=Z(null),d1=Z(null),f1=Z(null),F2=Z(null);let Ef=null,If=null,p1=0;function zM(){Ef&&(clearTimeout(Ef),Ef=null),If&&(clearTimeout(If),If=null)}let af=!1,cf=null,H2=!1;function wq(e,t,n="top",o=!1,s,i){if(!e)return;const r=++p1;zM();const l=()=>Un(null,null,function*(){var a,c;if(yield(function(){return Un(this,null,function*(){if(!af&&!H2&&typeof document<"u"){cf!=null||(cf=Un(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([Go(()=>import("./vue.runtime.esm-bundler-Bd0MpuGP.js"),[]),Go(()=>import("./Tooltip-DZguFKhz.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:u1.value,"anchor-el":mu.value,content:D2.value,placement:B2.value,id:gu.value,originX:d1.value,originY:f1.value,isDark:(p=F2.value)!=null?p:void 0})}}).mount(h),af=!0}));try{yield cf}catch(u){af=!1,cf=null,H2=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),af&&r===p1){gu.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,mu.value=e,D2.value=t,B2.value=n,d1.value=(a=s?.x)!=null?a:null,f1.value=(c=s?.y)!=null?c:null,F2.value=typeof i=="boolean"?i:null,u1.value=!0;try{e.setAttribute("aria-describedby",gu.value)}catch{}}});o?l():Ef=setTimeout(l,80)}function Sq(e=!1){p1+=1,zM();const t=()=>{if(mu.value&&gu.value)try{mu.value.removeAttribute("aria-describedby")}catch{}u1.value=!1,mu.value=null,gu.value=null,d1.value=null,f1.value=null};e?t():If=setTimeout(t,120)}const h1={"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..."},m1=e=>{var t;return(t=h1[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function W2(e){return{t(t){if(e.te&&h1[t]&&!e.te(t))return m1(t);const n=e.t(t);return n===t&&h1[t]?m1(t):n}}}function Cq(){const e=(function(){var t,n;try{const o=Oo(),s=o?.proxy,i=s?.$t;if(typeof i=="function"){const a=s?.$te;return{t:i.bind(s),te:typeof a=="function"?a.bind(s):void 0}}const r=(n=(t=o?.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 W2(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return W2({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:m1}}function xq(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const Aq=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Tq={key:1,class:"image-placeholder"},Mq={key:1,class:"image-node__raw-text"},Eq={key:0,class:"image-shimmer-overlay"},Iq={key:1,class:"image-node__raw-text"},$q={key:2,class:"image-error"},Ur=an(Ve({__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,o=t,s=Z(!1),i=Z(!1),r=Z(""),l=Z("primary"),a=Z(null),c=Ju(),u=jt(n1,null);let d="",f=null;const h=W(()=>_w(n.node.src)),p=W(()=>_w(n.fallbackSrc)),m=W(()=>r.value),b=W(()=>!n.lazy),_=W(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=W(()=>l.value==="failed"),v=W(()=>!b.value&&!s.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=W(()=>xq(n,c));function C(P=y.value){P&&a.value&&u?.reportHeight(P,a.value.offsetHeight)}function L(P=y.value){P&>(()=>{C(P)})}function $(){f&&(clearTimeout(f),f=null)}function k(){const P=y.value;P&&d!==P&&(d&&u?.markSettled(d),$(),d=P,u?.markPending(P),typeof window<"u"&&(f=window.setTimeout(()=>{d===P&&(L(P),M())},8e3)))}function M(){return Un(this,null,function*(){const P=d;P&&($(),d="",yield gt(),C(P),u?.markSettled(P))})}function E(){if(l.value==="primary"&&p.value&&p.value!==r.value)return l.value="fallback",r.value=p.value,s.value=!1,i.value=!1,void L();l.value="failed",i.value=!0,o("error",r.value),L()}function O(){s.value=!0,i.value=!1,o("load",m.value),L()}function S(P){P.preventDefault(),s.value&&!i.value&&o("click",[P,m.value])}const{t:I}=Cq();return Ge([h,p,()=>n.node.loading],()=>(s.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.value,void(l.value="primary")):p.value?(r.value=p.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ge([_,s,i,m,()=>n.lazy],([P,D,H,z,U])=>P&&z&&!H?D?(M(),void L()):U?(k(),void L()):void(D||H||k()):(M(),void L()),{flush:"post",immediate:!0}),vo(()=>{(function(){const P=d;P&&($(),d="",u?.markSettled(P))})()}),(P,D)=>{var H,z,U,Q,X;return w(),N("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[_.value?(w(),N("img",{key:0,src:m.value,alt:String((z=(H=n.node.alt)!=null?H:n.node.title)!=null?z:""),title:String((Q=(U=n.node.title)!=null?U:n.node.alt)!=null?Q:""),class:De(["image-node__img",{"is-loading":!b.value&&!s.value,"is-loaded":b.value||s.value,"has-natural-size":s.value,"cursor-pointer":s.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:b.value?"high":void 0,decoding:b.value?"sync":"async",tabindex:s.value?0:-1,"aria-label":(X=n.node.alt)!=null?X:A(I)("image.preview"),onError:E,onLoad:O,onClick:S},null,42,Aq)):ie("",!0),e.node.loading&&!i.value?(w(),N("span",Tq,[n.usePlaceholder?An(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=T("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",Mq,R(e.node.raw),1))])):ie("",!0),se(Kr,{name:"shimmer-fade"},{default:ke(()=>[v.value&&!e.node.loading?(w(),N("span",Eq,[n.usePlaceholder?An(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=T("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",Iq,R(e.node.raw),1))])):ie("",!0)]),_:3}),g.value?(w(),N("span",$q,[An(P.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[2]||(D[2]=T("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[T("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)),T("span",null,R(A(I)("image.loadError")),1)],!0)])):ie("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Ur.install=e=>{e.component(Ur.__name,Ur)};const Nq={key:2},Ii=Ve({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=uo(()=>t.customId),o=jt("markstreamHtmlPolicy",void 0),s=jt("markstreamNestedRendererProps",void 0),i=W(()=>{var p;return(p=o?.value)!=null?p:"safe"}),r=W(()=>{var p,m;const b=(p=s?.value)!=null?p:{};return Ot(rt({},b),{customId:(m=t.customId)!=null?m:b.customId,htmlPolicy:i.value})}),l=li({loader:()=>Promise.resolve().then(()=>ry),suspensible:!1}),a=W(()=>t.components[String(t.node.type)]),c=W(()=>!!(a.value&&n.value[t.node.type]&&!ad(String(t.node.type)))),u=W(()=>c.value?J0(t.node,i.value):void 0),d=W(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=W(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=W(()=>{var p,m;return String((m=(p=t.node.content)!=null?p:t.node.raw)!=null?m:"")});return(p,m)=>a.value&&c.value?(w(),ge(Fo(a.value),un({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:ke(()=>[d.value?(w(),ge(A(l),un({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"])):f.value?(w(),ge(A(l),un({key:1},r.value,{content:f.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"])):ie("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(w(),ge(Fo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(w(),N("span",Nq,R(h.value),1)):ie("",!0)}}),Lq=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],Oq={key:0,translate:"no",class:"markstream-pre__diff-code"},Pq={class:"markstream-pre__diff-number","aria-hidden":"true"},Rq={class:"markstream-pre__diff-content"},Dq={class:"markstream-pre__diff-content-inner"},Bq={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},Fq=["textContent"],_s=Ve({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=W(()=>{var S,I,P;const D=String((I=(S=t.node)==null?void 0:S.language)!=null?I:"");return String((P=String(D).split(/\s+/g)[0])!=null?P:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=W(()=>`language-${n.value}`),s=W(()=>{var S,I,P,D,H;return((S=t.node)==null?void 0:S.diff)===!0?String((P=(I=t.node)==null?void 0:I.code)!=null?P:""):(function(z,U){const Q=String(z??"");return U?Q:Q.replace(/\r\n$|\n$|\r$/,"")})((D=t.node)==null?void 0:D.code,((H=t.node)==null?void 0:H.loading)===!0)}),i=W(()=>s.value.split(/\r\n|\n|\r/)),r=W(()=>Array.from({length:Math.max(1,i.value.length)},(S,I)=>I+1)),l=W(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=W(()=>l.value&&t.diffInline===!0),c=W(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const I=`${Math.ceil(S)}px`;return{height:I,minHeight:I,maxHeight:I,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,I="context",P={}){const D=u(S);return{code:S,kind:D&&I!=="hunk"&&!P.preserveBlankKind?"context":I,empty:D}}function f(S){const I=String(S??"");return I?I.split(/\r\n|\n|\r/):[]}function h(S,I){return!u(S[I])||I<S.length-1}function p(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function b(S,I){const P=f(S),D=f(I),H=(function(me,Ae){const be=me.length,ze=Ae.length;if((be+1)*(ze+1)>15e5)return null;const qe=ze+1,Fe=new Uint32Array((be+1)*(ze+1));for(let te=1;te<=be;te++)for(let ee=1;ee<=ze;ee++){const q=te*qe+ee;if(me[te-1]===Ae[ee-1])Fe[q]=Fe[(te-1)*qe+(ee-1)]+1;else{const Y=Fe[(te-1)*qe+ee],de=Fe[te*qe+(ee-1)];Fe[q]=Y>=de?Y:de}}const Le=[];let le=be,F=ze;for(;le>0&&F>0;)me[le-1]===Ae[F-1]?(Le.push({originalIndex:le-1,modifiedIndex:F-1}),le--,F--):Fe[(le-1)*qe+F]>=Fe[le*qe+(F-1)]?le--:F--;return Le.reverse(),Le})(P,D);if(H){const me=[];let Ae=0,be=0;for(const ze of H){for(;Ae<ze.originalIndex;)me.push(Ot(rt({},d(P[Ae],"removed",{preserveBlankKind:h(P,Ae)})),{key:`inline-removed-source-${Ae}`,number:""})),Ae++;for(;be<ze.modifiedIndex;)me.push(Ot(rt({},d(D[be],"added",{preserveBlankKind:h(D,be)})),{key:`inline-added-source-${be}`,number:be+1})),be++;me.push(Ot(rt({},d(D[ze.modifiedIndex])),{key:`inline-context-source-${ze.originalIndex}-${ze.modifiedIndex}`,number:ze.modifiedIndex+1})),Ae=ze.originalIndex+1,be=ze.modifiedIndex+1}for(;Ae<P.length;)me.push(Ot(rt({},d(P[Ae],"removed",{preserveBlankKind:h(P,Ae)})),{key:`inline-removed-source-${Ae}`,number:""})),Ae++;for(;be<D.length;)me.push(Ot(rt({},d(D[be],"added",{preserveBlankKind:h(D,be)})),{key:`inline-added-source-${be}`,number:be+1})),be++;return me}const z=[];let U=0,Q=P.length-1,X=D.length-1;for(;U<=Q&&U<=X&&P[U]===D[U];)z.push(Ot(rt({},d(D[U])),{key:`inline-prefix-${U}`,number:U+1})),U++;const ue=[];for(;Q>=U&&X>=U&&P[Q]===D[X];)ue.unshift(Ot(rt({},d(D[X])),{key:`inline-suffix-${X}`,number:X+1})),Q--,X--;for(let me=U;me<=Q;me++)z.push(Ot(rt({},d(P[me],"removed",{preserveBlankKind:h(P,me)})),{key:`inline-removed-source-${me}`,number:""}));for(let me=U;me<=X;me++)z.push(Ot(rt({},d(D[me],"added",{preserveBlankKind:h(D,me)})),{key:`inline-added-source-${me}`,number:me+1}));return z.concat(ue)}const _=W(()=>{var S,I,P,D;const H=(function(X){const ue=X.some(Ae=>p(Ae)),me=X.some(Ae=>m(Ae));return ue&&me||(function(){var Ae,be,ze,qe;if(n.value==="diff")return!0;const Fe=(qe=(ze=String((be=(Ae=t.node)==null?void 0:Ae.raw)!=null?be:"").split(/\r?\n/,1)[0])==null?void 0:ze.trim())!=null?qe:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Fe)})()&&(ue||me)})(i.value),z=(function(){var X,ue;return((X=t.node)==null?void 0:X.originalCode)!=null||((ue=t.node)==null?void 0:ue.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:H?(function(X){const ue=[];let me=1;for(const[Ae,be]of X.entries())if(be.startsWith("@@"))ue.push(Ot(rt({},d(be,"hunk")),{key:`inline-hunk-${Ae}`,number:""}));else if(p(be))ue.push(Ot(rt({},d(be.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${Ae}`,number:""}));else if(m(be))ue.push(Ot(rt({},d(be.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${Ae}`,number:me++}));else{const ze=be.startsWith(" ")?be.slice(1):be;ue.push(Ot(rt({},d(ze)),{key:`inline-context-${Ae}`,number:me})),me++}return ue})(i.value):b((S=t.node)==null?void 0:S.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!H&&z){const X=f((P=t.node)==null?void 0:P.originalCode),ue=f((D=t.node)==null?void 0:D.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:X.map((me,Ae)=>{const be=ue[Ae]===me?"context":"removed";return Ot(rt({},d(me,be,{preserveBlankKind:h(X,Ae)})),{key:`original-${Ae}`,number:Ae+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ue.map((me,Ae)=>{const be=X[Ae]===me?"context":"added";return Ot(rt({},d(me,be,{preserveBlankKind:h(ue,Ae)})),{key:`modified-${Ae}`,number:Ae+1})})}]}const U=[],Q=[];for(const X of i.value)if(X.startsWith("@@"))U.push(d(X,"hunk")),Q.push(d(X,"hunk"));else if(X.startsWith("-")&&!X.startsWith("---"))U.push(d(X.slice(1),"removed",{preserveBlankKind:!0}));else if(X.startsWith("+")&&!X.startsWith("+++"))Q.push(d(X.slice(1),"added",{preserveBlankKind:!0}));else{const ue=X.startsWith(" ")?X.slice(1):X;U.push(d(ue)),Q.push(d(ue))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((X,ue)=>Ot(rt({},X),{key:`original-${ue}`,number:ue+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Q.map((X,ue)=>Ot(rt({},X),{key:`modified-${ue}`,number:ue+1}))}]}),g=W(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=Z(null),y=Z([]);let C=null,L=null;function $(S){const I=Number.parseFloat(String(S??""));return Number.isFinite(I)&&I>0?I:0}function k(S,I){var P;if(!S)return I;const D=S.querySelector(".markstream-pre__diff-content"),H=D?.getBoundingClientRect(),z=(P=H?.height)!=null?P:0;return Math.max(I,Math.ceil(z))}function M(){typeof window<"u"&&(C!=null&&window.cancelAnimationFrame(C),C=window.requestAnimationFrame(()=>{(function(){var S,I;C=null;const P=v.value;if(!P||!l.value)return void(y.value.length&&(y.value=[]));const D=(function(me){const Ae=window.getComputedStyle(me),be=$(Ae.getPropertyValue("--markstream-pre-diff-line-height"));if(be>0)return be;const ze=$(Ae.lineHeight);return ze>0?ze:18})(P),H=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),z=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),U=Math.max(H.length,z.length),Q=[];for(let me=0;me<U;me++){const Ae=k((S=H[me])!=null?S:null,D),be=k((I=z[me])!=null?I:null,D),ze=Math.max(D,Ae,be);Q.push({rowHeight:ze,originalHeight:Ae,modifiedHeight:be})}var X,ue;X=y.value,ue=Q,X.length===ue.length&&X.every((me,Ae)=>{const be=ue[Ae];return be&&Math.abs(me.rowHeight-be.rowHeight)<=.5&&Math.abs(me.originalHeight-be.originalHeight)<=.5&&Math.abs(me.modifiedHeight-be.modifiedHeight)<=.5})||(y.value=Q)})()}))}function E(S){L?.disconnect(),L=null,S&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{M()}),L.observe(S))}function O(S,I){const P=y.value[S];if(!P)return;const D=I==="original"?P.originalHeight:P.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(P.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(D)}px`}}return Ge(v,S=>{E(S),gt(()=>M())},{flush:"post"}),Ge([l,_],()=>{E(v.value),gt(()=>M())},{flush:"post",immediate:!0}),vo(()=>{C!=null&&(window.cancelAnimationFrame(C),C=null),L?.disconnect(),L=null}),(S,I)=>(w(),N("pre",{ref_key:"preRef",ref:v,style:Yt(c.value),class:De([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":g.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(w(),N("code",Oq,[(w(!0),N(Oe,null,st(_.value,P=>(w(),N("span",{key:P.key,class:De(["markstream-pre__diff-pane",P.className])},[(w(!0),N(Oe,null,st(P.lines,(D,H)=>(w(),N("span",{key:D.key,class:De(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:Yt(O(H,P.key))},[I[0]||(I[0]=T("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),T("span",Pq,R(D.number),1),T("span",Rq,[T("span",Dq,R(D.code),1)])],6))),128))],2))),128))])):(w(),N(Oe,{key:1},[t.showLineNumbers?(w(),N("span",Bq,[(w(!0),N(Oe,null,st(r.value,P=>(w(),N("span",{key:P,class:"markstream-pre__line-number"},R(P),1))),128))])):ie("",!0),T("code",{translate:"no",class:"markstream-pre__code",textContent:R(s.value)},null,8,Fq)],64))],14,Lq))}});_s.install=e=>{e.component(_s.__name,_s)};const Ng=Yl(!1);let z2=null;const Hq={key:0},Zn=an(Ve({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(z2||(z2=Y0().then(_=>{Ng.value=!!_}).catch(()=>{Ng.value=!1})),Wf(Ng)),o=Ju(),s=jt("markstreamFade",void 0),i=jt("markstreamTextStreamState",void 0),r=jt("markstreamStreamVersion",void 0),l=W(()=>{const _=o.fade;return _===""||_===!0||_==="true"||_!==!1&&_!=="false"&&void 0}),a=W(()=>typeof l.value=="boolean"?l.value:typeof s?.value!="boolean"||s.value),c=W(()=>{var _;const g=(_=o["index-key"])!=null?_:o.indexKey;return g==null||g===""?"":String(g)}),u=Z(t.node.content),d=Z("");let f=r?.value;const h=Z(0);function p(){return u.value+d.value}function m(){d.value&&(u.value=p(),d.value="")}Ge([()=>t.node.content,c,a,()=>r?.value],([_,g,v,y])=>{const C=String(_??""),L=c.value,$=y!==f;f=y;const k=TM({nextContent:C,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:$});u.value=k.settledContent,d.value=k.streamedDelta,k.appended&&(h.value+=1),L&&i?.set(L,C)},{immediate:!0}),Ge(a,_=>{var g;_||(g=p(),u.value=g,d.value="")});const b=W(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(_,g)=>(w(),N("span",{class:De([[A(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(w(),N("span",Hq,R(u.value),1)):ie("",!0),d.value?(w(),N("span",{key:1,class:De(["text-node-stream-delta",[b.value]]),onAnimationend:m},R(d.value),35)):ie("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Zn.install=e=>{e.component(Zn.__name,Zn)};const UM=Ve({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var o;return ln(_s,Ot(rt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(o=n.estimatedHeightPx)!=null?o:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),Lg=li({loader:()=>Un(null,null,function*(){try{return(yield Go(()=>import("./CodeBlockNode-CaJnX8WY.js"),__vite__mapDeps([4,5,6]))).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),_s}}),loadingComponent:UM,delay:0,suspensible:!1}),pi=li(()=>Un(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,o,s,i;return ln(Zn,Ot(rt({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))};try{if(yield Y0())return(yield Go(()=>import("./index6-BCwMTbX-.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,o,s,i;return ln(Zn,Ot(rt({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),qM=li(()=>Un(null,null,function*(){try{if(yield Y0())return(yield Go(()=>import("./index5-D0QCZ2WX.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,o,s;return ln(Zn,Ot(rt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),Xo=an(Ve({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(w(),N("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]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},R(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Xo.install=e=>{e.component(Xo.__name,Xo)};const Wq={class:"superscript-node"},ds=an(Ve({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=uo(()=>t.customId),o=W(()=>rt({text:Zn,inline_code:zo,link:Jo,html_inline:Ms,strong:Qo,emphasis:es,footnote_reference:Ts,strikethrough:Zo,highlight:Es,insert:ps,subscript:fs,emoji:us,math_inline:pi,reference:Xo},n.value));return(s,i)=>(w(),N("sup",Wq,[(w(!0),N(Oe,null,st(e.node.children,(r,l)=>(w(),ge(A(Ii),{key:`${e.indexKey||"superscript"}-${l}`,components:o.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"]]);ds.install=e=>{e.component(ds.__name,ds)};const zq={class:"subscript-node"},fs=an(Ve({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=uo(()=>t.customId),o=W(()=>rt({text:Zn,inline_code:zo,link:Jo,html_inline:Ms,strong:Qo,emphasis:es,footnote_reference:Ts,strikethrough:Zo,highlight:Es,insert:ps,superscript:ds,emoji:us,math_inline:pi,reference:Xo},n.value));return(s,i)=>(w(),N("sub",zq,[(w(!0),N(Oe,null,st(e.node.children,(r,l)=>(w(),ge(A(Ii),{key:`${e.indexKey||"subscript"}-${l}`,components:o.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"]]);fs.install=e=>{e.component(fs.__name,fs)};const Uq={class:"strong-node"},Qo=an(Ve({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=uo(()=>t.customId),o=W(()=>rt({text:Zn,inline_code:zo,link:Jo,html_inline:Ms,emphasis:es,strikethrough:Zo,highlight:Es,insert:ps,subscript:fs,superscript:ds,emoji:us,footnote_reference:Ts,math_inline:pi,reference:Xo},n.value));return(s,i)=>(w(),N("strong",Uq,[(w(!0),N(Oe,null,st(e.node.children,(r,l)=>(w(),ge(A(Ii),{key:`${e.indexKey||"strong"}-${l}`,components:o.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"]]);Qo.install=e=>{e.component(Qo.__name,Qo)};const qq={class:"strikethrough-node"},Zo=an(Ve({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=uo(()=>t.customId),o=W(()=>rt({text:Zn,inline_code:zo,link:Jo,html_inline:Ms,strong:Qo,emphasis:es,highlight:Es,insert:ps,subscript:fs,superscript:ds,emoji:us,footnote_reference:Ts,math_inline:pi,reference:Xo},n.value));return(s,i)=>(w(),N("del",qq,[(w(!0),N(Oe,null,st(e.node.children,(r,l)=>(w(),ge(A(Ii),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.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"]]);Zo.install=e=>{e.component(Zo.__name,Zo)};const jq=["href","title","aria-label","aria-hidden","target","rel"],Vq=["aria-hidden"],Kq={class:"link-text-wrapper relative inline-flex"},Gq={class:"leading-[normal] link-text"},Jo=an(Ve({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=jt("markstreamShowTooltips",void 0),o=W(()=>{const _=n?.value;return typeof _=="boolean"?_:t.showTooltip}),s=W(()=>{var _,g,v,y,C;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",$=(_=t.animationOpacity)!=null?_:.35,k=Math.max(.12,Math.min(.5*$,$)),M={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":L,"--underline-opacity":String($),"--underline-rest-opacity":String(k),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(C=t.animationIteration)!=null?C:"infinite"};return t.color&&(M["--link-color"]=t.color),M}),i=uo(()=>t.customId),r=W(()=>rt({text:Zn,strong:Qo,strikethrough:Zo,emphasis:es,image:Ur,html_inline:Ms,inline_code:zo},i.value)),l=Ju(),a=W(()=>{var _,g;const v=(_=t.node)==null?void 0:_.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const C of v)Array.isArray(C)&&C[0]&&(y[String(C[0])]=String((g=C[1])!=null?g:""));else for(const[C,L]of Object.entries(v))C&&L!=null&&L!==!1&&(y[C]=L===!0?"":String(L));return P2(y,"safe","a")}),c=W(()=>rt(rt({},l),a.value)),u=W(()=>{var _,g;return P2({href:String((g=(_=t.node)==null?void 0:_.href)!=null?g:"")},"safe","a").href}),d=W(()=>{if(!u.value)return;const _=c.value.target;return(typeof _=="string"?_.trim():String(_??"").trim())||(BB(u.value)?"_blank":void 0)}),f=W(()=>{var _;return String((_=d.value)!=null?_:"").trim().toLowerCase()==="_blank"}),h=W(()=>{if(!u.value)return;const _=c.value.rel,g=new Set((typeof _=="string"?_:String(_??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(y=>y.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),p=W(()=>{const _=rt({},c.value);return delete _.title,delete _.href,delete _.target,delete _.rel,_});function m(){o.value&&Sq()}const b=W(()=>{var _,g;const v=(_=t.node)==null?void 0:_.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(_,g)=>{var v,y;return e.node.loading?(w(),N("span",un({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},A(l),{style:s.value}),[T("span",Kq,[T("span",Gq,[se(A(Zn),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=T("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,Vq)):(w(),N("a",un({key:0,class:"link-node",href:u.value,title:o.value?"":b.value,"aria-label":`Link: ${b.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:s.value,onMouseenter:g[0]||(g[0]=C=>(function(L){var $,k,M,E;if(!o.value)return;const O=L,S=O?.clientX!=null&&O?.clientY!=null?{x:O.clientX,y:O.clientY}:void 0,I=(($=t.node)==null?void 0:$.title)||((k=u.value)!=null&&k.includes("xn--")&&((E=(M=t.node)==null?void 0:M.text)!=null&&E.includes("://"))?t.node.text:u.value)||"";wq(L.currentTarget,I,"top",!1,S)})(C)),onMouseleave:m}),[(w(!0),N(Oe,null,st(e.node.children,(C,L)=>(w(),ge(A(Ii),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:C,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,jq))}}}),[["__scopeId","data-v-367e6ca4"]]);Jo.install=e=>{e.component(Jo.__name,Jo)};const Yq={class:"insert-node"},ps=an(Ve({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=uo(()=>t.customId),o=W(()=>rt({text:Zn,inline_code:zo,link:Jo,html_inline:Ms,strong:Qo,emphasis:es,strikethrough:Zo,highlight:Es,subscript:fs,superscript:ds,emoji:us,footnote_reference:Ts,math_inline:pi,reference:Xo},n.value));return(s,i)=>(w(),N("ins",Yq,[(w(!0),N(Oe,null,st(e.node.children,(r,l)=>(w(),ge(A(Ii),{key:`${e.indexKey||"insert"}-${l}`,components:o.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"]]);ps.install=e=>{e.component(ps.__name,ps)};const Xq={class:"highlight-node"},Es=an(Ve({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=uo(()=>t.customId),o=W(()=>rt({text:Zn,inline_code:zo,link:Jo,html_inline:Ms,strong:Qo,emphasis:es,strikethrough:Zo,insert:ps,subscript:fs,superscript:ds,emoji:us,footnote_reference:Ts,math_inline:pi,reference:Xo},n.value));return(s,i)=>(w(),N("mark",Xq,[(w(!0),N(Oe,null,st(e.node.children,(r,l)=>(w(),ge(A(Ii),{key:`${e.indexKey||"highlight"}-${l}`,components:o.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"]]);Es.install=e=>{e.component(Es.__name,Es)};const Qq={class:"emphasis-node"},es=an(Ve({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=uo(()=>t.customId),o=W(()=>rt({text:Zn,inline_code:zo,link:Jo,html_inline:Ms,strong:Qo,strikethrough:Zo,highlight:Es,insert:ps,subscript:fs,superscript:ds,emoji:us,footnote_reference:Ts,math_inline:pi,reference:Xo},n.value));return(s,i)=>(w(),N("em",Qq,[(w(!0),N(Oe,null,st(e.node.children,(r,l)=>(w(),ge(A(Ii),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.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"]]);es.install=e=>{e.component(es.__name,es)};const Zq={class:"hard-break"},qr=an(Ve({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("br",Zq))}),[["__scopeId","data-v-50c58f70"]]);qr.install=e=>{e.component(qr.__name,qr)};const ju=Ve({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Rr({checkbox:As,checkbox_input:As,emoji:us,emphasis:es,hardbreak:qr,highlight:Es,inline_code:zo,insert:ps,link:Jo,reference:Xo,strikethrough:Zo,strong:Qo,subscript:fs,superscript:ds,text:Zn}),o=uo(()=>t.customId),s=W(()=>{const i=o.value;return Object.keys(i).length>0?rt(rt({},n),i):n});return(i,r)=>(w(!0),N(Oe,null,st(e.nodes,(l,a)=>(w(),ge(A(Ii),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function g1(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(g1)}function $p(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(g1))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(g1)?s:null}function rc(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const Jq=["cite"],ej={key:0,dir:"auto",class:"paragraph-node"},tj=["custom-id"],$f=an(Ve({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=uo(()=>t.customId),o=W(()=>!!n.value.paragraph),s=W(()=>!!n.value.text),i=W(()=>$p(t.node.children,!o.value)),r=W(()=>t.fade!==!1||s.value?null:rc(i.value));return On("markstreamShowTooltips",W(()=>t.showTooltips)),On("markstreamFade",W(()=>t.fade)),(l,a)=>(w(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(w(),N("p",ej,[r.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(r.value),9,tj)):(w(),ge(A(ju),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(w(),ge(A(hs),{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,Jq))}}),[["__scopeId","data-v-abfecebc"]]);$f.install=e=>{e.component($f.__name,$f)};const nj={class:"definition-list"},oj={class:"definition-term"},sj={class:"definition-desc"},Nf=an(Ve({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(w(),N("dl",nj,[(w(!0),N(Oe,null,st(t.node.items,(s,i)=>(w(),N(Oe,{key:i},[T("dt",oj,[se(A(hs),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),T("dd",sj,[se(A(hs),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Nf.install=e=>{e.component(Nf.__name,Nf)};const ij=["href","title"],vu=an(Ve({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const i=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(w(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,ij))}}),[["__scopeId","data-v-e1eb37b6"]]);vu.install=e=>{e.component(vu.__name,vu)};const rj=["id"],lj={class:"flex-1"},Lf=Ve({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(w(),N("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[T("div",lj,[se(A(hs),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,rj))}});Lf.install=e=>{e.component(Lf.__name,Lf)};const aj=["custom-id"],v1=an(Ve({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=uo(()=>t.customId),o=jt("markstreamFade",void 0),s=W(()=>o?.value!==!1||n.value.text?null:rc(t.node.children)),i=W(()=>rt({text:Zn,inline_code:zo,link:Jo,image:Ur,strong:Qo,emphasis:es,strikethrough:Zo,highlight:Es,insert:ps,subscript:fs,superscript:ds,emoji:us,checkbox:As,checkbox_input:As,footnote_reference:Ts,hardbreak:qr,math_inline:pi,reference:Xo},n.value));return(r,l)=>(w(),ge(Fo(`h${e.node.level}`),un({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:ke(()=>[s.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(s.value),9,aj)):(w(!0),N(Oe,{key:1},st(e.node.children,(a,c)=>(w(),ge(A(Ii),{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"]]),Np=v1;Np.install=e=>{e.component(v1.__name,v1)};const cj={key:0,dir:"auto",class:"paragraph-node"},uj=["custom-id"],dj={dir:"auto",class:"paragraph-node"},fj=["custom-id"],Xa=an(Ve({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=W(()=>{var h;return(h=t.node)!=null?h:t.item}),o=uo(()=>t.customId),s=W(()=>!!o.value.paragraph),i=W(()=>!!o.value.text),r=W(()=>{var h;return $p((h=n.value)==null?void 0:h.children,!s.value)}),l=W(()=>{var h;if(s.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const m=p[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const b=p.slice(1);if(!b.every(g=>g?.type==="list"))return null;const _=$p([m]);return _?{paragraphChildren:_,nestedLists:b}:null});function a(){return t.fade===!1&&!i.value}const c=W(()=>a()?rc(r.value):null),u=W(()=>{var h;return a()?rc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=W(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return On("markstreamShowTooltips",W(()=>t.showTooltips)),On("markstreamFade",W(()=>t.fade)),(h,p)=>{var m,b;return w(),N("li",un({class:"list-item",dir:"auto"},f.value),[r.value?(w(),N("p",cj,[c.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(c.value),9,uj)):(w(),ge(A(ju),{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?(w(),N(Oe,{key:1},[T("p",dj,[u.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(u.value),9,fj)):(w(),ge(A(ju),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(w(!0),N(Oe,null,st(l.value.nestedLists,(_,g)=>(w(),ge(A(hs),{key:g,nodes:[_],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:p[0]||(p[0]=v=>h.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(w(),ge(A(hs),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(b=(m=n.value)==null?void 0:m.children)!=null?b:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=_=>h.$emit("copy",_))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Xa.install=e=>{e.component(Xa.__name,Xa)};const Qa=an(Ve({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=uo(()=>e.customId),n=W(()=>t.value.list_item||Xa);return(o,s)=>(w(),ge(Fo(e.node.ordered?"ol":"ul"),{class:De(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:ke(()=>[(w(!0),N(Oe,null,st(e.node.items,(i,r)=>{var l;return w(),ge(Fo(n.value),un({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,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);Qa.install=e=>{e.component(Qa.__name,Qa)};const jM=Symbol("ViewportPriority");function pj(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Z(t):t,r=s?(n=window.requestIdleCallback)!=null?n:g=>window.setTimeout(()=>g({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:g=>window.clearTimeout(g):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function h(){if(f!=null){try{l?.(f)}catch{}f=null}}function p(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||h()}}function m(g){const v=u.get(g);if(v){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch{}}try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()}}function b(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&b())},{timeout:1200}))}Ge(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);h()}},{flush:"sync"});const _=(g,v)=>{const y=Z(!1);let C,L=!1;const $=new Promise(E=>{C=()=>{L||(L=!0,E())}}),k=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),p()};if(!s||!i.value)return y.value=!0,C(),{isVisible:y,whenVisible:$,destroy:k};const M=(function(E,O){if(!s)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(D,H){var z,U,Q;return{root:(z=e?.(D??null))!=null?z:null,rootMargin:(U=H?.rootMargin)!=null?U:"300px",threshold:(Q=H?.threshold)!=null?Q:0}})(E,O);if(a&&(P=S,(I=c)&&I.root===P.root&&I.rootMargin===P.rootMargin&&I.threshold===P.threshold))return a;var I,P;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const H of D)(H.isIntersecting||H.intersectionRatio>0)&&m(H.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const D of u.keys())a.observe(D);return a})(g,v);return M?(u.set(g,{resolve:C,visible:y}),M.observe(g),d.add(g),b(),{isVisible:y,whenVisible:$,destroy:k}):(y.value=!0,C(),{isVisible:y,whenVisible:$,destroy:k})};return On(jM,_),_}function hj(){var e,t;const n=jt(jM,void 0);if(n)return n;const o=new WeakMap;let s=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const h=o.get(f);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const h=Z(!1);let p,m=!1;const b=new Promise(v=>{p=()=>{m||(m=!0,v())}}),_=()=>{try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()},g=s||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(s=new IntersectionObserver(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),s));return g?(o.set(f,{resolve:p,visible:h}),g.observe(f),i.add(f),d(),{isVisible:h,whenVisible:b,destroy:_}):(h.value=!0,p(),{isVisible:h,whenVisible:b,destroy:_})}}const mj={key:2,class:"html-block-node__raw"},gj=["innerHTML"],vj={key:1,class:"html-block-node__placeholder"},yu=an(Ve({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=jt("markstreamHtmlPolicy",void 0),o=jt("markstreamNestedRendererProps",void 0),s=W(()=>{var L,$;return($=(L=t.htmlPolicy)!=null?L:n?.value)!=null?$:"safe"}),i=W(()=>{var L,$;const k=(L=o?.value)!=null?L:{};return Ot(rt({},k),{customId:($=t.customId)!=null?$:k.customId,htmlPolicy:s.value})}),r=li({loader:()=>Promise.resolve().then(()=>ry),suspensible:!1}),l=W(()=>{const L=t1(t.node.attrs,s.value);if(!L)return;const $=Tp(L);return Object.keys($).length>0?$:void 0}),a=W(()=>{const L=String(t.node.tag||"").trim(),$=t1(t.node.attrs,s.value,L);if(!$)return;const k=Tp($);return Object.keys(k).length>0?k:void 0}),c=uo(()=>t.customId),u=Ve({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Z(null),f=Z(typeof window>"u"),h=Z(t.node.content),p=W(()=>Array.isArray(t.node.children)?t.node.children:[]),m=W(()=>String(t.node.tag||"div")),b=W(()=>{const L=m.value.trim().toLowerCase();return IT.has(L)||U0(L,s.value)}),_=W(()=>p.value.length>0&&!!t.node.tag&&!b.value),g=W(()=>{var L,$,k;if(_.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(L=h.value)!=null?L:""};const M=($=h.value)!=null?$:t.node.content;if(!M)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:Ya(M,s.value)};if(t.node.loading){const O=Ip(M,c.value,s.value);return O===null?{mode:"text",content:(k=t.node.raw)!=null?k:M}:{mode:"dynamic",nodes:O}}if(!WM(M,c.value))return{mode:"html",content:Ya(M,s.value)};const E=Ip(M,c.value,s.value);return E===null?{mode:"html",content:Ya(M,s.value)}:{mode:"dynamic",nodes:E}}),v=hj(),y=Z(null),C=!!t.node.loading;return typeof window<"u"?(Ge(d,L=>{var $,k;if((k=($=y.value)==null?void 0:$.destroy)==null||k.call($),y.value=null,!C)return f.value=!0,void(h.value=t.node.content);if(!L)return void(f.value=!1);const M=v(L,{rootMargin:"400px"});y.value=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ge(()=>t.node.content,L=>{C&&!f.value||(h.value=L)})):f.value=!0,vo(()=>{var L,$;($=(L=y.value)==null?void 0:L.destroy)==null||$.call(L),y.value=null}),(L,$)=>(w(),ge(Fo(_.value?m.value:"div"),un({ref_key:"htmlRef",ref:d,class:"html-block-node"},_.value?a.value:void 0),{default:ke(()=>[f.value?(w(),N(Oe,{key:0},[g.value.mode==="structured"?(w(),ge(A(r),un({key:0},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(w(),ge(A(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(w(),N("pre",mj,R(g.value.content),1)):(w(),N("div",un({key:3},l.value,{innerHTML:g.value.content}),null,16,gj))],64)):(w(),N("div",vj,[An(L.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=T("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=T("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=T("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);yu.install=e=>{e.component(yu.__name,yu)};const yj={dir:"auto",class:"paragraph-node"},kj=["custom-id"],zl=an(Ve({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=uo(()=>t.customId),o=jt("markstreamHtmlPolicy",void 0),s=jt("markstreamFade",void 0),i=jt("markstreamParseOptions",void 0),r=jt("markstreamCustomMarkdownIt",void 0),l=jt("markstreamNestedRendererProps",void 0),a=W(()=>{var k;return(k=o?.value)!=null?k:"safe"}),c=W(()=>{var k;return(k=t.parseOptions)!=null?k:i?.value}),u=W(()=>{var k;return(k=t.customMarkdownIt)!=null?k:r?.value}),d=W(()=>{var k,M;return(M=t.customHtmlTags)!=null?M:(k=l?.value)==null?void 0:k.customHtmlTags}),f=W(()=>{var k,M;const E=(k=l?.value)!=null?k:{};return Ot(rt({},E),{customId:(M=t.customId)!=null?M:E.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=li({loader:()=>Promise.resolve().then(()=>ry),suspensible:!1});function p(k){var M;return k.type==="text"&&String((M=k.content)!=null?M:"").trim()===""}const m=W(()=>t.node.children.filter(k=>!p(k))),b=W(()=>m.value.length>0&&m.value.every(k=>k.type==="image"||(function(M){var E;const O=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(I=>!p(I)):[]})(M);return O.length===1&&((E=O[0])==null?void 0:E.type)==="image"})(k))),_=W(()=>new Set(pc(d.value))),g=W(()=>{if(!b.value||m.value.length<=1)return t.node.children;const k=[];for(let M=0;M<t.node.children.length;M++){const E=t.node.children[M];if(!p(E)){k.push(E);continue}const O=k.length>0,S=t.node.children.slice(M+1).some(I=>!p(I));O&&S&&k.push(Ot(rt({},E),{content:" ",raw:" "}))}return k}),v=W(()=>s?.value===!1&&!n.value.text),y=W(()=>v.value?rc(g.value):null);function C(k,M){return{node:k,"index-key":`${t.indexKey}-${M}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=W(()=>rt({inline_code:zo,image:Ur,link:Jo,hardbreak:qr,emphasis:es,strong:Qo,strikethrough:Zo,highlight:Es,insert:ps,subscript:fs,superscript:ds,html_inline:Ms,html_block:yu,emoji:us,checkbox:As,math_inline:pi,checkbox_input:As,reference:Xo,footnote_anchor:vu,footnote_reference:Ts,text:Zn},n.value)),$=W(()=>g.value.map((k,M)=>{var E;const O=(function(S){var I,P,D,H;if(S.type==="html_block"||S.type==="html_inline"){const z=String((I=S.tag)!=null?I:"").trim().toLowerCase()||OT(S.content);if(z&&!_.value.has(z)&&PT((P=S.content)!=null?P:S.raw,z)){const U=String((H=(D=S.content)!=null?D:S.raw)!=null?H:"");return{child:{type:"text",content:U,raw:U},component:Zn,isCustomComponent:!1}}}return{child:S,component:L.value[S.type],isCustomComponent:!!(n.value[S.type]&&!ad(String(S.type)))}})(k);return Ot(rt({},O),{index:M,key:`${t.indexKey||"paragraph"}-${M}`,customAttrs:O.isCustomComponent?J0(O.child,a.value):void 0,hasSlotChildren:Array.isArray(O.child.children)&&O.child.children.length>0,slotContent:String((E=O.child.content)!=null?E:""),originalChild:k})}));return(k,M)=>(w(),N("p",yj,[y.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(y.value),9,kj)):(w(!0),N(Oe,{key:1},st($.value,E=>{return w(),N(Oe,{key:E.key},[b.value&&p(E.originalChild)?(w(),N(Oe,{key:0},[je(R((O=E.originalChild,String((S=O.content)!=null?S:""))),1)],64)):E.isCustomComponent?(w(),ge(Fo(E.component),un({key:1,ref_for:!0},E.customAttrs,{node:E.child,loading:E.child.loading,"index-key":E.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:ke(()=>[E.hasSlotChildren?(w(),ge(A(h),un({key:0,ref_for:!0},f.value,{nodes:E.child.children,"index-key":E.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):E.slotContent?(w(),ge(A(h),un({key:1,ref_for:!0},f.value,{content:E.slotContent,final:!E.child.loading,"index-key":`${E.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(w(),ge(Fo(E.component),un({key:2,ref_for:!0},C(E.child,E.index)),null,16))],64);var O,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);zl.install=e=>{e.component(zl.__name,zl)};const bj={class:"table-node-wrapper"},_j=["aria-busy"],wj={key:0},Sj=["custom-id"],Cj=["aria-label","onPointerdown"],xj=["custom-id"],Aj={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},ku=an(Ve({__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=W(()=>{var _;return(_=t.node.loading)!=null&&_}),o=W(()=>{var _;return(_=t.node.rows)!=null?_:[]}),s=Z(null),i=Z([]);let r=null;const l=W(()=>t.node.header.cells.length),a=W(()=>i.value.some(_=>Number.isFinite(_)&&_>0)),c=W(()=>a.value?i.value.map(_=>_>0?{width:`${_}px`}:void 0):[]);On("markstreamShowTooltips",W(()=>t.showTooltips)),On("markstreamFade",W(()=>t.fade));const u=uo(()=>t.customId),d=W(()=>!!u.value.text),f=W(()=>!!u.value.paragraph),h=new WeakMap;function p(_){const g=t.fade===!1&&!d.value,v=!f.value,y=h.get(_);if(y?.children===_.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const C=$p(_.children,v,!0),L={simpleChildren:C,plainText:C&&g?rc(C):null};return h.set(_,{children:_.children,textFastPath:g,paragraphFastPath:v,info:L}),L}function m(_){if(!r)return;_.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),y=Math.max(v,Math.min(g-v,Math.round(r.startWidth+_.clientX-r.startX))),C=[...r.widths];C[r.index]=y,C[r.index+1]=g-y,i.value=C}function b(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),r=null)}return Ge(l,()=>{b(),i.value=[]}),vo(b),(_,g)=>(w(),N("div",bj,[T("table",{ref_key:"tableRef",ref:s,class:De(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(w(),N("colgroup",wj,[(w(!0),N(Oe,null,st(e.node.header.cells,(v,y)=>(w(),N("col",{key:y,style:Yt(c.value[y])},null,4))),128))])):ie("",!0),T("thead",null,[T("tr",null,[(w(!0),N(Oe,null,st(e.node.header.cells,(v,y)=>(w(),N("th",{key:y,dir:"auto",class:De([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[p(v).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(p(v).plainText),9,Sj)):p(v).simpleChildren?(w(),ge(A(ju),{key:1,nodes:p(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(w(),ge(A(hs),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=C=>_.$emit("copy",C))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(w(),N("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:C=>(function(L,$){if($.button!==0)return;const k=(function(){var O;const S=(O=s.value)==null?void 0:O.querySelectorAll("thead th");return Array.from(S??[],I=>Math.round(I.getBoundingClientRect().width))})(),M=k[L],E=k[L+1];M&&E&&($.preventDefault(),r={index:L,startX:$.clientX,startWidth:M,nextStartWidth:E,widths:k},i.value=k,window.addEventListener("pointermove",m),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))})(y,C)},null,40,Cj)):ie("",!0)],2))),128))])]),T("tbody",null,[(w(!0),N(Oe,null,st(o.value,(v,y)=>(w(),N("tr",{key:y},[(w(!0),N(Oe,null,st(v.cells,(C,L)=>(w(),N("td",{key:L,class:De([C.align==="right"?"text-right":C.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(C).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(p(C).plainText),9,xj)):p(C).simpleChildren?(w(),ge(A(ju),{key:1,nodes:p(C).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${L}`},null,8,["nodes","custom-id","index-key"])):(w(),ge(A(hs),{key:2,nodes:C.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[1]||(g[1]=$=>_.$emit("copy",$))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,_j),se(Kr,{name:"table-node-fade"},{default:ke(()=>[n.value?(w(),N("div",Aj,[An(_.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=T("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=T("span",{class:"sr-only"},"Loading",-1))],!0)])):ie("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);ku.install=e=>{e.component(ku.__name,ku)};const Tj={class:"hr-node"},Of=an({},[["render",function(e,t){return w(),N("hr",Tj)}],["__scopeId","data-v-39b2349c"]]);Of.install=e=>{e.component(Of.__name,Of)};const Mj={class:"unknown-node"},y1=Ve({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(w(),N("div",Mj,R(e.node.raw),1))}),Pf=an(Ve({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=W(()=>`vmr-container vmr-container-${t.node.name}`),o=uo(()=>t.customId),s=W(()=>rt({text:Zn,paragraph:zl,heading:Np,inline_code:zo,link:Jo,image:Ur,strong:Qo,emphasis:es,strikethrough:Zo,insert:ps,subscript:fs,superscript:ds,checkbox:As,checkbox_input:As,hardbreak:qr,math_inline:pi,reference:Xo,list:Qa,math_block:qM,table:ku},o.value));return(i,r)=>(w(),N("div",un({class:n.value},e.node.attrs),[(w(!0),N(Oe,null,st(e.node.children,(l,a)=>{return w(),ge(Fo((c=l.type,s.value[c]||y1)),{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"]]);Pf.install=e=>{e.component(Pf.__name,Pf)};const Ej=["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"],U2=[[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 Ij(e){if(e<=255)return Ej[e];let t=0,n=U2.length-1;for(;t<=n;){const o=t+n>>1,s=U2[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const $j=/[ \t\n\r\f]+/g,Nj=/[\t\n\r\f]| {2,}|^ | $/;let Og=null;const Lj=new RegExp("\\p{Script=Arabic}","u"),Th=new RegExp("\\p{M}","u"),VM=new RegExp("\\p{Nd}","u");function q2(e){return Lj.test(e)}function j2(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 Zi(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 o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){if(j2(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(j2(n))return!0}}return!1}const Oj=new Set([" "," ","","\uFEFF"]);function Pj(e){return Zi(e)}function k1(e){return!(function(t){const n=Lp(t);return n!==null&&(ey.has(n)||jl.has(n))})(e)&&!(function(t){const n=Lp(t);return n!==null&&Oj.has(n)})(e)}const ey=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Mh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),ty=new Set(["'","’"]),jl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Rj=new Set([":",".","،","؛"]),Dj=new Set(["၏"]),Bj=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Fj(e){if(ny(e))return!0;let t=!1;for(const n of e)if(jl.has(n))t=!0;else if(!t||!Th.test(n))return!1;return t}function Hj(e){for(const t of e)if(!ey.has(t)&&!jl.has(t))return!1;return e.length>0}function Wj(e){if(ny(e))return!0;for(const t of e)if(!Mh.has(t)&&!ty.has(t)&&!Th.test(t))return!1;return e.length>0}function ny(e){let t=!1;for(const n of e)if(n!=="\\"&&!Th.test(n)){if(!(Mh.has(n)||jl.has(n)||ty.has(n)))return!1;t=!0}return t}function KM(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function Lp(e){if(e.length===0)return null;const t=KM(e,e.length);return e.slice(t)}function zj(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Th.test(o))n--;else{if(!Mh.has(o)&&!ty.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Uj(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function V2(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function K2(e,t){return e&&t!==null&&Rj.has(t)}function qj(e){const t=Lp(e);return t!==null&&Dj.has(t)}function jj(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 b1(e){let t=e.length;for(;t>0;){const n=KM(e,t),o=e.slice(n,t);if(Bj.has(o))return!0;if(!jl.has(o))return!1;t=n}return!1}function Vj(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
237
|
+
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const Kj=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ws(e){return e.length===1?e[0]:e.join("")}function Gj(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Ws(n)}function Yj(e,t,n,o){if(!Kj.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=Vj(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:Ws(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&s.push({text:Ws(r),isWordLike:a,kind:i,start:l}),s}function Pg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Xj=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Qj(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Xj.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Zj(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const Jj=new Set([":","-","/","×",",",".","+","–","—"]),G2=/^[A-Za-z0-9_]+[,:;]*$/,Y2=/[,:;]+$/;function X2(e){for(const t of e)if(VM.test(t))return!0;return!1}function Rf(e){if(e.length===0)return!1;for(const t of e)if(!VM.test(t)&&!Jj.has(t))return!1;return!0}function Q2(e,t,n){var o,s,i;const r=(Og===null&&(Og=new Intl.Segmenter(void 0,{granularity:"word"})),Og);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],b=[],_=[],g=[],v=[];for(const k of r.segment(e))for(const M of Yj(k.segment,(o=k.isWordLike)!=null&&o,k.index,n)){let E=function(){h[U]!==null&&(c[U]=[V2(a,h,p,U)],h[U]=null),c[U].push(M.text),u[U]=u[U]||M.isWordLike,m[U]=m[U]||I,b[U]=b[U]||P,_[U]=H,g[U]=z,v[U]=K2(b[U],D)};const O=M.kind==="text",S=Uj(M.text,M.isWordLike,M.kind),I=Zi(M.text),P=q2(M.text),D=Lp(M.text),H=b1(M.text),z=qj(M.text),U=l-1;t.carryCJKAfterClosingQuote&&O&&l>0&&d[U]==="text"&&I&&m[U]&&_[U]||O&&l>0&&d[U]==="text"&&Hj(M.text)&&m[U]||O&&l>0&&d[U]==="text"&&g[U]?E():O&&l>0&&d[U]==="text"&&M.isWordLike&&P&&v[U]?(E(),u[U]=!0):S!==null&&l>0&&d[U]==="text"&&h[U]===S?p[U]=((s=p[U])!=null?s:1)+1:O&&!M.isWordLike&&l>0&&d[U]==="text"&&(Fj(M.text)||M.text==="-"&&u[U])?E():(a[l]=M.text,c[l]=[M.text],u[l]=M.isWordLike,d[l]=M.kind,f[l]=M.start,h[l]=S,p[l]=S===null?0:1,m[l]=I,b[l]=P,_[l]=H,g[l]=z,v[l]=K2(P,D),l++)}for(let k=0;k<l;k++)h[k]===null?a[k]=Ws(c[k]):a[k]=V2(a,h,p,k);for(let k=1;k<l;k++)d[k]==="text"&&!u[k]&&ny(a[k])&&d[k-1]==="text"&&(a[k-1]+=a[k],u[k-1]=u[k-1]||u[k],a[k]="");const y=Array.from({length:l},()=>null);let C=-1;for(let k=l-1;k>=0;k--){const M=a[k];if(M.length!==0){if(d[k]==="text"&&!u[k]&&Wj(M)&&C>=0&&d[C]==="text"){const E=(i=y[C])!=null?i:[];E.push(M),y[C]=E,f[C]=f[k],a[k]="";continue}C=k}}for(let k=0;k<l;k++){const M=y[k];M!=null&&(a[k]=Gj(M,a[k]))}let L=0;for(let k=0;k<l;k++){const M=a[k];M.length!==0&&(L!==k&&(a[L]=M,u[L]=u[k],d[L]=d[k],f[L]=f[k]),L++)}a.length=L,u.length=L,d.length=L,f.length=L;const $=(function(k){const M=k.texts.slice(),E=k.isWordLike.slice(),O=k.kinds.slice(),S=k.starts.slice();for(let I=0;I<M.length-1;I++){if(O[I]!=="text"||O[I+1]!=="text"||!Zi(M[I])||!Zi(M[I+1]))continue;const P=zj(M[I]);P!==null&&(M[I]=P.head,M[I+1]=P.tail+M[I+1],S[I+1]=S[I]+P.head.length)}return{len:M.length,texts:M,isWordLike:E,kinds:O,starts:S}})((function(k){const M=[],E=[],O=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I],D=k.kinds[I],H=k.isWordLike[I];if(D==="text"&&H&&G2.test(P)){const z=[P];let U=Y2.test(P),Q=I+1;for(;U&&Q<k.len&&k.kinds[Q]==="text"&&k.isWordLike[Q]&&G2.test(k.texts[Q]);){const X=k.texts[Q];z.push(X),U=Y2.test(X),Q++}M.push(Ws(z)),E.push(!0),O.push("text"),S.push(k.starts[I]),I=Q-1;continue}M.push(P),E.push(H),O.push(D),S.push(k.starts[I])}return{len:M.length,texts:M,isWordLike:E,kinds:O,starts:S}})((function(k){const M=[],E=[],O=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I];if(k.kinds[I]==="text"&&P.includes("-")){const D=P.split("-");let H=D.length>1;for(let z=0;z<D.length;z++){const U=D[z];if(!H)break;U.length!==0&&X2(U)&&Rf(U)||(H=!1)}if(H){let z=0;for(let U=0;U<D.length;U++){const Q=D[U],X=U<D.length-1?`${Q}-`:Q;M.push(X),E.push(!0),O.push("text"),S.push(k.starts[I]+z),z+=X.length}continue}}M.push(P),E.push(k.isWordLike[I]),O.push(k.kinds[I]),S.push(k.starts[I])}return{len:M.length,texts:M,isWordLike:E,kinds:O,starts:S}})((function(k){const M=[],E=[],O=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I],D=k.kinds[I];if(D==="text"&&Rf(P)&&X2(P)){const H=[P];let z=I+1;for(;z<k.len&&k.kinds[z]==="text"&&Rf(k.texts[z]);)H.push(k.texts[z]),z++;M.push(Ws(H)),E.push(!0),O.push("text"),S.push(k.starts[I]),I=z-1;continue}M.push(P),E.push(k.isWordLike[I]),O.push(D),S.push(k.starts[I])}return{len:M.length,texts:M,isWordLike:E,kinds:O,starts:S}})((function(k){const M=[],E=[],O=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I];if(M.push(P),E.push(k.isWordLike[I]),O.push(k.kinds[I]),S.push(k.starts[I]),!Zj(P))continue;const D=I+1;if(D>=k.len||Pg(k.kinds[D]))continue;const H=[],z=k.starts[D];let U=D;for(;U<k.len&&!Pg(k.kinds[U]);)H.push(k.texts[U]),U++;H.length>0&&(M.push(Ws(H)),E.push(!0),O.push("text"),S.push(z),I=U-1)}return{len:M.length,texts:M,isWordLike:E,kinds:O,starts:S}})((function(k){const M=k.texts.slice(),E=k.isWordLike.slice(),O=k.kinds.slice(),S=k.starts.slice();for(let P=0;P<k.len;P++){if(O[P]!=="text"||!Qj(k,P))continue;const D=[M[P]];let H=P+1;for(;H<k.len&&!Pg(O[H]);){D.push(M[H]),E[P]=!0;const z=M[H].includes("?");if(O[H]="text",M[H]="",H++,z)break}M[P]=Ws(D)}let I=0;for(let P=0;P<M.length;P++){const D=M[P];D.length!==0&&(I!==P&&(M[I]=D,E[I]=E[P],O[I]=O[P],S[I]=S[P]),I++)}return M.length=I,E.length=I,O.length=I,S.length=I,{len:I,texts:M,isWordLike:E,kinds:O,starts:S}})((function(k){const M=[],E=[],O=[],S=[];let I=0;for(;I<k.len;){const P=[k.texts[I]];let D=k.isWordLike[I],H=k.kinds[I],z=k.starts[I];if(H==="glue"){const U=[P[0]],Q=z;for(I++;I<k.len&&k.kinds[I]==="glue";)U.push(k.texts[I]),I++;const X=Ws(U);if(!(I<k.len&&k.kinds[I]==="text")){M.push(X),E.push(!1),O.push("glue"),S.push(Q);continue}P[0]=X,P.push(k.texts[I]),D=k.isWordLike[I],H="text",z=Q,I++}else I++;if(H==="text")for(;I<k.len&&k.kinds[I]==="glue";){const U=[];for(;I<k.len&&k.kinds[I]==="glue";)U.push(k.texts[I]),I++;const Q=Ws(U);I<k.len&&k.kinds[I]==="text"?(P.push(Q,k.texts[I]),D=D||k.isWordLike[I],I++):P.push(Q)}M.push(Ws(P)),E.push(D),O.push(H),S.push(z)}return{len:M.length,texts:M,isWordLike:E,kinds:O,starts:S}})({len:L,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let k=0;k<$.len-1;k++){const M=jj($.texts[k]);M!==null&&($.kinds[k]!=="space"&&$.kinds[k]!=="preserved-space"||$.kinds[k+1]!=="text"||!q2($.texts[k+1])||($.texts[k]=M.space,$.isWordLike[k]=!1,$.kinds[k]=$.kinds[k]==="preserved-space"?"preserved-space":"space",$.texts[k+1]=M.marks+$.texts[k+1],$.starts[k+1]=$.starts[k]+M.space.length))}return $}function eV(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let ka=null;const Z2=new Map;let ba=null;const tV=new RegExp("\\p{Emoji_Presentation}","u"),nV=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Rg=null;const J2=new Map;function _1(){if(ka!==null)return ka;if(typeof OffscreenCanvas<"u")return ka=new OffscreenCanvas(1,1).getContext("2d"),ka;if(typeof document<"u")return ka=document.createElement("canvas").getContext("2d"),ka;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Sr(e,t){let n=t.get(e);return n===void 0&&(n={width:_1().measureText(e).width,containsCJK:Zi(e)},t.set(e,n)),n}function Eh(){if(ba!==null)return ba;if(typeof navigator>"u")return ba={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ba;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 ba={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},ba}function GM(){return Rg===null&&(Rg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Rg}function oV(e){return tV.test(e)||e.includes("️")}function xl(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(i){let r=0;const l=GM();for(const a of l.segment(i))oV(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function sV(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 iV(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function eS(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i}=e;if(o.length===0)return 0;const r=t+Eh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(y=u,C=d,L=a){l++,a=0,c=!1,f=-1,h=0}function m(y,C){c=!0,u=y+1,d=0,a=C}function b(y,C,L){c=!0,u=y,d=C+1,a=L}function _(y,C){c?(a+=C,u=y+1,d=0):m(y,C)}function g(y,C){const L=i[y];for(let $=C;$<L.length;$++){const k=L[$];c?a+k>r?(p(),b(y,$,k)):(a+=k,u=y,d=$+1):b(y,$,k)}c&&u===y&&d===L.length&&(u=y+1,d=0)}let v=0;for(;v<o.length&&(c||(v=sV(e,v),!(v>=o.length)));){const y=o[v],C=s[v],L=C==="space"||C==="preserved-space"||C==="tab"||C==="zero-width-break"||C==="soft-hyphen";if(c)if(a+y>r){if(L){_(v,y),p(v+1,0,a-y),v++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(y>t&&i[v]!==null){p(),g(v,0),v++;continue}p()}else _(v,y),L&&(f=v+1,h=a-y),v++;else y>t&&i[v]!==null?g(v,0):m(v,y),L&&(f=v+1,h=a-y),v++}return c&&p(),l}let Dg=null;function rV(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=b1(d),l=Mh.has(d)}function u(d,f){o.push(d),i=i||f;const h=b1(d);r=d.length===1&&jl.has(d)&&r||h,l=!1}for(const d of(Dg===null&&(Dg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Dg).segment(e)){const f=d.segment,h=Zi(f);o.length!==0?l||ey.has(f)||jl.has(f)||t.carryCJKAfterClosingQuote&&h&&r?u(f,h):i||h?(a(),c(f,d.index,h)):u(f,h):c(f,d.index,h)}return a(),n}function lV(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],o=e[0].start,s=Zi(e[0].text),i=k1(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:o})}for(let l=1;l<e.length;l++){const a=e[l],c=Zi(a.text),u=k1(a.text);s&&i?(n.push(a.text),s=s||c,i=u):(r(),n=[a.text],o=a.start,s=c,i=u)}return r(),t}function aV(e,t,n,o){const s=Eh(),{cache:i,emojiCorrection:r}=(function($,k){_1().font=$;const M=(function(S){let I=Z2.get(S);return I||(I=new Map,Z2.set(S,I)),I})($),E=(function(S){const I=S.match(/(\d+(?:\.\d+)?)\s*px/);return I?parseFloat(I[1]):16})($),O=k?(function(S,I){let P=J2.get(S);if(P!==void 0)return P;const D=_1();D.font=S;const H=D.measureText("😀").width;if(P=0,H>I+.5&&typeof document<"u"&&document.body!==null){const z=document.createElement("span");z.style.font=S,z.style.display="inline-block",z.style.visibility="hidden",z.style.position="absolute",z.textContent="😀",document.body.appendChild(z);const U=z.getBoundingClientRect().width;document.body.removeChild(z),H-U>.5&&(P=H-U)}return J2.set(S,P),P})($,E):0;return{cache:M,fontSize:E,emojiCorrection:O}})(t,(l=e.normalized,nV.test(l)));var l;const a=xl("-",Sr("-",i),r),c=8*xl(" ",Sr(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],h=[];let p=e.chunks.length<=1;const m=null,b=[],_=n?[]:null,g=Array.from({length:e.len});function v($,k,M,E,O,S,I){O!=="text"&&O!=="space"&&O!=="zero-width-break"&&(p=!1),u.push(k),d.push(M),f.push(E),h.push(O),b.push(I),_!==null&&_.push($)}function y($,k,M,E,O){const S=Sr($,i),I=xl($,S,r),P=k==="space"||k==="preserved-space"||k==="zero-width-break"?0:I,D=k==="space"||k==="zero-width-break"?0:I;if(O&&E&&$.length>1){let H="sum-graphemes";Rf($)?H="pair-context":s.preferPrefixWidthsForBreakableRuns&&(H="segment-prefixes");const z=(function(U,Q,X,ue,me){if(Q.breakableFitAdvances!==void 0)return Q.breakableFitAdvances;const Ae=GM(),be=[];for(const Le of Ae.segment(U))be.push(Le.segment);if(be.length<=1)return Q.breakableFitAdvances=null,Q.breakableFitAdvances;if(me==="sum-graphemes"){const Le=[];for(const le of be){const F=Sr(le,X);Le.push(xl(le,F,ue))}return Q.breakableFitAdvances=Le,Q.breakableFitAdvances}if(me==="pair-context"||be.length>96){const Le=[];let le=null,F=0;for(const te of be){const ee=xl(te,Sr(te,X),ue);if(le===null)Le.push(ee);else{const q=le+te,Y=Sr(q,X);Le.push(xl(q,Y,ue)-F)}le=te,F=ee}return Q.breakableFitAdvances=Le,Q.breakableFitAdvances}const ze=[];let qe="",Fe=0;for(const Le of be){qe+=Le;const le=xl(qe,Sr(qe,X),ue);ze.push(le-Fe),Fe=le}return Q.breakableFitAdvances=ze,Q.breakableFitAdvances})($,S,i,r,H);return void v($,I,P,D,k,M,z)}v($,I,P,D,k,M,null)}for(let $=0;$<e.len;$++){g[$]=u.length;const k=e.texts[$],M=e.isWordLike[$],E=e.kinds[$],O=e.starts[$];if(E==="soft-hyphen"){v(k,0,a,a,E,O,null);continue}if(E==="hard-break"){v(k,0,0,0,E,O,null);continue}if(E==="tab"){v(k,0,0,0,E,O,null);continue}const S=Sr(k,i);if(E==="text"&&S.containsCJK){const I=rV(k,s),P=o==="keep-all"?lV(I):I;for(let D=0;D<P.length;D++){const H=P[D];y(H.text,"text",O+H.start,M,o==="keep-all"||!Zi(H.text))}continue}y(k,E,O,M,!0)}const C=(function($,k,M){const E=[];for(let O=0;O<$.length;O++){const S=$[O],I=S.startSegmentIndex<k.length?k[S.startSegmentIndex]:M,P=S.endSegmentIndex<k.length?k[S.endSegmentIndex]:M,D=S.consumedEndSegmentIndex<k.length?k[S.consumedEndSegmentIndex]:M;E.push({startSegmentIndex:I,endSegmentIndex:P,consumedEndSegmentIndex:D})}return E})(e.chunks,g,u.length),L=m===null?null:(function($,k){const M=(function(O){const S=O.length;if(S===0)return null;const I=new Array(S);let P=!1;for(let X=0;X<S;){const ue=O.charCodeAt(X);let me=ue,Ae=1;if(ue>=55296&&ue<=56319&&X+1<S){const ze=O.charCodeAt(X+1);ze>=56320&&ze<=57343&&(me=ze-56320+(ue-55296<<10)+65536,Ae=2)}const be=Ij(me);be!=="R"&&be!=="AL"&&be!=="AN"||(P=!0);for(let ze=0;ze<Ae;ze++)I[X+ze]=be;X+=Ae}if(!P)return null;let D=0;for(let X=0;X<S;X++){const ue=I[X];if(ue==="L"){D=0;break}if(ue==="R"||ue==="AL"){D=1;break}}const H=new Int8Array(S);for(let X=0;X<S;X++)H[X]=D;const z=1&D?"R":"L",U=z;let Q=U;for(let X=0;X<S;X++)I[X]==="NSM"?I[X]=Q:Q=I[X];Q=U;for(let X=0;X<S;X++){const ue=I[X];ue==="EN"?I[X]=Q==="AL"?"AN":"EN":ue!=="R"&&ue!=="L"&&ue!=="AL"||(Q=ue)}for(let X=0;X<S;X++)I[X]==="AL"&&(I[X]="R");for(let X=1;X<S-1;X++)I[X]==="ES"&&I[X-1]==="EN"&&I[X+1]==="EN"&&(I[X]="EN"),I[X]!=="CS"||I[X-1]!=="EN"&&I[X-1]!=="AN"||I[X+1]!==I[X-1]||(I[X]=I[X-1]);for(let X=0;X<S;X++){if(I[X]!=="EN")continue;let ue;for(ue=X-1;ue>=0&&I[ue]==="ET";ue--)I[ue]="EN";for(ue=X+1;ue<S&&I[ue]==="ET";ue++)I[ue]="EN"}for(let X=0;X<S;X++){const ue=I[X];ue!=="WS"&&ue!=="ES"&&ue!=="ET"&&ue!=="CS"||(I[X]="ON")}Q=U;for(let X=0;X<S;X++){const ue=I[X];ue==="EN"?I[X]=Q==="L"?"L":"EN":ue!=="R"&&ue!=="L"||(Q=ue)}for(let X=0;X<S;X++){if(I[X]!=="ON")continue;let ue=X+1;for(;ue<S&&I[ue]==="ON";)ue++;const me=(X>0?I[X-1]:U)!=="L"?"R":"L";if(me===((ue<S?I[ue]:U)!=="L"?"R":"L"))for(let Ae=X;Ae<ue;Ae++)I[Ae]=me;X=ue-1}for(let X=0;X<S;X++)I[X]==="ON"&&(I[X]=z);for(let X=0;X<S;X++){const ue=I[X];1&H[X]?ue!=="L"&&ue!=="AN"&&ue!=="EN"||H[X]++:ue==="R"?H[X]++:ue!=="AN"&&ue!=="EN"||(H[X]+=2)}return H})($);if(M===null)return null;const E=new Int8Array(k.length);for(let O=0;O<k.length;O++)E[O]=M[k[O]];return E})(e.normalized,m);return _!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:L,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:C,segments:_}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:L,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:C}}function cV(e,t,n){return(function(o,s,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return aV((function(c,u,d="normal",f="normal"){const h=(function(b){const _=b??"normal";return _==="pre-wrap"?{mode:_,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:_,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(b){return/[\r\f]/.test(b)?b.replace(/\r\n/g,`
|
|
238
|
+
`).replace(/[\r\f]/g,`
|
|
239
|
+
`):b.replace(/\r\n/g,`
|
|
240
|
+
`)})(c):(function(b){if(!Nj.test(b))return b;let _=b.replace($j," ");return _.charCodeAt(0)===32&&(_=_.slice(1)),_.length>0&&_.charCodeAt(_.length-1)===32&&(_=_.slice(0,-1)),_})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(b){if(b.len<=1)return b;const _=[],g=[],v=[],y=[];let C=null,L=!1,$=0,k=!1,M=!1;function E(){C!==null&&(_.push(Ws(C)),g.push(L),v.push("text"),y.push($),C=null)}for(let O=0;O<b.len;O++){const S=b.texts[O],I=b.kinds[O],P=b.isWordLike[O],D=b.starts[O];if(I==="text"){const H=Pj(S),z=k1(S);if(C!==null&&k&&M){C.push(S),L=L||P,k=k||H,M=z;continue}E(),C=[S],L=P,$=D,k=H,M=z;continue}E(),_.push(S),g.push(P),v.push(I),y.push(D)}return E(),{len:_.length,texts:_,isWordLike:g,kinds:v,starts:y}})(Q2(p,u,h)):Q2(p,u,h);return rt({normalized:p,chunks:eV(m,h)},m)})(o,Eh(),r?.whiteSpace,a),s,!1,a)})(e,t,0,n)}const Bg="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",ho=(()=>{const e=globalThis;if(e[Bg])return e[Bg];const t={configs:{},controllers:{},revision:Yl(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Bg]=t,t})();let jc=null;const tS=ho.revision;function nS(e){var t;return e&&(t=ho.configs[e])!=null?t:null}function oS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function uV(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Fg(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!uV(i))return null;i.type==="text"?s+=String((t=i.content)!=null?t:""):i.type==="emoji"?s+=String((o=(n=i.name)!=null?n:i.raw)!=null?o:""):i.type==="hardbreak"&&(s+=`
|
|
241
|
+
`)}return s.length>0?s:null}function Hg(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(jc!=null)return jc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return jc=!!((i=r.getContext)!=null&&i.call(r,"2d")),jc}catch{return jc=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(o=n.whiteSpace)!=null?o:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=ho.blockEstimateCache.get(r);if(l)return ho.blockEstimateCache.delete(r),ho.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(h,p,m){const b=`${m}\0${p}\0${h}`,_=ho.preparedCache.get(b);if(_)return ho.preparedCache.delete(b),ho.preparedCache.set(b,_),_.prepared;const g=cV(h,p,{whiteSpace:m});for(ho.preparedCache.set(b,{prepared:g});ho.preparedCache.size>240;){const v=ho.preparedCache.keys().next().value;if(!v)break;ho.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(h,p,m){const b=(function(_,g){return _.simpleLineWalkFastPath?eS(_,g):(function(v,y){if(v.simpleLineWalkFastPath)return eS(v,y);const{widths:C,lineEndFitAdvances:L,lineEndPaintAdvances:$,kinds:k,breakableFitAdvances:M,discretionaryHyphenWidth:E,tabStopAdvance:O,chunks:S}=v;if(C.length===0||S.length===0)return 0;const I=Eh(),P=I.lineFitEpsilon,D=y+P;let H=0,z=0,U=!1,Q=0,X=0,ue=-1,me=0,Ae=0,be=null;function ze(){ue=-1,me=0,Ae=0,be=null}function qe(Y=Q,de=X,ne=z){H++,z=0,U=!1,ze()}function Fe(Y,de){U=!0,Q=Y+1,X=0,z=de}function Le(Y,de,ne){U=!0,Q=Y,X=de+1,z=ne}function le(Y,de){U?(z+=de,Q=Y+1,X=0):Fe(Y,de)}function F(Y,de,ne,ce){if(!de)return;const j=Y==="tab"?0:L[ne],G=Y==="tab"?ce:$[ne];ue=ne+1,me=z-ce+j,Ae=z-ce+G,be=Y}function te(Y,de){const ne=M[Y];for(let ce=de;ce<ne.length;ce++){const j=ne[ce];U?z+j>D?(qe(),Le(Y,ce,j)):(z+=j,Q=Y,X=ce+1):Le(Y,ce,j)}U&&Q===Y&&X===ne.length&&(Q=Y+1,X=0)}function ee(Y){if(be!=="soft-hyphen")return!1;const de=M[Y];if(de==null)return!1;const{fitCount:ne,fittedWidth:ce}=(function(j,G,re,he,Ce){let Ee=0,ae=G;for(;Ee<j.length;){const xe=ae+j[Ee];if((Ee+1<j.length?xe+Ce:xe)>re+he)break;ae=xe,Ee++}return{fitCount:Ee,fittedWidth:ae}})(de,z,y,P,E);return ne!==0&&(z=ce,Q=Y,X=ne,ze(),ne===de.length?(Q=Y+1,X=0,!0):(qe(Y,ne,ce+E),te(Y,ne),!0))}function q(Y){H++,ze()}for(let Y=0;Y<S.length;Y++){const de=S[Y];if(de.startSegmentIndex===de.endSegmentIndex){q();continue}U=!1,z=0,de.startSegmentIndex,Q=de.startSegmentIndex,X=0,ze();let ne=de.startSegmentIndex;for(;ne<de.endSegmentIndex;){const ce=k[ne],j=ce==="space"||ce==="preserved-space"||ce==="tab"||ce==="zero-width-break"||ce==="soft-hyphen",G=ce==="tab"?iV(z,O):C[ne];if(ce!=="soft-hyphen")if(U){if(z+G>D){const re=z+(ce==="tab"?0:L[ne]),he=z+(ce==="tab"?G:$[ne]);if(be==="soft-hyphen"&&I.preferEarlySoftHyphenBreak&&me<=D){qe(ue,0,Ae);continue}if(be==="soft-hyphen"&&ee(ne)){ne++;continue}if(j&&re<=D){le(ne,G),qe(ne+1,0,he),ne++;continue}if(ue>=0&&me<=D){if(Q>ue||Q===ue&&X>0){qe();continue}const Ce=ue;qe(Ce,0,Ae),ne=Ce;continue}if(G>y&&M[ne]!==null){qe(),te(ne,0),ne++;continue}qe();continue}le(ne,G),F(ce,j,ne,G),ne++}else G>y&&M[ne]!==null?te(ne,0):Fe(ne,G),F(ce,j,ne,G),ne++;else U&&(Q=ne+1,X=0,ue=ne+1,me=z+E,Ae=z+E,be=ce),ne++}if(U){const ce=ue===de.consumedEndSegmentIndex?Ae:z;qe(de.consumedEndSegmentIndex,0,ce)}}return H})(_,g)})(h,p);return{lineCount:b,height:b*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(ho.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});ho.blockEstimateCache.size>4e3;){const h=ho.blockEstimateCache.keys().next().value;if(!h)break;ho.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function YM(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Fg(e.children);return i&&n.paragraph?Hg(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Fg(e.children),l=n.headings[i];return r&&l?Hg(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((o=i[0])==null?void 0:o.type)!=="paragraph"||!n.listItem)return null;const r=Fg((s=i[0])==null?void 0:s.children);return r?Hg(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=YM(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 uf(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function dV(e,t){var n;if(!e||e.type!=="code_block")return null;const o=t.rendererKind,s=t.showHeader!==!1,i=(function(u){var d,f,h;return u.diff?Math.max(uf(String((d=u.originalCode)!=null?d:"")),uf(String((f=u.updatedCode)!=null?f:"")),uf(String((h=u.code)!=null?h:""))):uf((function(p,m){const b=String(p??"");return m?b:b.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(o==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,p){const m=typeof h?.fontSize=="number"&&h.fontSize>0?h.fontSize:p?13:12;return typeof h?.lineHeight=="number"&&h.lineHeight>0?h.lineHeight:p?30:Math.round(1.5*m)})(u,r),f=(function(h,p){var m,b;if(!p)return 0;const _=typeof((m=h?.padding)==null?void 0:m.top)=="number"?h.padding.top:10,g=typeof((b=h?.padding)==null?void 0:b.bottom)=="number"?h.padding.bottom:22;return Math.max(0,_)+Math.max(0,g)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else o==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(s?40:0)),contentHeight:c,rendererKind:o}}function fV(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function Wg(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=oS(o.lineHeight,1.5*oS(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:fV(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const pV=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function sS(e,t={}){var n;const o={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return o;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))pV.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}const hV=!1;function ihe(){return hV}function iS(e,t,n,o){var s;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,i);if(!o.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 f of a){e.scrollTop=f;const h=o.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(s=o.epsilonPx)!=null?s:2;Math.abs(o.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const XM=Symbol("MarkstreamMathBlockMinHeightCache");function rhe(){return jt(XM,null)}const mV=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],gV=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],vV=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),QM=["raw","content","code","originalCode","updatedCode"],rS=new WeakMap,lS=new WeakMap;let yV=1;function ii(){return typeof performance<"u"?performance.now():Date.now()}function aS(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function js(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=rS.get(t);return n||(n=yV++,rS.set(t,n)),String(n)}function cS(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:js(t),customMarkdownIt:js(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:js(e.validateLink),preTransformTokens:js(e.preTransformTokens),postTransformTokens:js(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function uS(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
242
|
+
`,t-1)+1;return e.slice(n,t).trim()}function dS(e){const t=ZM(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function ZM(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function JM(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 oy(e){const t=String(e??"");return`${t.length}:${JM(t)}`}function w1(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?oy(r):`${r.length}:${JM(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${js(e)}`;if(typeof e!="object")return typeof e;const o=e,s=t.get(o);if(s)return`cycle:${s}`;if(n>=6)return`object:${js(o)}`;const i=js(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>w1(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}:${w1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Op(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function e3(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>Op(o)?Zr(o,t,n+1):e3(o,t,n+1)).join(",")}`:Op(e)?Zr(e,t,n):w1(e,t,n)}function kV(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!QM.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${oy(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${js(s)}`:vV.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${e3(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${js(s)}`:""}).filter(Boolean).join(";")}function bV(e){return QM.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${oy(n)}`:""}).filter(Boolean).join(";")}function Zr(e,t=new WeakMap,n=0){const o=lS.get(e);if(o)return o;const s=e,i=t.get(s);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${js(s)}`;const r=js(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(p=>Zr(p,c,u+1)).join("|"):"";return[a.type,bV(d),kV(d,c,u),f.length,h].join(":")})(e,t,n);return lS.set(s,l),l}function t3(e,t){return Zr(e)===Zr(t)}function sy(e,t,n){const o=ii(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=ii()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function fS(e,t,n){return sy(t,n,()=>Zr(e))}function n3(e,t,n){return fS(e,n,"stabilizeSignatureMs")===fS(t,n,"stabilizeSignatureMs")}function zg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function pS(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function _V(e,t){return e.length===t.length&&e===t}function iy(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).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 f=o[d],h=s[d];if(typeof f!=typeof h)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,h))return!1}else if(typeof h!="string"||!_V(f,h))return!1}const l=Object.prototype.hasOwnProperty.call(o,"children");if(l!==Object.prototype.hasOwnProperty.call(s,"children"))return!1;if(!l)return!0;const a=o.children,c=s.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],f=c[u];if(!Op(d)||!Op(f))return null;const h=iy(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function wV(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=iy(e,t);return n??t3(e,t)}function SV(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return sy(n,"stabilizeSignatureMs",()=>{o=iy(e,t)}),o??n3(e,t,n)}function CV(e,t){const n={};for(const o of mV){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function xV(e,t){var n;const o=v2(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:W(()=>!1),r=Z(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=ii();function m(){l&&(clearTimeout(l),l=void 0)}function b(){m();const M=t.renderContent.value;r.value!==M&&(r.value=M),p=ii()}Ge([t.renderContent,t.effectiveFinal,i],([M,E,O])=>{r.value!==M&&(!O||E||(function(S,I){if(!S&&I||I.length<=80||I.length<S.length||!I.startsWith(S))return!0;const P=I.slice(S.length);return!!P&&(!!dS(uS(I))||!(!P.includes(`
|
|
243
|
+
|
|
244
|
+
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(P))||P.endsWith(`
|
|
245
|
+
`)&&!(function(D){const H=uS(D);if(dS(H))return!1;const z=ZM(H);return z.length>=2&&z.some(U=>U.trim())})(I))})(r.value,M)?b():(function(){if(h+=1,l)return;const S=Math.max(0,(function(I){const P=I.parseCoalesceMs;return typeof P=="number"&&Number.isFinite(P)&&P>=0?P:80})(e)-(ii()-p));S<=0?b():l=setTimeout(b,S)})())},{flush:"sync",immediate:!0}),B1(m);const _=W(()=>{var M,E,O,S;return qB(e.customHtmlTags,(M=e.parseOptions)==null?void 0:M.customHtmlTags,(S=(O=(E=t.customComponentsMap)==null?void 0:E.value)!=null?O:{},Object.entries(S).map(([I,P])=>{const D=Js(I);return P==null||!D||ad(D)||ET.has(D)||id.has(D)?"":D}).filter(Boolean)))}),g=W(()=>{const{key:M,tags:E}=jB(_.value);if(!M)return o;const O=s.get(M);if(O)return O;const S=v2(t.instanceMsgId,{customHtmlTags:E});return s.set(M,S),S}),v=W(()=>{const M=g.value;return e.customMarkdownIt?e.customMarkdownIt(M):M}),y=W(()=>{var M,E;const O=(M=e.parseOptions)!=null?M:{},S=t.effectiveFinal.value,I=_.value,P=S!=null,D=I.length>0;return P||D||O.streamParse==null?rt(rt(Ot(rt({},O),{streamParse:(E=O.streamParse)==null||E}),P?{final:S}:{}),D?{customHtmlTags:I}:{}):O}),C=W(()=>{var M;return new Set(((M=y.value.customHtmlTags)!=null?M:[]).map(E=>String(E).trim().toLowerCase()).filter(Boolean))}),L=W(()=>cS(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),$=W(()=>cS(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ge([L,$],([M,E],[O,S])=>{O&&(M===O&&E===S||(b(),E!==S&&(a=[],d="")))},{flush:"sync"});const k=W(()=>{var M,E,O,S,I,P,D,H;if((M=e.nodes)!=null&&M.length)return a=[],d="",Rr(e.nodes.slice());const z=r.value;if(!z)return a=[],d="",[];const U=t.debugPerformanceEnabled.value,Q=U?ii():0,X=v.value,ue=L.value,me=$.value;c&&ue!==c&&(function(de){var ne,ce;(ce=(ne=de.stream)==null?void 0:ne.reset)==null||ce.call(ne)})(X),u&&me!==u&&(a=[],d="");const Ae=a.length>0&&z.startsWith(d)&&me===u,be=U?aS(X):null,ze=U?{}:void 0,qe=ze?Ot(rt({},y.value),{__timing:ze}):y.value,Fe=vM(z,X,qe),Le=U?ii():0,le=U?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let F,te=U?zg(Fe.length):void 0,ee=0,q=0;if(Ae){const de=U?ii():0;if(le){const ne=(function(ce,j,G){if(!j.length)return{nodes:ce,metrics:zg(ce.length)};const re=(function(Ee,ae,xe){const Ke=Math.min(Ee.length,ae.length);for(let ot=0;ot<Ke;ot++)if(!SV(ae[ot],Ee[ot],xe))return ot;return Ee.length===ae.length?-1:Ke})(ce,j,G);if(re<0)return{nodes:j,metrics:{reusedNodeCount:ce.length,dirtyStartIndex:re,stablePrefixNodeCount:ce.length,dirtyTailNodeCount:0}};const he=ce.slice();let Ce=re;for(let Ee=0;Ee<re;Ee++)he[Ee]=j[Ee];for(let Ee=re;Ee<ce.length;Ee++){const ae=j[Ee],xe=ce[Ee];ae&&n3(ae,xe,G)&&(he[Ee]=ae,Ce+=1)}return{nodes:he,metrics:{reusedNodeCount:Ce,dirtyStartIndex:re,stablePrefixNodeCount:re,dirtyTailNodeCount:pS(re,ce,j)}}})(Fe,a,le);F=ne.nodes,te=ne.metrics}else{const ne=(function(ce,j){if(!j.length)return{nodes:ce,metrics:zg(ce.length)};const G=(function(Ce,Ee){const ae=Math.min(Ce.length,Ee.length);for(let xe=0;xe<ae;xe++)if(!wV(Ee[xe],Ce[xe]))return xe;return Ce.length===Ee.length?-1:ae})(ce,j);if(G<0)return{nodes:j,metrics:{reusedNodeCount:ce.length,dirtyStartIndex:G,stablePrefixNodeCount:ce.length,dirtyTailNodeCount:0}};const re=ce.slice();let he=G;for(let Ce=0;Ce<G;Ce++)re[Ce]=j[Ce];for(let Ce=G;Ce<ce.length;Ce++){const Ee=j[Ce],ae=ce[Ce];Ee&&t3(Ee,ae)&&(re[Ce]=Ee,he+=1)}return{nodes:re,metrics:{reusedNodeCount:he,dirtyStartIndex:G,stablePrefixNodeCount:G,dirtyTailNodeCount:pS(G,ce,j)}}})(Fe,a);F=ne.nodes,te=ne.metrics}ee=U?ii()-de:0,q=te?.dirtyStartIndex==null||te.dirtyStartIndex<0?F.length:te.dirtyStartIndex}else F=Fe;le?(function(de,ne,ce=0){for(let j=Math.max(0,ce);j<de.length;j++)sy(ne,"primeSignatureMs",()=>Zr(de[j]))})(F,le,q):(function(de,ne=0){for(let ce=Math.max(0,ne);ce<de.length;ce++)Zr(de[ce])})(F,q);const Y=U?ii()-Le:0;if(f+=1,d=z,c=ue,u=me,a=F,U){const de=aS(X),ne=typeof de?.total=="number"&&de.total>((E=be?.total)!=null?E:0);t.logPerf(ne?"parse(stream)":"parse(sync)",rt(rt(rt({rendererId:t.instanceMsgId,ms:Math.round(ii()-Q),nodes:F.length,contentLength:z.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:Y,signatureMs:(O=le?.signatureMs)!=null?O:0,stabilizeSignatureMs:(S=le?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(I=le?.primeSignatureMs)!=null?I:0,signatureCallCount:(P=le?.signatureCallCount)!=null?P:0,stabilizeSignatureCallCount:(D=le?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(H=le?.primeSignatureCallCount)!=null?H:0,stabilizeMs:ee},te??{}),ze?Object.fromEntries(gV.map(ce=>{var j;return[ce,(j=ze[ce])!=null?j:0]})):{}),de?{streamMode:de.lastMode,streamDelta:CV(de,be),streamStats:de}:{}))}return Rr(F)});return{effectiveCustomHtmlTags:_,effectiveCustomHtmlTagsSet:C,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:k}}function AV(e){const{isClient:t}=e,n=Z(new Set),o=new Map,s=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:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,h){if((m=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!m)return;var p,m;const b=n.value,_=b.has(f);if(h){if(_)return;const v=new Set(b);return v.add(f),void(n.value=v)}if(!_)return;const g=new Set(b);g.delete(f),n.value=g})(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[f,h]of s.entries())f<c||(h(),s.delete(f));for(const[f,h]of o.entries())f<c||(h.destroy(),o.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of s.values())c();s.clear();for(const c of o.values())c.destroy();o.clear(),l()}}}function TV(e={}){const t=Z(""),n=Z(""),o=Z(!1),s=MU(e),i=()=>{const u=s.getSnapshot();t.value=u.source,n.value=u.visible,o.value=u.done},r=s.subscribe(i);i();const l=W(()=>Math.max(0,t.value.length-n.value.length)),a=W(()=>l.value===0),c=W(()=>o.value&&a.value);return D1()&&B1(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:c,caughtUp:a,pendingChars:l,enqueue:u=>s.enqueue(u),finish:u=>s.finish(u),flush:()=>s.flush(),reset:u=>s.reset(u),pause:()=>s.pause(),resume:()=>s.resume()}}const hS=/auto|scroll|overlay/i;function MV(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return hS.test(t)||hS.test(n)}function EV(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 IV=Ve({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=W(()=>{var n,o;return a1((o=Pa(e.estimatedPreviewHeightPx))!=null?o:r1(String((n=e.node.code)!=null?n:"")))});return()=>ln("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?ln("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)"}},[ln("div",{class:"flex items-center gap-x-2 overflow-hidden"},[ln("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),ln("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),ln("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},()=>ln("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,ln("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[ln("div",{class:"absolute inset-0"},[ln("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),$V=Ve({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=W(()=>{var n,o;return l1((o=Pa(e.estimatedPreviewHeightPx))!=null?o:i1(String((n=e.node.code)!=null?n:"")))});return()=>ln("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?ln("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)"}},[ln("div",{class:"flex items-center gap-x-2 overflow-hidden"},[ln("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),ln("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},()=>ln("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[ln("span",{class:"action-icon block"})])))]):null,ln("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)"}},[ln("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"}})])])}}),NV=["data-custom-id"],LV={class:"m-0 p-0"},OV=["data-probe"],PV=["data-node-index","data-node-type"],o3=an(Ve(Ot(rt({},{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:{},langs:{},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 o=e,s=n,i=Oo(),r=jt("markstreamNestedRendererProps",void 0);function l(x){var B,V;const K=o[x];return(function(J){const fe=i?.vnode.props;return!!fe&&(Object.prototype.hasOwnProperty.call(fe,J)||Object.prototype.hasOwnProperty.call(fe,String(J).replace(/[A-Z]/g,ve=>`-${ve.toLowerCase()}`)))})(x)?K:(V=(B=r?.value)==null?void 0:B[x])!=null?V:K}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,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"}},c=W(()=>{return(x=l("mode"))==="chat"||x==="minimal"||x==="docs"?x:"docs";var x}),u=W(()=>{const x=l("renderCodeBlocksAsPre"),B=l("codeRenderer");return x===!0?"pre":B==="pre"||B==="shiki"||B==="monaco"?B:x===!1||c.value==="docs"?"monaco":"pre"}),d=W(()=>a[c.value]),f=W(()=>{var x;return(x=l("showTooltips"))!=null?x:d.value.showTooltips}),h=W(()=>{var x;return(x=l("fade"))!=null?x:d.value.fade}),p=W(()=>{var x;return(x=l("batchRendering"))!=null?x:d.value.batchRendering}),m=W(()=>{var x;return(x=l("initialRenderBatchSize"))!=null?x:d.value.initialRenderBatchSize}),b=W(()=>{var x;return(x=l("renderBatchSize"))!=null?x:d.value.renderBatchSize}),_=W(()=>{var x;return(x=l("renderBatchDelay"))!=null?x:d.value.renderBatchDelay}),g=W(()=>{var x;return(x=l("renderBatchBudgetMs"))!=null?x:d.value.renderBatchBudgetMs}),v=W(()=>{var x;return(x=l("renderBatchIdleTimeoutMs"))!=null?x:d.value.renderBatchIdleTimeoutMs}),y=W(()=>{var x;return(x=l("deferNodesUntilVisible"))!=null?x:d.value.deferNodesUntilVisible}),C=W(()=>{var x;return(x=l("maxLiveNodes"))!=null?x:d.value.maxLiveNodes}),L=W(()=>{var x;return(x=l("liveNodeBuffer"))!=null?x:d.value.liveNodeBuffer}),$=W(()=>{var x;return(x=l("nodeVirtual"))!=null?x:d.value.nodeVirtual}),k={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return o.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return p.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return _.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return C.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return $.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function M(x){s("height-change",x)}function E(x){s("virtual-state-change",x)}function O(x){s("anchor-change",x)}const S=Z(),I=Z(null),P=Z(null),D=Z(null),H=No({1:null,2:null,3:null,4:null,5:null,6:null}),z=Z(!1),U=new Map,Q=Z(0),X=Z(0),ue=Z({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function me(){var x,B;if(((x=o.virtualScroll)==null?void 0:x.enabled)!==!0)return null;const V=(B=o.virtualScroll)==null?void 0:B.scrollRoot;return Ae(typeof V=="function"?V():V)}function Ae(x){return x?typeof HTMLElement<"u"&&x instanceof HTMLElement?x:typeof x=="object"&&"value"in x?Ae(x.value):typeof x=="object"&&"$el"in x?Ae(x.$el):null:null}const{isClient:be,renderAsFragment:ze,debugPerformanceEnabled:qe,resolvedShowTooltips:Fe,resolvedHtmlPolicy:Le,inheritedSmoothStreaming:le,ownsTypewriterCursor:F}=(function(x){const B=typeof window<"u",V=Ju(),K=jt("markstreamHtmlPolicy",void 0),J=jt("markstreamTypewriterCursor",void 0),fe=jt("markstreamSmoothStreaming",void 0),ve=W(()=>x.renderAsFragment===!0),we=W(()=>!!(x.debugPerformance&&B&&typeof console<"u")),Pe=W(()=>{var Be;if(typeof x.showTooltips=="boolean")return x.showTooltips;const $e=(Be=V.showTooltips)!=null?Be:V["show-tooltips"];return $e===""||$e===!0||$e==="true"||$e!==!1&&$e!=="false"&&void 0}),Me=W(()=>{var Be,$e;return($e=(Be=x.htmlPolicy)!=null?Be:K?.value)!=null?$e:"safe"}),We=W(()=>J?.value!==!0);return{isClient:B,renderAsFragment:ve,debugPerformanceEnabled:we,resolvedShowTooltips:Pe,resolvedHtmlPolicy:Me,inheritedSmoothStreaming:fe,inheritedTypewriterCursor:J,ownsTypewriterCursor:We}})(k),{resolveViewportRoot:te,resolveScrollContainer:ee,isReverseFlexScrollRoot:q,getNormalizedScrollTop:Y,getOffsetTopWithinRoot:de}=(function(x,B){function V(){var we,Pe;return(Pe=(we=B.scrollRoot)==null?void 0:we.call(B))!=null?Pe:null}function K(we){if(typeof window>"u")return null;const Pe=V();if(Pe)return Pe;const Me=we??x.value;if(!Me)return null;const We=Me.ownerDocument||document,Be=We.scrollingElement||We.documentElement;let $e=Me;for(;$e&&$e!==We.body&&$e!==Be;){if(MV(window.getComputedStyle($e))&&EV($e))return $e;$e=$e.parentElement}return null}function J(we){if(!B.isClient)return!1;try{const Pe=window.getComputedStyle(we);return!!(Pe.display||"").toLowerCase().includes("flex")&&(Pe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function fe(we,Pe,Me){var We,Be;if(Me)return ve(Pe);const $e=we.scrollTop;if(!J(we))return $e;const He=$e<0?-$e:$e;return Math.max(0,((We=we.scrollHeight)!=null?We:0)-((Be=we.clientHeight)!=null?Be:0))-He}function ve(we){var Pe,Me,We,Be,$e;const He=Number((Pe=we.scrollingElement)==null?void 0:Pe.scrollTop),Qe=Number((We=(Me=we.documentElement)==null?void 0:Me.scrollTop)!=null?We:0),Ze=Number(($e=(Be=we.body)==null?void 0:Be.scrollTop)!=null?$e:0);return Math.max(0,Number.isFinite(He)?He:0,Number.isFinite(Qe)?Qe:0,Number.isFinite(Ze)?Ze:0)}return{resolveViewportRoot:K,resolveScrollContainer:function(we){var Pe,Me,We,Be;const $e=V();if($e)return $e;const He=K((Pe=we??x.value)!=null?Pe:null);if(He)return He;const Qe=(Be=(We=we?.ownerDocument)!=null?We:(Me=x.value)==null?void 0:Me.ownerDocument)!=null?Be:typeof document<"u"?document:null;return Qe?.scrollingElement||Qe?.documentElement||null},isReverseFlexScrollRoot:J,getNormalizedScrollTop:fe,getOffsetTopWithinRoot:function(we,Pe){const Me=Pe.ownerDocument||we.ownerDocument||document;if((function(He,Qe){return He===Qe.documentElement||He===Qe.body||He===Qe.scrollingElement})(Pe,Me))return we.getBoundingClientRect().top+ve(Me);const We=Pe.getBoundingClientRect(),Be=we.getBoundingClientRect(),$e=fe(Pe,Me,!1);return Be.top-We.top+$e}}})(S,{isClient:be,scrollRoot:me});On("markstreamShowTooltips",Fe),On("markstreamHtmlPolicy",Le),On("markstreamTypewriter",W(()=>k.typewriter!==!1)),On("markstreamFade",W(()=>k.fade!==!1)),On("markstreamTypewriterCursor",W(()=>!0)),On("markstreamTextStreamState",U),On("markstreamStreamVersion",Q),On("markstreamParseOptions",W(()=>k.parseOptions)),On("markstreamCustomMarkdownIt",W(()=>k.customMarkdownIt));const{smoothStreamingEnabled:ne,renderContent:ce,effectiveFinal:j}=(function(x,B){const V=TV(x.smoothStreamingOptions),K=W(()=>{var Me,We,Be;return x.smoothStreaming!==!1&&!((Me=x.nodes)!=null&&Me.length)&&(x.smoothStreaming===!0||!((We=B.inheritedSmoothStreaming)!=null&&We.value))&&(x.smoothStreaming===!0||x.typewriter===!0||((Be=x.maxLiveNodes)!=null?Be:0)<=0)}),J=Z(!B.isClient||x.smoothStreaming===!0);bn(()=>{J.value=!0});const fe=W(()=>J.value&&K.value),ve=W(()=>{var Me;return fe.value?V.visible.value:(Me=x.content)!=null?Me:""}),we=W(()=>{var Me,We;const Be=(Me=x.parseOptions)!=null?Me:{};return(We=x.final)!=null?We:Be.final}),Pe=W(()=>{const Me=we.value;return fe.value&&Me!=null?!!Me&&V.caughtUp.value:Me});return Ge([()=>x.content,()=>x.nodes,fe,we],([Me,We,Be,$e])=>{if(We?.length)return void V.reset("");const He=Me??"";if(!Be)return V.reset(He),void($e&&V.finish({flush:!0}));const Qe=V.source.value;He?He===Qe||(He.startsWith(Qe)?V.enqueue(He.slice(Qe.length)):V.reset(He)):V.reset(""),$e&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:K,smoothStreamingEnabled:fe,renderContent:ve,requestedFinal:we,effectiveFinal:Pe}})(k,{isClient:be,inheritedSmoothStreaming:le});On("markstreamSmoothStreaming",ne);const G=Z(!1);let re="",he=!1,Ce=null;function Ee(){be&&Ce!=null&&(window.clearTimeout(Ce),Ce=null)}function ae(){G.value=!1,Ee()}function xe(x,B){if(!qe.value)return;const V=(function(){if(!qe.value)return null;const K=It(Ke),J=It(ot),fe=Math.max(wt,J);if(K<=0&&fe<=0)return null;const ve={total:K,maxPerFrame:fe,byLabel:(we=Ke,Object.fromEntries(Array.from(we.entries()).sort((Pe,Me)=>Me[1]-Pe[1]||Pe[0].localeCompare(Me[0]))))};var we;return Ke.clear(),ot.clear(),wt=0,ve})();console.info(`[markstream-vue][perf] ${x}`,V?Ot(rt({},B),{layoutReads:V}):B)}Ge([ce,()=>o.nodes,j],([x,B,V])=>{const K=x??"";return B?.length||V===!0?(ae(),re=K,void(he=!0)):he?(re&&K.length>re.length&&K.startsWith(re)?(G.value=!0,be&&(Ee(),Ce=window.setTimeout(()=>{var J;Ce=null,j.value===!0||(J=o.nodes)!=null&&J.length||(ca(),G.value=!1,Li())},1200))):(K.length<re.length||!K.startsWith(re))&&ae(),void(re=K)):(re=K,void(he=!0))},{flush:"sync",immediate:!0});const Ke=new Map,ot=new Map;let _t=!1,wt=0;function It(x){let B=0;for(const V of x.values())B+=V;return B}function Pt(){wt=Math.max(wt,It(ot)),ot.clear(),_t=!1}function bt(x,B){return(function(V){var K,J;qe.value&&(Ke.set(V,((K=Ke.get(V))!=null?K:0)+1),ot.set(V,((J=ot.get(V))!=null?J:0)+1),_t||(_t=!0,be&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Pt):typeof queueMicrotask!="function"?setTimeout(Pt,0):queueMicrotask(Pt)))})(x),B()}const Kt=k.customId?`renderer-${k.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Dn=(function(x){const B=new Map;return{scope:x,cache:B,clear:()=>B.clear()}})(Kt),In=W(()=>`${Kt}:${Q.value}`);On(XM,Dn);const Dt=uo(()=>k.customId),{effectiveCustomHtmlTagsSet:pn,mergedParseOptions:Kn,parsedNodes:nt}=xV(k,{instanceMsgId:Kt,renderContent:ce,effectiveFinal:j,smoothStreamingEnabled:ne,debugPerformanceEnabled:qe,customComponentsMap:Dt,logPerf:xe});Ge(nt,()=>{Dn.clear(),Q.value+=1},{immediate:!0});const wn=W(()=>({customId:k.customId,customHtmlTags:Kn.value.customHtmlTags,parseOptions:k.parseOptions,customMarkdownIt:k.customMarkdownIt,htmlPolicy:Le.value,viewportPriority:k.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:k.codeBlockStream,codeBlockDarkTheme:k.codeBlockDarkTheme,codeBlockLightTheme:k.codeBlockLightTheme,codeBlockMonacoOptions:k.codeBlockMonacoOptions,renderCodeBlocksAsPre:k.renderCodeBlocksAsPre,codeBlockMinWidth:k.codeBlockMinWidth,codeBlockMaxWidth:k.codeBlockMaxWidth,codeBlockProps:k.codeBlockProps,mermaidProps:k.mermaidProps,d2Props:k.d2Props,infographicProps:k.infographicProps,showTooltips:Fe.value,themes:k.themes,langs:k.langs,isDark:k.isDark,typewriter:k.typewriter,smoothStreamingOptions:k.smoothStreamingOptions,parseCoalesceMs:k.parseCoalesceMs,fade:k.fade}));On("markstreamNestedRendererProps",wn);const hn=W(()=>nt.value),Bn=W(()=>nt.value.length),Gn=Z(null),Ye=Z(null),Xe=Z(null),At=Z(null),Lt=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),$n=!Lt&&k.customId?nS(k.customId):null,cn=W(()=>$n?(tS.value,nS(k.customId)):null),Nn=W(()=>{var x;return!!(be&&!ze.value&&k.customId&&!Lt&&((x=cn.value)!=null&&x.enabled))}),Fn=W(()=>{var x;return!!(!ze.value&&((x=o.virtualScroll)!=null&&x.enabled))}),eo=Z(!1);bn(()=>{eo.value=!0});const Mt=W(()=>!!(be&&Fn.value));On("markstreamHostScrollManaged",Mt);const Yn=W(()=>!!(eo.value&&Mt.value)),mn=W(()=>Nn.value||Mt.value),wo=W(()=>Nn.value||Yn.value),ei=W(()=>{var x;return mn.value&&((x=cn.value)==null?void 0:x.textEstimation)!==!1}),Ns=W(()=>{var x;return mn.value&&((x=cn.value)==null?void 0:x.codeBlockEstimation)!==!1});function et(){const x=X.value||bt("getMeasuredContainerWidth.clientWidth",()=>{var B;return((B=S.value)==null?void 0:B.clientWidth)||0});return Number.isFinite(x)&&x>0?x:0}const it=W(()=>{const x=et();return x>0?Math.max(1,Math.round(x)):640}),lt=W(()=>{var x;return Math.max(1,(x=k.maxLiveNodes)!=null?x:320)}),pt=W(()=>{var x;return!ze.value&&k.nodeVirtual!==!1&&!(((x=k.maxLiveNodes)!=null?x:0)<=0)&&(k.nodeVirtual===!0?nt.value.length>0:nt.value.length>lt.value)}),ti=W(()=>pt.value||Nn.value||Mt.value),mi=W(()=>k.viewportPriority!==!1&&!z.value),Ie=pj(x=>{var B;return te((B=x??S.value)!=null?B:null)},mi),{requestFrame:_e,cancelFrame:Re,hasIdleCallback:on,isTestEnv:Ut}=(function(x){const B=x.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,V=x.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,K=x.isClient&&typeof window.requestIdleCallback=="function",J=(function(){var fe;if(typeof globalThis>"u"||!("process"in globalThis))return;const ve=(fe=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:fe.value;return ve?.env})();return{requestFrame:B,cancelFrame:V,hasIdleCallback:K,isTestEnv:J?.NODE_ENV==="test"}})({isClient:be}),{resolvedBatchSize:fo,resolvedInitialBatch:Hn,batchingEnabled:gs,incrementalRenderingActive:ni,renderedCount:yo,previousRenderContext:rl,adaptiveBatchSize:ll,previousBatchConfig:gc}=(function(x,B){var V;const K=W(()=>{var Be;const $e=Math.trunc((Be=x.renderBatchSize)!=null?Be:80);return Number.isFinite($e)?Math.max(0,$e):0}),J=W(()=>{var Be;const $e=Math.trunc((Be=x.initialRenderBatchSize)!=null?Be:K.value);return Number.isFinite($e)?Math.max(0,$e):K.value}),fe=W(()=>!B.renderAsFragment.value&&x.batchRendering!==!1&&K.value>0&&B.isClient&&!B.isTestEnv),ve=Z(0),we=Z({key:x.indexKey,total:0}),Pe=Z(Math.max(1,K.value||1)),Me=W(()=>{var Be;return fe.value&&((Be=x.maxLiveNodes)!=null?Be:0)<=0}),We=Z({batchSize:K.value,initial:J.value,delay:(V=x.renderBatchDelay)!=null?V:16,enabled:Me.value});return{resolvedBatchSize:K,resolvedInitialBatch:J,batchingEnabled:fe,incrementalRenderingActive:Me,renderedCount:ve,previousRenderContext:we,adaptiveBatchSize:Pe,previousBatchConfig:We}})(k,{isClient:be,isTestEnv:Ut,renderAsFragment:ze}),dt=new Map,pe=new Map,Ne=new WeakMap;let Sn=null;const dd=new WeakMap,oe=new Map,Se=Z(0),Te=W(()=>(Se.value,Array.from(dt.entries()).sort((x,B)=>x[0]-B[0]))),Ue=Z(null),tt=Z(null);let at=null,Ft=0,Xt=null;const{activeRestoreAnchor:Wt,getRelativeScrollTopWithinContainer:Ls,setRelativeScrollTopWithinContainer:Os,resolveAnchorOffset:gn,clearRestoreReconcile:oo,scheduleRestoreReconcile:Ln,captureRestoreAnchor:So,restoreAnchor:Co,getAnchorDrift:lr}=(function(x){const{isClient:B,containerRef:V,parsedNodeCount:K,requestFrame:J,cancelFrame:fe,resolveScrollContainer:ve,getNormalizedScrollTop:we,getOffsetTopWithinRoot:Pe,isReverseFlexScrollRoot:Me,estimateIndexForOffset:We,estimateHeightRange:Be,getFallbackNodeHeight:$e,clamp:He}=x,Qe=Z(null);let Ze=null,St=[];function ct(){const Tt=ve(),Ht=V.value;if(!Tt||!Ht)return null;const Bt=Tt.ownerDocument||Ht.ownerDocument||document;if(Tt===Bt.documentElement||Tt===Bt.body||Tt===Bt.scrollingElement){const sn=Ht.getBoundingClientRect();return Math.max(0,-sn.top)}return Math.max(0,we(Tt,Bt,!1)-Pe(Ht,Tt))}function ut(Tt){var Ht;const Bt=ve(),sn=V.value;if(!Bt||!sn)return;const bs=Math.max(0,Tt),Uo=Bt.ownerDocument||sn.ownerDocument||document,oi=Uo.defaultView||(typeof window<"u"?window:null);if(Bt===Uo.documentElement||Bt===Uo.body||Bt===Uo.scrollingElement){const pr=we(Bt,Uo,!0)+sn.getBoundingClientRect().top;return void((Ht=oi?.scrollTo)==null||Ht.call(oi,0,Math.max(0,pr+bs)))}iS(Bt,Uo,Pe(sn,Bt)+bs,{isReverseFlexScrollRoot:pr=>{var hr;return(hr=Me?.(pr))!=null&&hr},getNormalizedScrollTop:we})}function xt(Tt){const Ht=K.value,Bt=He(Tt.nodeIndex,0,Math.max(0,Ht-1));return Be(0,Bt)+Math.max(0,Tt.offsetWithinNodePx)}function Ct(){if(Ze!=null&&(fe?.(Ze),Ze=null),B)for(const Tt of St)window.clearTimeout(Tt);St=[]}function Qt(Tt){const Ht=xt(Tt),Bt=ct();Bt!=null&&Math.abs(Bt-Ht)<=.5||ut(Ht)}return{activeRestoreAnchor:Qe,getRelativeScrollTopWithinContainer:ct,setRelativeScrollTopWithinContainer:ut,resolveAnchorOffset:xt,clearRestoreReconcile:Ct,applyRestoreAnchor:Qt,scheduleRestoreReconcile:function(){Qe.value&&B&&Ze==null&&(Ze=J?J(()=>{Ze=null,Qe.value&&Qt(Qe.value)}):null,Ze==null&&Qe.value&&Qt(Qe.value))},captureRestoreAnchor:function(){const Tt=ct(),Ht=K.value;if(Tt==null||Ht<=0)return null;const Bt=He(We(Tt+1),0,Ht-1),sn=Be(0,Bt),bs=$e(Bt);return{nodeIndex:Bt,offsetWithinNodePx:He(Tt-sn,0,Math.max(0,bs-1))}},restoreAnchor:function(Tt){const Ht=K.value;if(Qe.value={nodeIndex:He(Tt.nodeIndex,0,Math.max(0,Ht-1)),offsetWithinNodePx:Math.max(0,Tt.offsetWithinNodePx)},Ct(),Qt(Qe.value),B)for(const Bt of[0,120,280,480])St.push(window.setTimeout(()=>{Qe.value&&Qt(Qe.value)},Bt))},getAnchorDrift:function(Tt){const Ht=ct();return Ht==null?null:Ht-xt(Tt)}}})({isClient:be,containerRef:S,parsedNodeCount:Bn,requestFrame:_e,cancelFrame:Re,resolveScrollContainer:()=>Ue.value||ee(),getNormalizedScrollTop:Y,getOffsetTopWithinRoot:de,isReverseFlexScrollRoot:q,estimateIndexForOffset:xm,estimateHeightRange:fr,getFallbackNodeHeight:_d,clamp:To}),{nodeHeights:xo,heightStats:ts,heightTreeSize:vc,heightSumTree:Wh,heightKnownTree:zh,averageNodeHeight:gi,resetHeightMeasurements:w4,pruneHeightMeasurements:S4,rebuildHeightTrees:fd,recordNodeHeight:C4,removeNodeHeights:x4,exportHeightCache:A4,importHeightCache:T4,fenwickRangeSum:pd}=(function(x={}){const B=No({}),V=No({total:0,count:0}),K=Z(0),J=Z([]),fe=Z([]);function ve(){for(const $e of Object.keys(B))delete B[Number($e)];V.total=0,V.count=0,K.value=0,J.value=[],fe.value=[]}function we($e,He,Qe){for(let Ze=He+1;Ze<$e.length;Ze+=Ze&-Ze)$e[Ze]+=Qe}function Pe($e,He){let Qe=0;for(let Ze=He+1;Ze>0;Ze-=Ze&-Ze)Qe+=$e[Ze];return Qe}function Me($e){K.value=$e;const He=new Array($e+1).fill(0),Qe=new Array($e+1).fill(0);for(const[Ze,St]of Object.entries(B)){const ct=Number(Ze),ut=Number(St);!Number.isFinite(ct)||ct<0||ct>=$e||!Number.isFinite(ut)||ut<=0||(we(He,ct,ut),we(Qe,ct,1))}J.value=He,fe.value=Qe}function We($e){if(!Number.isInteger($e)||$e<0)return!1;const He=B[$e];if(!Number.isFinite(He)||He<=0)return!1;if(delete B[$e],V.total=Math.max(0,V.total-He),V.count=Math.max(0,V.count-1),K.value>$e){const Qe=J.value,Ze=fe.value;Qe.length&&Ze.length&&(we(Qe,$e,-He),we(Ze,$e,-1))}return!0}const Be=W(()=>V.count>0?Math.max(12,V.total/V.count):32);return{nodeHeights:B,heightStats:V,heightTreeSize:K,heightSumTree:J,heightKnownTree:fe,averageNodeHeight:Be,resetHeightMeasurements:ve,pruneHeightMeasurements:function($e){if($e<=0)return void ve();let He=0,Qe=0;for(const[Ze,St]of Object.entries(B)){const ct=Number(Ze),ut=Number(St);!Number.isFinite(ct)||ct<0||ct>=$e||!Number.isFinite(ut)||ut<=0?delete B[ct]:(He+=ut,Qe++)}V.total=He,V.count=Qe},rebuildHeightTrees:Me,recordNodeHeight:function($e,He,Qe={}){(function(Ze,St,ct={}){var ut;if(!Number.isFinite(St)||St<=0)return!1;const xt=B[Ze];if(xt&&(ct.allowShrink===!1&&St<xt||Math.abs(St-xt)<=1))return!1;if(B[Ze]=St,xt?V.total+=St-xt:(V.total+=St,V.count++),K.value>Ze){const Ct=J.value,Qt=fe.value;if(Ct.length&&Qt.length)if(xt){const Tt=St-xt;Tt!==0&&we(Ct,Ze,Tt)}else we(Ct,Ze,St),we(Qt,Ze,1)}ct.notify!==!1&&((ut=x.onHeightRecorded)==null||ut.call(x))})($e,He,Ot(rt({},Qe),{notify:!0}))},removeNodeHeight:function($e,He={}){var Qe;const Ze=We($e);return Ze&&He.notify!==!1&&((Qe=x.onHeightRecorded)==null||Qe.call(x)),Ze},removeNodeHeights:function($e,He={}){var Qe;let Ze=0;for(const St of $e)We(Number(St))&&Ze++;return Ze>0&&He.notify!==!1&&((Qe=x.onHeightRecorded)==null||Qe.call(x)),Ze},exportHeightCache:function(){return Object.entries(B).map(([$e,He])=>({index:Number($e),height:Number(He)})).filter($e=>Number.isFinite($e.index)&&$e.index>=0&&Number.isFinite($e.height)&&$e.height>0).sort(($e,He)=>$e.index-He.index)},importHeightCache:function($e,He={}){var Qe;if(!Array.isArray($e))return;const Ze=K.value;let St=!1;if(He.mode!=="merge"){const ct=Object.keys(B);if(ct.length>0){for(const ut of ct)delete B[Number(ut)];St=!0}}for(const ct of $e){const ut=Number(ct.index),xt=Number(ct.height);if(!Number.isInteger(ut)||ut<0||Ze>0&&ut>=Ze||!Number.isFinite(xt)||xt<=0)continue;const Ct=B[ut];Ct&&Math.abs(Ct-xt)<=1||(B[ut]=xt,St=!0)}St&&((function(){let ct=0,ut=0;const xt=K.value;for(const[Ct,Qt]of Object.entries(B)){const Tt=Number(Ct),Ht=Number(Qt);!Number.isFinite(Tt)||Tt<0||xt>0&&Tt>=xt||!Number.isFinite(Ht)||Ht<=0?delete B[Tt]:(ct+=Ht,ut++)}V.total=ct,V.count=ut})(),Ze>0&&Me(Ze),(Qe=x.onHeightRecorded)==null||Qe.call(x))},fenwickRangeSum:function($e,He,Qe){if(Qe<=He)return 0;const Ze=Pe($e,Qe-1);return He<=0?Ze:Ze-Pe($e,He-1)}}})({onHeightRecorded:()=>{Rs(),Mt.value&&Lc(),Wt.value&&Ln(),tt.value&&ra(),Tn("node-resize")}});function hd(){w4(),oe.clear()}function Ay(x){!Number.isInteger(x)||x<0||x>=nt.value.length||oe.set(x,wc(x))}function Ty(x,B,V={}){const K=xo[x];C4(x,B,V);const J=xo[x];J&&J>0?Ay(x):K&&oe.delete(x)}function My(x,B){const V=bt("getNodeLayoutHeight.slot.offsetHeight",()=>{var K,J;return(J=(K=dt.get(x))==null?void 0:K.offsetHeight)!=null?J:0});return V>0?V:bt("getNodeLayoutHeight.content.offsetHeight",()=>B.offsetHeight)}function Ey(x,B={}){T4(x,B),gm()}const ar=W(()=>{var x;return!ze.value&&k.deferNodesUntilVisible!==!1&&!(((x=k.maxLiveNodes)!=null?x:0)<=0)&&!pt.value&&!(nt.value.length>900)&&mi.value}),Iy=W(()=>!!Ie&&(ar.value||pt.value)),$y=W(()=>pt.value||Mt.value),{liveNodeBufferResolved:yc,focusIndex:Ps,liveRange:Ao,updateLiveRange:al}=(function(x,B){const{parsedNodeCount:V,virtualizationEnabled:K,maxLiveNodesResolved:J,clamp:fe}=B,ve=W(()=>{var Me;return Math.max(0,(Me=x.liveNodeBuffer)!=null?Me:60)}),we=Z(0),Pe=No({start:0,end:0});return{liveNodeBufferResolved:ve,focusIndex:we,liveRange:Pe,updateLiveRange:function(){const Me=V.value;if(!K.value||Me===0)return Pe.start=0,void(Pe.end=Me);const We=Math.min(J.value,Me),Be=ve.value,$e=fe(we.value-Be,0,Math.max(0,Me-We));Pe.start=$e,Pe.end=Math.min(Me,$e+We)}}})(k,{parsedNodeCount:Bn,virtualizationEnabled:pt,maxLiveNodesResolved:lt,clamp:To}),vi=new Map,cl=new Map,cr=new Map,md=[],$i=new Map,ur=new Set,Ny=Z(0);let Uh=!1;const Ly=W(()=>(Ny.value,ur.size)),vs=new Map,yi=new Map,Oy=Z(0),qh=W(()=>{Oy.value;let x=0;for(const B of vs.values())x+=Math.max(0,B);return x});let ys=null,jh=!0,Py=[0],Ry="";function Rs(){jh=!0}const gd=W(()=>{if(!pt.value)return nt.value.length;const x=yc.value,B=Math.max(Ao.end+x,Hn.value),V=Math.min(nt.value.length,B);return Math.max(yo.value,V)});function vd(){Uh||(Uh=!0,queueMicrotask(()=>{Uh=!1,Ny.value+=1}))}function Dy(x,B,V="node-resize"){if(!be||typeof window>"u")return null;const K=window.setTimeout(()=>{ur.delete(K)&&vd();try{B()}finally{Tn(V)}},Math.max(0,x));return ur.add(K),vd(),K}function yd(x){be&&x!=null&&(ur.delete(x)&&vd(),window.clearTimeout(x))}function By(){if(be&&typeof window<"u")for(const x of ur)window.clearTimeout(x);ur.size&&(ur.clear(),vd()),md.length=0,cr.clear()}function M4(x){var B,V;return(V=(B=At.value)==null?void 0:B[x])!=null?V:null}const{cancelScheduledFocusSync:Vh,scheduleFocusSync:ki}=(function(x){const{isClient:B,containerRef:V,virtualizationEnabled:K,requestFrame:J,cancelFrame:fe,syncFocusToScroll:ve}=x;let we=null;function Pe(){var We,Be,$e;return($e=(Be=(We=V.value)==null?void 0:We.ownerDocument)==null?void 0:Be.defaultView)!=null?$e:typeof window<"u"?window:null}function Me(){if(!we)return;const We=Pe();we.viaTimeout?We?We.clearTimeout(we.id):clearTimeout(we.id):fe?.(we.id),we=null}return{cancelScheduledFocusSync:Me,scheduleFocusSync:function(We={}){if(!K.value)return;if(!B)return void ve(!0);if(We.immediate)return Me(),void ve(!0);if(we)return;const Be=()=>{we=null,ve()};if(J)return void(we={id:J(Be),viaTimeout:!1});const $e=Pe();we={id:$e?$e.setTimeout(Be,16):setTimeout(Be,16),viaTimeout:!0}}}})({isClient:be,containerRef:S,virtualizationEnabled:pt,requestFrame:_e,cancelFrame:Re,syncFocusToScroll:function(x=!1){var B;if(!pt.value)return;const V=Ue.value||ee();if(!V)return;const K=V.ownerDocument||((B=S.value)==null?void 0:B.ownerDocument)||document,J=K?.defaultView||(typeof window<"u"?window:null),fe=V===K?.documentElement||V===K?.body,ve=nt.value.length;if(!fe&&ve>0&&q(V)){const Qe=bt("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),Ze=bt("syncFocusToScroll.scrollTop",()=>V.scrollTop),St=Ze<0?-Ze:Ze,ct=(function(xt){var Ct,Qt;const Tt=nt.value;if(!Tt.length)return 0;if(xt<=0)return Math.max(0,Tt.length-1);if(mn.value){const Bt=(Ct=Qh()[Tt.length])!=null?Ct:0;return Vy(Math.max(0,Bt-xt))}if(vc.value===Tt.length){const Bt=fr(0,Tt.length);return xm(Math.max(0,Bt-xt))}let Ht=xt;for(let Bt=Tt.length-1;Bt>=0;Bt--){const sn=(Qt=xo[Bt])!=null?Qt:gi.value;if(Ht<=sn)return Bt;Ht-=sn}return 0})(Math.max(0,St)+.5*Math.max(0,Qe)),ut=To(ct,0,Math.max(0,ve-1));return void((x||Math.abs(ut-Ps.value)>1)&&(Ps.value=ut,al()))}const we=fe?null:bt("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),Pe=fe?0:we.top,Me=fe?bt("syncFocusToScroll.viewport.clientHeight",()=>{var Qe,Ze;return(Ze=(Qe=J?.innerHeight)!=null?Qe:V.clientHeight)!=null?Ze:0}):we.bottom,We=Te.value;let Be=null,$e=null;for(const[Qe,Ze]of We){if(!Ze)continue;const St=bt("syncFocusToScroll.slot.getBoundingClientRect",()=>Ze.getBoundingClientRect());St.bottom<=Pe||St.top>=Me||(Be==null&&(Be=Qe),$e=Qe)}if(Be==null||$e==null){const Qe=S.value;if(!Qe)return;const Ze=fe?{top:0}:bt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),St=bt("syncFocusToScroll.fallback.scrollTop",()=>Y(V,K,fe)),ct=fe?(()=>{const Ct=bt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Qe.getBoundingClientRect()),Qt=(fe?0:Ze.top)-Ct.top;return Math.max(0,Qt)})():(()=>{const Ct=de(Qe,V);return Math.max(0,St-Ct)})(),ut=fe?bt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Ct,Qt,Tt,Ht;return(Ht=(Tt=(Qt=J?.innerHeight)!=null?Qt:(Ct=K?.documentElement)==null?void 0:Ct.clientHeight)!=null?Tt:V.clientHeight)!=null?Ht:0}):bt("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),xt=xm(ct+.5*Math.max(0,ut));return Ps.value=To(xt,0,Math.max(0,nt.value.length-1)),void al()}const He=Math.round((Be+$e)/2);!x&&Math.abs(He-Ps.value)<=1||(Ps.value=To(He,0,Math.max(0,nt.value.length-1)),al())}}),{visibleNodeIndices:Kh,nodeVisibilityHandles:Jl,nodeVisibilityWatchStops:kd,nodeVisibilityFallbackTimers:Fy,clearVisibilityFallback:bd,markNodeVisible:dr,cleanupNodeVisibility:E4,destroyNodeVisibilityState:Gh}=AV({isClient:be,shouldTrackVisibleNodeIndices:()=>ar.value,shouldCleanupNodeVisibility:()=>pt.value,onNodeMarkedVisible:x=>{pt.value?ki():Ps.value=To(x,0,Math.max(0,nt.value.length-1))},onNodeVisibilityCleaned:x=>{dt.delete(x)&&hk()}}),{cleanupScrollListener:Hy,setupScrollListener:I4}=(function(x){const{isClient:B,virtualizationEnabled:V,listenerEnabled:K,scrollRootElement:J,resolveScrollContainer:fe,scheduleFocusSync:ve,onScroll:we}=x;let Pe=null,Me=null;function We(){Pe&&(Pe(),Pe=null),Me=null,J.value=null}function Be($e){const He=x.getScrollTop?x.getScrollTop($e):$e.scrollTop;return Math.max(0,Number.isFinite(He)?Math.abs(He):0)}return{cleanupScrollListener:We,setupScrollListener:function(){if(!B)return;if(!(($e=K?.value)!=null?$e:V.value))return void We();var $e;const He=fe();if(!He)return void We();if(J.value===He&&Pe)return;We(),Me=Be(He);const Qe=()=>{if(we?.(),V.value){const Ze=(function(St){const ct=Be(St),ut=Me;Me=ct;const xt=Math.max(480,.75*(St.clientHeight||0));return ut==null?ct>xt?{immediate:!0}:void 0:Math.abs(ct-ut)>xt?{immediate:!0}:void 0})(He);Ze?ve(Ze):ve()}};He.addEventListener("scroll",Qe,{passive:!0}),J.value=He,Pe=()=>{He.removeEventListener("scroll",Qe)}}}})({isClient:be,virtualizationEnabled:pt,listenerEnabled:$y,scrollRootElement:Ue,resolveScrollContainer:ee,scheduleFocusSync:ki,onScroll:function(){const x=tt.value;if(!x)return;const B=_c();if(!B||(function(K){if(Tc()>=Ft)return Xt=null,!1;const J=Xt;if(J==null)return!0;const fe=Math.abs(K.scrollTop-J)<=2;return fe||(Xt=null),fe})(B))return;const V=tk(B);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,x.distanceFromBottomPx))>32)&&ia("restore"):ia("restore")},getScrollTop:x=>{var B;const V=x.ownerDocument||((B=S.value)==null?void 0:B.ownerDocument)||document,K=x===V.documentElement||x===V.body||x===V.scrollingElement;return bt("scrollListener.getScrollTop",()=>Y(x,V,K))}});function To(x,B,V){return Math.min(Math.max(x,B),V)}function Yh(x){return x?.firstElementChild}function Wy(x,B){var V;return x?(V=x.matches)!=null&&V.call(x,B)?x:x.querySelector(B):null}function zy(){if(!mn.value)return void(X.value=0);const x=bt("updateExperimentContainerWidth.clientWidth",()=>{var B,V;return(V=(B=S.value)==null?void 0:B.clientWidth)!=null?V:0});X.value=x>0?x:0}let kc=null;function Xh(){kc?.disconnect(),kc=null}const Uy=li({loader:()=>Un(null,null,function*(){return(yield Go(()=>import("./index8-B8E09VXR.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:UM,delay:0,suspensible:!1});function qy(x){return x===Uy}const jy=W(()=>u.value==="pre"?_s:u.value==="shiki"?Uy:Lg),ul=W(()=>{const x=nt.value;if(!x.length||!mn.value)return x.map(()=>null);const B=X.value||bt("estimatedNodeHeights.clientWidth",()=>{var V;return((V=S.value)==null?void 0:V.clientWidth)||0});return!Number.isFinite(B)||B<=0?x.map(()=>null):x.map((V,K)=>{const J=xo[K],fe=typeof J=="number"&&J>0;if(ei.value&&!fe){const we=YM(V,B,ue.value);if(we)return we}if(Ns.value&&V.type==="code_block"){const we=(function(Pe){if(Pe.type!=="code_block")return null;const Me=Tk(Pe,Md(Pe));return qy(Me)?"markdown":Me===_s?"pre":Me===jy.value||Me===Lg?"monaco":null})(V);if(we==="monaco"||we==="markdown"||we==="pre")return dV(V,{rendererKind:we,monacoOptions:k.codeBlockMonacoOptions,showHeader:((ve=k.codeBlockProps)==null?void 0:ve.showHeader)!==!1})}var ve;return null})});function _d(x){var B;const V=xo[x];if(Number.isFinite(V)&&V>0)return V;const K=(B=ul.value[x])==null?void 0:B.height;return Number.isFinite(K)&&K>0?K:Math.max(gi.value,(function(J){var fe,ve,we,Pe,Me,We,Be,$e,He,Qe,Ze,St,ct;const ut=nt.value[J];if(!ut||typeof ut!="object")return 32;const xt=String((fe=ut.type)!=null?fe:""),Ct=et()||640;switch(xt){case"heading":return 44;case"paragraph":return ea(String((we=(ve=ut.raw)!=null?ve:ut.content)!=null?we:""),Ct,34);case"list":{const Qt=Array.isArray(ut.items)?ut.items.length:1;return Math.max(48,30*Qt+12)}case"list_item":return ea(String((Me=(Pe=ut.raw)!=null?Pe:ut.content)!=null?Me:""),Ct,34);case"blockquote":return ea(String((Be=(We=ut.raw)!=null?We:ut.content)!=null?Be:""),Ct,56);case"table":{const Qt=Array.isArray(ut.rows)?ut.rows.length:Array.isArray(ut.children)?ut.children.length:3;return Math.max(120,38*Qt+48)}case"code_block":return ea(String((He=($e=ut.code)!=null?$e:ut.raw)!=null?He:""),Ct,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return ea(String((Ze=(Qe=ut.raw)!=null?Qe:ut.content)!=null?Ze:""),Ct,96);case"thematic_break":return 24;default:return ea(String((ct=(St=ut.raw)!=null?St:ut.content)!=null?ct:""),Ct,40)}})(x))}function ea(x,B,V,K=22){const J=String(x??"");if(!J)return V;const fe=Math.max(18,Math.floor(Math.max(320,B)/8)),ve=J.split(/\r?\n/).length,we=Math.ceil(J.length/fe),Pe=Math.max(1,ve,we);return Math.max(V,Math.ceil(Pe*K+12))}function bc(x){const B=Number(x);return!Number.isFinite(B)||B<=0?-1:Math.round(B/32)}function Qh(){var x,B;const V=nt.value.length,K=bc(X.value||bt("getFallbackHeightPrefix.clientWidth",()=>{var we;return((we=S.value)==null?void 0:we.clientWidth)||0})),J=((x=o.virtualScroll)==null?void 0:x.measurementKey)==null?"":String(o.virtualScroll.measurementKey),fe=[V,ts.count,Math.round(ts.total),Math.round(100*gi.value),J,K,mn.value?1:0,tS.value,Q.value].join(":");if(!jh&&Ry===fe)return Py;const ve=new Array(V+1);ve[0]=0;for(let we=0;we<V;we++)ve[we+1]=ve[we]+(mn.value?_d(we):(B=xo[we])!=null?B:gi.value);return Py=ve,Ry=fe,jh=!1,ve}function Vy(x){var B,V;const K=nt.value.length;if(K<=0||x<=0)return 0;const J=Qh();if(x>=((B=J[K])!=null?B:0))return K-1;let fe=0,ve=K-1,we=K-1;for(;fe<=ve;){const Pe=fe+ve>>1;((V=J[Pe+1])!=null?V:0)>=x?(we=Pe,ve=Pe-1):fe=Pe+1}return we}function fr(x,B){var V,K;if(x>=B)return 0;if(mn.value)return(function(ve,we){var Pe,Me;const We=nt.value.length,Be=To(Math.trunc(ve),0,We),$e=To(Math.trunc(we),Be,We);if(Be>=$e)return 0;const He=Qh();return((Pe=He[$e])!=null?Pe:0)-((Me=He[Be])!=null?Me:0)})(x,B);if(vc.value!==nt.value.length){let ve=0;for(let we=x;we<B;we++)ve+=(V=xo[we])!=null?V:gi.value;return ve}const J=Wh.value,fe=zh.value;if(!J.length||!fe.length){let ve=0;for(let we=x;we<B;we++)ve+=(K=xo[we])!=null?K:gi.value;return ve}return pd(J,x,B)+(B-x-pd(fe,x,B))*gi.value}Ge(()=>nt.value.length,x=>{Rs(),x<=0?hd():(x<vc.value&&S4(x),x!==vc.value&&fd(x))},{immediate:!0});const $4=W(()=>{if(!pt.value)return nt.value.map((K,J)=>({node:K,index:J}));const x=nt.value.length,B=To(Ao.start,0,x),V=To(Ao.end,B,x);return nt.value.slice(B,V).map((K,J)=>({node:K,index:B+J}))}),Zh=W(()=>pt.value?fr(0,Math.min(Ao.start,nt.value.length)):0),Jh=W(()=>{if(!pt.value)return 0;const x=nt.value.length;return fr(Math.min(Ao.end,x),x)});function Ky(){if(!mn.value)return 0;let x=0;const B=ul.value;for(let V=0;V<B.length;V++){if(!B[V])continue;const K=xo[V];Number.isFinite(K)&&K>0||x++}return x}function Gy(){const x=nt.value.length;return{totalNodes:x,measuredCount:ts.count,estimatedCount:Ky(),averageNodeHeight:gi.value,topSpacerHeight:Zh.value,bottomSpacerHeight:Jh.value,estimatedTotalHeight:fr(0,x),width:dl()}}function N4(){const x=nt.value,B=Gy();return Ot(rt({},B),{probe:{paragraphReady:!!ue.value.paragraph,listItemReady:!!ue.value.listItem,listWrapperOverhead:ue.value.listWrapperOverhead,headingReadyLevels:Object.entries(ue.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:x.map((V,K)=>{var J,fe,ve,we,Pe,Me,We,Be,$e;return{index:K,type:V.type,estimateKind:(fe=(J=ul.value[K])==null?void 0:J.kind)!=null?fe:null,rendererKind:(we=(ve=ul.value[K])==null?void 0:ve.rendererKind)!=null?we:null,estimatedHeight:(Me=(Pe=ul.value[K])==null?void 0:Pe.height)!=null?Me:null,estimatedContentHeight:(Be=(We=ul.value[K])==null?void 0:We.contentHeight)!=null?Be:null,measuredHeight:($e=xo[K])!=null?$e:null}})})}function em(){return o.indexKey!=null?String(o.indexKey):Fn.value?`virtual-${Pn()}`:"markdown-renderer"}function Yy(x){const B=String(x),V=`${em()}-`;if(!B.startsWith(V))return null;const K=B.slice(V.length).match(/^(\d+)(?:$|-)/);if(!K)return null;const J=Number(K[1]);return!Number.isInteger(J)||J<0||J>=nt.value.length?null:J}function Pn(){var x,B,V;const K=(x=o.virtualScroll)==null?void 0:x.sessionKey;return String(K!=null&&K!==""?K:(V=(B=o.indexKey)!=null?B:k.customId)!=null?V:Kt)}function po(){var x;const B=(x=o.virtualScroll)==null?void 0:x.threadKey;return B==null||B===""?void 0:String(B)}function tm(x){var B;return(x??"")===((B=po())!=null?B:"")}function L4(){var x;const B=(x=o.virtualScroll)==null?void 0:x.measurementKey;return B==null?"":String(B)}function O4(){var x,B;const V=u.value,K=V==="monaco"?k.codeBlockMonacoOptions:void 0,J=k.codeBlockProps,fe=V==="shiki";return[k.isDark?"dark":"light",V==="monaco"?"code-rich":V==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",ko(k.codeBlockMinWidth),ko(k.codeBlockMaxWidth),...fe?[Mp((x=J?.themes)!=null?x:k.themes,(B=J?.langs)!=null?B:k.langs)]:[],ko(K?.fontSize),ko(K?.lineHeight),ko(K?.fontFamily),ko(K?.tabSize),ko(K?.MAX_HEIGHT),ko(K?.wordWrap),ko(K?.wrappingIndent),ko(K?.padding),ko(J?.showHeader),ko(J?.showCopyButton),ko(J?.showExpandButton),ko(J?.showPreviewButton),ko(J?.showCollapseButton),ko(J?.showFontSizeButtons)].join("\0")}function Ni(){return[L4(),O4()].join("\0")}function dl(){return et()}const wd=W(()=>bc(dl())),ks=W(()=>[Ni(),wd.value].join("\0")),P4=W(()=>{var x;return Fn.value?["virtual",(x=po())!=null?x:"",Pn(),ks.value].join("\0"):o.indexKey});function ta(){Oy.value+=1}function nm(x){return!(!x||!Number.isInteger(x.index)||x.index<0||x.index>=nt.value.length||x.sessionKey!==Pn()||x.threadKey!==po()||x.layoutEpochKey!==ks.value)}function Xy(x){const B=String(x),V=yi.get(B);return V?nm(V)?V.index:null:Yy(B)}function Qy(x="async-node"){(vs.size||yi.size)&&(vs.clear(),yi.clear(),ta(),Tn(x))}const na=jt(n1,null),om={reportHeight(x,B){if(!Mt.value)return;const V=Xy(x);if(V==null)return;const K=vi.get(V);if(!K)return;const J=Number(B),fe=My(V,K);Ty(V,Number.isFinite(J)&&J>0?Math.max(J,fe||0):fe)},markPending(x){if(!Mt.value)return;const B=Yy(x);B!=null&&(function(V,K){var J;const fe=yi.get(V);if(fe&&nm(fe))return vs.set(V,Math.max(0,(J=vs.get(V))!=null?J:0)+1),ta(),void Tn("async-node");vs.set(V,1),yi.set(V,(function(ve){return{index:ve,sessionKey:Pn(),threadKey:po(),layoutEpochKey:ks.value}})(K)),ta(),Tn("async-node")})(String(x),B)},markSettled(x){if(!Mt.value)return;const B=String(x),V=Xy(x);(V!=null||(function(K){return vs.has(String(K))})(B))&&(function(K){var J;const fe=(J=vs.get(K))!=null?J:0;return!(fe<=0||(fe<=1?(vs.delete(K),yi.delete(K)):vs.set(K,fe-1),ta(),fe===1&&Tn("async-node"),0))})(B)&&V!=null&&Li()}};function R4(){let x=0;for(const B of vi.values())x+=bt("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=B?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,x))}On(n1,{reportHeight(x,B){om.reportHeight(x,B),na?.reportHeight(x,B)},markPending(x){om.markPending(x),na?.markPending(x)},markSettled(x){om.markSettled(x),na?.markSettled(x)}});let sm,im=null,oa=null;function Sd(x){return x!==!1&&x!=null&&x!==""}function Zy(){return pt.value?(function(){if(!pt.value)return!0;const x=nt.value.length,B=To(Ao.start,0,x),V=To(Ao.end,B,x);if(B>=V)return!0;for(let K=B;K<V;K++)if(!dt.has(K)||Am(K)&&!vi.has(K))return!1;return!0})():yo.value>=gd.value}function rm(){return j.value===!0&&!G.value&&qh.value===0&&ur.size===0&&$i.size===0&&ys==null&&Zy()}function Jy(){var x,B;if(((x=o.virtualScroll)==null?void 0:x.settleMode)!=="manual"||im===Pn()&&sm===po())return!0;const V=(B=o.virtualScroll)==null?void 0:B.settledToken;return!!Sd(V)&&oa===Oc(V)}function lm(){return rm()&&Jy()}function D4(x,B){return B.totalNodes<=0?x==="final"?"final":"estimate":B.measuredCount>=B.totalNodes?x==="final"?"final":"measured":B.measuredCount>0||B.estimatedCount>0?"mixed":"estimate"}function fl(x="manual",B){const V=Gy(),K=(function(J){return J||(j.value!==!0?nt.value.length>0?"streaming":"estimating":!Zy()||$i.size>0||ys!=null?"measuring":lm()?"settled":"settling")})(B);return{sessionKey:Pn(),threadKey:po(),phase:K,nodeCount:V.totalNodes,liveRange:{start:Ao.start,end:Ao.end},renderedCount:yo.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:R4(),totalHeight:ek(),width:V.width,final:j.value===!0,stable:lm(),confidence:D4(K,V),reason:x}}function _c(){const x=Ue.value||ee(),B=S.value;if(!x||!B)return null;const V=x.ownerDocument||B.ownerDocument||document,K=x===V.documentElement||x===V.body||x===V.scrollingElement,J=bt("getScrollBox.scrollTop",()=>Y(x,V,K)),fe=bt("getScrollBox.scrollHeight",()=>{var we,Pe,Me,We,Be;return K?Math.max((Pe=(we=V.documentElement)==null?void 0:we.scrollHeight)!=null?Pe:0,(We=(Me=V.body)==null?void 0:Me.scrollHeight)!=null?We:0,(Be=x.scrollHeight)!=null?Be:0):x.scrollHeight}),ve=bt("getScrollBox.clientHeight",()=>{var we;return K?((we=V.documentElement)==null?void 0:we.clientHeight)||x.clientHeight||0:x.clientHeight});return{root:x,doc:V,isViewportRoot:K,scrollTop:J,scrollHeight:fe,clientHeight:ve}}function ek(){const x=nt.value.length,B=Math.max(0,fr(0,x)),V=bt("getRendererLogicalHeight.offsetHeight",()=>{var J,fe;return(fe=(J=S.value)==null?void 0:J.offsetHeight)!=null?fe:0}),K=Math.max(0,V>0?V:bt("getRendererLogicalHeight.scrollHeight",()=>{var J,fe;return(fe=(J=S.value)==null?void 0:J.scrollHeight)!=null?fe:0}));return x<=0?Math.ceil(V):pt.value?B>0?Math.max(1,Math.ceil(B),(function(){let J=Zh.value+Jh.value;for(const fe of dt.values())fe&&(J+=Math.max(0,bt("getVirtualizedDomLogicalHeight.offsetHeight",()=>fe.offsetHeight||0)));return Math.ceil(Math.max(0,J))})(),(function(J,fe){return J<=0||fe<=0?0:fe<=J+Math.max(512,.05*J)?Math.ceil(fe):0})(B,K)):Math.max(1,Math.ceil(K)):Mt.value?B>0||ts.count>0||Ky()>0?(ni.value&&yo.value,Math.max(1,Math.ceil(K),Math.ceil(B))):Math.ceil(K):Math.max(1,Math.ceil(K),Math.ceil(B))}function tk(x){const B=S.value;if(!B)return null;const V=bt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>B.getBoundingClientRect());return(function(J){return J.isViewportRoot?J.clientHeight:bt("getViewportBottomInRoot.getBoundingClientRect",()=>J.root.getBoundingClientRect().bottom)})(x)-V.bottom}function B4(x={}){const B=x.requireViewport!==!1,V=(function(fe=64){const ve=_c(),we=S.value;if(!ve||!we)return!1;const Pe=(function(We){if(We.isViewportRoot)return{top:0,bottom:We.clientHeight};const Be=bt("getVirtualViewportRect.getBoundingClientRect",()=>We.root.getBoundingClientRect());return{top:Be.top,bottom:Be.bottom}})(ve),Me=bt("isRendererNearVirtualViewport.getBoundingClientRect",()=>we.getBoundingClientRect());return Me.bottom>=Pe.top-fe&&Me.top<=Pe.bottom+fe})();if(B&&!V)return null;const K=(function(){const fe=_c(),ve=S.value;if(!fe||!ve||Math.max(0,fe.scrollHeight-fe.scrollTop-fe.clientHeight)>64)return null;const we=tk(fe);return we==null?null:we>=-8&&we<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,we)}:null})();if(K)return{anchor:K,captured:!0};const J=So();if(J)return{anchor:{type:"node",nodeIndex:J.nodeIndex,offsetWithinNodePx:J.offsetWithinNodePx},captured:V};if(x.allowFallback===!0){const fe=(function(){const ve=nt.value.length;return ve<=0?null:{type:"node",nodeIndex:To(Ps.value,0,Math.max(0,ve-1)),offsetWithinNodePx:0}})();return fe?{anchor:fe,captured:!1}:null}return null}function am(x){let B=2166136261;for(let V=0;V<x.length;V++)B^=x.charCodeAt(V),B=Math.imul(B,16777619);return(B>>>0).toString(36)}function F4(x,B){let V=x;for(let K=0;K<B.length;K++)V^=B.charCodeAt(K),V=Math.imul(V,16777619);return V^=31,V=Math.imul(V,16777619),V}const H4=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Cd(x,B=new WeakSet,V=0){if(x==null||typeof x=="number"||typeof x=="boolean")return String(x);if(typeof x=="string")return`s:${(function(K){const J=K.length>8192?`${K.slice(0,8192)}...${K.length}`:K;return`${K.length}:${am(J)}`})(x)}`;if(typeof x=="function")return"fn";if(typeof x!="object")return typeof x;if(B.has(x))return"cycle";if(V>=6)return"max-depth";B.add(x);try{if(Array.isArray(x)){if(x.length<=160){const Me=[];for(let We=0;We<x.length;We++)Me.push(Cd(x[We],B,V+1));return`a:${x.length}:${Me.join(",")}`}const fe=[],ve=[],we=Math.max(0,x.length-32);let Pe=2166136261;for(let Me=0;Me<x.length;Me++){const We=Cd(x[Me],B,V+1);Pe=F4(Pe,We),Me<32&&fe.push(We),Me>=we&&ve.push(We)}return[`a:${x.length}`,`h=${fe.join(",")}`,`t=${ve.join(",")}`,`all=${(Pe>>>0).toString(36)}`].join(":")}const K=x,J=Object.keys(K).filter(fe=>{const ve=K[fe];return fe!=="parent"&&fe!=="el"&&fe!=="component"&&(ve==null||typeof ve=="string"||typeof ve=="number"||typeof ve=="boolean"||H4.has(fe))}).sort();return`o:${J.length}:${J.map(fe=>`${fe}=${Cd(K[fe],B,V+1)}`).join(";")}`}finally{B.delete(x)}}let nk=-1,cm="";function wc(x){const B=nt.value[x];return B?am(Cd(B)):""}function um(){const x=Q.value;if(nk===x)return cm;let B=2166136261;for(let V=0;V<nt.value.length;V++){const K=wc(V);for(let J=0;J<K.length;J++)B^=K.charCodeAt(J),B=Math.imul(B,16777619)}return cm=(B>>>0).toString(36),nk=x,cm}function sa(x,B={}){var V;const K=B.includeHeightCache===!0,J=(V=B.includeContentHash)!=null?V:K,fe=K?(function(we){const Pe=(function(){var Ze,St;const ct=Number((St=(Ze=o.virtualScroll)==null?void 0:Ze.heightCacheLimit)!=null?St:5e3);return!Number.isFinite(ct)||ct<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ct))})();if(!Number.isFinite(Pe)||we.length<=Pe)return we;const Me=new Map,We=Ze=>{!Ze||Me.size>=Pe||Me.set(Ze.index,Ze)},Be=nt.value.length,$e=To(Ao.start-2*yc.value,0,Be),He=To(Ao.end+2*yc.value,$e,Be);for(const Ze of we)Ze.index>=$e&&Ze.index<He&&We(Ze);const Qe=Math.max(1,Math.ceil(we.length/Pe));for(let Ze=0;Ze<we.length&&Me.size<Pe;Ze+=Qe)We(we[Ze]);for(let Ze=we.length-1;Ze>=0&&Me.size<Pe;Ze-=Qe)We(we[Ze]);return Array.from(Me.values()).sort((Ze,St)=>Ze.index-St.index).slice(0,Pe)})(A4().map(we=>{var Pe;const Me=nt.value[we.index];return Me?Ot(rt({},we),{nodeType:String((Pe=Me.type)!=null?Pe:""),signature:wc(we.index)}):null}).filter(we=>!!we)):[],ve=B4({allowFallback:B.allowAnchorFallback===!0,requireViewport:B.requireViewport});return ve||fe.length||B.includeEmptyState===!0?Ot(rt({sessionKey:x.sessionKey,threadKey:x.threadKey},ve?{anchor:ve.anchor,anchorCaptured:ve.captured}:{anchorCaptured:!1}),{metrics:x,width:x.width,contentHash:J?um():void 0,measurementKey:Ni()||void 0,heightCache:fe.length?fe:void 0}):null}function dm(x){var B,V;const K=_c();if(!K)return;const J=(function(we){const Pe=S.value;if(!Pe)return null;const Me=de(Pe,we.root),We=nt.value.length,Be=bt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Pe.offsetHeight||0),$e=Math.max(0,Be>0?Be:We>0?bt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Pe.scrollHeight||0):0),He=ek();return Me+Math.max($e,He)})(K);if(J==null)return;const fe=Math.max(0,x.distanceFromBottomPx),ve=Math.max(0,J-K.clientHeight-fe);(function(we){Ft=Tc()+120,Xt=we})(ve),K.isViewportRoot?(V=(B=K.doc.defaultView)==null?void 0:B.scrollTo)==null||V.call(B,0,ve):iS(K.root,K.doc,ve,{isReverseFlexScrollRoot:q,getNormalizedScrollTop:Y})}const fm=[];function ok(){if(be)for(at!=null&&(Re?.(at),at=null);fm.length;){const x=fm.pop();x!=null&&window.clearTimeout(x)}}function ia(x){const B=!!tt.value;tt.value=null,Ft=0,Xt=null,ok(),B&&x&&Tn(x)}function ra(){if(!tt.value||!be||at!=null)return;const x=()=>{at=null;const B=tt.value;B&&dm(B)};at=_e?_e(x):null,at==null&&x()}function sk(x,B={}){const V=nt.value.length;return V<=0?[]:x.filter(K=>!(!Number.isInteger(K.index)||K.index<0||K.index>=V)&&!(!Number.isFinite(K.height)||K.height<=0)&&!(B.requireSignature&&!K.signature)&&!(B.requireCompatibilityMetadata&&!K.nodeType&&!K.signature)&&(function(J){var fe;const ve=nt.value[J.index];return!(!ve||J.nodeType&&J.nodeType!==String((fe=ve.type)!=null?fe:"")||J.signature&&J.signature!==wc(J.index))})(K))}function ik(x){const B=bc(dl()),V=bc(x);return B!==-1&&V!==-1&&B===V}function pm(x){var B;const V=Number(x?.width);if(Number.isFinite(V)&&V>0)return V;const K=Number((B=x?.metrics)==null?void 0:B.width);return Number.isFinite(K)&&K>0?K:null}function rk(x){var B;return x.sessionKey===Pn()&&!!tm(x.threadKey)&&((B=x.measurementKey)!=null?B:"")===Ni()&&!!ik(pm(x))&&!!(function(V){const K=V.heightCache;return!!K?.length&&(lk(V)?K.some(J=>!!(J.nodeType||J.signature)):K.some(J=>!!J.signature))})(x)}function lk(x){return!!(x.contentHash&&x.contentHash===um())}function W4(x){return!lk(x)}let pl=null,hl=null,xd=null,Sc=null,Cc=null;function hm(x){var B;const V=x.map(J=>{var fe,ve;return[J.index,Math.round(10*J.height),(fe=J.nodeType)!=null?fe:"",(ve=J.signature)!=null?ve:""].join("")}).join(""),K=bc(dl());return[(B=po())!=null?B:"",Pn(),Ni(),nt.value.length,K,x.length,am(V)].join(":")}function ak(x=(B=>(B=o.virtualScroll)==null?void 0:B.heightCache)()){if(!Mt.value||!x?.length||nt.value.length<=0||!ik((B=o.virtualScroll)==null?void 0:B.heightCacheWidth))return!1;var B;const V=sk(x,{requireSignature:!0});if(!V.length)return!1;const K=hm(V);return K===pl?(hl="standalone",!0):(Ey(V,{mode:"merge"}),Rs(),pl=K,hl="standalone",Ec(),Tn("restore"),!0)}function mm(x,B={}){var V,K,J;if(!Mt.value||!x||x.sessionKey!==Pn()||!tm(x.threadKey)||nt.value.length<=0)return!1;const fe=!!((V=x.heightCache)!=null&&V.length)&&!Ad(),ve=!x.anchor||x.anchorCaptured===!1&&B.allowUncapturedAnchor!==!0?null:x.anchor,we=B.restoreAnchor===!0&&!!ve&&!Ad()&&Number(pm(x))>0;let Pe=!1;if((K=x.heightCache)!=null&&K.length&&rk(x)){const We=sk(x.heightCache,{requireCompatibilityMetadata:!x.contentHash,requireSignature:W4(x)});We.length&&(Ey(We,{mode:"merge"}),Rs(),pl=hm(We),hl="restore",Ec(),Pe=!0)}if(fe||we)return!1;if(!B.restoreAnchor||!ve)return Pe&&Tn("restore"),!0;const Me=(function(We,Be){var $e;const He=We.anchor,Qe=He?He.type==="bottom"?`bottom:${Math.round(He.distanceFromBottomPx)}`:`node:${He.nodeIndex}:${Math.round(He.offsetWithinNodePx)}`:"none";return[($e=po())!=null?$e:"",Pn(),Ni(),wd.value,Be,Qe].join(":")})(x,(J=B.restoreToken)!=null?J:"imperative");return xd===Me?(Pe&&Tn("restore"),!0):(xd=Me,(function(We){const Be=()=>{if(We.type==="node")return ia(),void Co({nodeIndex:We.nodeIndex,offsetWithinNodePx:We.offsetWithinNodePx});if(oo(),Wt.value=null,tt.value=We,ok(),dm(We),be)for(const $e of[0,120,280,480])fm.push(window.setTimeout(()=>{const He=tt.value;He&&dm(He)},$e))};(function($e){if(!pt.value)return!1;const He=nt.value.length;return!(He<=0||(Ps.value=$e.type==="node"?To($e.nodeIndex,0,He-1):He-1,al(),0))})(We)?gt(Be):Be()})(ve),Tn("restore"),!0)}function Ad(){const x=dl();return Number.isFinite(x)&&x>0}function ck(x){var B;return x.sessionKey===Pn()&&!!tm(x.threadKey)&&(nt.value.length<=0||!(!((B=x.heightCache)!=null&&B.length)||Ad())||!(!(x.anchor&&Number(pm(x))>0)||Ad()))}function gm(){oe.clear();for(const x of Object.keys(xo)){const B=Number(x);Number.isInteger(B)&&B>=0&&B<nt.value.length&&Ay(B)}}function xc(){ys!=null&&(Re?.(ys),ys=null),Tm()}function uk(){return!be||Ut?Promise.resolve():new Promise(x=>{let B=!1,V=null;const K=()=>{B||(B=!0,V!=null&&window.clearTimeout(V),x())};if(_e)return _e(K),void(V=window.setTimeout(K,50));V=window.setTimeout(K,0)})}function vm(x,B=po(),V=ks.value){return Pn()===x&&po()===B&&ks.value===V}function ym(){return Un(this,arguments,function*(x={}){var B,V,K,J,fe;const ve=Pn(),we=po(),Pe=ks.value,Me=(B=x.frames)!=null?B:2,We=(V=x.timeoutMs)!=null?V:120,Be=(K=x.reason)!=null?K:"manual",$e=x.expectedSettledTokenKey,He=x.flushPendingTimers===!0,Qe=fl(Be),Ze=()=>Ot(rt({},Qe),{phase:Qe.final?"settling":Qe.phase,stable:!1,confidence:Qe.confidence==="final"?"mixed":Qe.confidence,reason:Be}),St=()=>vm(ve,we,Pe)&&($e==null||Mc()===$e);for(let Ct=0;Ct<Me;Ct++){if(yield gt(),!St()||(yield uk(),!St()))return Ze();Li(),xc()}if(yield(function(Ct){return!be||Ct<=0?Promise.resolve():new Promise(Qt=>window.setTimeout(Qt,Ct))})(We),!St()||(He&&By(),Li(),xc(),!St()))return Ze();const ct=rm();ct&&(im=ve,sm=we,((J=o.virtualScroll)==null?void 0:J.settleMode)==="manual"&&$e!=null&&Sd((fe=o.virtualScroll)==null?void 0:fe.settledToken)&&Mc()===$e&&(oa=Oc(o.virtualScroll.settledToken)));const ut=St()&&ct&&Jy(),xt=fl(Be,ut?"final":void 0);return Sm(xt,!0),xt})}let km="content",ml=null,gl=null,bm=0,Ac=null,la=null,_m=null,wm=null;function Tc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function dk(x){var B,V;const K=Ac;if(!K)return!0;const J=(V=(B=o.virtualScroll)==null?void 0:B.heightDiffThresholdPx)!=null?V:1;return Math.abs(x.totalHeight-K.totalHeight)>J||x.sessionKey!==K.sessionKey||x.phase!==K.phase||x.stable!==K.stable||x.final!==K.final||x.threadKey!==K.threadKey||x.nodeCount!==K.nodeCount||x.measuredCount!==K.measuredCount||x.width!==K.width}function ko(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 Mc(x=(B=>(B=o.virtualScroll)==null?void 0:B.settledToken)()){return ko(x)}function fk(x,B){var V,K;return[x,B.sessionKey,(V=B.threadKey)!=null?V:"",Ni(),um(),ko((K=o.virtualScroll)==null?void 0:K.settledToken),Math.round(B.totalHeight),Math.round(B.width)].join("\0")}function Ec(){_m=null,wm=null,la=null}function z4(x){const B=x.heightCache;return B?.length?hm(B):""}function Ic(x){var B,V,K;const J=x.metrics,fe=x.anchor?(ve=x.anchor).type==="bottom"?`bottom:${Math.round(ve.distanceFromBottomPx)}`:`node:${ve.nodeIndex}:${Math.round(ve.offsetWithinNodePx)}`:"none";var ve;return[x.sessionKey,(B=x.threadKey)!=null?B:"",(V=x.measurementKey)!=null?V:Ni(),(K=x.contentHash)!=null?K:"",z4(x),fe,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 Sm(x,B=!1){if(!Mt.value||(function(ve=!1){return!ve&&Fn.value&&!Yn.value})(B))return;const V=B||dk(x),K=(function(ve,we=!1){return we||ve.stable||ve.phase==="final"?{state:sa(ve,{includeHeightCache:!0})}:{state:sa(ve)}})(x,B),J=K.state,fe=!!(J&&(V||(function(ve,we=!1){return!!we||Ic(ve)!==la})(J,B)));if(V&&(M(x),Ac=x,bm=Tc()),J&&fe&&(E(J),J.anchor&&O(J.anchor),la=Ic(J)),x.stable){const ve=fk("settled",x);if(ve!==_m){_m=ve;const we=sa(x,{includeHeightCache:!0});we&&(E(we),la=Ic(we)),(function(Pe){s("render-settled",Pe)})(x)}}if(x.phase==="final"){const ve=fk("final",x);if(ve!==wm){wm=ve;const we=sa(x,{includeHeightCache:!0});we&&(E(we),la=Ic(we)),(function(Pe){s("render-final",Pe)})(x)}}}function Cm(){ml!=null&&(Re?.(ml),ml=null),gl!=null&&be&&(window.clearTimeout(gl),gl=null)}function pk(){ml=null,gl=null,(function(x){if($i.size>0||ys!=null)return!0;switch(x){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(km)&&(Li(),xc()),Sm(fl(km))}function Tn(x){var B,V;if(!Mt.value||(km=x,ml!=null||gl!=null))return;const K=Math.max(0,(V=(B=o.virtualScroll)==null?void 0:B.emitIntervalMs)!=null?V:32),J=Math.max(0,K-(Tc()-bm)),fe=()=>{gl=null,ml=_e?_e(pk):null,ml==null&&pk()};be&&J>0?gl=window.setTimeout(fe,J):fe()}function xm(x){var B;if(x<=0)return 0;const V=nt.value;if(mn.value)return Vy(x);if(vc.value===V.length&&Wh.value.length&&zh.value.length){const J=gi.value,fe=Wh.value,ve=zh.value,we=Be=>Be<=0?0:pd(fe,0,Be)+(Be-pd(ve,0,Be))*J;let Pe=0,Me=V.length-1,We=V.length-1;for(;Pe<=Me;){const Be=Pe+Me>>1;we(Be+1)>=x?(We=Be,Me=Be-1):Pe=Be+1}return We}let K=x;for(let J=0;J<V.length;J++){const fe=(B=xo[J])!=null?B:gi.value;if(K<=fe)return J;K-=fe}return Math.max(0,V.length-1)}function hk(){Se.value+=1}function Am(x){return!(ni.value&&x>=yo.value)&&(!ar.value||x<Hn.value||Kh.value.has(x))}function aa(x){const B=kd.get(x);B&&(B(),kd.delete(x));const V=Jl.get(x);V&&(V.destroy(),Jl.delete(x)),bd(x)}function mk(x,B){let V=!1;if(B){const fe=dt.get(x);dt.set(x,B),fe!==B&&(V=!0)}else dt.delete(x)&&(V=!0);if(V&&hk(),B||bd(x),!Iy.value||!Ie||!pt.value&&ar.value&&!z.value&&Jl.size>=640&&(z.value||(z.value=!0,Gh()),!Iy.value||!Ie))return aa(x),void(B&&dr(x,!0));if(x<Hn.value&&!pt.value||Kh.value.has(x))return aa(x),void dr(x,!0);if(!B)return void aa(x);aa(x);const K=Ie(B,{rootMargin:"400px"});if(!K)return;Jl.set(x,K),dr(x,K.isVisible.value),ar.value&&(function(fe){if(!be||!ar.value)return;bd(fe);const ve=fe%17*23,we=window.setTimeout(()=>{if(Fy.delete(fe),!ar.value||Kh.value.has(fe))return;const Pe=dt.get(fe);if(!Pe)return;const Me=ee(Pe),We=Pe.ownerDocument||document,Be=We.defaultView||window,$e=!Me||Me===We.documentElement||Me===We.body,He=!$e&&Me?bt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Me.getBoundingClientRect()):null,Qe=$e?0:He.top,Ze=$e?bt("nodeVisibilityFallback.clientHeight",()=>{var ct,ut;return(ut=(ct=Be.innerHeight)!=null?ct:Me?.clientHeight)!=null?ut:0}):He.bottom,St=bt("nodeVisibilityFallback.node.getBoundingClientRect",()=>Pe.getBoundingClientRect());St.bottom>=Qe-500&&St.top<=Ze+500&&dr(fe,!0)},1800+ve);Fy.set(fe,we)})(x);let J=null;J=Ge(()=>K.isVisible.value,fe=>{if(fe){bd(x),dr(x,!0),J?.(),kd.delete(x),Jl.get(x)===K&&Jl.delete(x);try{K.destroy()}catch{}}},{immediate:!0}),kd.set(x,J),pt.value&&ki()}function Tm(){ys=null;for(const[x,B]of $i)$i.delete(x),vi.get(x)===B.el&&cl.get(x)===B.version&&Ty(x,B.height,{allowShrink:B.allowShrink})}function ca(){ys!=null&&(Re?.(ys),ys=null),$i.clear()}function Td(x,B){(function(V,K,J){var fe;if(!Number.isFinite(J)||J<=0||vi.get(V)!==K)return;const ve=cl.get(V);if(ve==null)return;const we=nt.value[V],Pe=G.value&&j.value!==!0&&!((fe=o.nodes)!=null&&fe.length)&&V>=nt.value.length-2,Me=!(we?.loading===!0||Pe),We=$i.get(V),Be=We?We.allowShrink&&Me:Me,$e=We&&!Be?Math.max(We.height,J):J;$i.set(V,{height:$e,allowShrink:Be,version:ve,el:K}),ys==null&&(ys=_e?_e(Tm):null,ys==null&&Tm())})(x,B,My(x,B))}function Li(){for(const[x,B]of vi)B&&Td(x,B)}function gk(){Sn?.disconnect(),Sn=null,pe.clear()}function Mm(){for(;md.length;)yd(md.pop())}Ge(Yn,x=>{x&&Tn("content")},{flush:"post"}),t({getVirtualMetrics:fl,captureVirtualState:function(x={}){var B;return sa(fl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:x.allowFallbackAnchor===!0,requireViewport:x.requireViewport===!0,includeEmptyState:(B=x.includeEmptyState)==null||B})},restoreVirtualState:function(x,B={}){const V=B.restoreAnchor===!0,K=B.restoreToken==null?"imperative":String(B.restoreToken);Sc=x,Cc={restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0},!mm(x,{restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0})&&ck(x)||(Sc=null,Cc=null)},forceMeasure:function(x="manual"){return Un(this,null,function*(){yield gt(),yield uk(),Li(),xc(),yield gt();const B=fl(x);return Sm(B,!0),B})},settle:ym,scrollToNode:function(x,B="start"){ia(),oo();const V=nt.value.length;if(V<=0)return;const K=To(x,0,V-1),J=()=>{var fe;const ve=gn({nodeIndex:K,offsetWithinNodePx:0}),we=_d(K),Pe=_c(),Me=(fe=Pe?.clientHeight)!=null?fe:0,We=Ls();let Be=ve;if(B==="center")Be=ve-Me/2+we/2;else if(B==="end")Be=ve-Me+we;else if(B==="nearest"&&We!=null){if(ve>=We&&ve+we<=We+Me)return;Be=ve<We?ve:ve-Me+we}Os(Math.max(0,Be)),ki({immediate:!0}),pt.value&&(Ps.value=K,al())};if(pt.value)return Ps.value=K,al(),void gt(J);J()}}),Ge(()=>ti.value,x=>{if(!x){gk();for(const B of cr.values())for(const V of B)yd(V);cr.clear(),cl.clear(),Mm(),ca()}},{immediate:!0}),Ge(j,x=>{x&&(function(){if(be&&j.value&&vi.size){Mm();for(const B of[80,240,640]){const V=Dy(B,()=>{for(const[K,J]of vi)J&&Td(K,J)},"final");V!=null&&md.push(V)}}})(),Tn(x?"final":"content")}),Ge([()=>nt.value.length,()=>yo.value],()=>{tt.value&&ra(),Tn("content")},{flush:"post",immediate:!0}),Ge([()=>Ao.start,()=>Ao.end],()=>{Tn("batch")},{flush:"post"});const{cleanupBatchScheduler:U4}=(function(x){const{props:B,isClient:V,isTestEnv:K,parsedNodesIdentity:J,parsedNodeCount:fe,desiredRenderedCount:ve,datasetKey:we,batchingEnabled:Pe,incrementalRenderingActive:Me,resolvedBatchSize:We,resolvedInitialBatch:Be,renderedCount:$e,adaptiveBatchSize:He,previousRenderContext:Qe,previousBatchConfig:Ze,requestFrame:St,cancelFrame:ct,hasIdleCallback:ut,cleanupNodeVisibility:xt,onDatasetKeyChanged:Ct,onDatasetChanged:Qt}=x;let Tt=null,Ht=null,Bt=!1,sn=null,bs=null,Uo=0,oi=!1,pr=!1;const hr=new Set,yl=new Set;function Ok(){if(V){Tt!=null&&(ct?.(Tt),Tt=null),Ht!=null&&(window.clearTimeout(Ht),Ht=null),bs!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(bs),bs=null),Uo+=1;for(const Po of hr)ct?.(Po);hr.clear();for(const Po of yl)window.clearTimeout(Po);yl.clear(),Bt=!1,sn=null,oi=!1,pr=!1}}function Od(){return typeof performance<"u"?performance.now():Date.now()}function Pk(Po){(function(Oi){var mr;if(!Me.value)return;const Pi=Math.max(2,(mr=B.renderBatchBudgetMs)!=null?mr:6),Ri=Math.max(1,We.value||1),si=Math.max(1,Math.floor(Ri/4));Oi>1.2*Pi?He.value=Math.max(si,Math.floor(.7*He.value)):Oi<.5*Pi&&He.value<Ri&&(He.value=Math.min(Ri,Math.ceil(1.2*He.value)))})(Po),oi=!1;const ns=pr||$e.value<ve.value;pr=!1,ns&&Bk()}function Rk(Po,ns={}){var Oi,mr;if(!Me.value)return;const Pi=ve.value;if($e.value>=Pi)return;const Ri=Math.max(1,Po),si=()=>{const fa=Od();let pa=0;Tt=null,Ht=null,bs=null,Bt=!1;const ha=sn??Ri;sn=null;const Rm=Od();$e.value=Math.min(Pi,$e.value+ha),xt($e.value),pa=Od()-Rm,(function(Dm,Fk){if(!V)return void Pk(Fk);oi=!0;const Hk=++Uo;gt().then(()=>{var Wk;if(Hk!==Uo)return;const cE=Od(),uE=Math.max(Fk,cE-Dm),zk=()=>{Hk===Uo&&Pk(uE)};if(St){let qk=!1,Di=null;const jk=()=>{qk||(qk=!0,zk())},Pd=St(()=>{hr.delete(Pd),Di!=null&&(window.clearTimeout(Di),yl.delete(Di),Di=null),jk()});return hr.add(Pd),Di=window.setTimeout(()=>{Di!=null&&yl.delete(Di),Di=null,ct?.(Pd),hr.delete(Pd),jk()},Math.max(32,(Wk=B.renderBatchIdleTimeoutMs)!=null?Wk:120)),void yl.add(Di)}const Uk=window.setTimeout(()=>{yl.delete(Uk),zk()},0);yl.add(Uk)})})(fa,pa)};if(!V||ns.immediate)return void si();const gr=Math.max(0,(Oi=B.renderBatchDelay)!=null?Oi:16);if(sn=sn!=null?Math.max(sn,Ri):Ri,!Bt){if(Bt=!0,!K&&ut&&window.requestIdleCallback){const fa=Math.max(0,(mr=B.renderBatchIdleTimeoutMs)!=null?mr:120);return void(bs=window.requestIdleCallback(()=>si(),{timeout:fa}))}St&&!K?Tt=St(()=>{gr!==0?Ht=window.setTimeout(()=>si(),gr):si()}):Ht=window.setTimeout(()=>si(),gr)}}function Dk(Po,ns={}){oi?pr=!0:Po==null?Bk():Rk(Po,ns)}function Bk(){Me.value&&Rk(Pe.value?Math.max(1,Math.round(He.value)):Math.max(1,We.value))}return Ge([J,fe,we,Me,We,Be,()=>B.renderBatchDelay],()=>{var Po;const ns=fe.value,Oi=Qe.value,mr=we.value,Pi=!Object.is(mr,Oi.key),Ri=ns!==Oi.total,si=Pi||Ri;Qe.value={key:mr,total:ns};const gr=Ze.value,fa=(Po=B.renderBatchDelay)!=null?Po:16,pa=gr.batchSize!==We.value||gr.initial!==Be.value||gr.delay!==fa||gr.enabled!==Me.value;Ze.value={batchSize:We.value,initial:Be.value,delay:fa,enabled:Me.value},Pi&&Ct(ns),(si||pa||!Me.value)&&Ok(),(si||pa)&&(He.value=Math.max(1,We.value||1)),si&&Qt();const ha=ve.value;if(!ns)return $e.value=0,void xt(0);if(!Me.value)return $e.value=ha,void xt($e.value);const Rm=Pi||Oi.total===0;$e.value=Rm||pa?Math.min(ha,Be.value):Math.min($e.value,ha);const Dm=Math.max(1,Be.value||We.value||ns);$e.value<ha?Dk(Dm,{immediate:!V}):xt($e.value)},{immediate:!0}),Ge(ve,(Po,ns)=>{Me.value&&(typeof ns=="number"&&Po<=ns||Po>$e.value&&Dk())}),{cleanupBatchScheduler:Ok}})({props:k,isClient:be,isTestEnv:Ut,parsedNodesIdentity:hn,parsedNodeCount:Bn,desiredRenderedCount:gd,datasetKey:P4,batchingEnabled:gs,incrementalRenderingActive:ni,resolvedBatchSize:fo,resolvedInitialBatch:Hn,renderedCount:yo,adaptiveBatchSize:ll,previousRenderContext:rl,previousBatchConfig:gc,requestFrame:_e,cancelFrame:Re,hasIdleCallback:on,cleanupNodeVisibility:E4,onDatasetKeyChanged:x=>{ca(),hd(),Rs(),Ec(),x>0&&fd(x)},onDatasetChanged:()=>{pt.value&&ki({immediate:!0})}});Ge([$y,pt,()=>S.value,()=>me()],([x,B])=>{if(!x)return Hy(),void Vh();I4(),B?ki({immediate:!0}):Vh()},{flush:"post",immediate:!0}),Ge([()=>nt.value.length,()=>pt.value],x=>Un(null,[x],function*([B,V]){V&&B&&be&&(yield gt(),ki({immediate:!0}))}),{flush:"post"}),Ge(mn,x=>{x&&(function(){var B;if(Gn.value&&Ye.value&&Xe.value&&((B=At.value)!=null&&B[1]))return;const V=Rr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),K=Rr({type:"list_item",children:[V],raw:"- Probe paragraph text"}),J=Rr({type:"list",ordered:!1,items:[K],raw:"- Probe paragraph text"});Gn.value=V,Ye.value=K,Xe.value=J;const fe={1:null,2:null,3:null,4:null,5:null,6:null};for(let ve=1;ve<=6;ve++)fe[ve]=Rr({type:"heading",level:ve,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ve)} Probe heading`});At.value=fe})()},{immediate:!0}),Ge([()=>S.value,mn],()=>{if(!mn.value)return Xh(),void(X.value=0);zy(),Xh(),mn.value&&S.value&&typeof ResizeObserver<"u"&&(kc=new ResizeObserver(()=>{zy(),Wt.value&&Ln(),tt.value&&ra(),Tn("resize")}),kc.observe(S.value))},{immediate:!0}),Ge([mn,it,ks],()=>Un(null,null,function*(){if(!mn.value)return ue.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Rs();yield gt(),(function(){if(!mn.value||typeof window>"u")return ue.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Rs();const x={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},B=Wy(Yh(I.value),".paragraph-node");x.paragraph=Wg(I.value,B,"pre-wrap");const V=Yh(P.value),K=V?.querySelector(".paragraph-node");x.listItem=Wg(P.value,K,"pre-wrap");const J=bt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ve,we;return(we=(ve=D.value)==null?void 0:ve.offsetHeight)!=null?we:0}),fe=bt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ve,we;return(we=(ve=P.value)==null?void 0:ve.offsetHeight)!=null?we:0});x.listWrapperOverhead=Math.max(0,J-fe);for(let ve=1;ve<=6;ve++){const we=Wy(Yh(H[ve]),`h${ve}`);x.headings[ve]=Wg(H[ve],we,"pre-wrap")}ue.value=x,Rs()})()}),{flush:"post",immediate:!0}),Ge(()=>nt.value.length,()=>{pt.value&&ki({immediate:!0})}),Ge([mn,X],()=>{Rs(),pt.value&&ki({immediate:!0}),Wt.value&&Ln(),tt.value&&ra(),Tn("resize")},{immediate:!1}),Ge(()=>ar.value,x=>{if(x)for(const[B,V]of dt)mk(B,V);else{Gh();for(const[B,V]of dt)V&&dr(B,!0)}},{immediate:!1}),Ge([()=>k.viewportPriority,()=>nt.value.length],([x,B])=>{x!==!1?z.value&&B<=200&&(z.value=!1):z.value=!1}),Ge(()=>yo.value,()=>{pt.value&&ki({immediate:!0})}),Ge([Ps,lt,yc,()=>nt.value.length,pt],()=>{al()},{immediate:!0});let $c=null,Nc=!1,ua=null;function Lc(){$c=null,im=null,sm=void 0,oa=null,Ec()}function Em(){ca(),hd(),Rs(),oe.clear();const x=nt.value.length;x>0&&fd(x),gm()}function Im(){Cm(),By(),Ac=null,pl=null,hl=null,xd=null,Sc=null,Cc=null,Nc=!1,Lc(),Qy("restore"),oo(),ia()}function Oc(x){var B;return[(B=po())!=null?B:"",Pn(),Ni(),wd.value,Mc(x),nt.value.length,Math.round(fr(0,nt.value.length)),Math.round(dl()),ts.count,Math.round(ts.total)].join(":")}function vk(){return Un(this,null,function*(){var x,B,V,K;const J=(x=o.virtualScroll)==null?void 0:x.settledToken,fe=Mc(J),ve=Pn(),we=po(),Pe=ks.value;if(Mt.value&&((B=o.virtualScroll)==null?void 0:B.settleMode)==="manual"&&Sd(J))if(rm()){if(Oc(J)!==oa&&!Nc){Nc=!0;try{const Me=yield ym({reason:"manual",expectedSettledTokenKey:fe}),We=Mc()===fe;vm(ve,we,Pe)&&Me.sessionKey===ve&&Me.threadKey===we&&We&&Me.stable&&Me.phase==="final"&&(oa=Oc((V=o.virtualScroll)==null?void 0:V.settledToken))}finally{Nc=!1,yield gt();const Me=(K=o.virtualScroll)==null?void 0:K.settledToken,We=Sd(Me)?Oc(Me):"";vm(ve,we,Pe)&&We&&oa!==We&&vk()}}}else Tn("manual")})}Ge(Mt,(x,B)=>{if(x!==B){if(!x)return Im(),void Cm();Im(),Em(),ua=ks.value,Tn("content")}},{flush:"post"}),Ge([Mt,ks],([x,B])=>{x?ua!=null?ua!==B&&(ua=B,(function(V="resize"){ca(),hd(),Rs(),oe.clear();const K=nt.value.length;K>0&&fd(K),gm(),pl=null,hl=null,xd=null,Ac=null,Nc=!1,Lc(),ak(),gt(()=>{Li(),Wt.value&&Ln(),tt.value&&ra(),Tn(V)})})("resize")):ua=B:ua=null},{flush:"post",immediate:!0}),Ge([Mt,()=>Pn(),()=>po()],([x])=>{x&&(Im(),Em(),Qy("content"),Tn("content"))}),Ge([Mt,()=>Pn(),()=>po(),ks,()=>nt.value.length],([x])=>{x&&(function(B="async-node"){let V=!1;for(const[K,J]of Array.from(yi.entries()))nm(J)||(yi.delete(K),vs.delete(K),V=!0);V&&(ta(),Tn(B))})("async-node")},{flush:"post"}),Ge([Mt,()=>{var x;return(x=o.virtualScroll)==null?void 0:x.sessionKey},()=>{var x;return(x=o.virtualScroll)==null?void 0:x.measurementKey},()=>o.indexKey,()=>Q.value],([x])=>{x&&(Ec(),(function(B="content"){if(!Mt.value)return;const V=[],K=nt.value.length;for(const J of Array.from(oe.keys())){if(J>=K){V.push(J);continue}const fe=wc(J),ve=oe.get(J);ve!=null&&ve!==fe&&V.push(J),oe.set(J,fe)}for(const J of Array.from(oe.keys()))J>=K&&oe.delete(J);V.length&&((function(J,fe={}){const ve=Array.from(J,Number);x4(ve,fe)>0&&(function(Pe){for(const Me of Pe)oe.delete(Me)})(ve)})(V,{notify:!1}),Rs(),Lc(),Wt.value&&Ln(),tt.value&&ra(),Tn(B))})("content"))},{flush:"post",immediate:!0}),Ge([Mt,()=>nt.value.length,()=>Pn(),()=>po()],([x,B,V,K],[J,fe,ve,we])=>{x&&J&&V===ve&&K===we&&B!==fe&&Lc()},{flush:"post"}),Ge([Mt,()=>{var x;return(x=o.virtualScroll)==null?void 0:x.heightCache},()=>{var x;return(x=o.virtualScroll)==null?void 0:x.heightCacheWidth},()=>{var x;return(x=o.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=o.virtualScroll)==null?void 0:x.measurementKey},()=>nt.value.length,()=>Pn(),X],()=>{ak()},{flush:"post",immediate:!0}),Ge([Mt,()=>{var x;return(x=o.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=o.virtualScroll)==null?void 0:x.restoreAnchor},()=>{var x;return(x=o.virtualScroll)==null?void 0:x.measurementKey},()=>nt.value.length,()=>Pn(),X],x=>Un(null,[x],function*([B,V]){if(!B||!V)return;yield gt();const K=(function(){var J;const fe=(J=o.virtualScroll)==null?void 0:J.restoreAnchor;return fe==null||fe===!1?null:fe===!0?"true":String(fe)})();mm(V,{restoreAnchor:K!=null,restoreToken:K??void 0})}),{flush:"post",immediate:!0}),Ge([Mt,X,()=>{var x;return(x=o.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=o.virtualScroll)==null?void 0:x.measurementKey}],([x])=>{var B;if(!x)return;const V=(B=o.virtualScroll)==null?void 0:B.restoreState;V&&pl&&hl==="restore"&&(rk(V)||(Em(),pl=null,hl=null,Tn("resize")))},{flush:"post"}),Ge([Mt,()=>nt.value.length,()=>Pn(),X],x=>Un(null,[x],function*([B]){var V;const K=Sc,J=Cc;B&&K&&(yield gt(),!mm(K,{restoreAnchor:J?.restoreAnchor===!0,restoreToken:(V=J?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:J?.allowUncapturedAnchor===!0})&&ck(K)||(Sc=null,Cc=null))}),{flush:"post",immediate:!0}),Ge([Mt,j,()=>{var x;return(x=o.virtualScroll)==null?void 0:x.settleMode},()=>Pn(),()=>po(),ks,qh,Ly,()=>yo.value,gd,()=>ts.count,()=>ts.total],([x,B,V])=>{if(!x||B!==!0||V==="manual"||!lm())return;const K=(function(){var J;const fe=nt.value.length;return[(J=po())!=null?J:"",Pn(),Ni(),wd.value,fe,Math.round(fr(0,fe)),Math.round(dl()),ts.count,Math.round(ts.total)].join(":")})();$c!==K&&($c=K,ym({reason:"final"}).then(J=>{J.stable||$c!==K||($c=null)}))},{flush:"post",immediate:!0}),Ge([Mt,j,()=>{var x;return(x=o.virtualScroll)==null?void 0:x.settleMode},()=>{var x;return(x=o.virtualScroll)==null?void 0:x.settledToken},()=>Pn(),()=>po(),ks,qh,Ly,()=>yo.value,gd,()=>nt.value.length,()=>ts.count,()=>ts.total],()=>{vk()},{flush:"post",immediate:!0}),Ge([()=>nt.value.length,pt,lt,yc,()=>Ao.start,()=>Ao.end],([x,B,V,K,J,fe])=>{qe.value&&xe("virtualization",{nodes:x,virtualization:B,maxLiveNodes:V,buffer:K,focusIndex:Ps.value,scroll:B?(()=>{const ve=Ue.value||ee();return ve?{reverse:q(ve),scrollTop:Math.round(ve.scrollTop),scrollTopAbs:Math.round(Math.abs(ve.scrollTop)),scrollHeight:Math.round(ve.scrollHeight),clientHeight:Math.round(ve.clientHeight)}:null})():null,liveRange:{start:J,end:fe},rendered:yo.value})}),Ge([()=>k.customId],([x],B,V)=>{if(!x||Lt)return;const K=(function(J,fe){return J?(ho.controllers[J]=fe,()=>{ho.controllers[J]===fe&&delete ho.controllers[J]}):()=>{}})(x,{captureRestoreAnchor:So,restoreAnchor:Co,getAnchorDrift:lr,getReport:N4});V(()=>{K()})},{immediate:!0}),vo(()=>{(function(){if(Mt.value)try{Li(),xc();const x=fl("manual");dk(x)&&(M(x),Ac=x,bm=Tc());const B=sa(x,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});B&&(E(B),B.anchor&&O(B.anchor),la=Ic(B))}catch{}})(),U4(),Gh(),Ee(),gk();for(const x of cr.values())for(const B of x)yd(B);cr.clear(),cl.clear(),oe.clear(),Mm(),ca(),Xh(),oo(),ia(),Cm(),Hy(),Vh()});const q4=li({loader:()=>Un(null,null,function*(){try{return(yield Go(()=>import("./index11-BsI2TwS2.js"),__vite__mapDeps([8,5]))).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),_s}}),loadingComponent:$V,delay:0}),j4=li({loader:()=>Un(null,null,function*(){try{return(yield Go(()=>import("./index10-Cq9SfqzI.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),_s}}),loadingComponent:IV,delay:0}),V4=li(()=>Un(null,null,function*(){try{return(yield Go(()=>import("./index7-ngQ9Fglu.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),_s}})),yk={text:Zn,paragraph:zl,heading:Np,code_block:Lg,list:Qa,list_item:Xa,blockquote:$f,table:ku,definition_list:Nf,footnote:Lf,footnote_reference:Ts,footnote_anchor:vu,admonition:Df,vmr_container:Pf,hardbreak:qr,link:Jo,image:Ur,thematic_break:Of,math_inline:pi,math_block:qM,strong:Qo,emphasis:es,strikethrough:Zo,highlight:Es,insert:ps,subscript:fs,superscript:ds,emoji:us,checkbox:As,checkbox_input:As,inline_code:zo,html_inline:Ms,reference:Xo,html_block:yu},K4=W(()=>em()),kk=W(()=>sS(k.codeBlockProps)),G4=W(()=>sS(k.codeBlockProps,{omit:["langs"]})),bk=W(()=>rt(rt({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,monacoOptions:k.codeBlockMonacoOptions,themes:k.themes,langs:u.value==="shiki"?k.langs:void 0,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}),G4.value)),_k=W(()=>rt(Ot(rt({},bk.value),{langs:k.langs}),kk.value));function wk(x){return typeof x=="boolean"?x:void 0}const Y4=W(()=>{const x=k.codeBlockProps||{},B={},V=wk(x.showLineNumbers);V!==void 0&&(B.showLineNumbers=V);const K=wk(x.diffInline);K!==void 0&&(B.diffInline=K);const J=(function(fe){const ve=Number(fe);return Number.isFinite(ve)&&ve>0?ve:void 0})(x.reservedHeightPx);return J!==void 0&&(B.reservedHeightPx=J),B}),X4=W(()=>rt(rt({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,themes:k.themes,langs:k.langs,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}),kk.value)),Q4=W(()=>rt({},k.mermaidProps||{})),Sk=W(()=>rt({},k.d2Props||{})),Z4=W(()=>rt({},k.infographicProps||{})),Pc=W(()=>({typewriter:k.typewriter,fade:k.fade,customHtmlTags:Kn.value.customHtmlTags})),J4=W(()=>rt(rt({},Pc.value),typeof Fe.value=="boolean"?{showTooltip:Fe.value}:{})),eE=W(()=>rt(rt({},Pc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{})),tE=W(()=>rt(rt({},Pc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{})),nE=W(()=>rt(rt({},Pc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}));function oE(x){return Array.isArray(x.children)&&x.children.length>0}const $m=W(()=>$4.value.map(x=>{var B,V,K,J,fe,ve,we,Pe;let Me=(function(ct){var ut,xt,Ct,Qt,Tt,Ht,Bt;if(ct.type!=="code_block")return ct;const sn=ct,bs=[String((ut=sn.language)!=null?ut:""),String((xt=sn.loading)!=null?xt:""),String((Ct=sn.diff)!=null?Ct:""),String((Qt=sn.code)!=null?Qt:""),String((Tt=sn.originalCode)!=null?Tt:""),String((Ht=sn.updatedCode)!=null?Ht:""),String((Bt=sn.raw)!=null?Bt:"")].join("\0"),Uo=dd.get(sn);if(Uo&&Uo.signature===bs)return Uo.node;const oi=rt({},sn);return dd.set(sn,{signature:bs,node:oi}),oi})(x.node);const We=Md(Me);let Be=Tk(Me,We);if((Me.type==="html_block"||Me.type==="html_inline")&&Be===yk[Me.type]){const ct=Me,ut=String((B=ct.tag)!=null?B:"").trim().toLowerCase()||OT(ct.content);if(ut){const xt=Dt.value[ut];if(pn.value.has(ut)&&xt)Be=xt,Me=Ot(rt({},ct),{type:ut,tag:ut,content:KB(ct.content,ut)});else if(PT((V=ct.content)!=null?V:ct.raw,ut)){const Ct=String((J=(K=ct.content)!=null?K:ct.raw)!=null?J:"");Me.type==="html_inline"?(Be=Zn,Me={type:"text",content:Ct,raw:Ct}):(Be=zl,Me={type:"paragraph",children:[{type:"text",content:Ct,raw:Ct}],raw:Ct})}}}const $e=Me.type==="code_block"&&u.value==="pre"&&Be===_s&&!Nm(Dt.value,We);let He=rt({},(function(ct,ut,xt){const Ct=ut??Md(ct);if(ct.type==="code_block"){const Qt=Ct?Nm(Dt.value,Ct):void 0;if(xt&&u.value==="pre"&&!Qt&&xt===_s)return Y4.value;if(xt&&Ct&&xt===Qt)return Ct==="mermaid"?xk(ct):Ct==="infographic"?Ak(ct):Ct==="d2"||Ct==="d2lang"?Sk.value:_k.value;if(xt&&xt===Dt.value.code_block)return _k.value;if(qy(xt))return X4.value}return Ct==="mermaid"?xk(ct):Ct==="infographic"?Ak(ct):Ct==="d2"||Ct==="d2lang"?Sk.value:ct.type==="link"?J4.value:ct.type==="list"?eE.value:ct.type==="blockquote"?tE.value:ct.type==="table"?nE.value:ct.type==="code_block"?bk.value:Pc.value})(Me,We,Be));const Qe=ul.value[x.index];Me.type==="code_block"&&Qe?.kind==="code-block"&&(He=Ot(rt({},He),$e?{reservedHeightPx:(fe=Qe.height)!=null?fe:Qe.contentHeight}:{estimatedHeightPx:Qe.height,estimatedContentHeightPx:Qe.contentHeight})),$e||Me.type!=="code_block"||We!=="mermaid"||Pa(He.estimatedPreviewHeightPx)!=null||(He=Ot(rt({},He),{estimatedPreviewHeightPx:l1(i1(String((ve=Me.code)!=null?ve:"")))})),$e||Me.type!=="code_block"||We!=="infographic"||Pa(He.estimatedPreviewHeightPx)!=null||(He=Ot(rt({},He),{estimatedPreviewHeightPx:a1(r1(String((we=Me.code)!=null?we:"")))})),Me.type==="math_block"&&(He=Ot(rt({},He),{cacheScope:In.value}));const Ze=(function(ct,ut){const xt=String(ct.type);return!ad(xt)&&Dt.value[xt]===ut})(Me,Be),St=Ze?J0(Me,Le.value):void 0;return Ot(rt({},x),{node:Me,component:Be,bindings:He,customBindings:rt(rt({},St??{}),He),rendersCustomNode:Ze,hasSlotChildren:oE(Me),slotContent:String((Pe=Me.content)!=null?Pe:""),isCodeBlock:Me.type==="code_block",indexKey:`${K4.value}-${x.index}`})}));function Md(x){var B;return x?.type==="code_block"?String((B=x.language)!=null?B:"").trim().toLowerCase():""}function Nm(x,B){const V=B.trim().toLowerCase();if(V)for(const K of[V,V0(V),EM(V)]){const J=K&&x[K];if(J)return J}}function Ck(x,B,V,K){var J,fe;const ve=rt({},x.value);return Pa(ve.estimatedPreviewHeightPx)==null&&(ve.estimatedPreviewHeightPx=K(V(String((J=B?.code)!=null?J:"")),void 0,ve.maxHeight==="none"?null:(fe=Pa(ve.maxHeight))!=null?fe:void 0)),ve}function xk(x){return Ck(Q4,x,i1,l1)}function Ak(x){return Ck(Z4,x,r1,a1)}function Tk(x,B){if(!x)return y1;const V=Dt.value,K=V[String(x.type)];if(x.type==="code_block"){const J=B??Md(x),fe=J?Nm(V,J):void 0;return fe||(u.value==="pre"?V.code_block||_s:J==="mermaid"?V.mermaid||q4:J==="infographic"?V.infographic||j4:J==="d2"||J==="d2lang"?V.d2||V4:K||V.code_block||jy.value)}return K||yk[String(x.type)]||y1}function Lm(x){s("click",x)}function sE(x){var B;(B=x.target)!=null&&B.closest("[data-node-index]")&&s("mouseover",x)}function iE(x){var B;(B=x.target)!=null&&B.closest("[data-node-index]")&&s("mouseout",x)}function Mk(x){s("mouseover",x)}function Ek(x){s("mouseout",x)}const vl=Z(null),bi=Z(!1);let Rc,da=null,Om=0,Ed=0,Id=0;const Ik=["code_block","admonition","table","math_block","html_block","image","thematic_break"],rE=new Set(Ik),$k=[".typewriter-cursor",".height-estimation-probes",...Ik.map(x=>`[data-node-type="${x}"]`),"script","style"].join(",");function Nk(x){if(!x||typeof x!="object")return!1;const B=x.type;return typeof B=="string"&&rE.has(B)}function $d(x){var B,V;if(!x||typeof x!="object")return 0;const K=x,J=(V=(B=K.raw)!=null?B:K.content)!=null?V:K.code;if(typeof J=="string")return J.length;const fe=K.children;if(Array.isArray(fe))return fe.reduce((we,Pe)=>we+$d(Pe),0);const ve=K.items;return Array.isArray(ve)?ve.reduce((we,Pe)=>we+$d(Pe),0):0}function Nd(){Rc&&(clearTimeout(Rc),Rc=void 0)}function Lk(){Om+=1,da!=null&&(Re?.(da),da=null)}function Ld(){Lk(),vl.value&&(vl.value.style.visibility="hidden")}function lE(x){var B;if(x.nodeType!==Node.TEXT_NODE||!((B=x.textContent)!=null?B:"").trim())return!1;const V=x.parentElement;return!!V&&!V.closest($k)}function aE(x){let B=x.lastChild;for(;B;){if(lE(B))return B;if(B.nodeType===Node.ELEMENT_NODE){const V=B;if(!V.matches($k)&&V.lastChild){B=V.lastChild;continue}}for(;B&&B!==x&&!B.previousSibling;)B=B.parentNode;if(!B||B===x)break;B=B.previousSibling}return null}function Pm(){if(!be||!bi.value||da!=null)return;const x=Om,B=()=>{da=null,x===Om&&(function(){var V,K;if(!(be&&bi.value&&S.value&&vl.value))return;const J=S.value,fe=vl.value;fe.style.visibility="hidden";const ve=(function(){const Be=$m.value;for(let $e=Be.length-1;$e>=0;$e--){const He=Be[$e];if(!He||Nk(He.node)||!Am(He.index))continue;const Qe=dt.get(He.index);if(!Qe)continue;const Ze=aE(Qe);if(Ze)return Ze}return null})();if(!ve)return;let we=0,Pe=0,Me=20,We=!1;if(ve?.textContent){const Be=ve.textContent.length,$e=document.createRange();$e.setStart(ve,Math.max(0,Be-1)),$e.setEnd(ve,Be);const He=typeof $e.getClientRects=="function"?$e.getClientRects():void 0,Qe=(K=He?.[He.length-1])!=null?K:(V=ve.parentElement)==null?void 0:V.getBoundingClientRect();if(Qe){const Ze=bt("typewriterCursor.root.getBoundingClientRect",()=>J.getBoundingClientRect());we=Qe.right-Ze.left+J.scrollLeft,Pe=Qe.top-Ze.top+J.scrollTop,Me=Qe.height||Me,We=!0}$e.detach()}We&&(fe.style.transform=`translate(${Math.max(0,we)}px, ${Math.max(0,Pe)}px)`,fe.style.height=`${Me}px`,fe.style.visibility="visible")})()};_e?da=_e(B):B()}return Ge([ce,()=>o.content,()=>o.nodes,()=>k.typewriter,j],()=>Un(null,null,function*(){var x,B;if(!be||ze.value||!F.value)return;if(j.value)return bi.value=!1,Nd(),void Ld();if((x=o.nodes)!=null&&x.length)return bi.value=!1,Nd(),Ld(),Ed=((B=o.content)!=null?B:"").length,void(Id=ce.value.length);const V=(function(){var we,Pe;return(we=o.nodes)!=null&&we.length?o.nodes.reduce((Me,We)=>Me+$d(We),0):((Pe=o.content)!=null?Pe:"").length})(),K=(function(){var we;return(we=o.nodes)!=null&&we.length?o.nodes.reduce((Pe,Me)=>Pe+$d(Me),0):ce.value.length})(),J=!Nk(nt.value[nt.value.length-1]),fe=V>Ed,ve=K>Id;if(k.typewriter===!1||!J||!fe&&!ve)return k.typewriter!==!1&&J||(bi.value=!1,Ld()),Ed=V,void(Id=K);Ed=V,Id=K,bi.value=!0,vl.value&&(vl.value.style.visibility="hidden"),Nd(),yield gt(),Pm(),Rc=setTimeout(()=>{Rc=void 0,bi.value=!1},3e3)}),{flush:"post",immediate:!0}),Ge(bi,x=>Un(null,null,function*(){x?(yield gt(),Pm()):Ld()}),{flush:"post"}),Ge([()=>yo.value,()=>Ao.start,()=>Ao.end],()=>Un(null,null,function*(){be&&!ze.value&&F.value&&bi.value&&(yield gt(),Pm())}),{flush:"post"}),vo(()=>{Nd(),Lk(),Dn.clear()}),(x,B)=>{const V=PI("NodeRenderer",!0);return A(ze)?(w(!0),N(Oe,{key:0},st($m.value,K=>(w(),N(Oe,{key:K.index},[K.rendersCustomNode?(w(),ge(Fo(K.component),un({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onClick:Lm,onMouseover:Mk,onMouseout:Ek,onCopy:B[0]||(B[0]=J=>s("copy",J)),onHandleArtifactClick:B[1]||(B[1]=J=>s("handleArtifactClick",J))}),{default:ke(()=>[K.hasSlotChildren?(w(),ge(V,un({key:0,ref_for:!0},wn.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ge(V,un({key:1,ref_for:!0},wn.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ge(Fo(K.component),un({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onClick:Lm,onMouseover:Mk,onMouseout:Ek,onCopy:B[2]||(B[2]=J=>s("copy",J)),onHandleArtifactClick:B[3]||(B[3]=J=>s("handleArtifactClick",J))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(w(),N("div",{key:1,ref_key:"containerRef",ref:S,class:De(["markstream-vue markdown-renderer",[{dark:k.isDark},{virtualized:pt.value},{"virtual-scroll-coordinated":Yn.value}]]),"data-custom-id":k.customId,onClick:Lm,onMouseover:sE,onMouseout:iE},[wo.value||pt.value?(w(),N(Oe,{key:0},[wo.value?(w(),N("div",{key:0,class:"height-estimation-probes",style:Yt({width:`${it.value}px`}),"aria-hidden":"true"},[T("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[se(A(zl),{node:Gn.value,"index-key":"probe-paragraph"},null,8,["node"])],512),T("div",{ref_key:"listItemProbeWrapperRef",ref:P,class:"node-content","data-probe":"list-item"},[T("ul",LV,[se(A(Xa),{node:Ye.value,"index-key":"probe-list-item"},null,8,["node"])])],512),T("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[se(A(Qa),{node:Xe.value,"index-key":"probe-list"},null,8,["node"])],512),(w(),N(Oe,null,st(6,K=>T("div",{key:`probe-heading-${K}`,ref_for:!0,ref:J=>(function(fe,ve){fe<1||fe>6||(H[fe]=ve)})(K,J),class:"node-content","data-probe":`heading-${K}`},[se(A(Np),{node:M4(K),"index-key":`probe-heading-${K}`},null,8,["node","index-key"])],8,OV)),64))],4)):ie("",!0),pt.value?(w(),N("div",{key:1,class:"node-spacer",style:Yt({height:`${Zh.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],64)):ie("",!0),(w(!0),N(Oe,null,st($m.value,K=>(w(),N("div",{key:K.index,ref_for:!0,ref:J=>mk(K.index,J),class:"node-slot","data-node-index":K.index,"data-node-type":K.node.type},[Am(K.index)?(w(),N("div",{key:0,ref_for:!0,ref:J=>(function(fe,ve){var we;ve||(function(Be){const $e=`${em()}-${Be}`;let He=!1;for(const Qe of Array.from(vs.keys())){const Ze=yi.get(Qe);(Ze?.index===Be||Qe===$e||Qe.startsWith(`${$e}-`))&&(vs.delete(Qe),yi.delete(Qe),He=!0)}He&&(ta(),Tn("async-node"))})(fe),$i.delete(fe),(function(Be){var $e;const He=(($e=cl.get(Be))!=null?$e:0)+1;cl.set(Be,He)})(fe);const Pe=cr.get(fe);if(Pe){for(const Be of Pe)yd(Be);cr.delete(fe)}if((function(Be){const $e=pe.get(Be);$e&&(Sn?.unobserve($e),Ne.delete($e),pe.delete(Be))})(fe),!ve||!ti.value)return vi.delete(fe),void cl.delete(fe);vi.set(fe,ve);const Me=()=>{Td(fe,ve)};queueMicrotask(Me);const We=(Sn||typeof ResizeObserver>"u"||(Sn=new ResizeObserver(Be=>{if(Be.length)for(const $e of Be){const He=Ne.get($e.target),Qe=pe.get(He??-1);He!=null&&Qe&&Td(He,Qe)}else Li()})),Sn);if(We&&(pe.set(fe,ve),Ne.set(ve,fe),We.observe(ve)),typeof window<"u"){const Be=((we=nt.value[fe])==null?void 0:we.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(Be.length){const $e=Be.map(He=>Dy(He,Me,"node-resize")).filter(He=>He!=null);$e.length&&cr.set(fe,$e)}}})(K.index,J),class:"node-content"},[K.isCodeBlock?K.rendersCustomNode?(w(),ge(Fo(K.component),un({key:1,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[8]||(B[8]=J=>s("copy",J)),onHandleArtifactClick:B[9]||(B[9]=J=>s("handleArtifactClick",J))}),{default:ke(()=>[K.hasSlotChildren?(w(),ge(V,un({key:0,ref_for:!0},wn.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ge(V,un({key:1,ref_for:!0},wn.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ge(Fo(K.component),un({key:2,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[10]||(B[10]=J=>s("copy",J)),onHandleArtifactClick:B[11]||(B[11]=J=>s("handleArtifactClick",J))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(w(),ge(Kr,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:ke(()=>[K.rendersCustomNode?(w(),ge(Fo(K.component),un({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[4]||(B[4]=J=>s("copy",J)),onHandleArtifactClick:B[5]||(B[5]=J=>s("handleArtifactClick",J))}),{default:ke(()=>[K.hasSlotChildren?(w(),ge(V,un({key:0,ref_for:!0},wn.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ge(V,un({key:1,ref_for:!0},wn.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ge(Fo(K.component),un({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[6]||(B[6]=J=>s("copy",J)),onHandleArtifactClick:B[7]||(B[7]=J=>s("handleArtifactClick",J))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(w(),N("div",{key:1,class:"node-placeholder",style:Yt({height:`${_d(K.index)}px`})},null,4))],8,PV))),128)),bi.value?(w(),N("span",{key:1,ref_key:"typewriterCursorRef",ref:vl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ie("",!0),pt.value?(w(),N("div",{key:2,class:"node-spacer",style:Yt({height:`${Jh.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],42,NV))}}})),[["__scopeId","data-v-2e8e6e17"]]),hs=o3;hs.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",hs.__name,hs.name].filter(n=>!!n));for(const n of t)e.component(n,o3)};const ry=Object.freeze(Object.defineProperty({__proto__:null,default:hs},Symbol.toStringTag,{value:"Module"})),RV={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"},DV={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"},BV={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"},FV={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"},HV={class:"admonition-title"},WV=["aria-expanded","aria-controls"],zV=["id"],Df=an(Ve({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,s=t,i=W(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=Z(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(w(),N("div",{class:De(["admonition",[`admonition-${o.node.kind}`]])},[T("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(w(),N("svg",RV,[...u[1]||(u[1]=[T("circle",{cx:"12",cy:"12",r:"10"},null,-1),T("path",{d:"M12 16v-4"},null,-1),T("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(w(),N("svg",DV,[...u[2]||(u[2]=[T("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),T("path",{d:"M9 18h6"},null,-1),T("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(w(),N("svg",BV,[...u[3]||(u[3]=[T("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),T("path",{d:"M12 9v4"},null,-1),T("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(w(),N("svg",FV,[...u[4]||(u[4]=[T("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),T("path",{d:"M12 8v4"},null,-1),T("path",{d:"M12 16h.01"},null,-1)])])):ie("",!0),T("span",HV,R(i.value),1),o.node.collapsible?(w(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(w(),N("svg",{style:Yt({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]=[T("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,WV)):ie("",!0)]),En(T("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[se(A(hs),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:u[0]||(u[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,zV),[[Vs,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Df.install=e=>{e.component(Df.__name,Df)};const s3=()=>Go(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let df=null,UV=s3;function lhe(){return Un(this,null,function*(){if(df)return df;const e=UV;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===s3?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(df=(function(n){var o;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 s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),df):null})}function ahe(){return!1}function che(){return Un(this,null,function*(){return null})}const ff=Z(!1);let mS=!1;function Ug(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function qV(){return!mS&&typeof window<"u"&&typeof document<"u"&&(mS=!0,ff.value=Ug(),new MutationObserver(()=>{ff.value=Ug()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{ff.value=Ug()})),ff}const i3=["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"],jV=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),S1=[...i3].sort((e,t)=>t.length-e.length).join("|"),qg=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${S1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${S1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),r3=/[),.;!?,。;!?)]+$/;function VV(e){const t=e.toLowerCase();return i3.some(n=>t.endsWith(`.${n}`))}function KV(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${S1}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=s.split("/").pop();i&&t.set(i,s)}return t}function GV(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(r3,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=jV.has(i),a=VV(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const c=o[2]??o[3],u=c?Number(c):void 0;return{path:s,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function YV(e,t={}){const n=[];qg.lastIndex=0;let o;for(;(o=qg.exec(e))!==null;){const s=o[0]??"",i=o[1]??"",r=s.indexOf(i);if(r<0)continue;const l=o[2]??o[3];let a=i+(l?s.slice(r+i.length):"");const c=a.replace(r3,""),u=a.length-c.length;a=c;const d=GV(a,t);if(!d)continue;const f=o.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(qg.lastIndex-=u)}return n}const XV=12e4,QV=6e4,ZV=32,JV=3e4,gS=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function eK(e){let t=0,n=0,o=0;gS.lastIndex=0;let s;for(;(s=gS.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=XV||n>=QV||t>=ZV||o>=JV?"pre":"shiki",codeFenceCount:t,codeChars:n}}function tK(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function nK(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const oK={key:1,class:"diff-wrap"},sK={class:"diff-bar"},iK=["onClick"],rK={class:"diff-pre"},lK="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",vS="github-light",yS="github-dark",aK=Ve({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){FU(),ZU(),WU(),oq(),HU(new tK),nq(new nK);function t(P){return P.inline.ruler.disable("math"),P}const{t:n}=Nt(),o=jt("resolveImage"),s=Z(null),i=e,r=W(()=>!i.streaming),l=W(()=>KV(i.text??"")),a=W(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:eK(i.text??"")),c=qV(),u=W(()=>!i.streaming),d=No(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(P){return!/^(https?:|data:|blob:)/i.test(P)}function b(P){if(!o)return;const D=[];for(const H of[h,p]){H.lastIndex=0;let z;for(;(z=H.exec(P))!==null;)D.push(z[2]??"")}for(const H of D)!H||!m(H)||d.has(H)||f.has(H)||(f.add(H),o(H).then(z=>{d.set(H,z!==H?z:"")}).catch(()=>{d.set(H,"")}).finally(()=>{f.delete(H)}))}function _(P){if(!o)return P;const D=H=>{if(!m(H))return null;const z=d.get(H);return z===void 0?lK:z===""?null:z};return P.replace(h,(H,z,U,Q)=>{const X=D(U);return X===null?H:`${z}${X}${Q}`}).replace(p,(H,z,U,Q)=>{const X=D(U);return X===null?H:`${z}${X}${Q}`})}Ge(()=>i.text,P=>b(P??""),{immediate:!0});function g(){if(!s.value||!i.openFile||i.streaming)return;const P=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),D=[];let H=P.nextNode();for(;H;){const z=H,U=z.parentElement;U&&!U.closest("a, pre, .md-file-link, svg")&&z.data.trim().length>0&&D.push(z),H=P.nextNode()}for(const z of D){const U=YV(z.data,{aliases:l.value});if(U.length===0||!z.parentNode)continue;const Q=document.createDocumentFragment();let X=0;for(const ue of U){ue.start>X&&Q.append(document.createTextNode(z.data.slice(X,ue.start)));const me=document.createElement("button");me.type="button",me.className="md-file-link",me.textContent=ue.text,me.title=ue.line?`${ue.path}:${ue.line}`:ue.path,me.addEventListener("click",Ae=>{Ae.preventDefault(),Ae.stopPropagation(),i.openFile?.({path:ue.path,line:ue.line})}),Q.append(me),X=ue.end}X<z.data.length&&Q.append(document.createTextNode(z.data.slice(X))),z.parentNode.replaceChild(Q,z)}}function v(P){return!(!P||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(P))}function y(P){let D=P.length;for(const H of["#","?"]){const z=P.indexOf(H);z!==-1&&z<D&&(D=z)}return P.slice(0,D)}function C(){if(!s.value||!i.openFile||i.streaming)return;const P=s.value.querySelectorAll("a[href]");for(const D of P){if(D.dataset.mdLinkHandled==="true"||D.closest("svg"))continue;const H=D.getAttribute("href")??"";v(H)&&(D.dataset.mdLinkHandled="true",D.addEventListener("click",z=>{z.preventDefault(),z.stopPropagation(),i.openFile?.({path:y(H)})}))}}function L(){gt().then(()=>{g(),C()})}Ge(()=>i.text,L),Ge(()=>i.streaming,L);let $=null;bn(()=>{L(),s.value&&($=new MutationObserver(L),$.observe(s.value,{childList:!0,subtree:!0}))}),_n(()=>{$?.disconnect()});const k={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},M=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,E=W(()=>{const P=_(i.text??""),D=[];let H=0;M.lastIndex=0;let z;for(;(z=M.exec(P))!==null;){const Q=z[1]??"",X=P.slice(H,z.index)+(Q||"");X.trim()&&D.push({kind:"md",text:X}),D.push({kind:"diff",code:z[2]??""}),H=M.lastIndex}const U=P.slice(H);return(U.trim()||D.length===0)&&D.push({kind:"md",text:U}),D});function O(P){return P.split(`
|
|
246
|
+
`).map(D=>/^\+(?!\+\+)/.test(D)?{cls:"diff-add",text:D}:/^-(?!--)/.test(D)?{cls:"diff-del",text:D}:D.startsWith("@@")?{cls:"diff-hunk",text:D}:{cls:"diff-ctx",text:D})}const S=Z(null);function I(P,D){Wo(P).then(H=>{H&&(S.value=D,setTimeout(()=>{S.value=null},1400))})}return(P,D)=>(w(),N("div",{ref_key:"mdRef",ref:s,class:"md"},[(w(!0),N(Oe,null,st(E.value,(H,z)=>(w(),N(Oe,{key:z},[H.kind==="md"?(w(),ge(A(hs),{key:0,content:H.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":A(c),"code-block-light-theme":vS,"code-block-dark-theme":yS,themes:[vS,yS],"code-block-props":k,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(w(),N("div",oK,[T("div",sK,[D[0]||(D[0]=T("span",{class:"diff-lang"},"diff",-1)),se(zt,{text:A(n)("filePreview.copyCode")},{default:ke(()=>[T("button",{class:"diff-copy",onClick:U=>I(H.code,z)},R(S.value===z?"✓":"⧉"),9,iK)]),_:2},1032,["text"])]),T("pre",rK,[T("code",null,[(w(!0),N(Oe,null,st(O(H.code),(U,Q)=>(w(),N("span",{key:Q,class:De(U.cls)},R(U.text),3))),128))])])]))],64))),128))],512))}}),Ih=ft(aK,[["__scopeId","data-v-8b684052"]]),cK={class:"tc-anim"},uK={class:"prev-anim"},dK={class:"prev"},fK=Ve({__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,o=t,s=W(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=W(()=>n.foldable&&s.value.length>1),r=W(()=>n.streaming||!i.value),l=W(()=>s.value.pop()??""),a=Z(null);return bn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ge(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||gt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(w(),N("div",{class:De(["think",{mob:e.mobile}])},[i.value?(w(),N("div",{key:0,class:De(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[T("div",cK,[T("pre",{ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513)]),T("div",uK,[T("span",dK,R(l.value),1)])],2)):(w(),N("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513))],2))}}),pK=ft(fK,[["__scopeId","data-v-5f6e61ba"]]),hK={class:"activity-notice",role:"status"},mK={"aria-hidden":"true"},gK={class:"an-label"},vK=Ve({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(w(),N("div",hK,[T("span",mK,[se(Zs,{size:"sm"})]),T("span",gK,R(e.label),1)]))}}),yK=ft(vK,[["__scopeId","data-v-0d497074"]]),kK=["aria-label"],bK=120,_K=60,wK=Ve({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*bK}ms`,"--moon-frame-fast-delay":`${o*_K}ms`}}return(o,s)=>(w(),N("span",{class:De(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(w(),N(Oe,null,st(t,(i,r)=>T("span",{key:i,class:"ui-moon__frame",style:Yt(n(r)),"aria-hidden":"true"},R(i),5)),64))],10,kK))}}),l3=ft(wK,[["__scopeId","data-v-a6b7ec07"]]);function SK(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),i=`${s(n.getHours())}:${s(n.getMinutes())}`,r=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(r&&l&&a)return i;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`}catch{return e}}const CK={class:"chat"},xK={key:0,class:"chat-loading"},AK={class:"chat-loading-text"},TK={key:1,class:"chat-empty"},MK={key:1,class:"top-sentinel-text"},EK=["data-turn-id"],IK={key:0,class:"u-imgs"},$K=["src"],NK=["src","alt"],LK={key:1,class:"skill-act"},OK={class:"skill-act-head"},PK={key:0,class:"skill-act-args"},RK={key:2,class:"skill-act"},DK={class:"skill-act-head"},BK={key:0,class:"skill-act-args"},FK={key:3,class:"u-text"},HK={key:0,class:"u-meta"},WK=["aria-label","onClick"],zK=["aria-label","onClick"],UK=["onClick"],qK=["data-turn-id"],jK=["onClick"],VK={class:"cd-view"},KK={key:1,class:"cd-label"},GK=["data-turn-id"],YK={key:1,class:"msg"},XK={key:0,class:"a-msg-ft"},QK={key:0,class:"a-duration"},ZK=["aria-label","onClick"],JK={key:4,class:"sending-placeholder"},eG={key:5,class:"q-stack"},tG={class:"q-head"},nG={class:"q-title"},oG={class:"q-hint"},sG=["onDragover","onDrop"],iG={class:"u-bub q-bub"},rG=["title","onDragstart"],lG=["title","disabled","onClick"],aG={key:0,class:"u-text q-text"},cG={key:1,class:"q-text q-text-placeholder"},uG={key:0,class:"q-imgs"},dG=["src"],fG=["src"],pG={key:1,class:"q-tag q-tag-next"},hG={key:2,class:"q-tag q-tag-idx"},mG=["aria-label","onClick"],gG=2500,vG=Ve({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},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},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:o}=Nt(),{confirm:s}=ol();_n(()=>{be!==null&&(clearTimeout(be),be=null),z!==null&&(clearTimeout(z),z=null),M!==null&&(clearTimeout(M),M=null)});const i=e,r=Z(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Le=>{Le[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}bn(a),_n(()=>{l?.disconnect(),l=null}),Ge(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{gt().then(a)});const c=W(()=>{if(!i.running||i.turns.length===0)return null;const Le=i.turns.at(-1);return Le.role==="assistant"?Le.id:null}),u=W(()=>i.sending||i.running),d=n,f=Z(null),h=Z(null);function p(Le){return(Le.attachments?.length??0)>0}function m(Le,le){p(le)||d("editQueued",Le)}function b(Le,le){if(f.value=Le,!le.dataTransfer)return;le.dataTransfer.effectAllowed="move",le.dataTransfer.setData("text/plain",String(Le));const F=le.currentTarget?.closest(".q-turn");F&&le.dataTransfer.setDragImage(F,24,24)}function _(Le,le){if(f.value===null)return;le.preventDefault(),le.dataTransfer&&(le.dataTransfer.dropEffect="move");const F=le.currentTarget.getBoundingClientRect(),te=le.clientY<F.top+F.height/2?"before":"after";h.value={index:Le,position:te}}function g(Le,le){le.preventDefault();const F=f.value,te=h.value?.position??"before";if(f.value=null,h.value=null,F===null)return;let ee=te==="before"?Le:Le+1;F<ee&&(ee-=1),F!==ee&&d("reorderQueue",{from:F,to:ee})}function v(){f.value=null,h.value=null}const y=W(()=>{for(let Le=i.turns.length-1;Le>=0;Le--)if(i.turns[Le].role==="user")return i.turns[Le].id;return null});function C(Le){return Le.role==="user"&&Le.id===y.value&&!i.running&&!i.sending&&!Le.skillActivation&&!Le.pluginCommand}function L(Le){const le=Le.compaction,F=le?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof le?.tokensBefore=="number"&&typeof le?.tokensAfter=="number"?F+o("conversation.compactedTokens",{before:C_(le.tokensBefore),after:C_(le.tokensAfter)}):F}const $=Z(null),k=Z(null);let M=null;const E=Z(new Set);function O(Le){return E.value.has(Le)}function S(Le){const le=new Set(E.value);le.has(Le)?le.delete(Le):le.add(Le),E.value=le}function I(Le,le){if(O(le)){const F=new Date(Le);if(Number.isNaN(F.getTime()))return Le;const te=ee=>String(ee).padStart(2,"0");return`${F.getFullYear()}-${te(F.getMonth()+1)}-${te(F.getDate())} ${te(F.getHours())}:${te(F.getMinutes())}`}return SK(Le,o("conversation.yesterday"))}async function P(Le){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&D(Le)}function D(Le){k.value===null&&(k.value=Le.id,d("editMessage",Le.text),M=setTimeout(()=>{M=null,k.value=null},gG))}Ge(()=>i.turns,Le=>{k.value!==null&&(Le.some(le=>le.id===k.value)||(k.value=null,M!==null&&(clearTimeout(M),M=null)))},{flush:"post"});const H=Z(!1);let z=null;function U(){if(i.turns.length===0)return;const Le=[];for(const F of i.turns){if(F.role==="compaction")continue;const te=F.role==="user"?"User":"Assistant",ee=MP(F);ee.trim()&&Le.push(`**${te}**
|
|
247
|
+
|
|
248
|
+
${ee}`)}const le=Le.join(`
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
`);Wo(le).then(F=>{F&&(H.value=!0,d("copyConversationCopied"),z!==null&&clearTimeout(z),z=setTimeout(()=>{z=null,H.value=!1},2e3))}).catch(()=>{})}function Q(Le){const le=[];for(let F=Le;F>=0;F--){const te=i.turns[F];if(!te||te.role!=="assistant")break;le.unshift(te)}return le}function X(Le){return Q(Le).map(le=>TP(le)).filter(Boolean).join(`
|
|
253
|
+
|
|
254
|
+
`)}function ue(){for(let Le=i.turns.length-1;Le>=0;Le-=1)if(i.turns[Le]?.role==="assistant")return X(Le);return""}function me(){const Le=ue();Le.trim()&&Wo(Le).then(le=>{le&&(H.value=!0,d("copyConversationCopied"),z!==null&&clearTimeout(z),z=setTimeout(()=>{z=null,H.value=!1},2e3))}).catch(()=>{})}t({copyConversation:U,copyFinalSummary:me});function Ae(Le){const le=i.turns[Le];if(!le||le.role!=="assistant")return!1;const F=i.turns[Le+1];return!F||F.role!=="assistant"}let be=null;function ze(Le){const le=i.turns[Le];if(!le)return;const F=X(Le);F.trim()&&Wo(F).then(te=>{te&&($.value=le.id,be!==null&&clearTimeout(be),be=setTimeout(()=>{be=null,$.value=null},1400))}).catch(()=>{})}function qe(Le){const le=Le.text;le.trim()&&Wo(le).then(F=>{F&&($.value=Le.id,be!==null&&clearTimeout(be),be=setTimeout(()=>{be=null,$.value=null},1400))}).catch(()=>{})}function Fe(Le,le){return Le.id!==c.value?!1:le.sourceIndex===uh(Le).length-1}return(Le,le)=>(w(),N("div",CK,[e.sessionLoading?(w(),N("div",xK,[se(Zs,{size:"sm"}),T("span",AK,R(A(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(w(),N("div",TK)):ie("",!0),e.hasMoreMessages||e.loadingMore?(w(),N("div",{key:2,ref_key:"topSentinelRef",ref:r,class:De(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(w(),N("span",MK,[se(Zs,{size:"sm"}),je(" "+R(A(o)("conversation.loadingOlder")),1)])):(w(),N("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:le[0]||(le[0]=F=>d("loadOlderMessages"))},R(A(o)("conversation.loadOlder")),1))],2)):ie("",!0),(w(!0),N(Oe,null,st(e.turns,(F,te)=>(w(),N(Oe,{key:F.id},[F.role==="user"?(w(),N("div",{key:0,class:De(["u-turn",{"is-latest-user":F.id===y.value}])},[T("div",{class:De(["u-bub turn-anchor",{undoing:k.value===F.id}]),"data-turn-id":F.id},[F.images&&F.images.length>0?(w(),N("div",IK,[(w(!0),N(Oe,null,st(F.images,(ee,q)=>(w(),N(Oe,{key:q},[ee.kind==="video"?(w(),N("video",{key:0,class:"u-img",src:ee.url,controls:"",playsinline:"",preload:"metadata"},null,8,$K)):(w(),N("img",{key:1,class:"u-img",src:ee.url,alt:ee.alt||"",loading:"lazy"},null,8,NK))],64))),128))])):ie("",!0),F.skillActivation?(w(),N("div",LK,[T("div",OK,[le[9]||(le[9]=T("span",{class:"skill-act-arrow"},"▶",-1)),T("span",null,R(A(o)("conversation.activatedSkill",{name:F.skillActivation.name})),1)]),F.skillActivation.args?(w(),N("div",PK,R(F.skillActivation.args),1)):ie("",!0)])):F.pluginCommand?(w(),N("div",RK,[T("div",DK,[le[10]||(le[10]=T("span",{class:"skill-act-arrow"},"▶",-1)),T("span",null,"/"+R(F.pluginCommand.pluginId)+":"+R(F.pluginCommand.commandName),1)]),F.pluginCommand.args?(w(),N("div",BK,R(F.pluginCommand.args),1)):ie("",!0)])):(w(),N("div",FK,R(F.text),1))],10,EK),F.createdAt||C(F)?(w(),N("div",HK,[C(F)?(w(),N("div",{key:0,class:De(["u-edit-wrap",{undoing:k.value===F.id}])},[T("button",{type:"button",class:"u-edit","aria-label":A(o)("conversation.undoTooltip"),onClick:ee=>P(F)},[se(Je,{name:"undo",size:"sm"})],8,WK)],2)):ie("",!0),F.text.trim().length>0?(w(),N("button",{key:1,type:"button",class:"u-copy","aria-label":A(o)("filePreview.copy"),onClick:yt(ee=>qe(F),["stop"])},[$.value!==F.id?(w(),ge(Je,{key:0,name:"copy",size:"sm"})):(w(),ge(Je,{key:1,name:"check",size:"sm"}))],8,zK)):ie("",!0),F.createdAt?(w(),N("button",{key:2,type:"button",class:"u-time",onClick:yt(ee=>S(F.id),["stop"])},R(I(F.createdAt,F.id)),9,UK)):ie("",!0)])):ie("",!0)],2)):F.role==="compaction"?(w(),N("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":F.id,role:"separator"},[le[11]||(le[11]=T("span",{class:"cd-line","aria-hidden":"true"},null,-1)),F.text?(w(),N("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:ee=>d("openCompaction",{turnId:F.id})},[T("span",null,R(L(F)),1),T("span",VK,R(A(o)("conversation.viewSummary")),1)],8,jK)):(w(),N("span",KK,R(L(F)),1)),le[12]||(le[12]=T("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,qK)):(w(),N("div",{key:2,class:"a-msg turn-anchor","data-turn-id":F.id},[(w(!0),N(Oe,null,st(A(AP)(F),(ee,q)=>(w(),N(Oe,{key:A(EP)(ee,q)},[ee.kind==="thinking"?(w(),ge(pK,{key:0,text:ee.thinking,mobile:"",streaming:Fe(F,ee),onOpen:Y=>d("openThinking",{turnId:F.id,blockIndex:ee.sourceIndex})},null,8,["text","streaming","onOpen"])):ee.kind==="text"&&ee.text?(w(),N("div",YK,[se(Ih,{text:ee.text,streaming:Fe(F,ee),"open-file":Y=>d("openFile",Y)},null,8,["text","streaming","open-file"])])):ee.kind==="tool-stack"?(w(),ge(PP,{key:2,tools:ee.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:le[1]||(le[1]=Y=>d("openMedia",Y)),onOpenFile:le[2]||(le[2]=Y=>d("openFile",Y)),onOpenToolDiff:le[3]||(le[3]=Y=>d("openToolDiff",Y)),onOpenAgent:le[4]||(le[4]=Y=>d("openAgent",Y))},null,8,["tools","tool-diff-panel"])):ee.kind==="tool"?(w(),ge(xA,{key:3,tool:ee.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:le[5]||(le[5]=Y=>d("openMedia",Y)),onOpenFile:le[6]||(le[6]=Y=>d("openFile",Y)),onOpenToolDiff:le[7]||(le[7]=Y=>d("openToolDiff",Y)),onOpenAgent:le[8]||(le[8]=Y=>d("openAgent",Y))},null,8,["tool","tool-diff-panel"])):ie("",!0)],64))),128)),F.id!==c.value&&Ae(te)&&(X(te).trim().length>0||F.durationMs!==void 0)?(w(),N("div",XK,[se(zt,{text:`${F.durationMs} ms`},{default:ke(()=>[F.durationMs!==void 0?(w(),N("span",QK,R(A(SP)(F.durationMs)),1)):ie("",!0)]),_:2},1032,["text"]),X(te).trim().length>0?(w(),N("button",{key:0,class:"a-cpbtn","aria-label":A(o)("filePreview.copy"),onClick:ee=>ze(te)},[$.value!==F.id?(w(),ge(Je,{key:0,name:"copy",size:"sm"})):(w(),ge(Je,{key:1,name:"check",size:"sm"}))],8,ZK)):ie("",!0)])):ie("",!0)],8,GK))],64))),128)),e.compaction?(w(),ge(yK,{key:3,label:A(o)("conversation.compacting")},null,8,["label"])):ie("",!0),u.value?(w(),N("div",JK,[se(l3,{fast:e.fastMoon},null,8,["fast"])])):ie("",!0),e.queued.length>0?(w(),N("div",eG,[T("div",tG,[T("span",nG,[se(Je,{name:"mail",size:"sm"}),je(" "+R(A(o)("composer.queueLabel"))+" · ",1),T("b",null,R(e.queued.length),1)]),T("span",oG,R(A(o)("composer.queueAutoDrain")),1)]),(w(!0),N(Oe,null,st(e.queued,(F,te)=>(w(),N("div",{key:te,class:De(["u-turn q-turn",{"q-dragging":f.value===te,"drop-before":h.value?.index===te&&h.value.position==="before","drop-after":h.value?.index===te&&h.value.position==="after"}]),onDragover:ee=>_(te,ee),onDrop:ee=>g(te,ee)},[T("div",iG,[T("span",{class:"q-grip",title:A(o)("composer.queueDragTitle"),draggable:"true",onDragstart:ee=>b(te,ee),onDragend:v},[se(Je,{name:"grip",size:"sm"})],40,rG),T("button",{type:"button",class:"q-body",title:p(F)?A(o)("composer.queuedHasImage",{n:F.attachments?.length??0}):A(o)("composer.editQueued"),disabled:p(F),onClick:ee=>m(te,F)},[F.text?(w(),N("span",aG,R(F.text),1)):(w(),N("span",cG,[se(Je,{name:"image",size:"sm"}),je(" "+R(A(o)("composer.queuedImageOnly",{n:F.attachments?.length??0})),1)]))],8,lG),p(F)?(w(),N("div",uG,[(w(!0),N(Oe,null,st(F.attachments,(ee,q)=>(w(),N(Oe,{key:q},[ee.kind==="video"?(w(),N("video",{key:0,class:"q-img",src:ee.url,muted:"",playsinline:"",preload:"metadata"},null,8,dG)):(w(),N("img",{key:1,class:"q-img",src:ee.url,alt:"",loading:"lazy"},null,8,fG))],64))),128))])):ie("",!0),te===0?(w(),N("span",pG,R(A(o)("composer.queueNext")),1)):(w(),N("span",hG,"#"+R(te+1),1)),T("button",{type:"button",class:"q-rm","aria-label":A(o)("composer.remove"),onClick:yt(ee=>d("unqueue",te),["stop"])},[se(Je,{name:"close",size:"sm"})],8,mG)])],42,sG))),128))])):ie("",!0)]))}}),a3=ft(vG,[["__scopeId","data-v-13e4f733"]]),yG={class:"ch-id"},kG={key:0,class:"ch-ws"},bG={key:1,class:"ch-sep"},_G=["onKeydown"],wG={class:"ch-ses"},SG={key:0,class:"ch-pill ch-sync-pill"},CG={key:0,class:"ch-ahead"},xG={key:1,class:"ch-behind"},AG={key:1,class:"ch-pill ch-diff-pill"},TG={key:0,class:"ch-add"},MG={key:1,class:"ch-del"},EG=Ve({__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}=Nt(),{confirm:o}=ol(),s=e,i=t,r=W(()=>s.ahead??0),l=W(()=>s.behind??0),a=W(()=>s.gitDiffStats?.totalAdditions??0),c=W(()=>s.gitDiffStats?.totalDeletions??0),u=W(()=>a.value>0||c.value>0),d=Z(!1),f=Z(null),h=Z(null),p=Z({});function m(D){const H=D.target;h.value?.el?.contains(H)||f.value?.el?.contains(H)||g()}function b(){g()}async function _(D){if(D.stopPropagation(),d.value){g();return}d.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",b),await gt();const H=f.value?.el,z=h.value?.el;if(!H||!z)return;const U=H.getBoundingClientRect(),Q=4,X=8,ue=z.offsetWidth,me=z.offsetHeight;let Ae=U.bottom+Q;Ae+me>window.innerHeight-X&&(Ae=Math.max(X,U.top-me-Q));let be=U.left;be+ue>window.innerWidth-X&&(be=Math.max(X,U.right-ue)),p.value={top:`${Math.round(Ae)}px`,left:`${Math.round(be)}px`}}function g(){d.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",b)}_n(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",b)});function v(){i("copyAll"),g()}function y(){i("copyFinalSummary"),g()}const C=Z(!1);function L(){s.sessionId&&Wo(s.sessionId).then(D=>{D&&(C.value=!0,setTimeout(()=>{C.value=!1},1200))})}const $=Z(!1),k=Z(""),M=Z(null);async function E(){if(g(),!!s.sessionId){$.value=!0,k.value=s.sessionTitle??"",await gt();try{M.value?.focus(),M.value?.select()}catch{}}}function O(){const D=k.value.trim();D&&s.sessionId&&D!==(s.sessionTitle??"").trim()&&i("renameSession",s.sessionId,D),$.value=!1}function S(){$.value=!1}function I(){s.sessionId&&(g(),i("forkSession",s.sessionId))}async function P(){s.sessionId&&(g(),await o({title:n("header.archiveSession"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archiveSession",s.sessionId))}return(D,H)=>(w(),N("header",{class:De(["chat-header",{"macos-desktop":A(kA)}])},[T("div",yG,[e.workspaceName?(w(),N("span",kG,R(e.workspaceName),1)):ie("",!0),e.workspaceName&&e.sessionTitle?(w(),N("span",bG,"/")):ie("",!0),$.value?En((w(),N("input",{key:2,ref_key:"renameInputRef",ref:M,"onUpdate:modelValue":H[0]||(H[0]=z=>k.value=z),class:"ch-rename",type:"text",onKeydown:[ai(yt(O,["stop"]),["enter"]),ai(yt(S,["stop"]),["esc"])],onBlur:O,onClick:H[1]||(H[1]=yt(()=>{},["stop"]))},null,40,_G)),[[ms,k.value]]):e.sessionTitle?(w(),ge(zt,{key:3,text:e.sessionTitle},{default:ke(()=>[T("span",wG,R(e.sessionTitle),1)]),_:1},8,["text"])):ie("",!0)]),se(vn,{ref_key:"kebabRef",ref:f,class:De(["ch-act-more",{open:d.value}]),label:A(n)("header.options"),"aria-expanded":d.value,"aria-haspopup":"menu",onClick:H[2]||(H[2]=yt(z=>_(z),["stop"]))},{default:ke(()=>[se(Je,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),d.value?(w(),ge(Fl,{key:0,ref_key:"menuRef",ref:h,class:"ch-menu",style:Yt(p.value),onClick:H[3]||(H[3]=yt(()=>{},["stop"]))},{default:ke(()=>[se(dn,{onClick:v},{default:ke(()=>[je(R(e.copied?A(n)("header.copied"):A(n)("header.copyAll")),1)]),_:1}),se(dn,{onClick:y},{default:ke(()=>[je(R(A(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(w(),N(Oe,{key:0},[se(dn,{separator:""}),se(dn,{onClick:L},{default:ke(()=>[je(R(C.value?A(n)("header.copied"):A(n)("header.copySessionId")),1)]),_:1}),se(dn,{onClick:E},{default:ke(()=>[je(R(A(n)("header.renameSession")),1)]),_:1}),se(dn,{onClick:I},{default:ke(()=>[je(R(A(n)("header.forkSession")),1)]),_:1}),se(dn,{danger:"",onClick:P},{default:ke(()=>[je(R(A(n)("header.archiveSession")),1)]),_:1})],64)):ie("",!0)]),_:1},8,["style"])):ie("",!0),H[6]||(H[6]=T("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(w(),N("button",{key:1,type:"button",class:"ch-git",onClick:H[4]||(H[4]=z=>i("openChanges"))},[T("span",{class:De(["ch-branch",{"ch-detached":!e.branch}])},R(e.branch||A(n)("header.detached")),3),r.value>0||l.value>0?(w(),N("span",SG,[r.value>0?(w(),N("span",CG,"↑"+R(r.value),1)):ie("",!0),l.value>0?(w(),N("span",xG,"↓"+R(l.value),1)):ie("",!0)])):ie("",!0),u.value?(w(),N("span",AG,[a.value>0?(w(),N("span",TG,"+"+R(a.value),1)):ie("",!0),c.value>0?(w(),N("span",MG,"-"+R(c.value),1)):ie("",!0)])):ie("",!0)])):ie("",!0),e.pr?(w(),N("button",{key:2,type:"button",class:De(["ch-pill ch-pr",`pr-${e.pr.state}`]),onClick:H[5]||(H[5]=z=>e.pr&&i("openPr",e.pr.url))},[se(Je,{name:"git-pull-request",size:"sm"}),T("span",null,"PR #"+R(e.pr.number)+" · "+R(e.pr.state),1)],2)):ie("",!0)],2))}}),IG=ft(EG,[["__scopeId","data-v-39760f19"]]),$G={key:0,class:"slash-menu",role:"listbox"},NG=["aria-selected","onMouseenter","onMousedown"],LG={class:"slash-name"},OG={class:"slash-desc"},PG=Ve({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=Z([]);return Ge(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(w(),N("div",$G,[(w(!0),N(Oe,null,st(e.items,(a,c)=>(w(),N("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:De(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:yt(u=>s("select",a),["prevent"])},[T("span",LG,R(a.name),1),T("span",OG,R(a.isSkill?a.desc:A(n)(a.desc)),1)],42,NG))),128))])):ie("",!0)}}),RG=ft(PG,[["__scopeId","data-v-f60b70d9"]]),DG={class:"mention-menu",role:"listbox"},BG={key:0,class:"mention-state dim"},FG={key:1,class:"mention-state dim"},HG=["aria-selected","onMouseenter","onMousedown"],WG=["innerHTML"],zG={class:"mention-name"},UG={class:"mention-path"},qG=Ve({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=Ta("folder","sm"),r=Ta("code","sm"),l=Ta("file-text","sm"),a=Ta("image","sm"),c=Ta("file","sm"),u=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"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),f=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(p){const m=p.path;if(m.endsWith("/"))return i;const b=p.name||m.split("/").pop()||m,_=b.lastIndexOf("."),g=_>0?b.slice(_+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(p,m)=>(w(),N("div",DG,[n.loading?(w(),N("div",BG,R(A(s)("mention.searching")),1)):n.items.length===0?(w(),N("div",FG,R(A(s)("mention.noMatch")),1)):(w(!0),N(Oe,{key:2},st(n.items,(b,_)=>(w(),N("div",{key:b.path,class:De(["mention-item",{active:_===n.activeIndex}]),role:"option","aria-selected":_===n.activeIndex,onMouseenter:g=>o("hover",_),onMousedown:yt(g=>o("select",b),["prevent"])},[T("span",{class:"mention-icon",innerHTML:h(b),"aria-hidden":"true"},null,8,WG),T("span",zG,R(b.name),1),T("span",UG,R(b.path),1)],42,HG))),128))]))}}),jG=ft(qG,[["__scopeId","data-v-f4d6b958"]]),c3=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.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 VG(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 u3(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...c3,...t]}function KG(e,t=c3){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((o,s)=>{const i=o.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:o,index:s,score:r}}).filter(({score:o})=>o>0).sort((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function d3(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 kS(e,t){switch(d3(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const Pp=100;function GG(e){const t=td($t.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>Pp?n.slice(-Pp):n,s={[e]:o};return fc($t.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function YG(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=Z(GG(s())),r=W(()=>i.value[s()??""]??[]);let l=-1,a="";function c(_){const g=s();if(l=-1,!g)return;const v=_.trim();if(!v)return;const y=i.value[g]??[];if(y.at(-1)===v)return;const C=[...y,v],L=C.length>Pp?C.slice(-Pp):C;i.value={...i.value,[g]:L},fc($t.inputHistory,i.value)}function u(){const _=n.value;return _?(_.selectionStart??0)===0:!1}function d(_){t.value=_,gt(()=>{const g=n.value;if(!g)return;o();const v=_.length;g.setSelectionRange(v,v)})}function f(){const _=r.value;if(_.length!==0){if(l===-1)a=t.value,l=_.length-1;else if(l>0)l-=1;else return;d(_[l])}}function h(){if(l===-1)return;const _=r.value;l<_.length-1?(l+=1,d(_[l])):(l=-1,d(a))}function p(){l=-1}function m(){return l!==-1}function b(){return r.value.length>0}return Ge(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:m,hasHistory:b}}function XG(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=Z(!1),c=Z([]),u=Z(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=KG(h,u3(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,gt(()=>{const p=n.value;if(!p)return;const m=t.value.length;p.setSelectionRange(m,m),p.focus(),o()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function QG(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=Z(!1),r=Z([]),l=Z(0),a=Z(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let m=p-1;for(;m>=0&&!/\s/.test(h[m]);)m--;m++;const b=h.slice(m,p);return b.startsWith("@")?{token:b.slice(1),start:m,end:p}:null}function d(){const h=u(),p=s();if(!h||!p){i.value=!1;return}const m=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const m=t.value;t.value=m.slice(0,p.start)+h.path+m.slice(p.end),i.value=!1,gt(()=>{const b=n.value;if(!b)return;const _=p.start+h.path.length;b.setSelectionRange(_,_),b.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function ZG(e){const{sessionId:t}=e;function n(c){return Jn(p_(c))??""}function o(c,u){const d=p_(c);u?no(d,u):sc(d)}const s=Z(n(t())),i=Z(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Ge(s,c=>{gt(r),o(t(),c)}),Ge(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),gt(r))});function l(c){s.value=c,gt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function JG(e){const{uploadImage:t,sessionId:n}=e,o=Z({}),s=W(()=>o.value[n()??""]??[]),i=Z(null),r=Z(null),l=Z(!1);let a=0;function c(){return`att_${++a}`}function u(k,M){o.value={...o.value,[k]:M}}function d(k){try{URL.revokeObjectURL(k.previewUrl)}catch{}}function f(k){return k.startsWith("image/")?"image":k.startsWith("video/")?"video":null}async function h(k){const M=t();if(!M)return;const E=n()??"",O=k.map(S=>({file:S,kind:f(S.type)})).filter(S=>S.kind!==null);if(O.length!==0)for(const{file:S,kind:I}of O){const P=c(),D=URL.createObjectURL(S),H={localId:P,name:S.name,kind:I,previewUrl:D,uploading:!0};u(E,[...o.value[E]??[],H]),M(S,S.name).then(z=>{const U=o.value[E]??[];u(E,U.map(Q=>Q.localId===P?{...Q,uploading:!1,fileId:z?.fileId,error:z===null}:Q))}).catch(()=>{const z=o.value[E]??[];u(E,z.map(U=>U.localId===P?{...U,uploading:!1,error:!0}:U))})}}function p(k){const M=n()??"",E=o.value[M]??[],O=E.find(S=>S.localId===k);i.value?.localId===k&&(i.value=null),O&&d(O),u(M,E.filter(S=>S.localId!==k))}function m(k){i.value=k}function b(){i.value=null}function _(){r.value?.click()}function g(k){const M=k.target,E=Array.from(M.files??[]);h(E),M.value=""}function v(k){if(!t())return;const M=k.clipboardData;if(!M)return;const E=[],O=new Set,S=(I,P)=>{const D=`${I.size}:${I.type}:${P}`;if(O.has(D))return;O.add(D);const H=I.type.split("/")[1]??"png",z=P.includes(".")?P:`paste-${Date.now()}.${H}`;E.push(I instanceof File?I:new File([I],z,{type:I.type}))};for(const I of Array.from(M.items))if(I.kind==="file"&&f(I.type)){const P=I.getAsFile();P&&S(P,P.name||`paste-${Date.now()}.${I.type.split("/")[1]??"png"}`)}for(const I of Array.from(M.files))f(I.type)&&S(I,I.name);E.length!==0&&(k.preventDefault(),h(E))}function y(k){!t()||!Array.from(k.dataTransfer?.items??[]).some(E=>E.kind==="file")||(k.preventDefault(),l.value=!0)}function C(){l.value=!1}function L(k){if(l.value=!1,!t())return;k.preventDefault();const M=Array.from(k.dataTransfer?.files??[]);h(M)}function $(){const k=n()??"";for(const M of o.value[k]??[])d(M);u(k,[])}return Ge(n,()=>{i.value=null}),bn(()=>{document.addEventListener("paste",v)}),_n(()=>{document.removeEventListener("paste",v);for(const k of Object.values(o.value))for(const M of k)d(M);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:m,closeAttachmentPreview:b,openFilePicker:_,handleFileInputChange:g,handleDragOver:y,handleDragLeave:C,handleDrop:L,clearAfterSubmit:$}}const eY={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},tY=["stroke-dasharray","stroke-dashoffset"],jg=7,nY=Ve({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*jg;return(o,s)=>(w(),N("svg",eY,[T("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:jg,fill:"none","stroke-width":"2.5"}),T("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:jg,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,tY)]))}}),oY=ft(nY,[["__scopeId","data-v-a364f1f1"]]),sY={key:0,class:"att-strip"},iY=["onClick"],rY=["src"],lY=["src","alt"],aY={key:2,class:"att-video-badge","aria-hidden":"true"},cY={class:"att-name"},uY={class:"att-err-icon"},dY=["onClick"],fY={class:"att-lightbox-card"},pY=["src"],hY=["src","alt"],mY={class:"att-lightbox-name"},gY={class:"composer-card"},vY={class:"cin-wrap"},yY={class:"input-row"},kY=["placeholder"],bY=["aria-label"],_Y={class:"toolbar-left"},wY=["onKeydown"],SY=["onClick"],CY={class:"pd-check"},xY={class:"pd-info"},AY={class:"pd-desc"},TY={class:"mode-label"},MY={key:0,class:"mode-tag"},EY={key:1,class:"mode-tag"},IY={key:2,class:"mode-tag"},$Y={class:"mode-row-name"},NY={class:"mode-row-name"},LY={class:"mode-row-name"},OY={key:0,class:"mode-row-actions"},PY={class:"toolbar-right"},RY={key:0,class:"ctx-group"},DY={class:"ctx-num"},BY=["onKeydown"],FY={key:0,class:"think-suffix"},HY=["aria-label"],WY=["aria-label"],zY={key:0,class:"md-section"},UY=["onClick"],qY={class:"md-check"},jY={class:"md-name"},VY={class:"md-provider"},KY={key:1,class:"md-divider"},GY={key:2,class:"md-section"},YY=["onClick"],XY={class:"md-check"},QY={class:"md-name"},ZY={key:3,class:"md-divider"},JY=["disabled"],eX={class:"md-check"},tX={class:"md-name"},nX={key:0,class:"md-note"},oX={key:1,class:"md-note"},sX={class:"md-name"},bS=36,iX=Ve({__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 o=e,s=W(()=>o.running?r("composer.placeholderRunning"):o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=Nt(),{text:l,textareaRef:a,autosize:c,loadForEdit:u,clearDraft:d}=ZG({sessionId:()=>o.sessionId}),f=Z(!1);function h(){f.value=!f.value,gt(()=>{c(),_(),a.value?.focus()})}function p(){f.value&&(f.value=!1,gt(c))}function m(et){if(typeof getComputedStyle>"u")return bS;const it=Number.parseFloat(getComputedStyle(et).minHeight);return Number.isFinite(it)&&it>0?it:bS}const b=Z(!1);function _(){const et=a.value;b.value=!!et&&et.scrollHeight>m(et)}Ge(l,()=>{gt(_)}),Ge(()=>o.sessionId,()=>{f.value=!1});const g=YG({text:l,textareaRef:a,autosize:c,sessionId:()=>o.sessionId}),{open:v,items:y,active:C,update:L,select:$}=XG({text:l,textareaRef:a,autosize:c,skills:()=>o.skills,emitCommand:et=>i("command",et),historyPush:et=>g.push(et),clearDraft:d}),{open:k,items:M,active:E,loading:O,update:S,select:I}=QG({text:l,textareaRef:a,autosize:c,searchFiles:()=>o.searchFiles});function P(){g.resetBrowsing(),L(),S()}const{attachments:D,previewAttachment:H,fileInputRef:z,isDragOver:U,removeAttachment:Q,openAttachmentPreview:X,closeAttachmentPreview:ue,openFilePicker:me,handleFileInputChange:Ae,handleDragOver:be,handleDragLeave:ze,handleDrop:qe,clearAfterSubmit:Fe}=JG({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});bn(()=>{l.value&>(()=>{c(),_()})}),_n(()=>{document.removeEventListener("mousedown",Lt),q()});function Le(){a.value?.focus({preventScroll:!0})}t({loadForEdit:u,focus:Le});function le(){const et=l.value.trim();if(D.value.some(pt=>pt.uploading))return;const it=D.value.filter(pt=>!pt.uploading&&!pt.error&&pt.fileId);if(!et&&it.length===0)return;if(g.push(et),et){const pt=VG(et),ti=pt?u3(o.skills).some(mi=>mi.name===pt.cmd):!1;if(pt&&ti){l.value="",d(),v.value=!1,p(),i("command",pt.arg?`${pt.cmd} ${pt.arg}`:pt.cmd);return}}const lt={text:et,attachments:it.map(pt=>({fileId:pt.fileId,kind:pt.kind}))};H.value=null,Fe(),l.value="",d(),v.value=!1,k.value=!1,p(),i("submit",lt)}function F(){if(!o.running||D.value.some(pt=>pt.uploading))return;const et=l.value.trim(),it=D.value.filter(pt=>!pt.uploading&&!pt.error&&pt.fileId);if(!et&&it.length===0&&o.queued.length===0)return;const lt={text:et,attachments:it.map(pt=>({fileId:pt.fileId,kind:pt.kind}))};Fe(),g.push(et),l.value="",d(),v.value=!1,k.value=!1,p(),i("steer",lt)}let te=!1,ee=null;function q(){ee!==null&&(clearTimeout(ee),ee=null)}function Y(){q(),te=!0}function de(){q(),ee=setTimeout(()=>{ee=null,te=!1},0)}function ne(et){return te||et.isComposing||et.keyCode===229}function ce(et){if(!ne(et)){if(et.key==="Escape"){if(re.value){et.preventDefault(),ae();return}if(he.value){et.preventDefault(),Ke();return}}if(v.value){if(et.key==="ArrowDown"){et.preventDefault(),C.value=(C.value+1)%y.value.length;return}if(et.key==="ArrowUp"){et.preventDefault(),C.value=(C.value-1+y.value.length)%y.value.length;return}if(et.key==="Enter"||et.key==="Tab"){et.preventDefault();const it=y.value[C.value];it&&$(it);return}if(et.key==="Escape"){et.preventDefault(),v.value=!1;return}}if(k.value&&!O.value){if(et.key==="ArrowDown"){et.preventDefault(),E.value=(E.value+1)%Math.max(1,M.value.length);return}if(et.key==="ArrowUp"){et.preventDefault(),E.value=(E.value-1+Math.max(1,M.value.length))%Math.max(1,M.value.length);return}if(et.key==="Enter"||et.key==="Tab"){et.preventDefault();const it=M.value[E.value];it&&I(it);return}if(et.key==="Escape"){et.preventDefault(),k.value=!1;return}}if(et.key==="s"&&(et.ctrlKey||et.metaKey)&&!et.shiftKey&&!et.altKey){o.running&&(et.preventDefault(),F());return}if(!f.value&&!v.value&&!k.value&&!et.shiftKey&&!et.altKey&&!et.metaKey&&!et.ctrlKey){const it=g.isBrowsing();if(et.key==="ArrowUp"&&g.hasHistory()&&(it||g.caretAtTextStart())){et.preventDefault(),g.recallOlder();return}if(et.key==="ArrowDown"&&it){et.preventDefault(),g.recallNewer();return}}if(et.key==="Enter"&&!et.shiftKey){if(f.value&&!(et.metaKey||et.ctrlKey))return;et.preventDefault(),le()}}}const j=W(()=>r("composer.send")),G=W(()=>!!o.uploadImage),re=Z(!1),he=Z(!1),Ce=Z(null);function Ee(){re.value=!re.value,re.value?(he.value=!1,At(),document.addEventListener("click",ot,!0)):document.removeEventListener("click",ot,!0)}function ae(){re.value=!1,he.value||document.removeEventListener("click",ot,!0)}function xe(){he.value=!he.value,he.value?(re.value=!1,At(),document.addEventListener("click",ot,!0)):document.removeEventListener("click",ot,!0)}function Ke(){he.value=!1,re.value||document.removeEventListener("click",ot,!0)}function ot(et){Ce.value&&!Ce.value.contains(et.target)&&(ae(),Ke())}_n(()=>{document.removeEventListener("click",ot,!0)});const _t=et=>`${Math.round(et/1e3)}k`,wt=W(()=>{const et=o.status?.ctxMax??0;return et<=0?0:Math.min(100,Math.max(0,Math.round((o.status?.ctxUsed??0)/et*100)))}),It=W(()=>{const et=(o.status?.ctxUsed??0).toLocaleString(),it=(o.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:et,max:it,pct:wt.value})}),Pt=W(()=>wt.value>=80),bt=W(()=>{const et=o.status?.modelId??o.status?.model??"";return o.models?.find(it=>it.id===et||it.model===et||it.displayName===o.status?.model)}),Kt=W(()=>d3(bt.value)),Dn=W(()=>Kt.value==="toggle"),In=W(()=>Kt.value==="always-on"?!0:Kt.value==="unsupported"?!1:(o.thinking??"off")!=="off");function Dt(){Dn.value&&i("setThinking",In.value?"off":"high")}const pn=W(()=>o.planMode===!0),Kn=W(()=>o.swarmMode===!0),nt=W(()=>o.activationBadges?.goal!==null),wn=W(()=>nt.value||o.goalMode===!0),hn=Z(!1),Bn=Z(null),Gn=Z(null),Ye=Z({}),Xe=W(()=>pn.value||Kn.value||wn.value);function At(){hn.value=!1,document.removeEventListener("mousedown",Lt)}function Lt(et){const it=et.target;Bn.value?.contains(it)||Gn.value?.contains(it)||At()}function $n(){if(hn.value){At();return}ae(),Ke();const et=Bn.value?.getBoundingClientRect();et&&(Ye.value={left:`${Math.round(et.left)}px`,bottom:`${Math.round(window.innerHeight-et.top+8)}px`}),hn.value=!0,setTimeout(()=>document.addEventListener("mousedown",Lt),0)}const cn=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}];function Nn(et){i("setPermission",et),Ke()}const Fn=W(()=>cn.find(et=>et.mode===o.status?.permission)),eo=W(()=>Fn.value?r(Fn.value.labelKey):""),Mt=W(()=>bt.value?.provider??""),Yn=W(()=>!Mt.value||!o.models?.length?[]:o.models.filter(et=>et.provider===Mt.value)),mn=W(()=>new Set(o.starredIds??[]));function wo(et){return mn.value.has(et)}const ei=W(()=>o.models?.length?o.models.filter(et=>wo(et.id)&&et.provider!==Mt.value):[]);function Ns(et){i("selectModel",et),ae()}return(et,it)=>(w(),N("div",{class:De(["composer",{"drag-over":A(U),expanded:f.value}]),onDragover:it[18]||(it[18]=(...lt)=>A(be)&&A(be)(...lt)),onDragleave:it[19]||(it[19]=(...lt)=>A(ze)&&A(ze)(...lt)),onDrop:it[20]||(it[20]=(...lt)=>A(qe)&&A(qe)(...lt))},[A(D).length>0?(w(),N("div",sY,[(w(!0),N(Oe,null,st(A(D),lt=>(w(),N("div",{key:lt.localId,class:De(["att-chip",{"att-error":lt.error}])},[se(zt,{text:A(r)("composer.previewAttachment",{name:lt.name})},{default:ke(()=>[T("button",{type:"button",class:"att-preview",onClick:pt=>A(X)(lt)},[lt.kind==="video"?(w(),N("video",{key:0,class:"att-thumb",src:lt.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,rY)):(w(),N("img",{key:1,class:"att-thumb",src:lt.previewUrl,alt:lt.name},null,8,lY)),lt.kind==="video"?(w(),N("span",aY,[se(Je,{name:"play",size:"sm"})])):ie("",!0)],8,iY)]),_:2},1032,["text"]),T("span",cY,R(lt.name),1),lt.uploading?(w(),ge(Zs,{key:0,size:"sm",label:A(r)("composer.uploading")},null,8,["label"])):lt.error?(w(),ge(zt,{key:1,text:A(r)("composer.uploadFailed")},{default:ke(()=>[T("span",uY,[se(Je,{name:"info",size:"sm"})])]),_:1},8,["text"])):ie("",!0),se(zt,{text:A(r)("composer.removeNamed",{name:lt.name})},{default:ke(()=>[T("button",{class:"att-rm",onClick:pt=>A(Q)(lt.localId)},[se(Je,{name:"close",size:"sm"})],8,dY)]),_:2},1032,["text"])],2))),128))])):ie("",!0),A(H)?(w(),N("div",{key:1,class:"att-lightbox",onClick:it[1]||(it[1]=yt((...lt)=>A(ue)&&A(ue)(...lt),["self"]))},[T("div",fY,[se(zt,{text:A(r)("model.close")},{default:ke(()=>[T("button",{type:"button",class:"att-lightbox-close",onClick:it[0]||(it[0]=(...lt)=>A(ue)&&A(ue)(...lt))},"✕")]),_:1},8,["text"]),A(H).kind==="video"?(w(),N("video",{key:0,class:"att-lightbox-media",src:A(H).previewUrl,controls:"",playsinline:""},null,8,pY)):(w(),N("img",{key:1,class:"att-lightbox-media",src:A(H).previewUrl,alt:A(H).name},null,8,hY)),T("div",mY,R(A(H).name),1)])])):ie("",!0),T("div",gY,[T("div",vY,[A(v)?(w(),ge(RG,{key:0,items:A(y),"active-index":A(C),onSelect:A($),onHover:it[2]||(it[2]=lt=>C.value=lt)},null,8,["items","active-index","onSelect"])):ie("",!0),A(k)?(w(),ge(jG,{key:1,items:A(M),"active-index":A(E),loading:A(O),onSelect:A(I),onHover:it[3]||(it[3]=lt=>E.value=lt)},null,8,["items","active-index","loading","onSelect"])):ie("",!0),T("div",yY,[En(T("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":it[4]||(it[4]=lt=>to(l)?l.value=lt:null),class:"ph",placeholder:s.value,rows:"1",onKeydown:ce,onCompositionstart:Y,onCompositionend:de,onInput:P},null,40,kY),[[ms,A(l)]]),f.value||b.value?(w(),N("button",{key:0,class:"expand-btn",type:"button","aria-label":f.value?A(r)("composer.collapseTitle"):A(r)("composer.expandTitle"),onClick:h},[f.value?(w(),ge(Je,{key:0,name:"collapse",size:"sm"})):(w(),ge(Je,{key:1,name:"expand",size:"sm"}))],8,bY)):ie("",!0)])]),G.value?(w(),N("input",{key:0,ref_key:"fileInputRef",ref:z,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:it[5]||(it[5]=(...lt)=>A(Ae)&&A(Ae)(...lt))},null,544)):ie("",!0),T("div",{ref_key:"toolbarRef",ref:Ce,class:"toolbar"},[T("div",_Y,[G.value?(w(),ge(vn,{key:0,size:"md",label:A(r)("composer.attachImage"),onClick:A(me)},{default:ke(()=>[se(Je,{name:"image"})]),_:1},8,["label","onClick"])):ie("",!0),e.status?(w(),N("span",{key:1,class:De(["perm-pill",["perm-"+e.status.permission,{open:he.value}]]),role:"button",tabindex:"0",onClick:yt(xe,["stop"]),onKeydown:[ai(xe,["enter"]),ai(yt(xe,["prevent"]),["space"])]},R(eo.value),43,wY)):ie("",!0),he.value&&e.status?(w(),N("div",{key:2,class:"perm-dropdown",role:"menu",onClick:it[6]||(it[6]=yt(()=>{},["stop"]))},[(w(),N(Oe,null,st(cn,lt=>T("button",{key:lt.mode,class:De(["pd-row",{"is-current":lt.mode===e.status.permission}]),role:"menuitem",onClick:pt=>Nn(lt.mode)},[T("span",CY,[lt.mode===e.status.permission?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",xY,[T("span",{class:"pd-name",style:Yt({color:lt.color})},R(A(r)(lt.labelKey)),5),T("span",AY,R(A(r)(lt.descKey)),1)])],10,SY)),64))])):ie("",!0),e.status?(w(),N("div",{key:3,ref_key:"modesRef",ref:Bn,class:"modes"},[T("button",{type:"button",class:De(["mode-pill",{on:Xe.value,open:hn.value}]),onClick:yt($n,["stop"])},[T("span",TY,R(A(r)("status.modesLabel")),1),pn.value?(w(),N("span",MY,R(A(r)("status.planLabel")),1)):ie("",!0),Kn.value?(w(),N("span",EY,R(A(r)("status.swarmLabel")),1)):ie("",!0),wn.value?(w(),N("span",IY,R(A(r)("status.goalLabel")),1)):ie("",!0)],2),hn.value?(w(),N("div",{key:0,ref_key:"modesMenuRef",ref:Gn,class:"modes-menu",style:Yt(Ye.value)},[T("button",{type:"button",class:De(["mode-row",{on:pn.value}]),onClick:it[7]||(it[7]=lt=>i("togglePlan"))},[T("span",$Y,R(A(r)("status.planLabel")),1),T("span",{class:De(["mode-switch",{on:pn.value}])},[...it[21]||(it[21]=[T("span",{class:"mode-knob"},null,-1)])],2)],2),T("button",{type:"button",class:De(["mode-row",{on:Kn.value}]),onClick:it[8]||(it[8]=lt=>i("toggleSwarm"))},[T("span",NY,R(A(r)("status.swarmLabel")),1),T("span",{class:De(["mode-switch",{on:Kn.value}])},[...it[22]||(it[22]=[T("span",{class:"mode-knob"},null,-1)])],2)],2),T("div",{class:De(["mode-row mode-row-goal",{on:nt.value||o.goalMode}])},[T("button",{type:"button",class:"mode-row-main",onClick:it[9]||(it[9]=lt=>nt.value?i("controlGoal","cancel"):i("toggleGoal"))},[T("span",LY,R(A(r)("status.goalLabel")),1),nt.value?ie("",!0):(w(),N("span",{key:0,class:De(["mode-switch",{on:o.goalMode}])},[...it[23]||(it[23]=[T("span",{class:"mode-knob"},null,-1)])],2))]),nt.value?(w(),N("div",OY,[T("button",{type:"button",class:"mode-row-action",onClick:it[10]||(it[10]=lt=>i("controlGoal","pause"))},R(A(r)("status.goalPause")),1),T("button",{type:"button",class:"mode-row-action",onClick:it[11]||(it[11]=lt=>i("controlGoal","resume"))},R(A(r)("status.goalResume")),1)])):ie("",!0)],2)],4)):ie("",!0)],512)):ie("",!0)]),T("div",PY,[Pt.value?(w(),N("button",{key:0,class:"compact-chip",onClick:it[12]||(it[12]=yt(lt=>i("compact"),["stop"]))},"/compact")):ie("",!0),se(zt,{text:It.value},{default:ke(()=>[e.status&&!e.hideContext?(w(),N("span",RY,[se(oY,{pct:wt.value},null,8,["pct"]),T("span",DY,R(_t(e.status.ctxUsed))+"/"+R(_t(e.status.ctxMax)),1)])):ie("",!0)]),_:1},8,["text"]),e.status?(w(),N("span",{key:1,class:De(["model-pill",{open:re.value}]),role:"button",tabindex:"0",onClick:yt(Ee,["stop"]),onKeydown:[ai(Ee,["enter"]),ai(yt(Ee,["prevent"]),["space"])]},[T("b",null,R(e.status.model),1),In.value?(w(),N("span",FY,R(A(r)("composer.thinkingSuffix")),1)):ie("",!0),se(Je,{class:"cv",name:"chevron-down",size:"sm"})],42,BY)):ie("",!0),e.running?(w(),ge(zt,{key:2,text:A(r)("composer.interruptTitle")},{default:ke(()=>[T("button",{class:"stop","aria-label":A(r)("composer.interrupt"),onClick:it[13]||(it[13]=lt=>i("interrupt"))},[se(Je,{name:"stop",size:"sm"})],8,HY)]),_:1},8,["text"])):ie("",!0),T("button",{class:"send","aria-label":j.value,onClick:it[14]||(it[14]=lt=>le())},[se(Je,{name:"send",size:"sm"})],8,WY)]),re.value&&e.status?(w(),N("div",{key:0,class:"model-dropdown",role:"menu",onClick:it[17]||(it[17]=yt(()=>{},["stop"]))},[ei.value.length>0?(w(),N("div",zY,R(A(r)("status.starredModels")),1)):ie("",!0),(w(!0),N(Oe,null,st(ei.value,lt=>(w(),N("button",{key:lt.id,class:De(["md-row",{"is-current":lt.id===e.status.modelId}]),role:"menuitem",onClick:pt=>Ns(lt.id)},[T("span",qY,[lt.id===e.status.model||lt.model===e.status.model||lt.displayName===e.status.model?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",jY,R(lt.displayName??lt.model),1),T("span",VY,R(lt.provider),1),se(Je,{class:"md-star",name:"star",size:"sm"})],10,UY))),128)),ei.value.length>0?(w(),N("div",KY)):ie("",!0),Yn.value.length>0?(w(),N("div",GY,R(Mt.value),1)):ie("",!0),(w(!0),N(Oe,null,st(Yn.value,lt=>(w(),N("button",{key:lt.id,class:De(["md-row",{"is-current":lt.id===e.status.modelId}]),role:"menuitem",onClick:pt=>Ns(lt.id)},[T("span",XY,[lt.id===e.status.model||lt.model===e.status.model||lt.displayName===e.status.model?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",QY,R(lt.displayName??lt.model),1),wo(lt.id)?(w(),ge(Je,{key:0,class:"md-star",name:"star",size:"sm"})):ie("",!0)],10,YY))),128)),Yn.value.length>0?(w(),N("div",ZY)):ie("",!0),T("button",{class:De(["md-row md-row-toggle",{"is-on":In.value,"is-disabled":!Dn.value}]),role:"menuitem",disabled:!Dn.value,onClick:it[15]||(it[15]=lt=>Dt())},[T("span",eX,[In.value?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",tX,R(A(r)("status.thinkingLabel")),1),Kt.value==="always-on"?(w(),N("span",nX,R(A(r)("status.planOn")),1)):Kt.value==="unsupported"?(w(),N("span",oX,R(A(r)("status.modeNotSupported")),1)):ie("",!0)],10,JY),it[24]||(it[24]=T("div",{class:"md-divider"},null,-1)),T("button",{class:"md-row md-row-more",role:"menuitem",onClick:it[16]||(it[16]=lt=>{ae(),i("pickModel")})},[T("span",sX,R(A(r)("status.moreModels")),1)])])):ie("",!0)],512)])],34))}}),f3=ft(iX,[["__scopeId","data-v-0924690c"]]),rX=["id"],lX=["aria-expanded"],aX={class:"swarm-meta"},cX={class:"swarm-meta"},uX={class:"swarm-body"},dX={class:"row-name"},fX={key:0,class:"row-type"},pX={key:0,class:"row-activity"},hX={class:"row-phase"},mX=Ve({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=Z(!0),o=W(()=>t.group.members.length),s=W(()=>t.group.counts.completed+t.group.counts.failed),i=W(()=>t.group.counts.working+t.group.counts.queued+t.group.counts.suspended),r=W(()=>i.value>0?"running":t.group.counts.failed>0?"error":"done"),l=W(()=>{switch(r.value){case"running":return`${i.value} running`;case"error":return"has failures";default:return"completed"}});function a(f){switch(f){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function c(f){return f.outputLines?.map(h=>h.trimEnd()).filter(Boolean).at(-1)}function u(f){return f.suspendedReason||c(f)||f.summary}function d(){n.value=!n.value}return(f,h)=>(w(),N("section",{class:De(["swarm-card",{open:n.value}]),id:`swarm-${e.group.id}`},[T("button",{class:"swarm-head",type:"button","aria-expanded":n.value,onClick:d},[se(Ru,{status:r.value},null,8,["status"]),se(Je,{class:"swarm-ic",name:"git-pull-request",size:"sm"}),h[0]||(h[0]=T("span",{class:"swarm-title"},"Swarm",-1)),T("span",aX,"· "+R(s.value)+"/"+R(o.value),1),T("span",cX,"· "+R(l.value),1),se(Je,{class:"swarm-car",name:"chevron-right",size:"sm"})],8,lX),En(T("div",uX,[(w(!0),N(Oe,null,st(e.group.members,p=>(w(),N("div",{key:p.id,class:De(["swarm-row",`phase-${p.phase}`])},[se(Ru,{class:"row-dot",status:p.phase},null,8,["status"]),se(zt,{text:p.name},{default:ke(()=>[T("span",dX,R(p.name),1)]),_:2},1032,["text"]),p.subagentType?(w(),N("span",fX,R(p.subagentType),1)):ie("",!0),se(zt,{text:u(p)},{default:ke(()=>[u(p)?(w(),N("span",pX,R(u(p)),1)):ie("",!0)]),_:2},1032,["text"]),T("span",hX,R(a(p.phase)),1)],2))),128))],512),[[Vs,n.value]])],10,rX))}}),gX=ft(mX,[["__scopeId","data-v-e56cfe7c"]]),vX={key:0,class:"ui-card__head"},yX={class:"ui-card__body"},kX={key:1,class:"ui-card__foot"},bX=Ve({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(w(),N("div",{class:De(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(w(),N("div",vX,[An(t.$slots,"head",{},void 0,!0)])):ie("",!0),T("div",yX,[An(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(w(),N("div",kX,[An(t.$slots,"foot",{},void 0,!0)])):ie("",!0)],2))}}),ly=ft(bX,[["__scopeId","data-v-9c9f9a9a"]]),_X=["type","disabled"],wX={class:"ui-button__content"},SX=Ve({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(w(),N("button",{class:De(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(w(),ge(Zs,{key:0,size:"sm",class:"ui-button__spinner"})):ie("",!0),T("span",wX,[An(t.$slots,"default",{},void 0,!0)])],10,_X))}}),Rt=ft(SX,[["__scopeId","data-v-e58393a8"]]),CX={class:"goal-progress","aria-hidden":"true"},xX={class:"goal-full"},AX={key:0,class:"goal-criterion"},TX={class:"goal-stats"},MX={class:"goal-actions"},EX=Ve({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=Z(!1);Ge(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=W(()=>{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)=>(w(),ge(ly,{class:De(["goal-strip",{expanded:i.value}])},G1({head:ke(()=>[T("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[4]||(c[4]=T("span",{class:"goal-kicker"},"Goal",-1)),T("span",{class:De(["goal-objective",{"expanded-hidden":i.value}])},R(e.goal.objective),3),se($o,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:ke(()=>[je(R(e.goal.status),1)]),_:1},8,["variant"]),T("span",CX,[T("span",{class:"goal-progress-fill",style:Yt({width:`${r.value}%`})},null,4)]),se(Je,{class:De(["goal-chevron",{open:i.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),_:2},[i.value?{name:"default",fn:ke(()=>[T("div",xX,R(e.goal.objective),1),e.goal.completionCriterion?(w(),N("div",AX,[c[5]||(c[5]=T("span",null,"Done when",-1)),T("p",null,R(e.goal.completionCriterion),1)])):ie("",!0),T("div",TX,[se($o,{variant:"neutral",size:"sm"},{default:ke(()=>[je(R(e.goal.turnsUsed)+" turns",1)]),_:1}),se($o,{variant:"neutral",size:"sm"},{default:ke(()=>[je(R(e.goal.tokensUsed.toLocaleString())+" tokens",1)]),_:1}),se($o,{variant:"neutral",size:"sm"},{default:ke(()=>[je(R(l(e.goal.wallClockMs)),1)]),_:1}),e.goal.budget.tokenBudget!==null?(w(),ge($o,{key:0,variant:"neutral",size:"sm"},{default:ke(()=>[je(R(r.value)+"% token budget",1)]),_:1})):ie("",!0)])]),key:"0"}:void 0,i.value?{name:"foot",fn:ke(()=>[T("div",MX,[e.goal.status!=="paused"?(w(),ge(Rt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:c[1]||(c[1]=yt(u=>o("controlGoal","pause"),["stop"]))},{default:ke(()=>[je(R(A(s)("status.goalPause")),1)]),_:1})):ie("",!0),e.goal.status==="paused"?(w(),ge(Rt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:c[2]||(c[2]=yt(u=>o("controlGoal","resume"),["stop"]))},{default:ke(()=>[je(R(A(s)("status.goalResume")),1)]),_:1})):ie("",!0),se(Rt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:c[3]||(c[3]=yt(u=>o("controlGoal","cancel"),["stop"]))},{default:ke(()=>[je(R(A(s)("status.goalCancel")),1)]),_:1})])]),key:"1"}:void 0]),1032,["class"]))}}),IX=ft(EX,[["__scopeId","data-v-eaeefe1e"]]),$X={class:"qh"},NX={class:"qtitle"},LX={key:0,class:"qstep"},OX={key:1,class:"qmin-peek"},PX={class:"qbody"},RX=["aria-label"],DX=["aria-selected","aria-label","onClick"],BX={class:"qstep-num"},FX={key:1,class:"qheader-chip"},HX={class:"qtext"},WX={class:"qopts"},zX=["onClick"],UX={class:"qopt-key"},qX={class:"qopt-glyph"},jX={key:0,class:"chk"},VX={key:1,class:"rad"},KX={class:"qopt-text"},GX={class:"qopt-label"},YX={key:0,class:"qopt-desc"},XX={class:"qopt-glyph"},QX={key:0,class:"chk"},ZX={key:1,class:"rad"},JX={class:"qopt-label"},eQ=["placeholder"],tQ={class:"qfoot"},nQ=Ve({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=Nt(),s=t,i=Z(0),r=Z(!1),l=W(()=>n.question.questions[i.value]),a=W(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(H){H>=0&&H<a.value&&(i.value=H)}function f(H){const z=p.value[H];return z?z.kind==="multi"?z.optionIds.length>0:z.kind==="multiWithOther"?z.optionIds.length>0||z.otherText.trim().length>0:z.kind==="other"?z.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=Z({});function m(H){return H.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${H.label} ${H.description??""}`.toLowerCase())}function b(){const H={...p.value};let z=!1;for(const U of n.question.questions){if(H[U.id])continue;const Q=U.options.filter(m);Q.length!==0&&(H[U.id]=U.multiSelect?{kind:"multi",optionIds:Q.map(X=>X.id)}:{kind:"single",optionId:Q[0].id},z=!0)}z&&(p.value=H)}Ge(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},v.value={}}),Ge(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),b()},{immediate:!0,deep:!0});function _(H,z){const U=p.value[H];if(U&&U.kind==="single"&&U.optionId===z){const Q={...p.value};delete Q[H],p.value=Q}else p.value={...p.value,[H]:{kind:"single",optionId:z}}}function g(H,z){const U=p.value[H],Q=U&&(U.kind==="multi"||U.kind==="multiWithOther")?U.kind==="multi"?[...U.optionIds]:[...U.optionIds]:[],X=Q.indexOf(z);X>=0?Q.splice(X,1):Q.push(z);const ue=p.value[H],me=ue&&ue.kind==="multiWithOther"?ue.otherText:"";me?p.value={...p.value,[H]:{kind:"multiWithOther",optionIds:Q,otherText:me}}:p.value={...p.value,[H]:{kind:"multi",optionIds:Q}}}const v=Z({}),y=Z(null);function C(H){const z=n.question.questions.find(Q=>Q.id===H),U=v.value[H]??"";if(z.multiSelect){const Q=p.value[H],X=Q&&(Q.kind==="multi"||Q.kind==="multiWithOther")?Q.kind==="multi"?[...Q.optionIds]:[...Q.optionIds]:[];p.value={...p.value,[H]:{kind:"multiWithOther",optionIds:X,otherText:U}}}else p.value={...p.value,[H]:{kind:"other",text:U}}}function L(H){C(H),gt(()=>y.value?.focus())}function $(H,z){const U=p.value[H];return U?U.kind==="single"?U.optionId===z:U.kind==="multi"||U.kind==="multiWithOther"?U.optionIds.includes(z):!1:!1}function k(H){const z=p.value[H];return!!(z&&(z.kind==="other"||z.kind==="multiWithOther"))}function M(){return n.question.questions.every(H=>f(H.id))}const E=W(()=>n.busyKind==="answer"),O=W(()=>n.busyKind==="dismiss"),S=W(()=>!!n.busyKind);function I(){if(S.value||!M())return;const H={answers:p.value,method:"click"};s("answer",n.question.questionId,H)}function P(){S.value||s("dismiss",n.question.questionId)}function D(H){const z=(document.activeElement?.tagName??"").toLowerCase(),U=z==="input"||z==="textarea";if(S.value)return;if(H.key==="Enter"){if(H.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():M()&&I();return}if(U)return;if(H.key==="Escape"){H.preventDefault(),P();return}if(r.value)return;const Q=parseInt(H.key,10);if(!isNaN(Q)&&Q>=1&&Q<=9){H.preventDefault();const X=l.value,ue=Q-1,me=X.options[ue];me&&(X.multiSelect?g(X.id,me.id):_(X.id,me.id))}}return bn(()=>document.addEventListener("keydown",D)),_n(()=>document.removeEventListener("keydown",D)),(H,z)=>(w(),ge(ly,{class:De(["qcard",{minimized:r.value}])},G1({head:ke(()=>[T("div",$X,[z[5]||(z[5]=T("span",{class:"qh-ic"},"?",-1)),T("span",NX,R(A(o)("question.title")),1),a.value>1&&!r.value?(w(),N("span",LX,R(A(o)("question.step",{current:i.value+1,total:a.value})),1)):ie("",!0),r.value?(w(),N("span",OX,R(l.value.question),1)):ie("",!0),se(vn,{class:"qmin",size:"sm",label:r.value?A(o)("question.expand"):A(o)("question.minimize"),onClick:z[0]||(z[0]=U=>r.value=!r.value)},{default:ke(()=>[r.value?(w(),ge(Je,{key:0,name:"chevron-down",size:"md"})):(w(),ge(Je,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:ke(()=>[T("div",PX,[a.value>1?(w(),N("div",{key:0,class:"qsteps",role:"tablist","aria-label":A(o)("question.step",{current:i.value+1,total:a.value})},[(w(!0),N(Oe,null,st(n.question.questions,(U,Q)=>(w(),N("button",{key:U.id,type:"button",class:De(["qstep-dot",{active:Q===i.value,answered:f(U.id)}]),"aria-selected":Q===i.value,"aria-label":A(o)("question.step",{current:Q+1,total:a.value}),onClick:X=>d(Q)},[T("span",BX,R(Q+1),1)],10,DX))),128))],8,RX)):ie("",!0),l.value.header?(w(),N("div",FX,[se($o,{variant:"neutral",size:"sm"},{default:ke(()=>[je(R(l.value.header),1)]),_:1})])):ie("",!0),T("div",HX,R(l.value.question),1),l.value.body?(w(),ge(Ih,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ie("",!0),T("div",WX,[(w(!0),N(Oe,null,st(l.value.options,(U,Q)=>(w(),N("label",{key:U.id,class:De(["qopt",{selected:$(l.value.id,U.id)}]),onClick:yt(X=>l.value.multiSelect?g(l.value.id,U.id):_(l.value.id,U.id),["prevent"])},[T("span",UX,R(Q+1),1),T("span",qX,[l.value.multiSelect?(w(),N("span",jX,R($(l.value.id,U.id)?"■":"□"),1)):(w(),N("span",VX,R($(l.value.id,U.id)?"●":"○"),1))]),T("span",KX,[T("span",GX,R(U.label),1),U.description?(w(),N("span",YX,R(U.description),1)):ie("",!0)])],10,zX))),128)),l.value.allowOther?(w(),N("label",{key:0,class:De(["qopt",{selected:k(l.value.id)}]),onClick:z[4]||(z[4]=yt(U=>L(l.value.id),["prevent"]))},[z[6]||(z[6]=T("span",{class:"qopt-key"},null,-1)),T("span",XX,[l.value.multiSelect?(w(),N("span",QX,R(k(l.value.id)?"■":"□"),1)):(w(),N("span",ZX,R(k(l.value.id)?"●":"○"),1))]),T("span",JX,R(l.value.otherLabel??A(o)("question.otherDefault")),1),En(T("input",{ref_key:"otherInputEl",ref:y,"onUpdate:modelValue":z[1]||(z[1]=U=>v.value[l.value.id]=U),class:"other-input",type:"text",placeholder:l.value.otherLabel??A(o)("question.otherDefault"),onInput:z[2]||(z[2]=U=>C(l.value.id)),onFocus:z[3]||(z[3]=U=>C(l.value.id))},null,40,eQ),[[ms,v.value[l.value.id]]])],2)):ie("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:ke(()=>[T("div",tQ,[i.value<a.value-1?(w(),ge(Rt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:ke(()=>[je(R(A(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(w(),ge(Rt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!M(),loading:E.value,onClick:I},{default:ke(()=>[je(R(A(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(w(),ge(Rt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:ke(()=>[je(R(A(o)("question.back")),1)]),_:1},8,["disabled"])):ie("",!0),se(Rt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:O.value,disabled:S.value,onClick:P},{default:ke(()=>[je(R(A(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),oQ=ft(nQ,[["__scopeId","data-v-08fbd85e"]]),sQ={class:"ah"},iQ={class:"akind"},rQ={class:"apath"},lQ={class:"ah-path"},aQ={key:1,class:"diff"},cQ={class:"dg"},uQ={class:"dc"},dQ={key:2,class:"body-shell"},fQ={class:"shell-cmd"},pQ={key:0,class:"shell-cwd"},hQ={key:1,class:"shell-danger"},mQ={key:3,class:"body-file"},gQ={class:"file-bar"},vQ={class:"file-lang"},yQ={class:"file-content"},kQ={class:"file-ln"},bQ={class:"file-text"},_Q={key:4,class:"body-chip"},wQ={class:"chip-label"},SQ={class:"chip-value"},CQ={key:0,class:"chip-detail"},xQ={key:5,class:"body-chip"},AQ={key:0,class:"chip-label"},TQ={class:"chip-value"},MQ={key:6,class:"body-chip"},EQ={class:"chip-label"},IQ={class:"chip-value"},$Q={key:0,class:"chip-detail"},NQ={key:7,class:"body-chip"},LQ={class:"chip-label"},OQ={class:"chip-value"},PQ={key:0,class:"chip-detail"},RQ={key:8,class:"body-todo"},DQ={class:"todo-glyph"},BQ={key:9,class:"body-plan"},FQ={key:10,class:"body-generic"},HQ={class:"gen-text"},WQ={key:11,class:"feedback-wrap"},zQ=["placeholder"],UQ={class:"feedback-hint"},qQ={key:0,class:"plan-actions"},jQ={class:"k"},VQ={key:0,class:"k"},KQ={key:0,class:"k"},GQ={key:1,class:"abtn"},YQ=Ve({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=W(()=>{const E=n.block;return E.kind!=="plan_review"?null:{plan:E.plan,path:E.path,options:E.options??[]}}),r=Z(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const E=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${E}`)}const c=Z(!1),u=Z(""),d=Z(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const E=u.value.trim();i.value?_("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:E||void 0}):_("feedback",{decision:"rejected",feedback:E||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function m(E){E.key==="Enter"&&!E.shiftKey?(E.preventDefault(),h()):E.key==="Escape"&&(E.preventDefault(),p())}const b=Z(null);Ge(()=>n.busy,E=>{E||(b.value=null)});function _(E,O){n.busy||(b.value=E,o("decide",O))}function g(){_("approve",{decision:"approved"})}function v(){_("approveSession",{decision:"approved",scope:"session"})}function y(){_("reject",{decision:"rejected"})}function C(){_("approvePlan",{decision:"approved"})}function L(E){_(`option:${E}`,{decision:"approved",selectedLabel:E})}function $(){n.busy||f()}function k(){_("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function M(E){const O=(document.activeElement?.tagName??"").toLowerCase();if(O==="input"||O==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){E.key==="1"?(E.preventDefault(),C()):E.key==="2"?(E.preventDefault(),$()):E.key==="3"&&(E.preventDefault(),k());return}E.key==="1"&&S.options[0]?(E.preventDefault(),L(S.options[0].label)):E.key==="2"&&S.options[1]?(E.preventDefault(),L(S.options[1].label)):E.key==="3"&&S.options[2]&&(E.preventDefault(),L(S.options[2].label));return}E.key==="1"?(E.preventDefault(),g()):E.key==="2"?(E.preventDefault(),v()):E.key==="3"?(E.preventDefault(),y()):E.key==="4"&&(E.preventDefault(),f())}return bn(()=>document.addEventListener("keydown",M)),_n(()=>document.removeEventListener("keydown",M)),(E,O)=>(w(),ge(ly,{class:De(["appr",{minimized:r.value}])},G1({head:ke(()=>[T("div",sQ,[O[2]||(O[2]=T("span",{class:"ah-ic"},"!",-1)),T("span",iQ,R(a()),1),T("span",rQ,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(w(),N(Oe,{key:0},[je(R(e.block.path),1)],64)):e.block.kind==="shell"?(w(),N(Oe,{key:1},[je(R(e.block.command),1)],64)):e.block.kind==="url"?(w(),N(Oe,{key:2},[je(R(e.block.url),1)],64)):e.block.kind==="search"?(w(),N(Oe,{key:3},[je(R(e.block.query),1)],64)):e.block.kind==="invocation"?(w(),N(Oe,{key:4},[je(R(e.block.name),1)],64)):e.block.kind==="generic"?(w(),N(Oe,{key:5},[je(R(e.block.summary),1)],64)):ie("",!0)]),e.agentName&&!r.value?(w(),ge($o,{key:0,variant:"neutral",size:"sm"},{default:ke(()=>[je(R(A(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ie("",!0),r.value?ie("",!0):(w(),ge($o,{key:1,variant:"warning",size:"sm",class:"aw"},{default:ke(()=>[je(R(A(s)("approval.required")),1)]),_:1})),se(vn,{class:"amin",size:"sm",label:r.value?A(s)("question.expand"):A(s)("question.minimize"),onClick:O[0]||(O[0]=S=>r.value=!r.value)},{default:ke(()=>[r.value?(w(),ge(Je,{key:0,name:"chevron-down",size:"md"})):(w(),ge(Je,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:ke(()=>[e.block.kind==="plan_review"&&e.block.path?(w(),ge(zt,{key:0,text:e.block.path},{default:ke(()=>[T("div",lQ,R(e.block.path),1)]),_:1},8,["text"])):ie("",!0),e.block.kind==="diff"?(w(),N("div",aQ,[(w(!0),N(Oe,null,st(e.block.diff,(S,I)=>(w(),N("div",{key:I,class:De(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[T("span",cQ,R(S.gutter),1),T("span",uQ,R(S.text),1)],2))),128))])):e.block.kind==="shell"?(w(),N("div",dQ,[T("div",fQ,[O[3]||(O[3]=T("span",{class:"shell-dollar"},"$",-1)),je(" "+R(e.block.command),1)]),e.block.cwd?(w(),N("div",pQ,"cwd: "+R(e.block.cwd),1)):ie("",!0),e.block.danger?(w(),N("div",hQ,R(A(s)("approval.danger",{detail:e.block.danger})),1)):ie("",!0)])):e.block.kind==="file"?(w(),N("div",mQ,[T("div",gQ,[T("span",vQ,R(e.block.language??""),1)]),T("div",yQ,[(w(!0),N(Oe,null,st(e.block.content.split(`
|
|
255
|
+
`),(S,I)=>(w(),N("div",{key:I,class:"file-line"},[T("span",kQ,R(I+1),1),T("span",bQ,R(S),1)]))),128))])])):e.block.kind==="fileop"?(w(),N("div",_Q,[T("span",wQ,R(e.block.op),1),T("span",SQ,R(e.block.path),1),e.block.detail?(w(),N("span",CQ,R(e.block.detail),1)):ie("",!0)])):e.block.kind==="url"?(w(),N("div",xQ,[e.block.method?(w(),N("span",AQ,R(e.block.method),1)):ie("",!0),T("span",TQ,R(e.block.url),1)])):e.block.kind==="search"?(w(),N("div",MQ,[T("span",EQ,R(A(s)("approval.searchQueryLabel")),1),T("span",IQ,R(e.block.query),1),e.block.scope?(w(),N("span",$Q,R(A(s)("approval.searchScope",{scope:e.block.scope})),1)):ie("",!0)])):e.block.kind==="invocation"?(w(),N("div",NQ,[T("span",LQ,R(e.block.kind2),1),T("span",OQ,R(e.block.name),1),e.block.description?(w(),N("span",PQ,R(e.block.description),1)):ie("",!0)])):e.block.kind==="todo"?(w(),N("div",RQ,[(w(!0),N(Oe,null,st(e.block.items,(S,I)=>(w(),N("div",{key:I,class:"todo-item"},[T("span",DQ,R(S.status==="done"||S.status==="completed"?"✓":"○"),1),T("span",{class:De(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},R(S.title),3)]))),128))])):e.block.kind==="plan_review"?(w(),N("div",BQ,[se(Ih,{text:e.block.plan},null,8,["text"])])):(w(),N("div",FQ,[T("span",HQ,R(e.block.summary),1)])),c.value?(w(),N("div",WQ,[En(T("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":O[1]||(O[1]=S=>u.value=S),class:"feedback-ta",placeholder:A(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,zQ),[[ms,u.value]]),T("div",UQ,R(A(s)("approval.feedbackHint")),1)])):ie("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:ke(()=>[i.value?(w(),N("div",qQ,[i.value.options.length>0?(w(!0),N(Oe,{key:0},st(i.value.options,(S,I)=>(w(),ge(zt,{key:I,text:S.description},{default:ke(()=>[se(Rt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value===`option:${S.label}`,disabled:e.busy,onClick:P=>L(S.label)},{default:ke(()=>[je(R(S.label),1),T("span",jQ,"["+R(I+1)+"]",1)]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(w(),ge(Rt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approvePlan",disabled:e.busy,onClick:C},{default:ke(()=>[je(R(A(s)("approval.approvePlan")),1),O[4]||(O[4]=T("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"])),se(Rt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:$},{default:ke(()=>[je(R(A(s)("approval.revise")),1),i.value.options.length===0?(w(),N("span",VQ,"[2]")):ie("",!0)]),_:1},8,["disabled"]),se(Rt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:b.value==="rejectAndExit",disabled:e.busy,onClick:k},{default:ke(()=>[je(R(A(s)("approval.rejectAndExit")),1),i.value.options.length===0?(w(),N("span",KQ,"[3]")):ie("",!0)]),_:1},8,["loading","disabled"])])):(w(),N("div",GQ,[se(Rt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approve",disabled:e.busy,onClick:g},{default:ke(()=>[je(R(A(s)("approval.approve")),1),O[5]||(O[5]=T("span",{class:"k"},"[1]",-1))]),_:1},8,["loading","disabled"]),se(Rt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="approveSession",disabled:e.busy,onClick:v},{default:ke(()=>[je(R(A(s)("approval.approveSession")),1),O[6]||(O[6]=T("span",{class:"k"},"[2]",-1))]),_:1},8,["loading","disabled"]),se(Rt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="reject",disabled:e.busy,onClick:y},{default:ke(()=>[je(R(A(s)("approval.reject")),1),O[7]||(O[7]=T("span",{class:"k"},"[3]",-1))]),_:1},8,["loading","disabled"]),se(Rt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:ke(()=>[je(R(A(s)("approval.feedback")),1),O[8]||(O[8]=T("span",{class:"k"},"[4]",-1))]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),XQ=ft(YQ,[["__scopeId","data-v-4c0c7bdb"]]),QQ=Ve({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(w(),N("span",{class:De(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},R(n[t.status]),3))}}),p3=ft(QQ,[["__scopeId","data-v-f595d935"]]),ZQ={class:"taskspane"},JQ={class:"tp-head"},eZ={class:"tp-title"},tZ={class:"tp-count"},nZ={class:"tp-list"},oZ={key:0,class:"tp-empty"},sZ=["role","onClick"],iZ={class:"tp-name"},rZ={class:"tp-time"},lZ=["onClick"],aZ={key:0,class:"tp-detail"},cZ={key:0,class:"tp-codebox"},uZ=["onClick"],dZ={class:"tp-pre"},fZ={class:"tp-cmd"},pZ={key:1,class:"tp-codebox"},hZ=["onClick"],mZ={class:"tp-pre"},gZ=Ve({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Nt(),s=No(new Set),i=No(new Set),r=No(new Set);function l(p){return!!(p.output&&p.output.length>0||p.meta)}function a(p){if(p.kind==="subagent"){n("open",p.id);return}l(p)&&(s.has(p.id)?s.delete(p.id):s.add(p.id))}function c(p){return p.kind==="subagent"||l(p)}function u(p){return p==="run"||p==="done"||p==="fail"?p:"pending"}async function d(p,m,b){await Wo(p)&&(b.add(m),setTimeout(()=>b.delete(m),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const m=p.output?.join(`
|
|
256
|
+
`)??"";m&&await d(m,p.id,r)}return(p,m)=>(w(),N("div",ZQ,[T("div",JQ,[T("span",eZ,R(A(o)("tasks.tag")),1),T("span",tZ,R(e.tasks.length),1)]),T("div",nZ,[e.tasks.length===0?(w(),N("div",oZ,R(A(o)("tasks.emptyTasks")),1)):(w(!0),N(Oe,{key:1},st(e.tasks,b=>(w(),N("div",{key:b.id,class:De(["tp-row",{done:b.state==="done",fail:b.state==="fail",expandable:c(b)}])},[T("div",{class:"tp-main",role:c(b)?"button":void 0,onClick:_=>a(b)},[se(p3,{status:u(b.state)},null,8,["status"]),T("span",iZ,R(b.name),1),se($o,{variant:"neutral",size:"sm"},{default:ke(()=>[je(R(b.kind),1)]),_:2},1024),T("span",rZ,R(b.timing),1),b.state==="run"?(w(),N("button",{key:0,class:"tp-stop",onClick:yt(_=>n("cancel",b.id),["stop"])},R(A(o)("tasks.stop")),9,lZ)):ie("",!0),b.kind==="subagent"?(w(),ge(Je,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(b)?(w(),ge(Je,{key:2,class:De(["tp-chevron",{open:s.has(b.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):ie("",!0)],8,sZ),s.has(b.id)&&l(b)?(w(),N("div",aZ,[b.meta?(w(),N("div",cZ,[T("button",{class:De(["tp-copy",{copied:i.has(b.id)}]),onClick:yt(_=>f(b),["stop"])},R(i.has(b.id)?"已复制":"复制"),11,uZ),T("pre",dZ,[T("code",null,[T("span",fZ,R(b.meta),1)])])])):ie("",!0),b.output&&b.output.length>0?(w(),N("div",pZ,[T("button",{class:De(["tp-copy",{copied:r.has(b.id)}]),onClick:yt(_=>h(b),["stop"])},R(r.has(b.id)?"已复制":"复制"),11,hZ),T("pre",mZ,[T("code",null,[m[0]||(m[0]=je(`
|
|
257
|
+
`,-1)),(w(!0),N(Oe,null,st(b.output,(_,g)=>(w(),N("span",{key:g,class:"tp-line"},R(_),1))),128)),m[1]||(m[1]=je(`
|
|
258
|
+
`,-1))])])])):ie("",!0)])):ie("",!0)],2))),128))])]))}}),_S=ft(gZ,[["__scopeId","data-v-28fd5fc0"]]),vZ={class:"todo-card"},yZ={key:0,class:"tc-empty"},kZ={class:"tc-name"},bZ=Ve({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Nt();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(w(),N("div",vZ,[t.todos.length===0?(w(),N("div",yZ,[i[0]||(i[0]=T("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[T("path",{d:"M9 11l2 2 4-4"}),T("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),T("span",null,R(A(n)("tasks.emptyTodo")),1)])):ie("",!0),(w(!0),N(Oe,null,st(t.todos,(r,l)=>(w(),N("div",{key:l,class:De(["tc-row",`s-${r.status}`])},[se(p3,{status:o(r.status)},null,8,["status"]),T("span",kZ,R(r.title),1)],2))),128))]))}}),_Z=ft(bZ,[["__scopeId","data-v-5ad486e3"]]),wZ=["disabled","aria-pressed"],SZ=Ve({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(w(),N("button",{key:0,class:De(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[An(t.$slots,"default",{},void 0,!0)],10,wZ)):(w(),N("span",{key:1,class:De(["ui-pill",{"is-active":e.active}])},[An(t.$slots,"default",{},void 0,!0)],2))}}),Vg=ft(SZ,[["__scopeId","data-v-317ace1a"]]),CZ={class:"dock-work-head"},xZ={key:0,class:"dock-work-tab static"},AZ={key:1,class:"dock-work-tab static"},TZ={key:2,class:"dock-work-tab static"},MZ={class:"dock-work-body"},EZ={class:"dw-count"},IZ={class:"dw-count"},$Z={class:"dw-count"},NZ=Ve({__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:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=Nt(),r=Z(null),l=Z(null),a=Z(null);function c(f){r.value?.loadForEdit(f)}function u(){r.value?.focus()}function d(f){if(!o.dockPanel)return;const h=f.target;h&&(l.value?.contains(h)||a.value?.contains(h)||s("close-dock-panel"))}return Ge(()=>o.dockPanel,f=>{typeof document>"u"||(document.removeEventListener("mousedown",d,!0),f&&document.addEventListener("mousedown",d,!0))},{immediate:!0}),_n(()=>{typeof document<"u"&&document.removeEventListener("mousedown",d,!0)}),t({loadForEdit:c,focus:u}),(f,h)=>(w(),N("div",{class:De(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:h[28]||(h[28]=yt(()=>{},["stop"]))},[se(Kr,{name:"dock-panel"},{default:ke(()=>[e.dockPanel?(w(),N("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:h[3]||(h[3]=yt(()=>{},["stop"]))},[T("div",CZ,[e.dockPanel==="bash"?(w(),N("span",xZ,R(A(i)("tasks.dockBash"))+" · "+R(e.bashRunning)+" "+R(A(i)("tasks.running")),1)):e.dockPanel==="subagent"?(w(),N("span",AZ,R(A(i)("tasks.dockSubagent"))+" · "+R(e.subagentRunning)+" "+R(A(i)("tasks.running")),1)):e.dockPanel==="todos"?(w(),N("span",TZ,R(A(i)("tasks.dockTodos"))+" · "+R(e.todoDoneCount)+"/"+R(e.todos?.length??0),1)):ie("",!0)]),T("div",MZ,[e.dockPanel==="bash"?(w(),ge(_S,{key:0,tasks:e.bashTasks,onCancel:h[0]||(h[0]=p=>s("cancelTask",p))},null,8,["tasks"])):e.dockPanel==="subagent"?(w(),ge(_S,{key:1,tasks:e.subagentTasks,onCancel:h[1]||(h[1]=p=>s("cancelTask",p)),onOpen:h[2]||(h[2]=p=>s("openAgent",p))},null,8,["tasks"])):e.dockPanel==="todos"?(w(),ge(_Z,{key:2,todos:e.todos??[]},null,8,["todos"])):ie("",!0)])],512)):ie("",!0)]),_:1}),e.goal?(w(),ge(IX,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:h[4]||(h[4]=p=>s("controlGoal",p))},null,8,["goal","force-expanded"])):ie("",!0),e.hasDockWork?(w(),N("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(w(),ge(Vg,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:h[5]||(h[5]=p=>s("toggle-dock-panel","bash"))},{default:ke(()=>[se(Je,{name:"clock",size:"md"}),T("span",null,R(A(i)("tasks.dockBash")),1),T("span",EZ,[h[29]||(h[29]=je("(",-1)),T("b",null,R(e.bashTasks.length),1),h[30]||(h[30]=je(")",-1))])]),_:1},8,["active","aria-pressed"])):ie("",!0),e.subagentTasks.length>0?(w(),ge(Vg,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:h[6]||(h[6]=p=>s("toggle-dock-panel","subagent"))},{default:ke(()=>[se(Je,{name:"sparkles",size:"md"}),T("span",null,R(A(i)("tasks.dockSubagent")),1),T("span",IZ,[h[31]||(h[31]=je("(",-1)),T("b",null,R(e.subagentTasks.length),1),h[32]||(h[32]=je(")",-1))])]),_:1},8,["active","aria-pressed"])):ie("",!0),(e.todos?.length??0)>0?(w(),ge(Vg,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:h[7]||(h[7]=p=>s("toggle-dock-panel","todos"))},{default:ke(()=>[se(Je,{name:"check-list",size:"md"}),T("span",null,R(A(i)("tasks.dockTodos")),1),T("span",$Z,[h[33]||(h[33]=je("(",-1)),T("b",null,R(e.todoDoneCount)+"/"+R(e.todos?.length??0),1),h[34]||(h[34]=je(")",-1))])]),_:1},8,["active","aria-pressed"])):ie("",!0)],512)):ie("",!0),e.pendingQuestion?(w(),ge(oQ,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:h[8]||(h[8]=(p,m)=>s("answer",p,m)),onDismiss:h[9]||(h[9]=p=>s("dismiss",p))},null,8,["question","busy-kind"])):e.pendingApproval?(w(),ge(XQ,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:h[10]||(h[10]=p=>s("approval",e.pendingApproval.approvalId,p))},null,8,["block","agent-name","busy"])):(w(),ge(f3,{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:h[11]||(h[11]=p=>s("submit",p)),onSteer:h[12]||(h[12]=p=>s("steer",p)),onCommand:h[13]||(h[13]=p=>s("command",p)),onInterrupt:h[14]||(h[14]=p=>s("interrupt")),onSetPermission:h[15]||(h[15]=p=>s("setPermission",p)),onSetThinking:h[16]||(h[16]=p=>s("setThinking",p)),onTogglePlan:h[17]||(h[17]=p=>s("togglePlan")),onToggleSwarm:h[18]||(h[18]=p=>s("toggleSwarm")),onToggleGoal:h[19]||(h[19]=p=>s("toggleGoal")),onOpenBtw:h[20]||(h[20]=p=>s("openBtw")),onCreateGoal:h[21]||(h[21]=p=>s("createGoal",p)),onControlGoal:h[22]||(h[22]=p=>s("controlGoal",p)),onFocusGoal:h[23]||(h[23]=p=>s("focusGoal")),onFocusSwarm:h[24]||(h[24]=p=>s("focusSwarm")),onCompact:h[25]||(h[25]=p=>s("compact")),onPickModel:h[26]||(h[26]=p=>s("pickModel")),onSelectModel:h[27]||(h[27]=p=>s("selectModel",p))},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))}}),LZ=ft(NZ,[["__scopeId","data-v-c6b691c5"]]),OZ=["aria-label","aria-hidden"],PZ={class:"toc-scroll"},RZ=["onClick"],DZ={class:"toc-label"},BZ=240,FZ=Ve({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=Z(null),r=Z(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=BZ}const c=W(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Ge(c,u=>{l?.disconnect(),l=null,u&>(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),vo(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(w(),N("nav",{key:0,ref_key:"navRef",ref:i,class:De(["conversation-toc",{"toc-clipped":!r.value}]),"aria-label":A(s)("conversation.toc"),"aria-hidden":r.value?void 0:!0},[T("div",PZ,[(w(!0),N(Oe,null,st(e.items,f=>(w(),N("button",{key:f.id,type:"button",class:De(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>o("select",f.id)},[d[0]||(d[0]=T("span",{class:"toc-bar"},null,-1)),T("span",DZ,R(f.title),1)],10,RZ))),128))])],10,OZ)):ie("",!0)}}),HZ=ft(FZ,[["__scopeId","data-v-0a2a2a96"]]),WZ=5;function zZ(e,t,n,o=WZ){if(n||e.length<=o)return e;const s=e.slice(0,o);if(t&&!s.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(s[o-1]=i)}return s}const UZ={class:"chat-layout"},qZ={class:"empty-hint"},jZ={class:"empty-hint-title"},VZ={class:"empty-hint-text"},KZ={key:0,class:"ws-pick"},GZ={class:"ws-pick-name"},YZ={key:1,class:"ws-pick-menu"},XZ=["onClick"],QZ={class:"ws-pick-item-name"},ZZ={class:"ws-pick-item-path"},JZ={key:0,class:"swarm-stack"},eJ=["aria-label"],tJ={key:0,class:"abort-toast",role:"status","aria-live":"polite"},nJ={class:"abort-toast-text"},Kg=80,wS=1e3,oJ=420,sJ=3e3,iJ=Ve({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},swarms:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},fastMoon:{type:Boolean},mobile:{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:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=Z(!1),r=Z(!1),l=W(()=>o.workspaces?.find(_e=>_e.id===o.activeWorkspaceId)?.name??o.workspaceName??""),a=W(()=>(o.workspaces?.length??0)>0),c=W(()=>zZ(o.workspaces??[],o.activeWorkspaceId,r.value)),u=W(()=>(o.workspaces?.length??0)-c.value.length);Ge(i,Ie=>{Ie||(r.value=!1)});const d=W(()=>o.swarms?.filter(Ie=>Ie.members.some(_e=>_e.phase!=="completed"&&_e.phase!=="failed"))??[]);function f(Ie){i.value=!1,Ie!==o.activeWorkspaceId&&s("selectWorkspace",Ie)}const{t:h}=Nt();sc($t.contentAlign);const p=Z(null),m=Z(null),b=Z(null),_=Z(!1),g=Z(0);let v=null;function y(Ie){(b.value??m.value)?.loadForEdit(Ie)}function C(){_.value=!0,v!==null&&clearTimeout(v),v=setTimeout(()=>{v=null,_.value=!1},2e3)}function L(){g.value++}function $(){gt(()=>{Fe.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const k=W(()=>o.tasks.filter(Ie=>Ie.kind!=="subagent")),M=W(()=>o.tasks.filter(Ie=>Ie.kind==="subagent"&&Ie.runInBackground)),E=W(()=>k.value.filter(Ie=>Ie.state==="run").length),O=W(()=>M.value.filter(Ie=>Ie.state==="run").length);function S(Ie){const _e=o.tasks,Re=_e.find(Ut=>Ut.id===Ie)??_e.find(Ut=>Ut.parentToolCallId===Ie);if(Re)return Re.id;const on=_e.filter(Ut=>Ut.kind==="subagent"&&!Ut.parentToolCallId);if(on.length===1)return on[0].id}On("resolveAgentTaskId",S);const I=W(()=>(o.todos??[]).filter(Ie=>Ie.status==="done").length),P=W(()=>k.value.length>0||M.value.length>0||(o.todos?.length??0)>0||(o.queued?.length??0)>0),D=Z(null),H=W(()=>o.gitInfo?o.changes?.length??0:0);function z(Ie){D.value=D.value===Ie?null:Ie}function U(){D.value=null}Ge(P,Ie=>{Ie||U()});function Q(Ie){if(Ie.role==="compaction")return h("conversation.compactedPlain");if(Ie.role==="user"){if(Ie.skillActivation)return`/${Ie.skillActivation.name}`;if(Ie.pluginCommand)return`/${Ie.pluginCommand.pluginId}:${Ie.pluginCommand.commandName}`;const Re=Ie.text.trim().replaceAll(/\s+/g," ");return Re.length>0?Re:"user"}const _e=(Ie.text||Ie.thinking||"").trim().replaceAll(/\s+/g," ");return _e.length>0?_e:(Ie.tools?.length??0)>0?`${Ie.tools.length} tools`:"kimi"}const X=W(()=>o.turns.filter(Ie=>Ie.role==="user").map((Ie,_e)=>({id:Ie.id,role:Ie.role,no:_e+1,title:Q(Ie)}))),ue=Z(null);function me(){const Ie=Fe.value;if(!Ie)return;const _e=Ie.querySelectorAll(".turn-anchor[data-turn-id]");if(_e.length===0)return;const Re=X.value;if(Re.length===0)return;const on=new Set(Re.map(gs=>gs.id));if(j()<=Kg){ue.value=Re[Re.length-1].id;return}const Ut=Ie.getBoundingClientRect(),fo=Ut.height/2;let Hn=null;_e.forEach(gs=>{const ni=gs.dataset.turnId;if(!ni||!on.has(ni))return;gs.getBoundingClientRect().top-Ut.top<=fo&&(Hn=ni)}),ue.value=Hn??Re[0].id}const Ae=W(()=>o.questions&&o.questions.length>0?o.questions[0]:void 0),be=W(()=>{const Ie=Ae.value;if(Ie)return o.pendingQuestionActions?.[Ie.questionId]}),ze=W(()=>o.approvals&&o.approvals.length>0?o.approvals[0]:void 0),qe=W(()=>{const Ie=ze.value;return Ie?!!o.pendingApprovalActions?.[Ie.approvalId]:!1}),Fe=Z(null),Le=Z(null),le=Z(0),F=Z(0),te=W(()=>({"--panes-scrollbar-width":`${le.value}px`}));function ee(Ie){return Ie instanceof HTMLElement?Ie:Ie&&"$el"in Ie&&Ie.$el instanceof HTMLElement?Ie.$el:null}function q(){const Ie=Fe.value;le.value=Ie?Math.max(0,Ie.offsetWidth-Ie.clientWidth):0,F.value=Le.value?.offsetHeight??0}function Y(Ie){const _e=ee(Ie);Fe.value=_e,_e&&wo()}function de(Ie){const _e=ee(Ie);Le.value=_e??null,Ie&&"loadForEdit"in Ie&&typeof Ie.loadForEdit=="function"&&"focus"in Ie&&typeof Ie.focus=="function"?b.value={loadForEdit:Ie.loadForEdit.bind(Ie),focus:Ie.focus.bind(Ie)}:b.value=null,mn()}const ne=Z(!0),ce=Z(!1);function j(){const Ie=Fe.value;return Ie?Ie.scrollHeight-Ie.scrollTop-Ie.clientHeight:0}let G=0,re=0,he=0,Ce=0,Ee=0,ae=0;function xe(){return Date.now()<re}function Ke(){const Ie=Fe.value;if(!Ie)return;const _e=Ie.scrollTop;if(performance.now()-he<100){G=_e;return}const Re=j();if(xe()){ne.value=!0,ce.value=!1,G=_e;return}_e<G-1&&Re>1?ne.value=!1:Re<=Kg&&_e>G+1&&(ne.value=!0,ce.value=!1),G=_e,me()}function ot(Ie=!1){const _e=Fe.value;ne.value=!0,ce.value=!1,_e&&(!Ie&&performance.now()<Ce||(Ie&&typeof _e.scrollTo=="function"?(he=performance.now(),Ce=performance.now()+oJ,_e.scrollTo({top:_e.scrollHeight,behavior:"smooth"})):_e.scrollTop=_e.scrollHeight,G=_e.scrollTop))}function _t(Ie,_e){const Re=Ie.querySelectorAll(".turn-anchor");for(const on of Re)if(on.offsetTop>=_e){const Ut=on.dataset.turnId;if(Ut)return{id:Ut,top:on.offsetTop}}return null}async function wt(){if(!o.sessionId||!o.loadOlderMessages||o.loadingMore||!o.hasMoreMessages)return;const Ie=o.sessionId,_e=Fe.value,Re=_e?.scrollTop??0,on=_e?.scrollHeight??0,Ut=_e?_t(_e,Re):null;eo.value=!0;try{await o.loadOlderMessages(Ie),await gt()}finally{eo.value=!1}if(o.sessionId!==Ie)return;const fo=Fe.value;if(!fo)return;let Hn=0;if(Ut){const gs=fo.querySelector(`.turn-anchor[data-turn-id="${It(Ut.id)}"]`);gs&&(Hn=gs.offsetTop-Ut.top)}Hn===0&&(Hn=fo.scrollHeight-on),fo.scrollTop=Re+Hn}function It(Ie){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ie):Ie.replaceAll(/["\\]/g,"\\$&")}function Pt(Ie){const _e=Fe.value;if(!_e)return;const Re=_e.querySelector(`.turn-anchor[data-turn-id="${It(Ie)}"]`);Re&&(ne.value=!1,ce.value=j()>Kg,Re.scrollIntoView({behavior:"smooth",block:"center"}))}function bt(){const Ie=Fe.value;if(!Ie)return"none";const _e=Ie.firstElementChild,Re=_e instanceof HTMLElement?_e.offsetHeight:0,on=Le.value?.offsetHeight??0;return`${Ie.scrollHeight}:${Ie.clientHeight}:${Re}:${on}`}function Kt(Ie){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ie):setTimeout(Ie,16)}function Dn(Ie){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ie):clearTimeout(Ie)}function In(Ie=36){if(!ne.value&&!xe())return;const _e=++ae;let Re="",on=0,Ut=0;Ee&&(Dn(Ee),Ee=0);const fo=()=>{if(Ee=0,_e!==ae||!ne.value&&!xe())return;ot(!1);const Hn=bt();on=Hn===Re?on+1:0,Re=Hn,Ut++,on<3&&Ut<Ie&&(Ee=Kt(fo))};Ee=Kt(fo)}function Dt(Ie,_e){return Ie!==void 0&&Ie.length>0&&_e.length>=Ie.length&&Ie.firstId!==_e.firstId&&Ie.lastId===_e.lastId&&Ie.lastTextLen===_e.lastTextLen&&Ie.lastThinkingLen===_e.lastThinkingLen&&Ie.lastToolsLen===_e.lastToolsLen&&Ie.approvalIds===_e.approvalIds}const pn=W(()=>{const Ie=(o.approvals??[]).map(fo=>fo.approvalId).join(","),_e=o.turns,Re=_e.at(-1),on=Re?.thinking?.length??0,Ut=Re?.tools?.reduce((fo,Hn)=>fo+Hn.name.length+(Hn.arg?.length??0)+(Hn.output?.join("").length??0),0)??0;return{length:_e.length,firstId:_e[0]?.id??"",lastId:Re?.id??"",lastTextLen:Re?.text.length??0,lastThinkingLen:on,lastToolsLen:Ut,approvalIds:Ie}});Ge(pn,async(Ie,_e)=>{if(eo.value&&Dt(_e,Ie)){me();return}await gt(),ne.value||xe()?ot(Ie.length<_e.length):ce.value=!0,me()}),Ge(Le,()=>{mn()}),Ge(()=>o.mobile,async()=>{await gt(),q()});const Kn=new Map;Ge(()=>o.fileReloadKey,async(Ie,_e)=>{const Re=Fe.value;_e&&Re&&Kn.set(String(_e),{top:Re.scrollTop,following:ne.value}),await gt();const on=Fe.value,Ut=Ie?Kn.get(String(Ie)):void 0;Ut&&on?(ne.value=Ut.following,on.scrollTop=Ut.top,G=Ut.top,Ut.following&&In()):(ne.value=!0,G=0,ot(!1),In()),me()}),Ge(()=>o.sessionLoading,async(Ie,_e)=>{Ie||!_e||(ne.value=!0,await gt(),In(),me())}),Ge(()=>o.running,async(Ie,_e)=>{Ie||!_e||!ne.value&&!xe()||(await gt(),In(48),me())});function nt(){ne.value=!0,ce.value=!1,re=Date.now()+wS,gt(()=>{ot(!0),In(16)})}function wn(Ie){nt(),s("submit",Ie)}function hn(Ie){ne.value=!0,ce.value=!1,re=Date.now()+wS,s("editMessage",Ie)}function Bn(Ie){const _e=o.queued?.[Ie]?.text??"";_e&&y(_e),s("editQueued",Ie)}function Gn(Ie){s("reorderQueue",Ie)}function Ye(Ie,_e){nt(),s("answer",Ie,_e)}function Xe(Ie,_e){!Ie||!_e||s("approval",Ie,_e)}let At=null,Lt=null,$n=null,cn=null,Nn=0,Fn=!1;const eo=Z(!1);function Mt(Ie){if(eo.value||(Fn=Fn||Ie,Nn))return;Nn=(typeof requestAnimationFrame=="function"?requestAnimationFrame:Re=>setTimeout(Re,16))(()=>{Nn=0;const Re=Fn;Fn=!1,ne.value||xe()?ot(!1):Re&&(ce.value=!0)})}function Yn(){if(!Lt)return;const Ie=Fe.value?.firstElementChild??null;Ie!==$n&&($n&&Lt.unobserve($n),$n=Ie,Ie&&Lt.observe(Ie))}function mn(){if(!Lt)return;const Ie=Le.value;Ie!==cn&&(cn&&Lt.unobserve(cn),cn=Ie,Ie&&Lt.observe(Ie))}function wo(){const Ie=Fe.value;q(),At&&(At.disconnect(),Ie&&At.observe(Ie,{childList:!0,subtree:!0,characterData:!0})),Lt&&(Lt.disconnect(),$n=null,cn=null,Ie&&Lt.observe(Ie),Yn(),mn())}function ei(){Yn(),Mt(!0)}function Ns(){typeof document>"u"||document.visibilityState==="visible"&&ne.value&&In()}const et=Z(!1);let it=null;function lt(){et.value=!0,it!==null&&clearTimeout(it),it=setTimeout(()=>{et.value=!1},sJ)}function pt(){lt(),s("interrupt")}function ti(Ie){Ie.key==="Escape"&&(o.running||o.sending)&&(Ie.preventDefault(),pt())}bn(()=>{gt(()=>{typeof MutationObserver=="function"&&(At=new MutationObserver(ei)),typeof ResizeObserver=="function"&&(Lt=new ResizeObserver(()=>{q(),Mt(!1)})),wo(),In(48),me(),typeof document<"u"&&(document.addEventListener("visibilitychange",Ns),document.addEventListener("keydown",ti))})}),_n(()=>{At&&At.disconnect(),Lt&&Lt.disconnect(),Nn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(Nn),Ee&&Dn(Ee),it!==null&&clearTimeout(it),v!==null&&(clearTimeout(v),v=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ns),document.removeEventListener("keydown",ti))});function mi(){(b.value??m.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:mi}),(Ie,_e)=>(w(),N("section",{class:De(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(w(),ge(IG,{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":H.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:_.value,onOpenChanges:_e[0]||(_e[0]=Re=>s("openChanges")),onCopyAll:_e[1]||(_e[1]=Re=>p.value?.copyConversation()),onCopyFinalSummary:_e[2]||(_e[2]=Re=>p.value?.copyFinalSummary()),onOpenPr:_e[3]||(_e[3]=Re=>e.pr&&s("openPr",e.pr.url)),onRenameSession:_e[4]||(_e[4]=(Re,on)=>s("renameSession",Re,on)),onForkSession:_e[5]||(_e[5]=Re=>s("forkSession",Re)),onArchiveSession:_e[6]||(_e[6]=Re=>s("archiveSession",Re))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ie("",!0),e.conversationToc?(w(),ge(HZ,{key:1,items:X.value,"active-turn-id":ue.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:Pt},null,8,["items","active-turn-id","mobile","session-loading"])):ie("",!0),T("div",UZ,[T("div",{ref:Y,class:"panes chat-scroll",onScrollPassive:Ke},[T("div",{class:De(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(w(),N(Oe,{key:0},[_e[54]||(_e[54]=T("div",{class:"empty-spacer"},null,-1)),T("div",qZ,[T("span",jZ,R(A(h)("composer.emptyConversationTitle")),1),T("span",VZ,R(A(h)("composer.emptyConversation")),1),a.value?(w(),N("div",KZ,[se(zt,{text:A(h)("conversation.switchWorkspace")},{default:ke(()=>[T("button",{type:"button",class:"ws-pick-btn",onClick:_e[7]||(_e[7]=yt(Re=>i.value=!i.value,["stop"]))},[se(Je,{name:"folder",size:"sm"}),T("span",GZ,R(l.value),1),se(Je,{class:De(["ws-pick-chev",{open:i.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),i.value?(w(),N("div",{key:0,class:"ws-pick-backdrop",onClick:_e[8]||(_e[8]=Re=>i.value=!1)})):ie("",!0),i.value?(w(),N("div",YZ,[(w(!0),N(Oe,null,st(c.value,Re=>(w(),N("button",{key:Re.id,type:"button",class:De(["ws-pick-item",{on:Re.id===e.activeWorkspaceId}]),onClick:yt(on=>f(Re.id),["stop"])},[T("span",QZ,R(Re.name),1),T("span",ZZ,R(Re.shortPath),1)],10,XZ))),128)),u.value>0?(w(),N("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:_e[9]||(_e[9]=yt(Re=>r.value=!r.value,["stop"]))},[T("span",null,R(A(h)("conversation.moreWorkspaces",{count:u.value})),1)])):ie("",!0),_e[53]||(_e[53]=T("div",{class:"ws-pick-divider"},null,-1)),T("button",{type:"button",class:"ws-pick-action",onClick:_e[10]||(_e[10]=yt(Re=>{i.value=!1,s("addWorkspace")},["stop"]))},[se(Je,{name:"plus",size:"sm"}),T("span",null,R(A(h)("conversation.addWorkspace")),1)])])):ie("",!0)])):(w(),N("button",{key:1,type:"button",class:"empty-add-workspace",onClick:_e[11]||(_e[11]=Re=>s("addWorkspace"))},[se(Je,{name:"folder-plus",size:"sm"}),T("span",null,R(A(h)("conversation.addWorkspace")),1)]))]),se(f3,{ref_key:"emptyComposerRef",ref:m,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:wn,onSteer:_e[12]||(_e[12]=Re=>s("steer",Re)),onCommand:_e[13]||(_e[13]=Re=>s("command",Re)),onInterrupt:pt,onUnqueue:_e[14]||(_e[14]=Re=>s("unqueue",Re)),onEditQueued:_e[15]||(_e[15]=Re=>s("editQueued",Re)),onSetPermission:_e[16]||(_e[16]=Re=>s("setPermission",Re)),onSetThinking:_e[17]||(_e[17]=Re=>s("setThinking",Re)),onTogglePlan:_e[18]||(_e[18]=Re=>s("togglePlan")),onToggleSwarm:_e[19]||(_e[19]=Re=>s("toggleSwarm")),onToggleGoal:_e[20]||(_e[20]=Re=>s("toggleGoal")),onOpenBtw:_e[21]||(_e[21]=Re=>s("command","/btw")),onCreateGoal:_e[22]||(_e[22]=Re=>s("createGoal",Re)),onControlGoal:_e[23]||(_e[23]=Re=>s("controlGoal",Re)),onFocusGoal:L,onFocusSwarm:$,onCompact:_e[24]||(_e[24]=Re=>s("compact")),onPickModel:_e[25]||(_e[25]=Re=>s("pickModel")),onSelectModel:_e[26]||(_e[26]=Re=>s("selectModel",Re))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),_e[55]||(_e[55]=T("div",{class:"empty-spacer"},null,-1))],64)):(w(),N(Oe,{key:1},[(w(),ge(a3,{ref_key:"chatPaneRef",ref:p,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,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":ne.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:_e[27]||(_e[27]=Re=>s("openFile",Re)),onOpenMedia:_e[28]||(_e[28]=Re=>s("openMedia",Re)),onCopyConversationCopied:C,onOpenThinking:_e[29]||(_e[29]=Re=>s("openThinking",Re)),onOpenCompaction:_e[30]||(_e[30]=Re=>s("openCompaction",Re)),onOpenAgent:_e[31]||(_e[31]=Re=>s("openAgent",Re)),onOpenToolDiff:_e[32]||(_e[32]=Re=>s("openToolDiff",Re)),onEditMessage:hn,onLoadOlderMessages:wt,onUnqueue:_e[33]||(_e[33]=Re=>s("unqueue",Re)),onEditQueued:Bn,onReorderQueue:Gn},null,8,["turns","approvals","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"])),d.value.length>0?(w(),N("div",JZ,[(w(!0),N(Oe,null,st(d.value,Re=>(w(),ge(gX,{key:Re.id,group:Re},null,8,["group"]))),128))])):ie("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?ie("",!0):(w(),ge(LZ,{key:0,ref:de,style:Yt(te.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":g.value,"dock-panel":D.value,"bash-tasks":k.value,"subagent-tasks":M.value,"bash-running":E.value,"subagent-running":O.value,"todo-done-count":I.value,"has-dock-work":P.value,todos:e.todos,"pending-question":Ae.value,"question-busy-kind":be.value,"pending-approval":ze.value,"approval-busy":qe.value,mobile:e.mobile,onToggleDockPanel:_e[34]||(_e[34]=Re=>z(Re)),onCloseDockPanel:_e[35]||(_e[35]=Re=>U()),onOpenAgent:_e[36]||(_e[36]=Re=>s("openAgent",Re)),onAnswer:Ye,onDismiss:_e[37]||(_e[37]=Re=>s("dismiss",Re)),onApproval:Xe,onCancelTask:_e[38]||(_e[38]=Re=>s("cancelTask",Re)),onControlGoal:_e[39]||(_e[39]=Re=>s("controlGoal",Re)),onSubmit:wn,onSteer:_e[40]||(_e[40]=Re=>s("steer",Re)),onCommand:_e[41]||(_e[41]=Re=>s("command",Re)),onInterrupt:pt,onSetPermission:_e[42]||(_e[42]=Re=>s("setPermission",Re)),onSetThinking:_e[43]||(_e[43]=Re=>s("setThinking",Re)),onTogglePlan:_e[44]||(_e[44]=Re=>s("togglePlan")),onToggleSwarm:_e[45]||(_e[45]=Re=>s("toggleSwarm")),onToggleGoal:_e[46]||(_e[46]=Re=>s("toggleGoal")),onOpenBtw:_e[47]||(_e[47]=Re=>s("command","/btw")),onCreateGoal:_e[48]||(_e[48]=Re=>s("createGoal",Re)),onFocusGoal:L,onFocusSwarm:$,onCompact:_e[49]||(_e[49]=Re=>s("compact")),onPickModel:_e[50]||(_e[50]=Re=>s("pickModel")),onSelectModel:_e[51]||(_e[51]=Re=>s("selectModel",Re))},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","question-busy-kind","pending-approval","approval-busy","mobile"]))]),se(Kr,{name:"pill"},{default:ke(()=>[ce.value?(w(),N("button",{key:0,class:"newmsg-pill",style:Yt({bottom:`${F.value+12}px`}),"aria-label":A(h)("conversation.jumpToLatestAria"),onClick:_e[52]||(_e[52]=Re=>ot(!0))},[se(Je,{class:"pill-chevron",name:"chevron-down",size:"md"}),je(" "+R(A(h)("conversation.newMessages")),1)],12,eJ)):ie("",!0)]),_:1}),se(Kr,{name:"abort-toast"},{default:ke(()=>[et.value?(w(),N("div",tJ,[T("span",nJ,R(A(h)("conversation.manuallyAborted")),1)])):ie("",!0)]),_:1})],2))}}),rJ=ft(iJ,[["__scopeId","data-v-b7070e01"]]),lJ=["aria-selected","onClick"],aJ=Ve({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(w(),N("div",{class:De(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(w(!0),N(Oe,null,st(e.options,i=>(w(),N("button",{key:i.value,class:De(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},R(i.label),11,lJ))),128))],2))}}),Xs=ft(aJ,[["__scopeId","data-v-d1aaccd7"]]),cJ={class:"ui-panel-header__title"},uJ={key:0,class:"ui-panel-header__sub"},dJ=Ve({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(w(),N("div",{class:De(["ui-panel-header",{wrap:e.wrap}])},[T("span",cJ,R(e.title),1),se(zt,{text:e.subtitle},{default:ke(()=>[e.subtitle?(w(),N("span",uJ,R(e.subtitle),1)):ie("",!0)]),_:1},8,["text"]),An(t.$slots,"default",{},void 0,!0),e.closable?(w(),ge(vn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:ke(()=>[se(Je,{name:"close",size:"sm"})]),_:1},8,["label"])):ie("",!0)],2))}}),Vl=ft(dJ,[["__scopeId","data-v-c47879ad"]]),fJ={key:0,class:"fp-empty fp-error"},pJ={key:1,class:"fp-empty"},hJ={key:2,class:"fp-loading"},mJ={class:"fp-path"},gJ={class:"fp-meta"},vJ={key:0,class:"fp-lines"},yJ={class:"fp-size"},kJ={key:3,class:"fp-search"},bJ=["placeholder"],_J={key:0,class:"fp-search-count"},wJ=["href","aria-label"],SJ={key:1,class:"fp-code"},CJ={class:"fp-line-table"},xJ=["data-line"],AJ={class:"fp-gutter"},TJ=["innerHTML"],MJ={key:1,class:"fp-body fp-code"},EJ={class:"fp-line-table"},IJ=["data-line"],$J={class:"fp-gutter"},NJ=["innerHTML"],LJ={key:2,class:"fp-body"},OJ=["srcdoc","title"],PJ={key:1,class:"fp-code"},RJ={class:"fp-line-table"},DJ=["data-line"],BJ={class:"fp-gutter"},FJ=["innerHTML"],HJ={key:3,class:"fp-body fp-pdf-wrap"},WJ=["src","title"],zJ={key:1,class:"fp-binary-card"},UJ={class:"fp-binary-label"},qJ={key:4,class:"fp-body fp-table-wrap"},jJ={class:"fp-table"},VJ=["data-line"],KJ={key:5,class:"fp-body fp-image-wrap"},GJ=["src","alt"],YJ={key:1,class:"fp-binary-card"},XJ={class:"fp-binary-icon"},QJ={class:"fp-binary-label"},ZJ={key:6,class:"fp-body fp-code"},JJ={class:"fp-line-table"},eee=["data-line"],tee={class:"fp-gutter"},nee=["innerHTML"],oee={key:7,class:"fp-body fp-binary-wrap"},see={class:"fp-binary-card"},iee={class:"fp-binary-icon"},ree={class:"fp-binary-label"},lee=Ve({__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}=Nt();function o(le,F){const te=F?F.split("/").filter(Boolean):[];for(const ee of le.split("/"))ee===""||ee==="."||(ee===".."?te.pop():te.push(ee));return te.join("/")}const s=jt("resolveImage",async le=>le),i=W(()=>{const le=c.file?.path??"",F=le.lastIndexOf("/");return F>0?le.slice(0,F):""});function r(le){if(/^(https?:|data:|blob:)/i.test(le)||le.startsWith("/"))return le;const F=i.value;return F?o(le,F):le}async function l(le){const F=r(le);return s?s(F):F}On("resolveImage",l);function a(le){let F=le.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(F)||F.startsWith("/"))return le;for(const ee of["#","?"]){const q=F.indexOf(ee);q!==-1&&(F=F.slice(0,q))}const te=i.value;return{...le,path:o(F,te)}}const c=e,u=t;function d(le){c.openFile?.(a(le))}const f=Z(null),h=W(()=>{const le=c.file;if(!le)return"binary";const F=le.mime??"",te=le.languageId??"",ee=le.path.toLowerCase();return F==="text/markdown"||te==="markdown"||te==="md"||ee.endsWith(".mdx")?"markdown":F==="application/json"||te==="json"?"json":F==="text/html"||te==="html"||ee.endsWith(".html")||ee.endsWith(".htm")?"html":F==="application/pdf"||ee.endsWith(".pdf")?"pdf":F==="text/csv"||te==="csv"||ee.endsWith(".csv")?"csv":F.startsWith("image/")?"image":le.isBinary?"binary":F.startsWith("text/")||te!==""?"text":"binary"});function p(le){const F=atob(le),te=Uint8Array.from(F,ee=>ee.charCodeAt(0));return new TextDecoder().decode(te)}const m=W(()=>{const le=c.file;if(!le)return"";if(le.encoding==="base64")try{return p(le.content)}catch{return le.content}return le.content}),b=W(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),_=W(()=>c.file?(h.value==="json"?b.value:m.value).split(`
|
|
259
|
+
`):[]),g=W(()=>c.file?h.value==="json"?b.value:m.value:""),v=Z(""),y=Z(0),C=W(()=>{const le=v.value.trim().toLowerCase();if(!le)return[];const F=[];return _.value.forEach((te,ee)=>{te.toLowerCase().includes(le)&&F.push(ee+1)}),F});Ge(v,()=>{y.value=0});function L(le,F=!1){le&>(()=>{const te=f.value?.querySelector(".fp-body"),ee=te?.querySelector(`[data-line="${le}"]`);if(!te||!ee)return;F&&(te.scrollTop=0);const q=te.getBoundingClientRect(),Y=ee.getBoundingClientRect(),de=Y.top-q.top+te.scrollTop;te.scrollTop=de-te.clientHeight/2+Y.height/2})}Ge(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function $(le){const F=C.value;F.length!==0&&(y.value=(y.value+le+F.length)%F.length,L(F[y.value]))}function k(le){const F=C.value;return{target:c.line===le,hit:F.includes(le),active:F[y.value]===le}}function M(le){return le<1024?`${le} B`:le<1024*1024?`${(le/1024).toFixed(1)} KB`:`${(le/(1024*1024)).toFixed(1)} MB`}const E=Z(!1),O=Z(!1);function S(){c.file&&Wo(g.value).then(le=>{le&&(E.value=!0,setTimeout(()=>{E.value=!1},1400))})}function I(){c.file&&Wo(c.file.path).then(le=>{le&&(O.value=!0,setTimeout(()=>{O.value=!1},1400))})}const P=Z("preview"),D=Z("preview"),H=Z("fit");function z(le){P.value=le}function U(le){D.value=le}function Q(le){H.value=le}Ge(h,le=>{P.value=le==="html"?"preview":"source",D.value="preview",H.value="fit"});const X=W(()=>{const le=c.file;return!le||h.value!=="image"?null:le.sourceUrl?le.sourceUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:le.mime==="image/svg+xml"?`data:${le.mime};charset=utf-8,${encodeURIComponent(le.content)}`:null}),ue=W(()=>{const le=c.file;return!le||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:null}),me=W(()=>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:;">`,m.value].join(""):"");function Ae(le){const F=[];let te="",ee=!1;for(let q=0;q<le.length;q++){const Y=le[q];Y==='"'&&le[q+1]==='"'?(te+='"',q++):Y==='"'?ee=!ee:Y===","&&!ee?(F.push(te),te=""):te+=Y}return F.push(te),F}const be=W(()=>_.value.slice(0,200).map(Ae));function ze(le){return le.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function qe(){const le=c.file;if(!le)return"";const F=le.languageId?.toLowerCase();return F||(le.path.split(".").pop()?.toLowerCase()??"")}function Fe(le){const F=qe();let te=ze(le);return h.value==="json"||F==="json"||F==="jsonc"?(te=te.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),te=te.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),te=te.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),te=te.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),te):h.value==="html"||F==="html"||F==="xml"||F==="svg"?(te=te.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),te=te.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),te=te.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),te):(te=te.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>'),te=te.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),te=te.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),te)}function Le(le,F=55){return!le||le.length<=F?le:"…"+le.slice(le.length-F+1)}return(le,F)=>(w(),N("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(w(),N("div",fJ,[T("span",null,R(e.error),1),e.closable?(w(),ge(Rt,{key:0,variant:"secondary",size:"sm",onClick:F[0]||(F[0]=te=>u("close"))},{default:ke(()=>[je(R(A(n)("filePreview.close")),1)]),_:1})):ie("",!0)])):!e.file&&!e.loading?(w(),N("div",pJ,R(A(n)("filePreview.empty")),1)):e.loading?(w(),N("div",hJ,[F[7]||(F[7]=T("span",{class:"spinner"},null,-1)),T("span",null,R(A(n)("filePreview.loading")),1)])):e.file?(w(),N(Oe,{key:3},[se(Vl,{wrap:"",title:A(n)("common.preview"),closable:e.closable,"close-label":A(n)("filePreview.close"),onClose:F[6]||(F[6]=te=>u("close"))},{default:ke(()=>[se(zt,{text:e.file.path},{default:ke(()=>[T("span",mJ,R(Le(e.file.path)),1)]),_:1},8,["text"]),T("span",gJ,[e.file.lineCount?(w(),N("span",vJ,R(A(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ie("",!0),T("span",yJ,R(M(e.file.size)),1)]),h.value==="html"?(w(),ge(Xs,{key:0,"model-value":P.value,size:"sm",options:[{value:"preview",label:A(n)("filePreview.preview")},{value:"source",label:A(n)("filePreview.source")}],"onUpdate:modelValue":z},null,8,["model-value","options"])):ie("",!0),h.value==="markdown"?(w(),ge(Xs,{key:1,"model-value":D.value,size:"sm",options:[{value:"preview",label:A(n)("filePreview.preview")},{value:"source",label:A(n)("filePreview.source")}],"onUpdate:modelValue":U},null,8,["model-value","options"])):ie("",!0),h.value==="image"?(w(),ge(Xs,{key:2,"model-value":H.value,size:"sm",options:[{value:"fit",label:A(n)("filePreview.fit")},{value:"actual",label:A(n)("filePreview.actual")}],"onUpdate:modelValue":Q},null,8,["model-value","options"])):ie("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(w(),N("div",kJ,[En(T("input",{"onUpdate:modelValue":F[1]||(F[1]=te=>v.value=te),class:"fp-search-input",type:"search",placeholder:A(n)("filePreview.search")},null,8,bJ),[[ms,v.value]]),v.value.trim()?(w(),N("span",_J,R(C.value.length),1)):ie("",!0),se(vn,{size:"sm",disabled:C.value.length===0,label:A(n)("filePreview.prevMatch"),onClick:F[2]||(F[2]=te=>$(-1))},{default:ke(()=>[se(Je,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),se(vn,{size:"sm",disabled:C.value.length===0,label:A(n)("filePreview.nextMatch"),onClick:F[3]||(F[3]=te=>$(1))},{default:ke(()=>[se(Je,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):ie("",!0),se(vn,{size:"sm",class:De({copied:O.value}),label:O.value?A(n)("filePreview.copied"):A(n)("filePreview.copyPath"),onClick:I},{default:ke(()=>[O.value?(w(),ge(Je,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),ge(Je,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(w(),ge(vn,{key:4,size:"sm",label:A(n)("filePreview.openInEditor"),onClick:F[4]||(F[4]=te=>u("openExternal"))},{default:ke(()=>[se(Je,{name:"external-link",size:"md"})]),_:1},8,["label"])):ie("",!0),e.externalActions?(w(),ge(vn,{key:5,size:"sm",label:A(n)("filePreview.reveal"),onClick:F[5]||(F[5]=te=>u("reveal"))},{default:ke(()=>[se(Je,{name:"folder",size:"md"})]),_:1},8,["label"])):ie("",!0),e.downloadUrl?(w(),N("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":A(n)("filePreview.download")},[se(Je,{name:"download",size:"md"})],8,wJ)):ie("",!0),!e.file.isBinary&&h.value!=="image"?(w(),ge(vn,{key:7,size:"sm",class:De({copied:E.value}),label:E.value?A(n)("filePreview.copied"):A(n)("filePreview.copy"),onClick:S},{default:ke(()=>[E.value?(w(),ge(Je,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),ge(Je,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):ie("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(w(),N("div",{key:0,class:De(["fp-body",{"fp-markdown":D.value==="preview"}])},[D.value==="preview"?(w(),ge(Ih,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(w(),N("div",SJ,[T("div",CJ,[(w(!0),N(Oe,null,st(_.value,(te,ee)=>(w(),N("div",{key:ee,class:De(["fp-line-row",k(ee+1)]),"data-line":ee+1},[T("span",AJ,R(ee+1),1),T("span",{class:"fp-line-text",innerHTML:Fe(te)},null,8,TJ)],10,xJ))),128))])]))],2)):h.value==="json"?(w(),N("div",MJ,[T("div",EJ,[(w(!0),N(Oe,null,st(_.value,(te,ee)=>(w(),N("div",{key:ee,class:De(["fp-line-row",k(ee+1)]),"data-line":ee+1},[T("span",$J,R(ee+1),1),T("span",{class:"fp-line-text",innerHTML:Fe(te)},null,8,NJ)],10,IJ))),128))])])):h.value==="html"?(w(),N("div",LJ,[P.value==="preview"?(w(),N("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:me.value,title:e.file.path},null,8,OJ)):(w(),N("div",PJ,[T("div",RJ,[(w(!0),N(Oe,null,st(_.value,(te,ee)=>(w(),N("div",{key:ee,class:De(["fp-line-row",k(ee+1)]),"data-line":ee+1},[T("span",BJ,R(ee+1),1),T("span",{class:"fp-line-text",innerHTML:Fe(te)},null,8,FJ)],10,DJ))),128))])]))])):h.value==="pdf"?(w(),N("div",HJ,[ue.value?(w(),N("iframe",{key:0,class:"fp-pdf-frame",src:ue.value,title:e.file.path},null,8,WJ)):(w(),N("div",zJ,[T("span",UJ,R(A(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(w(),N("div",qJ,[T("table",jJ,[T("tbody",null,[(w(!0),N(Oe,null,st(be.value,(te,ee)=>(w(),N("tr",{key:ee,class:De(k(ee+1)),"data-line":ee+1},[T("th",null,R(ee+1),1),(w(!0),N(Oe,null,st(te,(q,Y)=>(w(),N("td",{key:Y},R(q),1))),128))],10,VJ))),128))])])])):h.value==="image"?(w(),N("div",KJ,[X.value?(w(),N("img",{key:0,src:X.value,alt:e.file.path,class:De(["fp-image",{actual:H.value==="actual"}])},null,10,GJ)):(w(),N("div",YJ,[T("span",XJ,[se(Je,{name:"image-off",size:"lg"})]),T("span",QJ,R(A(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:M(e.file.size)})),1)]))])):h.value==="text"?(w(),N("div",ZJ,[T("div",JJ,[(w(!0),N(Oe,null,st(_.value,(te,ee)=>(w(),N("div",{key:ee,class:De(["fp-line-row",k(ee+1)]),"data-line":ee+1},[T("span",tee,R(ee+1),1),T("span",{class:"fp-line-text",innerHTML:Fe(te)},null,8,nee)],10,eee))),128))])])):(w(),N("div",oee,[T("div",see,[T("span",iee,[se(Je,{name:"file-off",size:"lg"})]),T("span",ree,R(A(n)("filePreview.binaryNoPreview",{mime:e.file.mime||A(n)("filePreview.unknownType"),size:M(e.file.size)})),1)])]))],64)):ie("",!0)],512))}}),aee=ft(lee,[["__scopeId","data-v-62bfaf2d"]]),cee={class:"tp"},uee=Ve({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=Z(null);return Ge(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||gt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(w(),N("div",cee,[se(Vl,{title:A(s)("common.preview"),subtitle:e.subtitle??A(s)("thinking.panelTitle"),"close-label":A(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),T("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},R(e.text),513)]))}}),SS=ft(uee,[["__scopeId","data-v-6af94b37"]]),dee={class:"ap"},fee={key:0,class:"ap-type"},pee={key:1,class:"ap-reason"},hee={key:2,class:"ap-field"},mee={class:"ap-field-body"},gee={key:3,class:"ap-field"},vee={class:"ap-field-body ap-live"},yee={key:4,class:"ap-field"},kee={class:"ap-field-body ap-progress"},bee={key:0,class:"ap-call"},_ee={key:1,class:"ap-output"},wee=["onClick"],See={key:5,class:"ap-field"},Cee={class:"ap-field-body"},xee=8,CS=5,xS=2,Aee=Ve({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=W(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=W(()=>(n.member.text??"").trimEnd());function l(m){const b=[];let _=null,g=0;for(const v of m)v.startsWith("Calling ")?(_={key:`g${g++}`,call:v,output:[]},b.push(_)):_?_.output.push(v):(_={key:`g${g++}`,call:"",output:[v]},b.push(_));return b}const a=W(()=>l(i.value)),c=Z(new Set);function u(m){return c.value.has(m)}function d(m){const b=new Set(c.value);b.has(m)?b.delete(m):b.add(m),c.value=b}function f(m){return m.output.length-CS-xS}function h(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=Z(null);return Ge(()=>i.value.length+r.value.length,()=>{const m=p.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||gt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(m,b)=>(w(),N("div",dee,[se(Vl,{title:A(s)("common.preview"),subtitle:e.member.name,"close-label":A(s)("thinking.close"),onClose:b[0]||(b[0]=_=>o("close"))},{default:ke(()=>[se($o,{variant:"neutral",size:"sm",class:"ap-phase"},{default:ke(()=>[je(R(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),T("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(w(),N("div",fee,R(e.member.subagentType),1)):ie("",!0),e.member.suspendedReason?(w(),N("div",pee,R(e.member.suspendedReason),1)):ie("",!0),e.member.prompt?(w(),N("div",hee,[b[1]||(b[1]=T("span",{class:"ap-field-label"},"Task",-1)),T("div",mee,R(e.member.prompt),1)])):ie("",!0),r.value?(w(),N("div",gee,[b[2]||(b[2]=T("span",{class:"ap-field-label"},"Output",-1)),T("div",vee,R(r.value),1)])):ie("",!0),a.value.length>0?(w(),N("div",yee,[b[4]||(b[4]=T("span",{class:"ap-field-label"},"Progress",-1)),T("div",kee,[(w(!0),N(Oe,null,st(a.value,_=>(w(),N("div",{key:_.key,class:"ap-group"},[_.call?(w(),N("div",bee,[b[3]||(b[3]=T("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),je(" "+R(_.call),1)])):ie("",!0),_.output.length>0?(w(),N("div",_ee,[_.output.length<=xee||u(_.key)?(w(!0),N(Oe,{key:0},st(_.output,(g,v)=>(w(),N("div",{key:v,class:"ap-out-line"},R(g),1))),128)):(w(),N(Oe,{key:1},[(w(!0),N(Oe,null,st(_.output.slice(0,CS),(g,v)=>(w(),N("div",{key:v,class:"ap-out-line"},R(g),1))),128)),T("button",{type:"button",class:"ap-fold",onClick:g=>d(_.key)}," … ("+R(f(_))+" more) ",9,wee),(w(!0),N(Oe,null,st(_.output.slice(-xS),(g,v)=>(w(),N("div",{key:"t"+v,class:"ap-out-line"},R(g),1))),128))],64))])):ie("",!0)]))),128))])])):ie("",!0),e.member.summary?(w(),N("div",See,[b[5]||(b[5]=T("span",{class:"ap-field-label"},"Result",-1)),T("div",Cee,R(e.member.summary),1)])):ie("",!0)],512)]))}}),Tee=ft(Aee,[["__scopeId","data-v-715bd93e"]]),Mee={class:"diff-lines"},Eee={key:0,class:"hunk-text"},Iee={class:"dl-gutter old"},$ee={class:"dl-gutter new"},Nee={class:"dl-sign"},Lee={class:"dl-text"},Oee=Ve({__name:"DiffLines",props:{lines:{}},setup(e){function t(s){return s.oldNo!==void 0?String(s.oldNo):""}function n(s){return s.newNo!==void 0?String(s.newNo):""}function o(s){return`dl-${s.type}`}return(s,i)=>(w(),N("div",Mee,[(w(!0),N(Oe,null,st(e.lines,(r,l)=>(w(),N("div",{key:l,class:De(["dl",o(r)])},[r.type==="hunk"?(w(),N("span",Eee,R(r.text),1)):(w(),N(Oe,{key:1},[T("span",Iee,R(t(r)),1),T("span",$ee,R(n(r)),1),T("span",Nee,R(r.type==="add"?"+":r.type==="del"?"-":" "),1),T("span",Lee,R(r.text),1)],64))],2))),128))]))}}),h3=ft(Oee,[["__scopeId","data-v-2f6bc1cc"]]),Pee={class:"tdp"},Ree={class:"tdp-body"},Dee={key:1,class:"tdp-output"},Bee={key:2,class:"tdp-empty"},Fee=Ve({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=Nt();return(s,i)=>(w(),N("div",Pee,[se(Vl,{title:e.target.title,subtitle:e.target.path,"close-label":A(o)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),T("div",Ree,[e.target.lines&&e.target.lines.length>0?(w(),ge(h3,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(w(),N("div",Dee,[(w(!0),N(Oe,null,st(e.target.output,(r,l)=>(w(),N("div",{key:l},R(r),1))),128))])):(w(),N("div",Bee,R(A(o)("diff.noDiff")),1))])]))}}),Hee=ft(Fee,[["__scopeId","data-v-76f2fbca"]]),Wee={class:"sc"},zee={key:0,class:"sc-empty"},Uee={key:2,class:"sc-loading","aria-hidden":"true"},qee={class:"sc-composer"},jee=["placeholder"],Vee=["disabled"],Kee=Ve({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt(),i=W(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=W(()=>n.title?.trim()||s("sideChat.title")),l=W(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=Z(""),c=Z(null),u=Z(null);function d(){const _=a.value.trim();_&&(o("send",_),a.value="",gt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const _=u.value;_&&(_.scrollTop=_.scrollHeight)}const h=W(()=>{const _=n.turns;if(_.length===0)return"0";const g=_.at(-1),v=g.thinking?.length??0,y=g.tools?.reduce((C,L)=>C+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${_.length}:${g.text.length}:${v}:${y}`});Ge(h,async()=>{!n.running&&!n.sending||(await gt(),f())});const p=W(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(_){_.key==="Enter"&&!_.shiftKey&&!_.isComposing&&(_.preventDefault(),d())}function b(){const _=c.value;_&&(_.style.height="auto",_.style.height=`${Math.min(_.scrollHeight,160)}px`)}return(_,g)=>(w(),N("div",Wee,[se(Vl,{title:r.value,subtitle:l.value,"close-label":A(s)("thinking.close"),onClose:g[0]||(g[0]=v=>o("close"))},null,8,["title","subtitle","close-label"]),T("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(w(),N("div",zee,R(A(s)("sideChat.empty")),1)):(w(),ge(a3,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending},null,8,["turns","running","sending"])),p.value?(w(),N("div",Uee,[se(l3)])):ie("",!0)],512),T("div",qee,[En(T("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:A(s)("sideChat.placeholder"),onInput:b,onKeydown:m},null,40,jee),[[ms,a.value]]),se(zt,{text:A(s)("sideChat.send")},{default:ke(()=>[T("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[se(Je,{name:"arrow-right",size:"sm"})],8,Vee)]),_:1},8,["text"])])]))}}),Gee=ft(Kee,[["__scopeId","data-v-9ee5df02"]]),Yee={class:"changes-pane"},Xee={class:"dv-path"},Qee={class:"diff-head"},Zee={class:"back-label"},Jee={key:0,class:"empty-state"},ete={key:1,class:"dv-lines-wrap"},tte={key:2,class:"empty-state"},nte={class:"dv-change-count"},ote={class:"ch-head"},ste={class:"br-label"},ite={class:"br-name"},rte={key:0,class:"sync-info"},lte={key:0,class:"ahead"},ate={key:0,class:"behind"},cte={key:1,class:"empty-head"},ute={key:0,class:"ch-list"},dte=["onClick"],fte={class:"fpath"},pte={key:1,class:"ch-list ch-tree"},hte={class:"tree-list"},mte=["onClick"],gte={class:"tree-name"},vte=["onClick"],yte={class:"tree-name"},kte={key:2,class:"empty-state"},bte={key:3,class:"empty-state"},_te=Ve({__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}=Nt(),o=e,s=t;function i(O){const S=O.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(O){return r[i(O)]??"?"}function a(O,S=60){return O.length<=S?O:"…"+O.slice(O.length-S+1)}const c=W(()=>o.gitInfo!==null),u=W(()=>o.changes.length>0),d=W(()=>(o.selectedDiffPath??null)!==null),f=W(()=>o.mode==="detail"||o.mode==="full"&&d.value),h=W(()=>o.fileDiff??[]),p=W(()=>o.fileDiffLoading===!0);function m(O){s("open",O)}function b(){s("back")}function _(){s("close")}const g=Z("list");function v(O){g.value=O}function y(O){const S={children:[]},I=[...O].sort((P,D)=>P.path.localeCompare(D.path));for(const P of I){const D=P.path.split("/");let H=S;for(let z=0;z<D.length;z++){const U=D[z],Q=z===D.length-1,X=D.slice(0,z+1).join("/");let ue=H.children.find(me=>me.name===U&&me.kind===(Q?"file":"folder"));ue||(ue={name:U,path:X,kind:Q?"file":"folder",status:Q?P.status:void 0,children:[]},H.children.push(ue)),H=ue}}return S.children}const C=W(()=>y(o.changes)),L=Z(new Set);function $(O){return!L.value.has(O)}const k=W(()=>{const O=[];function S(I,P){for(const D of I)O.push({node:D,depth:P}),D.kind==="folder"&&$(D.path)&&S(D.children,P+1)}return S(C.value,0),O});function M(O){const S=new Set(L.value);S.has(O.path)?S.delete(O.path):S.add(O.path),L.value=S}function E(O){return`${16+O*16}px`}return(O,S)=>(w(),N("div",Yee,[f.value?(w(),N(Oe,{key:0},[se(Vl,{title:A(n)("diff.title"),closable:e.closable,"close-label":A(n)("diff.close"),onClose:_},{default:ke(()=>[se(zt,{text:e.selectedDiffPath??""},{default:ke(()=>[T("span",Xee,R(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),T("div",Qee,[e.hideBack?ie("",!0):(w(),ge(Rt,{key:0,variant:"ghost",size:"sm",onClick:b},{default:ke(()=>[S[0]||(S[0]=T("span",{"aria-hidden":"true"},"←",-1)),T("span",Zee,R(A(n)("diff.back")),1)]),_:1}))]),p.value?(w(),N("div",Jee,R(A(n)("diff.loading")),1)):h.value.length>0?(w(),N("div",ete,[se(h3,{lines:h.value},null,8,["lines"])])):(w(),N("div",tte,R(A(n)("diff.noDiff")),1))],64)):(w(),N(Oe,{key:1},[se(Vl,{title:A(n)("diff.title"),closable:e.closable,"close-label":A(n)("diff.close"),onClose:_},{default:ke(()=>[T("span",nte,R(A(n)("diff.changeCount",{count:e.changes.length})),1),se(Xs,{"model-value":g.value,size:"sm",options:[{value:"list",label:A(n)("diff.list")},{value:"tree",label:A(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),T("div",ote,[c.value?(w(),N(Oe,{key:0},[T("span",ste,R(A(n)("diff.branch")),1),T("span",ite,R(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(w(),N("span",rte,[se(zt,{text:A(n)("diff.aheadTitle")},{default:ke(()=>[e.gitInfo.ahead>0?(w(),N("span",lte,"↑"+R(e.gitInfo.ahead),1)):ie("",!0)]),_:1},8,["text"]),se(zt,{text:A(n)("diff.behindTitle")},{default:ke(()=>[e.gitInfo.behind>0?(w(),N("span",ate,"↓"+R(e.gitInfo.behind),1)):ie("",!0)]),_:1},8,["text"])])):ie("",!0)],64)):(w(),N("span",cte,R(A(n)("diff.empty")),1))]),u.value&&g.value==="list"?(w(),N("div",ute,[(w(!0),N(Oe,null,st(e.changes,I=>(w(),ge(zt,{key:I.path,text:I.path},{default:ke(()=>[T("button",{type:"button",class:"ch-row",onClick:P=>m(I.path)},[T("span",{class:De(["badge",i(I.status)])},R(l(I.status)),3),T("span",fte,R(a(I.path)),1)],8,dte)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(w(),N("div",pte,[T("ul",hte,[(w(!0),N(Oe,null,st(k.value,({node:I,depth:P})=>(w(),N("li",{key:I.path,class:"tree-node"},[I.kind==="folder"?(w(),N("button",{key:0,type:"button",class:"tree-row tree-folder",style:Yt({paddingLeft:E(P)}),onClick:D=>M(I)},[se(Je,{class:"tree-icon",name:"folder-solid",size:"sm"}),T("span",gte,R(I.name),1)],12,mte)):(w(),ge(zt,{key:1,text:I.path},{default:ke(()=>[T("button",{type:"button",class:"tree-row tree-file",style:Yt({paddingLeft:E(P)}),onClick:D=>m(I.path)},[T("span",{class:De(["badge",i(I.status)])},R(l(I.status)),3),T("span",yte,R(I.name),1)],12,vte)]),_:2},1032,["text"]))]))),128))])])):c.value?(w(),N("div",kte,R(A(n)("diff.clean")),1)):(w(),N("div",bte,R(A(n)("diff.empty")),1))],64))]))}}),wte=ft(_te,[["__scopeId","data-v-7778610a"]]);function ay(e,t){let n=null;bn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,gt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),vo(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const Ste=["type","value","placeholder","disabled","readonly"],Cte=Ve({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const o=n,s=Z();function i(a){o("update:modelValue",a.target.value)}function r(){s.value?.focus()}function l(){s.value?.select()}return t({focus:r,select:l,el:s}),(a,c)=>(w(),N("input",{ref_key:"el",ref:s,class:De(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,Ste))}}),Za=ft(Cte,[["__scopeId","data-v-340f0da2"]]),xte={class:"search-wrap"},Ate={key:0,class:"tab-strip"},Tte={key:1,class:"state-row"},Mte={key:2,class:"state-row unavail"},Ete={key:3,class:"model-list"},Ite=["aria-selected","onClick","onMouseenter"],$te={class:"check"},Nte={class:"model-main"},Lte={class:"model-name"},Ote={class:"model-id"},Pte={key:0,class:"caps"},Rte={class:"model-provider"},Dte={class:"model-ctx"},Bte={key:0,class:"empty"},Fte={class:"footer-hint"},Hte=Ve({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=W(()=>new Set(o.starredIds??[]));function r(v){return i.value.has(v)}const l=Z(""),a=Z(null),c=Z(null),u=Z("all");ay(c,a);const d=W(()=>{const v=new Set,y=[{id:"all",label:n("model.allTab")}];for(const C of o.models)v.has(C.provider)||(v.add(C.provider),y.push({id:C.provider,label:C.provider}));return y}),f=W(()=>{const v=l.value.toLowerCase().trim(),y=o.models.filter(C=>{if(u.value!=="all"&&C.provider!==u.value)return!1;const L=(C.displayName??C.model).toLowerCase().includes(v),$=C.provider.toLowerCase().includes(v),k=C.id.toLowerCase().includes(v);return!v||L||$||k});return u.value!=="all"?y:y.sort((C,L)=>{const $=r(C.id)?1:0;return(r(L.id)?1:0)-$})}),h=W(()=>f.value),p=Z(0);Ge([l,u],()=>{p.value=0}),Ge(d,v=>{v.some(y=>y.id===u.value)||(u.value="all")}),Ge(h,v=>{p.value=Math.min(p.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){s("close");return}if(v.key==="ArrowDown")v.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),p.value=Math.max(p.value-1,0);else if(v.key==="Enter"){const y=h.value[p.value];y&&s("select",y.id)}}bn(()=>{document.addEventListener("keydown",m)}),_n(()=>{document.removeEventListener("keydown",m)});function b(v){s("select",v)}function _(v){return h.value.indexOf(v)}function g(v){u.value=v}return(v,y)=>(w(),ge(rr,{open:!0,"close-on-esc":!1,title:A(n)("model.title"),size:"xl",height:"fixed",onClose:y[1]||(y[1]=C=>s("close"))},{default:ke(()=>[T("div",{ref_key:"dialogRef",ref:c,class:"mp"},[T("div",xte,[se(Za,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":y[0]||(y[0]=C=>l.value=C),placeholder:A(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(w(),N("div",Ate,[(w(!0),N(Oe,null,st(d.value,C=>(w(),ge(Rt,{key:C.id,variant:C.id===u.value?"secondary":"ghost",size:"sm",onClick:L=>g(C.id)},{default:ke(()=>[je(R(C.label),1)]),_:2},1032,["variant","onClick"]))),128))])):ie("",!0),e.loading?(w(),N("div",Tte,[se(Zs,{size:"sm"}),T("span",null,R(A(n)("model.loading")),1)])):e.unavailable?(w(),N("div",Mte,[se(Je,{name:"alert-triangle",size:"lg"}),T("span",null,R(A(n)("model.unavailable")),1)])):(w(),N("div",Ete,[(w(!0),N(Oe,null,st(h.value,C=>(w(),N("div",{key:C.id,class:De(["model-row",{"is-current":C.id===e.current,"is-selected":_(C)===p.value}]),role:"option","aria-selected":C.id===e.current,onClick:L=>b(C.id),onMouseenter:L=>p.value=_(C)},[T("span",$te,[C.id===e.current?(w(),ge(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),T("span",Nte,[T("span",Lte,R(C.displayName??C.model),1),T("span",Ote,R(C.id),1),C.capabilities&&C.capabilities.length>0?(w(),N("span",Pte,[(w(!0),N(Oe,null,st(C.capabilities,L=>(w(),ge($o,{key:L,variant:"info",size:"sm"},{default:ke(()=>[je(R(L),1)]),_:2},1024))),128))])):ie("",!0)]),T("span",Rte,R(C.provider),1),T("span",Dte,R(A(n)("model.contextSuffix",{size:Math.round(C.maxContextSize/1e3)})),1),se(vn,{size:"sm",label:r(C.id)?A(n)("model.unstarTitle"):A(n)("model.starTitle"),onClick:yt(L=>s("toggle-star",C.id),["stop"])},{default:ke(()=>[r(C.id)?(w(),ge(Je,{key:0,name:"star",size:"md"})):(w(),ge(Je,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Ite))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(w(),N("div",Bte,R(o.models.length===0?A(n)("model.emptyNoModels"):A(n)("model.emptyNoMatch")),1)):ie("",!0)])),T("div",Fte,R(A(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Wte=ft(Hte,[["__scopeId","data-v-e93073d7"]]),zte={key:0,class:"ui-field__label"},Ute={key:1,class:"ui-field__error"},qte={key:2,class:"ui-field__hint"},jte=Ve({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(w(),N("div",{class:De(["ui-field",{"has-error":!!e.error}])},[e.label?(w(),N("label",zte,R(e.label),1)):ie("",!0),An(t.$slots,"default",{},void 0,!0),e.error?(w(),N("span",Ute,R(e.error),1)):e.hint?(w(),N("span",qte,R(e.hint),1)):ie("",!0)],2))}}),Zc=ft(jte,[["__scopeId","data-v-49bce958"]]),Vte=["value","disabled"],Kte=Ve({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function o(s){n("update:modelValue",s.target.value)}return(s,i)=>(w(),N("select",{class:De(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[An(s.$slots,"default",{},void 0,!0)],42,Vte))}}),m3=ft(Kte,[["__scopeId","data-v-92a040fd"]]),Gte={class:"prov-list"},Yte={key:0,class:"state-row"},Xte={key:1,class:"state-row unavail"},Qte={key:2,class:"empty"},Zte={class:"prov-info"},Jte={class:"prov-type"},ene={key:0,class:"prov-url"},tne={class:"prov-meta"},nne={key:0},one={class:"prov-actions"},sne={key:0,class:"add-section"},ine={key:0,class:"add-btns"},rne={key:1,class:"add-form"},lne=["value"],ane={key:0,class:"add-error"},cne={class:"form-btns"},une={class:"footer-hint"},dne=Ve({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Nt(),{confirm:o}=ol(),s=Z(null);ay(s);const i=t;async function r(_){await o({title:n("providers.delete"),message:n("providers.confirmDelete"),variant:"danger"})&&i("delete",_)}const l=Z(!1),a=No({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),c=Z(""),u=["moonshot","anthropic","openai","custom"];function d(){a.type="moonshot",a.apiKey="",a.baseUrl="",a.defaultModel="",c.value="",l.value=!0}function f(){l.value=!1}function h(){if(!a.apiKey.trim()){c.value=n("providers.apiKeyRequired");return}c.value="",i("add",{type:a.type,apiKey:a.apiKey.trim()||void 0,baseUrl:a.baseUrl.trim()||void 0,defaultModel:a.defaultModel.trim()||void 0}),l.value=!1}function p(_){if(_.key==="Escape"){if(l.value){f();return}i("close")}}bn(()=>document.addEventListener("keydown",p)),_n(()=>document.removeEventListener("keydown",p));function m(_){return _==="connected"?"var(--color-success)":_==="error"?"var(--color-danger)":"var(--color-text-faint)"}function b(_){return n(_==="connected"?"providers.status.connected":_==="error"?"providers.status.error":"providers.status.unconfigured")}return(_,g)=>(w(),ge(rr,{open:!0,"close-on-esc":!1,title:A(n)("providers.title"),size:"xl",height:"fixed",onClose:g[6]||(g[6]=v=>i("close"))},{default:ke(()=>[T("div",{ref_key:"dialogRef",ref:s,class:"pm"},[T("div",Gte,[e.loading?(w(),N("div",Yte,[se(Zs,{size:"sm"}),T("span",null,R(A(n)("providers.loading")),1)])):e.unavailable?(w(),N("div",Xte,[se(Je,{name:"alert-triangle",size:"md"}),T("span",null,R(A(n)("providers.unavailable")),1)])):e.providers.length===0?(w(),N("div",Qte,R(A(n)("providers.empty")),1)):(w(!0),N(Oe,{key:3},st(e.providers,v=>(w(),N("div",{key:v.id,class:"prov-row"},[se(zt,{text:b(v.status)},{default:ke(()=>[T("span",{class:De(["status-dot",{"status-dot--empty":v.status!=="connected"&&v.status!=="error"}]),style:Yt(v.status==="connected"||v.status==="error"?{background:m(v.status)}:void 0)},null,6)]),_:2},1032,["text"]),T("div",Zte,[T("span",Jte,R(v.type),1),v.baseUrl?(w(),N("span",ene,R(v.baseUrl),1)):ie("",!0),T("span",tne,[se($o,{variant:v.hasApiKey?"success":"neutral",size:"sm"},{default:ke(()=>[je(R(v.hasApiKey?A(n)("providers.keySet"):A(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),v.models&&v.models.length>0?(w(),N("span",nne," · "+R(A(n)("providers.modelCount",{count:v.models.length})),1)):ie("",!0)])]),T("div",one,[se(zt,{text:A(n)("providers.refreshTitle",{type:v.type})},{default:ke(()=>[se(Rt,{variant:"secondary",size:"sm",onClick:y=>i("refresh",v.id)},{default:ke(()=>[je(R(A(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),se(zt,{text:A(n)("providers.deleteTitle",{type:v.type})},{default:ke(()=>[se(Rt,{variant:"danger-soft",size:"sm",onClick:y=>r(v.id)},{default:ke(()=>[je(R(A(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?ie("",!0):(w(),N("div",sne,[l.value?(w(),N("div",rne,[se(Zc,{label:A(n)("providers.fieldType")},{default:ke(()=>[se(m3,{modelValue:a.type,"onUpdate:modelValue":g[2]||(g[2]=v=>a.type=v)},{default:ke(()=>[(w(),N(Oe,null,st(u,v=>T("option",{key:v,value:v},R(v),9,lne)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),se(Zc,{label:A(n)("providers.fieldApiKey")},{default:ke(()=>[se(Za,{modelValue:a.apiKey,"onUpdate:modelValue":g[3]||(g[3]=v=>a.apiKey=v),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),se(Zc,{label:A(n)("providers.fieldBaseUrl")},{default:ke(()=>[se(Za,{modelValue:a.baseUrl,"onUpdate:modelValue":g[4]||(g[4]=v=>a.baseUrl=v),placeholder:A(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),se(Zc,{label:A(n)("providers.fieldDefaultModel")},{default:ke(()=>[se(Za,{modelValue:a.defaultModel,"onUpdate:modelValue":g[5]||(g[5]=v=>a.defaultModel=v),placeholder:A(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c.value?(w(),N("div",ane,R(c.value),1)):ie("",!0),T("div",cne,[se(Rt,{variant:"primary",size:"sm",onClick:h},{default:ke(()=>[je(R(A(n)("providers.add")),1)]),_:1}),se(Rt,{variant:"secondary",size:"sm",onClick:f},{default:ke(()=>[je(R(A(n)("common.cancel")),1)]),_:1})])])):(w(),N("div",ine,[se(Rt,{variant:"secondary",size:"sm",onClick:g[0]||(g[0]=v=>i("openLogin","moonshot"))},{default:ke(()=>[se(Je,{name:"user",size:"sm"}),je(" "+R(A(n)("providers.loginKimi")),1)]),_:1}),se(Rt,{variant:"secondary",size:"sm",onClick:g[1]||(g[1]=v=>i("openLogin","anthropic"))},{default:ke(()=>[se(Je,{name:"user",size:"sm"}),je(" "+R(A(n)("providers.loginAnthropic")),1)]),_:1}),se(Rt,{variant:"primary",size:"sm",onClick:d},{default:ke(()=>[se(Je,{name:"plus",size:"sm"}),je(" "+R(A(n)("providers.enterApiKey")),1)]),_:1})]))])),T("div",une,R(A(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),fne=ft(dne,[["__scopeId","data-v-fb6f1365"]]),pne={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},hne={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},mne={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},Gg=Ve({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(w(),N("svg",pne,[...n[0]||(n[0]=[T("circle",{cx:"18",cy:"18",r:"15"},null,-1),T("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(w(),N("svg",hne,[...n[1]||(n[1]=[T("circle",{cx:"14",cy:"14",r:"12"},null,-1),T("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),T("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(w(),N("svg",mne,[...n[2]||(n[2]=[T("path",{d:"M14 3 L26 24 H2 Z"},null,-1),T("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),T("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),gne={key:0,class:"center-body"},vne={class:"center-text"},yne={key:1,class:"nb"},kne={class:"nb-lead"},bne=["href"],_ne={class:"nb-or"},wne={class:"nb-fallback"},Sne={class:"nb-fb-text"},Cne=["href"],xne={class:"nb-code-row"},Ane={class:"nb-code"},Tne={class:"nb-status"},Mne={class:"nb-status-text"},Ene={class:"nb-countdown"},Ine={key:2,class:"center-body"},$ne={class:"center-text success-text"},Nne={class:"center-hint"},Lne={class:"center-body"},One={class:"center-text err-text"},Pne={class:"center-hint"},Rne={class:"actions"},Dne={class:"center-body"},Bne={class:"center-text warn-text"},Fne={class:"center-hint"},Hne={class:"actions"},Wne=Ve({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=Z(!0),s=t,i=e,r=Z("starting"),l=Z(null),a=Z(0),c=Z(!1);let u=null,d=null;bn(async()=>{await f()}),_n(()=>{m()});async function f(){m(),l.value=null,r.value="starting";const y=await i.onStartOAuthLogin();if(!y){r.value="error";return}l.value={flowId:y.flowId,verificationUri:y.verificationUri,verificationUriComplete:y.verificationUriComplete,userCode:y.userCode,expiresIn:y.expiresIn,interval:y.interval},a.value=y.expiresIn,r.value="device-code",h(),p(y.interval)}function h(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function p(y){u&&clearTimeout(u),u=setTimeout(async()=>{const C=await i.onPollOAuthLogin();C?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):C?.status==="expired"||C?.status==="cancelled"?(m(),r.value="expired"):p(y)},y*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function b(){await f()}async function _(){!l.value||!await Wo(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function g(){m(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function v(y){const C=Math.floor(y/60),L=y%60;return`${C}:${String(L).padStart(2,"0")}`}return(y,C)=>(w(),ge(rr,{open:o.value,"onUpdate:open":C[0]||(C[0]=L=>o.value=L),title:A(n)("login.title"),"close-on-overlay":!1,onClose:g},{default:ke(()=>[r.value==="starting"?(w(),N("div",gne,[se(Zs,{size:"md"}),T("span",vne,R(A(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(w(),N("div",yne,[T("div",kne,R(A(n)("login.lead")),1),T("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[je(R(A(n)("login.authorizeInBrowser"))+" ",1),se(Je,{name:"external-link",size:"sm"})],8,bne),T("div",_ne,R(A(n)("login.orDivider")),1),T("div",wne,[T("div",Sne,[je(R(A(n)("login.fallbackPrefix")),1),T("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},R(l.value.verificationUri),9,Cne),je(R(A(n)("login.fallbackSuffix")),1)]),T("div",xne,[T("span",Ane,R(l.value.userCode),1),se(Rt,{class:De(["nb-copy",{"is-copied":c.value}]),variant:"secondary",size:"sm",onClick:_},{default:ke(()=>[c.value?(w(),N(Oe,{key:0},[se(Je,{name:"check",size:"sm"}),je(" "+R(A(n)("login.copied")),1)],64)):(w(),N(Oe,{key:1},[se(Je,{name:"copy",size:"sm"}),je(" "+R(A(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),T("div",Tne,[se(Zs,{size:"sm",label:A(n)("login.waitingAuth")},null,8,["label"]),T("span",Mne,R(A(n)("login.waitingAutoClose")),1),T("span",Ene,R(v(a.value)),1)])])):r.value==="success"?(w(),N("div",Ine,[se(Gg,{kind:"success"}),T("span",$ne,R(A(n)("login.success")),1),T("span",Nne,R(A(n)("login.successHint")),1)])):r.value==="expired"?(w(),N(Oe,{key:3},[T("div",Lne,[se(Gg,{kind:"expired"}),T("span",One,R(A(n)("login.expiredTitle")),1),T("span",Pne,R(A(n)("login.expiredHint")),1)]),T("div",Rne,[se(Rt,{variant:"primary",onClick:b},{default:ke(()=>[je(R(A(n)("login.retry")),1)]),_:1}),se(Rt,{variant:"secondary",onClick:g},{default:ke(()=>[je(R(A(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(w(),N(Oe,{key:4},[T("div",Dne,[se(Gg,{kind:"error"}),T("span",Bne,R(A(n)("login.errorTitle")),1),T("span",Fne,R(A(n)("login.errorHint")),1)]),T("div",Hne,[se(Rt,{variant:"primary",onClick:b},{default:ke(()=>[je(R(A(n)("login.retry")),1)]),_:1}),se(Rt,{variant:"secondary",onClick:g},{default:ke(()=>[je(R(A(n)("login.closeBtn")),1)]),_:1})])],64)):ie("",!0)]),_:1},8,["open","title"]))}}),zne=ft(Wne,[["__scopeId","data-v-b228800e"]]),g3=Ve({__name:"LanguageSwitcher",setup(e){const{locale:t}=Nt(),n=bA.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&_A(s)}return(s,i)=>(w(),ge(Xs,{"model-value":A(t),options:A(n),"onUpdate:modelValue":o},null,8,["model-value","options"]))}}),AS=1e3,Yg=16384,Xg=500,Qg=50,Une=6,qne=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,jne=/^[A-Za-z0-9+/=_-]{200,}$/;let Zg=null;function hi(){if(Zg!==null)return Zg;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=Jn($t.debug)==="1"),Zg=e,e}const Fr=[];let Vne=1;const cy=Z(0),Jc=Yl(!1);function Kne(){return Fr}function Gne(){Fr.length=0,cy.value++}function il(e){Jc.value||(Fr.push({id:Vne++,ts:Date.now(),...e}),Fr.length>AS&&Fr.splice(0,Fr.length-AS),cy.value++)}function C1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const s=e;return jne.test(s)?`[base64-like, ${s.length} chars omitted]`:s.length>Xg?`${s.slice(0,Xg)}… [+${s.length-Xg} chars]`:s}if(n!=="object")return String(e);if(t>=Une)return"[max depth]";if(Array.isArray(e)){const s=e.slice(0,Qg).map(i=>C1(i,t+1));return e.length>Qg&&s.push(`[+${e.length-Qg} more items]`),s}const o={};for(const[s,i]of Object.entries(e))o[s]=qne.test(s)?"[redacted]":C1(i,t+1);return o}function Zl(e){if(e===void 0)return;const t=C1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>Yg)return{_truncated:`detail JSON was ${n.length} chars; first ${Yg} kept`,preview:n.slice(0,Yg)}}catch{return"[unserializable detail]"}return t}function TS(e){hi()&&il({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Zl(e.body)}})}function MS(e){if(!hi())return;const t=e.code!==0;il({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:Zl(e.data)}})}function pf(e){hi()&&il({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 _a(e,t){hi()&&il({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Zl(t)})}function Yne(e){if(!hi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;il({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:Zl(e)})}function Xne(e){if(!hi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[o,s!==void 0?`seq=${s}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);il({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Zl(t.payload)})}const Qne={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Jg(e,t,n){hi()&&il({source:"client",kind:`client:${e}`,label:`${Qne[e]} ${t}`,detail:Zl(n)})}function Nr(e,t){hi()&&il({source:"client",kind:"client:event",label:`· ${e}`,detail:Zl(t)})}let ES=!1;function Zne(){if(!(ES||!hi())){ES=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{Jg("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;Jg("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{Jg(e,n.map(Jne).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function Jne(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 v3(e=Fr){if(typeof document>"u")return;const t=new Blob([eoe(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}function eoe(e=Fr){return e.map(t=>JSON.stringify(t)).join(`
|
|
260
|
+
`)}const toe=["aria-checked","aria-label","disabled"],noe=Ve({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(w(),N("button",{class:De(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:s[0]||(s[0]=i=>n("update:modelValue",!e.modelValue))},[...s[1]||(s[1]=[T("span",{class:"ui-switch__thumb"},null,-1)])],10,toe))}}),Cr=ft(noe,[["__scopeId","data-v-dbe22dc4"]]),ooe=["aria-label"],soe=["aria-selected","onClick"],ioe={class:"body"},roe={class:"panel"},loe={class:"sec"},aoe={class:"sec-title"},coe={class:"row"},uoe={class:"rlabel"},doe={class:"row"},foe={class:"rlabel"},poe={class:"row"},hoe={class:"rlabel"},moe={class:"num-field"},goe=["value","aria-label"],voe={class:"row"},yoe={class:"rlabel"},koe={class:"row"},boe={class:"rlabel"},_oe={class:"hint"},woe={class:"sec"},Soe={class:"sec-title"},Coe={class:"row"},xoe={class:"rlabel"},Aoe={key:0,class:"hint"},Toe={class:"row"},Moe={class:"rlabel"},Eoe={key:0,class:"hint"},Ioe={class:"row"},$oe={class:"rlabel"},Noe={class:"panel"},Loe={class:"sec"},Ooe={class:"sec-title"},Poe={class:"row"},Roe={class:"rlabel"},Doe={key:0,class:"rvalue"},Boe={class:"actions"},Foe={class:"panel"},Hoe={class:"sec"},Woe={class:"sec-head"},zoe={class:"sec-title"},Uoe={key:0,class:"saving"},qoe={class:"row"},joe={class:"rlabel"},Voe={class:"hint"},Koe={key:0,class:"select-wrap"},Goe={key:0,value:"",disabled:""},Yoe=["label"],Xoe=["value"],Qoe={key:1,class:"rvalue mono"},Zoe={class:"row"},Joe={class:"rlabel"},ese={class:"hint"},tse={class:"row"},nse={class:"rlabel"},ose={class:"hint"},sse={class:"row"},ise={class:"rlabel"},rse={class:"hint"},lse={class:"row"},ase={class:"rlabel"},cse={class:"hint"},use={key:1,class:"empty-config"},dse={class:"panel"},fse={class:"sec"},pse={class:"sec-title"},hse={class:"row"},mse={class:"rlabel"},gse={class:"rvalue mono"},vse={class:"row"},yse={class:"rlabel"},kse={class:"rvalue mono"},bse={key:0,class:"row"},_se={class:"rlabel"},wse={class:"hint"},Sse={class:"hint"},Cse={class:"row"},xse={class:"rlabel"},Ase={key:0,class:"hint"},Tse=Ve({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=Z("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"}],l=w5(),a=["manual","auto","yolo"],c={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},u=Z(null);ay(u);function d(E){E.key==="Escape"&&s("close")}bn(()=>document.addEventListener("keydown",d)),_n(()=>document.removeEventListener("keydown",d));function f(){v3()}const h=W(()=>{const E=new Map;for(const O of o.models??[])E.set(O.id,{id:O.id,label:O.displayName??O.model??O.id,provider:O.provider});for(const[O,S]of Object.entries(o.config?.models??{})){if(E.has(O))continue;const I=b(S);E.set(O,{id:O,label:_(O,S,I),provider:I??O})}return Array.from(E.values())}),p=W(()=>{const E=new Map;for(const O of h.value){const S=E.get(O.provider)??[];S.push(O),E.set(O.provider,S)}for(const O of E.values())O.sort((S,I)=>S.label.localeCompare(I.label));return Array.from(E.entries()).toSorted(([O],[S])=>O.localeCompare(S)).map(([O,S])=>({provider:O,options:S}))}),m=W(()=>{const E=o.config?.defaultPermissionMode;return E==="auto"||E==="yolo"||E==="manual"?E:"manual"});function b(E){if(!E||typeof E!="object")return;const O=E;return typeof O.provider=="string"?O.provider:void 0}function _(E,O,S){if(!O||typeof O!="object")return E;const I=O,P=typeof I.model=="string"?I.model:void 0,D=S??b(O);return P&&D?`${E} (${D}/${P})`:P?`${E} (${P})`:E}function g(E){return E===!0}function v(E){!E||E===o.config?.defaultModel||s("updateConfig",{defaultModel:E})}function y(E){E!==m.value&&s("updateConfig",{defaultPermissionMode:E})}function C(E){const O=o.config?.[E];s("updateConfig",{[E]:!g(O)})}function L(){const E=o.config?.thinking;return!E||typeof E!="object"?!0:E.enabled!==!1}function $(){s("updateConfig",{thinking:{enabled:!L()}})}function k(){const E=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!E})}function M(E){i.value=E}return(E,O)=>(w(),ge(rr,{open:!0,"close-on-esc":!1,title:A(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:O[15]||(O[15]=S=>s("close"))},{default:ke(()=>[T("div",{ref_key:"dialogRef",ref:u,class:"sd"},[T("nav",{class:"settings-tabs",role:"tablist","aria-label":A(n)("settings.title")},[(w(),N(Oe,null,st(r,S=>T("button",{key:S.id,type:"button",class:De(["tab",{on:i.value===S.id}]),role:"tab","aria-selected":i.value===S.id,onClick:I=>M(S.id)},R(A(n)(S.labelKey)),11,soe)),64))],8,ooe),T("div",ioe,[En(T("section",roe,[T("section",loe,[T("h3",aoe,R(A(n)("settings.appearance")),1),T("div",coe,[T("span",uoe,R(A(n)("theme.colorSchemeLabel")),1),se(Xs,{"model-value":e.colorScheme,options:[{value:"light",label:A(n)("theme.light")},{value:"dark",label:A(n)("theme.dark")},{value:"system",label:A(n)("theme.system")}],"onUpdate:modelValue":O[0]||(O[0]=S=>s("setColorScheme",S))},null,8,["model-value","options"])]),T("div",doe,[T("span",foe,R(A(n)("theme.accentLabel")),1),se(Xs,{"model-value":e.accent,options:[{value:"blue",label:A(n)("theme.accentBlue")},{value:"mono",label:A(n)("theme.accentBlack")}],"onUpdate:modelValue":O[1]||(O[1]=S=>s("setAccent",S))},null,8,["model-value","options"])]),T("div",poe,[T("span",hoe,R(A(n)("settings.uiFontSize")),1),T("label",moe,[T("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":A(n)("settings.uiFontSize"),onInput:O[2]||(O[2]=S=>s("setUiFontSize",Number(S.target.value)))},null,40,goe),O[16]||(O[16]=T("span",{class:"num-unit"},"px",-1))])]),T("div",voe,[T("span",yoe,R(A(n)("sidebar.language")),1),se(g3)]),T("div",koe,[T("span",boe,[je(R(A(n)("settings.conversationToc"))+" ",1),T("span",_oe,R(A(n)("settings.conversationTocHint")),1)]),se(Cr,{"model-value":e.conversationToc??!0,label:A(n)("settings.conversationToc"),"onUpdate:modelValue":O[3]||(O[3]=S=>s("setConversationToc",S))},null,8,["model-value","label"])])]),T("section",woe,[T("h3",Soe,R(A(n)("settings.notifications")),1),T("div",Coe,[T("span",xoe,[je(R(A(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(w(),N("span",Aoe,R(A(n)("settings.notifyDenied")),1)):ie("",!0)]),se(Cr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:A(n)("settings.notifyOnComplete"),"onUpdate:modelValue":O[4]||(O[4]=S=>s("setNotify",S))},null,8,["model-value","disabled","label"])]),T("div",Toe,[T("span",Moe,[je(R(A(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(w(),N("span",Eoe,R(A(n)("settings.notifyDenied")),1)):ie("",!0)]),se(Cr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:A(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":O[5]||(O[5]=S=>s("setNotifyQuestion",S))},null,8,["model-value","disabled","label"])]),T("div",Ioe,[T("span",$oe,R(A(n)("settings.soundOnComplete")),1),se(Cr,{"model-value":e.sound,label:A(n)("settings.soundOnComplete"),"onUpdate:modelValue":O[6]||(O[6]=S=>s("setSound",S))},null,8,["model-value","label"])])])],512),[[Vs,i.value==="general"]]),En(T("section",Noe,[T("section",Loe,[T("h3",Ooe,R(A(n)("settings.account")),1),T("div",Poe,[T("span",Roe,R(e.authReady?"managed:kimi-code":A(n)("sidebar.notSignedIn")),1),se(zt,{text:e.accountModel},{default:ke(()=>[e.authReady&&e.accountModel?(w(),N("span",Doe,R(e.accountModel),1)):ie("",!0)]),_:1},8,["text"])]),T("div",Boe,[se(Rt,{variant:"secondary",size:"sm",onClick:O[7]||(O[7]=S=>{s("openOnboarding"),s("close")})},{default:ke(()=>[je(R(A(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(w(),ge(Rt,{key:0,variant:"danger-soft",size:"sm",onClick:O[8]||(O[8]=S=>s("logout"))},{default:ke(()=>[je(R(A(n)("sidebar.signOut")),1)]),_:1})):(w(),ge(Rt,{key:1,variant:"primary",size:"sm",onClick:O[9]||(O[9]=S=>s("login"))},{default:ke(()=>[je(R(A(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[Vs,i.value==="account"]]),En(T("section",Foe,[T("section",Hoe,[T("div",Woe,[T("h3",zoe,R(A(n)("settings.agentDefaults")),1),e.configSaving?(w(),N("span",Uoe,R(A(n)("settings.saving")),1)):ie("",!0)]),e.config?(w(),N(Oe,{key:0},[T("div",qoe,[T("span",joe,[je(R(A(n)("settings.defaultModel"))+" ",1),T("span",Voe,R(A(n)("settings.defaultModelHint")),1)]),p.value.length>0?(w(),N("div",Koe,[se(m3,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":A(n)("settings.defaultModel"),"onUpdate:modelValue":v},{default:ke(()=>[e.config.defaultModel?ie("",!0):(w(),N("option",Goe,R(A(n)("settings.noDefaultModel")),1)),(w(!0),N(Oe,null,st(p.value,S=>(w(),N("optgroup",{key:S.provider,label:S.provider},[(w(!0),N(Oe,null,st(S.options,I=>(w(),N("option",{key:I.id,value:I.id},R(I.label),9,Xoe))),128))],8,Yoe))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(w(),N("span",Qoe,R(e.config.defaultModel??A(n)("settings.noDefaultModel")),1))]),T("div",Zoe,[T("span",Joe,[je(R(A(n)("settings.defaultPermission"))+" ",1),T("span",ese,R(A(n)("settings.defaultPermissionHint")),1)]),se(Xs,{"model-value":m.value,options:a.map(S=>({value:S,label:A(n)(c[S])})),"onUpdate:modelValue":O[10]||(O[10]=S=>y(S))},null,8,["model-value","options"])]),T("div",tse,[T("span",nse,[je(R(A(n)("settings.defaultThinking"))+" ",1),T("span",ose,R(A(n)("settings.defaultThinkingHint")),1)]),se(Cr,{"model-value":L(),disabled:e.configSaving,label:A(n)("settings.defaultThinking"),"onUpdate:modelValue":O[11]||(O[11]=S=>$())},null,8,["model-value","disabled","label"])]),T("div",sse,[T("span",ise,[je(R(A(n)("settings.defaultPlanMode"))+" ",1),T("span",rse,R(A(n)("settings.defaultPlanModeHint")),1)]),se(Cr,{"model-value":g(e.config.defaultPlanMode),disabled:e.configSaving,label:A(n)("settings.defaultPlanMode"),"onUpdate:modelValue":O[12]||(O[12]=S=>C("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),T("div",lse,[T("span",ase,[je(R(A(n)("settings.mergeSkills"))+" ",1),T("span",cse,R(A(n)("settings.mergeSkillsHint")),1)]),se(Cr,{"model-value":g(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:A(n)("settings.mergeSkills"),"onUpdate:modelValue":O[13]||(O[13]=S=>C("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(w(),N("div",use,R(A(n)("settings.configUnavailable")),1))])],512),[[Vs,i.value==="agent"]]),En(T("section",dse,[T("section",fse,[T("h3",pse,R(A(n)("settings.advanced")),1),T("div",hse,[T("span",mse,R(A(n)("sidebar.daemon")),1),T("span",gse,R(A(l)),1)]),T("div",vse,[T("span",yse,R(A(n)("settings.serverVersion")),1),T("span",kse,R(e.serverVersion||"-"),1)]),e.config?(w(),N("div",bse,[T("span",_se,[je(R(A(n)("settings.telemetry"))+" ",1),T("span",wse,R(A(n)("settings.telemetryHint")),1),T("span",Sse,R(A(n)("settings.telemetryRestartHint")),1)]),se(Cr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:A(n)("settings.telemetry"),"onUpdate:modelValue":O[14]||(O[14]=S=>k())},null,8,["model-value","disabled","label"])])):ie("",!0),T("div",Cse,[T("span",xse,[je(R(A(n)("settings.exportLog"))+" ",1),A(hi)()?ie("",!0):(w(),N("span",Ase,R(A(n)("settings.logHint")),1))]),se(Rt,{variant:"secondary",size:"sm",onClick:f},{default:ke(()=>[je(R(A(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[Vs,i.value==="advanced"]])])],512)]),_:1},8,["title"]))}}),Mse=ft(Tse,[["__scopeId","data-v-b6913864"]]),Ese={class:"aw"},Ise={class:"crumbbar"},$se={class:"crumbs"},Nse={key:0,class:"crumb-sep"},Lse=["onClick"],Ose={key:0,class:"filterbar"},Pse=["placeholder"],Rse={class:"folder-list"},Dse={key:0,class:"fl-loading"},Bse=["onClick"],Fse={class:"folder-name search-rel"},Hse={key:0,class:"git-branch"},Wse={key:0,class:"fl-empty"},zse={key:1,class:"fl-loading"},Use=["onClick"],qse={class:"folder-name"},jse={key:0,class:"git-branch"},Vse={key:0,class:"fl-empty"},Kse={class:"paste-row"},Gse={class:"paste-input-wrap"},Yse={key:1,class:"add-error",role:"alert"},Xse={class:"actions"},Qse={class:"footer-hint"},Zse=600,Jse=6,IS=150,eie=Ve({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=Z(!0),r=Z(!1),l=Z(!1),a=Z(""),c=Z(null),u=Z([]),d=Z(""),f=Z(!1),h=Z([]),p=W(()=>d.value.trim().length>0);let m=0,b=null;function _(I,P){const D=I.toLowerCase(),H=P.toLowerCase();let z=0;for(let U=0;U<H.length&&z<D.length;U++)H[U]===D[z]&&z++;return z===D.length}async function g(I){const P=a.value,D=I.trim();if(!P||D===""){h.value=[],f.value=!1;return}const H=++m;f.value=!0;const z=[],U=[{path:P,depth:0}];let Q=0;for(;U.length>0&&Q<Zse&&z.length<IS;){if(H!==m)return;const X=U.shift();Q++;let ue;try{ue=await o.browseFs(X.path)}catch{continue}if(H!==m)return;for(const me of ue.entries){if(!me.isDir)continue;const Ae=me.path.startsWith(P)?me.path.slice(P.length).replace(/^\/+/,""):me.path;if(_(D,Ae||me.name)&&(z.push({path:me.path,name:me.name,rel:Ae||me.name,isGitRepo:me.isGitRepo,branch:me.branch}),z.length>=IS))break;X.depth+1<Jse&&U.push({path:me.path,depth:X.depth+1})}H===m&&(h.value=[...z])}H===m&&(f.value=!1)}Ge(d,I=>{if(b&&clearTimeout(b),I.trim()===""){m++,h.value=[],f.value=!1;return}b=setTimeout(()=>void g(I),220)});const v=Z(!1),y=Z(""),C=W(()=>y.value.trim()),L=W(()=>{const I=a.value;if(!I)return[];const P=I.split("/").filter(Boolean),D=[{label:"/",path:"/"}];let H="";for(const z of P)H+=`/${z}`,D.push({label:z,path:H});return D}),$=W(()=>a.value.length>0);async function k(I){r.value=!0;try{const P=await o.browseFs(I);if(!P.path){l.value=!0;return}a.value=P.path,c.value=P.parent,u.value=P.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function M(I){I.isDir&&k(I.path)}function E(){c.value&&k(c.value)}function O(){$.value&&s("add",a.value)}function S(){C.value.length!==0&&s("add",C.value)}return bn(async()=>{r.value=!0;try{if(o.defaultPath&&(await k(o.defaultPath),!l.value))return;const I=await o.getFsHome();I.home?await k(I.home):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),_n(()=>{b&&clearTimeout(b)}),(I,P)=>(w(),ge(rr,{open:i.value,"onUpdate:open":P[5]||(P[5]=D=>i.value=D),title:A(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:P[6]||(P[6]=D=>s("close"))},{default:ke(()=>[T("div",Ese,[l.value?ie("",!0):(w(),N(Oe,{key:0},[T("div",Ise,[se(vn,{size:"sm",disabled:!c.value,label:A(n)("workspace.up"),onClick:E},{default:ke(()=>[se(Je,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),T("div",$se,[(w(!0),N(Oe,null,st(L.value,(D,H)=>(w(),N(Oe,{key:D.path},[H>1?(w(),N("span",Nse,"/")):ie("",!0),T("button",{class:De(["crumb",{last:H===L.value.length-1}]),onClick:z=>k(D.path)},R(D.label),11,Lse)],64))),128))])]),r.value?ie("",!0):(w(),N("div",Ose,[se(Je,{class:"filter-icon",name:"search",size:"md"}),En(T("input",{"onUpdate:modelValue":P[0]||(P[0]=D=>d.value=D),class:"filter-input",type:"text",placeholder:A(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:P[1]||(P[1]=yt(()=>{},["stop"]))},null,40,Pse),[[ms,d.value]]),f.value?(w(),ge(Zs,{key:0,size:"sm"})):ie("",!0)])),T("div",Rse,[r.value?(w(),N("div",Dse,R(A(n)("workspace.browsing")),1)):p.value?(w(),N(Oe,{key:1},[(w(!0),N(Oe,null,st(h.value,D=>(w(),N("button",{key:D.path,class:"folder-row",onClick:H=>k(D.path)},[se(Je,{class:"dir-icon",name:"folder-closed",size:"sm"}),T("span",Fse,R(D.rel),1),D.isGitRepo?(w(),ge($o,{key:0,variant:"info",size:"sm"},{default:ke(()=>[je(R(A(n)("workspace.gitTag")),1),D.branch?(w(),N("span",Hse,R(D.branch),1)):ie("",!0)]),_:2},1024)):ie("",!0)],8,Bse))),128)),!f.value&&h.value.length===0?(w(),N("div",Wse,R(A(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(w(),N("div",zse,R(A(n)("workspace.searching")),1)):ie("",!0)],64)):(w(),N(Oe,{key:2},[(w(!0),N(Oe,null,st(u.value,D=>(w(),N("button",{key:D.path,class:"folder-row",onClick:H=>M(D)},[se(Je,{class:"dir-icon",name:"folder-closed",size:"sm"}),T("span",qse,R(D.name),1),D.isGitRepo?(w(),ge($o,{key:0,variant:"info",size:"sm"},{default:ke(()=>[je(R(A(n)("workspace.gitTag")),1),D.branch?(w(),N("span",jse,R(D.branch),1)):ie("",!0)]),_:2},1024)):ie("",!0)],8,Use))),128)),u.value.length===0?(w(),N("div",Vse,R(A(n)("workspace.noSubfolders")),1)):ie("",!0)],64))])],64)),T("div",{class:De(["paste-section",{"paste-only":l.value}])},[!l.value&&!v.value?(w(),ge(Rt,{key:0,variant:"ghost",size:"sm",onClick:P[2]||(P[2]=D=>v.value=!0)},{default:ke(()=>[je(R(A(n)("workspace.pasteToggle")),1)]),_:1})):(w(),ge(Zc,{key:1,label:A(n)("workspace.pathLabel")},{default:ke(()=>[T("div",Kse,[T("div",Gse,[se(Za,{modelValue:y.value,"onUpdate:modelValue":P[3]||(P[3]=D=>y.value=D),placeholder:A(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:ai(yt(S,["stop"]),["enter"])},null,8,["modelValue","placeholder","onKeydown"])]),se(vn,{disabled:C.value.length===0,label:A(n)("workspace.add"),onClick:S},{default:ke(()=>[se(Je,{name:"plus",size:"md"})]),_:1},8,["disabled","label"])])]),_:1},8,["label"]))],2),e.error?(w(),N("div",Yse,R(e.error),1)):ie("",!0),T("div",Xse,[se(zt,{text:a.value},{default:ke(()=>[l.value?ie("",!0):(w(),ge(Rt,{key:0,variant:"primary",disabled:!$.value,onClick:O},{default:ke(()=>[je(R(A(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),se(Rt,{variant:"secondary",onClick:P[4]||(P[4]=D=>s("close"))},{default:ke(()=>[je(R(A(n)("workspace.cancel")),1)]),_:1})]),T("div",Qse,R(A(n)("workspace.browseHint")),1)])]),_:1},8,["open","title"]))}}),tie=ft(eie,[["__scopeId","data-v-ad529757"]]),nie={key:0,class:"confirm-dialog__message"},oie=Ve({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=t,{t:o}=Nt();function s(){n("update:open",!1),n("cancel")}return(i,r)=>(w(),ge(rr,{open:e.open,title:e.title,height:"auto","onUpdate:open":r[1]||(r[1]=l=>n("update:open",l)),onClose:s},{foot:ke(()=>[se(Rt,{variant:"secondary",disabled:e.loading,onClick:s},{default:ke(()=>[je(R(e.cancelLabel??A(o)("common.cancel")),1)]),_:1},8,["disabled"]),se(Rt,{variant:e.variant,loading:e.loading,onClick:r[0]||(r[0]=l=>n("confirm"))},{default:ke(()=>[je(R(e.confirmLabel??A(o)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:ke(()=>[e.message?(w(),N("p",nie,R(e.message),1)):ie("",!0)]),_:1},8,["open","title"]))}}),sie=ft(oie,[["__scopeId","data-v-a9df9b9a"]]),iie=Ve({__name:"ConfirmDialogHost",setup(e){const{current:t,settle:n}=ol();return(o,s)=>(w(),ge(sie,{open:A(t)!==null,title:A(t)?.title??"",message:A(t)?.message,"confirm-label":A(t)?.confirmLabel,"cancel-label":A(t)?.cancelLabel,variant:A(t)?.variant,onConfirm:s[0]||(s[0]=i=>A(n)(!0)),onCancel:s[1]||(s[1]=i=>A(n)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant"]))}}),rie={class:"rows"},lie={class:"row"},aie={class:"row"},cie={class:"row"},uie={class:"row"},die={class:"row"},fie={class:"row"},pie={class:"ctx-text"},hie={key:0,class:"bar"},mie={class:"row"},gie=Ve({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t,i=Z(!0),r=W(()=>o.status.ctxMax>0?Math.round(o.status.ctxUsed/o.status.ctxMax*100):0),l=W(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:o.status.ctxUsed.toLocaleString(),max:o.status.ctxMax.toLocaleString(),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=W(()=>{const p=o.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=W(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=W(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=W(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=W(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,m)=>(w(),ge(rr,{open:i.value,"onUpdate:open":m[0]||(m[0]=b=>i.value=b),title:A(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=b=>s("close"))},{default:ke(()=>[T("dl",rie,[T("div",lie,[T("dt",null,R(A(n)("status.statusModel")),1),T("dd",null,R(e.status.model),1)]),T("div",aie,[T("dt",null,R(A(n)("status.statusThinking")),1),T("dd",null,R(e.thinking),1)]),T("div",cie,[T("dt",null,R(A(n)("status.statusPermission")),1),T("dd",{style:Yt({color:c.value})},R(a(e.status.permission)),5)]),T("div",uie,[T("dt",null,R(A(n)("status.statusPlanMode")),1),T("dd",{class:De({"plan-on":e.planMode})},R(u.value),3)]),T("div",die,[T("dt",null,R(A(n)("status.statusSwarmMode")),1),T("dd",{class:De({"swarm-on":e.swarmMode})},R(d.value),3)]),T("div",fie,[T("dt",null,R(A(n)("status.statusContext")),1),T("dd",null,[T("span",pie,R(l.value),1),e.status.ctxMax>0?(w(),N("span",hie,[T("i",{style:Yt({width:r.value+"%"})},null,4)])):ie("",!0)])]),T("div",mie,[T("dt",null,R(A(n)("status.statusCost")),1),T("dd",null,R(h.value),1)])])]),_:1},8,["open","title"]))}}),vie=ft(gie,[["__scopeId","data-v-59dd31f3"]]),yie={class:"ui-toast__icon","aria-hidden":"true"},kie={class:"ui-toast__body"},bie={class:"ui-toast__title"},_ie={key:0,class:"ui-toast__msg"},wie=Ve({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(w(),N("div",{class:De(["ui-toast",`ui-toast--${e.variant}`])},[T("span",yie,[An(t.$slots,"icon",{},()=>[e.variant==="success"?(w(),ge(Je,{key:0,name:"check"})):e.variant==="danger"?(w(),ge(Je,{key:1,name:"close"})):e.variant==="warning"?(w(),ge(Je,{key:2,name:"alert-triangle"})):(w(),ge(Je,{key:3,name:"info"}))],!0)]),T("div",kie,[T("div",bie,R(e.title),1),e.message?(w(),N("div",_ie,R(e.message),1)):ie("",!0),An(t.$slots,"default",{},void 0,!0)]),se(vn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:ke(()=>[se(Je,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Sie=ft(wie,[["__scopeId","data-v-adc6f346"]]),Cie={key:0,class:"actions"},xie=["onClick"],Aie=["onClick"],Tie={key:1,class:"details"},Mie=Ve({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Nt();function i(k){return typeof k=="object"&&k!==null}function r(k){return i(k)?k.title:k}function l(k){return i(k)?k.message??"":""}function a(k){return i(k)?k.details:void 0}function c(k){return i(k)?k.severity==="error":k.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(k)}function u(k){return i(k)?`notice:${k.severity}:${k.title}:${k.message??""}:${JSON.stringify(k.details??[])}`:`text:${k}`}function d(k){if(!i(k))return k;const M=[k.title];k.message&&M.push(k.message);const E=k.details??[];if(E.length>0){M.push("",`${s("warnings.diagnostics")}:`);for(const O of E)M.push(`${O.label}: ${O.value}`)}return M.join(`
|
|
261
|
+
`)}let f=1;const h=Z([]),p=new Map,m=new Map;function b(k){const M=c(k)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?M+5e3:M}function _(k,M){const E=p.get(k)??{handle:null,deadline:0,remaining:0};E.handle=setTimeout(()=>$(k),M),E.deadline=Date.now()+M,p.set(k,E)}function g(k){const M=p.get(k);M&&M.handle!==null&&clearTimeout(M.handle),p.delete(k)}function v(k){const M=p.get(k);!M||M.handle===null||(clearTimeout(M.handle),M.handle=null,M.remaining=Math.max(0,M.deadline-Date.now()))}function y(k){if(h.value.find(O=>O.id===k)?.detailsOpen)return;const E=p.get(k);!E||E.handle!==null||_(k,E.remaining)}function C(k){k.detailsOpen=!k.detailsOpen,k.detailsOpen?v(k.id):y(k.id)}async function L(k){if(!await Wo(d(k.warning)))return;k.copied=!0;const E=m.get(k.id);E&&clearTimeout(E),m.set(k.id,setTimeout(()=>{k.copied=!1,m.delete(k.id)},1400))}function $(k){g(k);const M=m.get(k);M&&clearTimeout(M),m.delete(k);const E=h.value.findIndex(O=>O.id===k);E!==-1&&(h.value=h.value.filter(O=>O.id!==k),o("dismiss",E))}return Ge(()=>n.warnings,k=>{const M=[...h.value];h.value=k.map(E=>{const O=u(E),S=M.findIndex(D=>D.key===O),I=S===-1?void 0:M.splice(S,1)[0];if(I)return I.warning=E,I;const P={id:f++,key:O,warning:E,detailsOpen:!1,copied:!1};return _(P.id,b(E)),P});for(const E of M){g(E.id);const O=m.get(E.id);O&&clearTimeout(O),m.delete(E.id)}},{immediate:!0,flush:"post"}),_n(()=>{p.forEach(k=>{k.handle!==null&&clearTimeout(k.handle)}),p.clear(),m.forEach(k=>clearTimeout(k)),m.clear()}),(k,M)=>(w(),ge(K$,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:ke(()=>[(w(!0),N(Oe,null,st(h.value,E=>(w(),ge(Sie,{key:E.id,variant:c(E.warning)?"danger":"warning",title:r(E.warning),message:l(E.warning),"dismiss-label":A(s)("warnings.dismiss"),onDismiss:O=>$(E.id),onPointerenter:O=>v(E.id),onPointerleave:O=>y(E.id)},{default:ke(()=>[a(E.warning)?.length?(w(),N("div",Cie,[T("button",{class:"link",type:"button",onClick:O=>C(E)},R(E.detailsOpen?A(s)("warnings.hideDetails"):A(s)("warnings.showDetails")),9,xie),T("button",{class:"link",type:"button",onClick:O=>L(E)},R(E.copied?A(s)("warnings.copied"):A(s)("warnings.copyDetails")),9,Aie)])):ie("",!0),E.detailsOpen&&a(E.warning)?.length?(w(),N("dl",Tie,[(w(!0),N(Oe,null,st(a(E.warning),O=>(w(),N("div",{key:`${O.label}:${O.value}`,class:"detail-row"},[T("dt",null,R(O.label),1),T("dd",null,R(O.value),1)]))),128))])):ie("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Eie=ft(Mie,[["__scopeId","data-v-92efeff8"]]),Iie={class:"topbar"},$ie={class:"wsq"},Nie=["aria-label"],Lie={class:"tb-path"},Oie={class:"ws"},Pie={class:"se"},Rie={class:"tb-sub"},Die=Ve({__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}=Nt(),o=e,s=t,i=W(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=W(()=>o.workspace?.name??n("workspace.noWorkspace")),l=W(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(w(),N("div",Iie,[T("span",$ie,R(i.value),1),T("button",{type:"button",class:"tb-mid","aria-label":A(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[T("span",Lie,[T("span",Oie,R(r.value),1),e.sessionTitle?(w(),N(Oe,{key:0},[c[2]||(c[2]=T("span",{class:"sl"},"/",-1)),T("span",Pie,R(e.sessionTitle),1)],64)):ie("",!0),c[3]||(c[3]=T("span",{class:"cv"},"⌄",-1))]),T("span",Rie,[T("span",{class:De(["rd",{on:e.running}])},null,2),T("span",null,R(l.value),1),e.branch?(w(),N(Oe,{key:0},[je(" · "+R(e.branch),1)],64)):ie("",!0),e.sessionCount>0?(w(),N(Oe,{key:1},[je(" · "+R(A(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ie("",!0)])],8,Nie),se(vn,{size:"lg",label:A(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:ke(()=>[se(Je,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Bie=ft(Die,[["__scopeId","data-v-59a11935"]]),Fie={key:0,class:"sheet-root"},Hie=["aria-label"],Wie=["aria-label"],zie={key:0,class:"sheet-head"},Uie={class:"sheet-title"},qie={class:"sheet-body"},jie=Ve({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return Ge(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),_n(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(w(),ge(Kr,{name:"sheet"},{default:ke(()=>[e.modelValue?(w(),N("div",Fie,[T("div",{class:"sheet-scrim",onClick:i}),T("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||A(n)("mobile.sheetLabel")},[T("button",{type:"button",class:"sheet-grab","aria-label":A(n)("mobile.closeSheet"),onClick:i},null,8,Wie),e.title?(w(),N("div",zie,[T("span",Uie,R(e.title),1)])):ie("",!0),T("div",qie,[An(l.$slots,"default",{},void 0,!0)])],8,Hie)])):ie("",!0)]),_:3}))}}),y3=ft(jie,[["__scopeId","data-v-4441dd70"]]),Vie={class:"mlist"},Kie={key:0,class:"mempty"},Gie=["onClick"],Yie={class:"mgh-main"},Xie={class:"mgh-name"},Qie={class:"mgh-path"},Zie={key:2,class:"att"},Jie={key:0,class:"mempty small"},ere=["onClick"],tre={class:"m"},nre={class:"s"},ore={key:0,class:"att"},sre=["disabled","onClick"],ire=["onClick"],rre=Ve({__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","loadMore"],setup(e,{emit:t}){const{t:n}=Nt(),{confirm:o}=ol(),s=e,i=t;function r(){i("update:modelValue",!1)}function l(S){i("select",S),r()}function a(S){i("createInWorkspace",S),r()}function c(){i("create"),r()}function u(){i("addWorkspace"),r()}const d=Z(new Set);function f(S){return d.value.has(S)}function h(S){const I=new Set(d.value);I.has(S)?I.delete(S):I.add(S),d.value=I,y.value=null,k.value=null}const p=Z(new Set);function m(S){return p.value.has(S)}function b(S){const I=new Set(p.value);I.has(S)?I.delete(S):I.add(S),p.value=I}function _(S){if(m(S.workspace.id))return S.sessions;const I=S.sessions.slice(0,S.initialCount);if(s.activeId&&!I.some(P=>P.id===s.activeId)){const P=S.sessions.find(D=>D.id===s.activeId);if(P)return[...I,P]}return I}function g(S){if(!p.value.has(S)){const I=new Set(p.value);I.add(S),p.value=I}i("loadMore",S)}function v(S){return s.attentionByWorkspace[S]??0}const y=Z(null);function C(S){y.value=y.value===S?null:S,k.value=null}function L(S){y.value=null;const P=(typeof window<"u"?window.prompt(n("sidebar.rename"),S.title):null)?.trim();P&&i("rename",S.id,P)}async function $(S){y.value=null,await o({title:n("sidebar.archive"),message:n("sidebar.archiveConfirm"),variant:"danger"})&&i("archive",S)}const k=Z(null);function M(S){k.value=k.value===S?null:S,y.value=null}function E(S){Wo(S.root),k.value=null}async function O(S){k.value=null,await o({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:S.name}),variant:"danger"})&&i("deleteWorkspace",S.id)}return(S,I)=>(w(),ge(y3,{"model-value":e.modelValue,"onUpdate:modelValue":I[2]||(I[2]=P=>i("update:modelValue",P))},{default:ke(()=>[T("button",{type:"button",class:"newrow",onClick:c},[se(Je,{name:"message",size:"sm"}),je(" "+R(A(n)("sidebar.newChat")),1)]),T("button",{type:"button",class:"newrow secondary",onClick:u},[se(Je,{name:"folder",size:"sm"}),je(" "+R(A(n)("sidebar.newWorkspace")),1)]),T("div",Vie,[e.groups.length===0?(w(),N("div",Kie,R(A(n)("workspace.noWorkspace")),1)):ie("",!0),(w(!0),N(Oe,null,st(e.groups,P=>(w(),N("div",{key:P.workspace.id,class:"mgroup"},[T("div",{class:De(["mgh",{on:P.workspace.id===e.activeWorkspaceId}]),onClick:D=>h(P.workspace.id)},[f(P.workspace.id)?(w(),ge(Je,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(w(),ge(Je,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),T("div",Yie,[T("span",Xie,R(P.workspace.name),1),se(zt,{text:P.workspace.root},{default:ke(()=>[T("span",Qie,R(P.workspace.branch||P.workspace.shortPath),1)]),_:2},1032,["text"])]),f(P.workspace.id)&&v(P.workspace.id)>0?(w(),N("span",Zie,R(v(P.workspace.id)),1)):ie("",!0),se(vn,{size:"lg",class:"mgh-more",label:A(n)("sidebar.options"),onClick:yt(D=>M(P.workspace.id),["stop"])},{default:ke(()=>[se(Je,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),se(vn,{size:"lg",class:"mgh-add",label:A(n)("workspace.newInGroup"),onClick:yt(D=>a(P.workspace.id),["stop"])},{default:ke(()=>[se(Je,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),k.value===P.workspace.id?(w(),ge(Fl,{key:3,class:"kmenu wsmenu",onClick:I[0]||(I[0]=yt(()=>{},["stop"]))},{default:ke(()=>[se(dn,{size:"lg",onClick:D=>E(P.workspace)},{default:ke(()=>[je(R(A(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),se(dn,{size:"lg",danger:"",onClick:D=>O(P.workspace)},{default:ke(()=>[je(R(A(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ie("",!0)],10,Gie),En(T("div",null,[P.sessions.length===0?(w(),N("div",Jie,R(A(n)("sidebar.noSessions")),1)):ie("",!0),(w(!0),N(Oe,null,st(_(P),D=>(w(),N("div",{key:D.id,class:De(["srow",{cur:D.id===e.activeId}]),onClick:H=>l(D.id)},[T("div",tre,[T("div",{class:De(["t",{run:D.busy,aborted:D.status==="aborted"}])},R(D.title),3),T("div",nre,R(D.time),1)]),(e.attentionBySession[D.id]??0)>0?(w(),N("span",ore,R(e.attentionBySession[D.id]),1)):ie("",!0),se(vn,{size:"lg",class:"kb",label:A(n)("sidebar.options"),onClick:yt(H=>C(D.id),["stop"])},{default:ke(()=>[se(Je,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===D.id?(w(),ge(Fl,{key:1,class:"kmenu",onClick:I[1]||(I[1]=yt(()=>{},["stop"]))},{default:ke(()=>[se(dn,{size:"lg",onClick:H=>L(D)},{default:ke(()=>[je(R(A(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),se(dn,{size:"lg",danger:"",onClick:H=>$(D.id)},{default:ke(()=>[je(R(A(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ie("",!0)],10,ere))),128)),P.hasMore||P.loadingMore?(w(),N("button",{key:1,type:"button",class:"mshow-more",disabled:P.loadingMore,onClick:yt(D=>g(P.workspace.id),["stop"])},R(P.loadingMore?A(n)("sidebar.loadingMore"):A(n)("sidebar.showMore",{count:Math.max(0,P.workspace.sessionCount-P.sessions.length)})),9,sre)):ie("",!0),P.sessions.length>P.initialCount?(w(),N("button",{key:2,type:"button",class:"mshow-more",onClick:yt(D=>b(P.workspace.id),["stop"])},R(m(P.workspace.id)?A(n)("sidebar.showLess"):A(n)("sidebar.showAll",{count:P.sessions.length-P.initialCount})),9,ire)):ie("",!0)],512),[[Vs,!f(P.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),lre=ft(rre,[["__scopeId","data-v-58db7de1"]]),are={class:"group-title"},cre={class:"srow-main"},ure={class:"srow-label"},dre={class:"srow-sub"},fre={class:"srow-main"},pre={class:"srow-label"},hre={class:"srow-val"},mre={class:"srow-main"},gre={class:"srow-label"},vre={class:"srow-sub"},yre=["aria-checked"],kre={class:"srow-main"},bre={class:"srow-label"},_re={class:"srow-sub"},wre=["aria-checked"],Sre={class:"srow-main"},Cre={class:"srow-label"},xre={class:"srow read-only"},Are={class:"srow-main"},Tre={class:"srow-label"},Mre={class:"srow-sub"},Ere=["aria-label"],Ire={class:"group-title"},$re={class:"srow read-only pref"},Nre={class:"srow-main"},Lre={class:"srow-label"},Ore={class:"srow read-only pref"},Pre={class:"srow-main"},Rre={class:"srow-label"},Dre={class:"srow read-only pref"},Bre={class:"srow-main"},Fre={class:"srow-label"},Hre={class:"num-field"},Wre=["value","aria-label"],zre={class:"srow-main"},Ure={class:"srow-label"},qre={class:"srow-sub"},jre=["aria-checked"],Vre={class:"srow-main"},Kre={class:"srow-label"},Gre={class:"srow-main"},Yre={class:"srow-label"},Xre={key:2,class:"srow read-only"},Qre={class:"srow-main"},Zre={class:"srow-label"},Jre={class:"srow-val dim"},ele=Ve({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Nt(),o=e,s=t;function i(y){s("setColorScheme",y)}const r=["manual","auto","yolo"],l=W(()=>o.thinking??"high"),a=W(()=>o.planMode===!0),c=W(()=>o.swarmMode===!0),u=W(()=>{const y=o.status.permission;return y==="yolo"?"var(--color-danger)":y==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),d=W(()=>{const y=o.status.permission,C=n(y==="yolo"?"mobile.permYoloSub":y==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${y} · ${C}`}),f=y=>`${Math.round(y/1e3)}k`,h=W(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(o.status.ctxUsed/o.status.ctxMax*100))):0),p=W(()=>o.status.ctxMax>0?`${f(o.status.ctxUsed)}/${f(o.status.ctxMax)}`:n("status.statusNone"));function m(){s("setThinking",l.value==="off"?"high":"off")}function b(){const y=r.indexOf(o.status.permission),C=r[(y+1)%r.length];s("setPermission",C)}function _(){s("pickModel"),s("update:modelValue",!1)}function g(){s("login"),s("update:modelValue",!1)}function v(){s("logout"),s("update:modelValue",!1)}return(y,C)=>(w(),ge(y3,{"model-value":e.modelValue,title:A(n)("mobile.settingsTitle"),"onUpdate:modelValue":C[4]||(C[4]=L=>s("update:modelValue",L))},{default:ke(()=>[T("div",are,R(A(n)("mobile.groupSession")),1),T("button",{type:"button",class:"srow",onClick:_},[T("span",cre,[T("span",ure,R(A(n)("status.statusModel")),1),T("span",dre,R(e.status.model),1)]),C[5]||(C[5]=T("span",{class:"chev"},"›",-1))]),T("button",{type:"button",class:"srow",onClick:m},[T("span",fre,[T("span",pre,R(A(n)("status.statusThinking")),1)]),T("span",hre,R(l.value==="off"?A(n)("status.planOff"):A(n)("status.planOn")),1),C[6]||(C[6]=T("span",{class:"chev"},"›",-1))]),T("button",{type:"button",class:"srow",onClick:C[0]||(C[0]=L=>s("togglePlan"))},[T("span",mre,[T("span",gre,R(A(n)("status.statusPlanMode")),1),T("span",vre,R(A(n)("mobile.planModeSub")),1)]),T("span",{class:De(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,yre)]),T("button",{type:"button",class:"srow",onClick:C[1]||(C[1]=L=>s("toggleSwarm"))},[T("span",kre,[T("span",bre,R(A(n)("status.statusSwarmMode")),1),T("span",_re,R(A(n)("mobile.swarmModeSub")),1)]),T("span",{class:De(["toggle",{on:c.value}]),role:"switch","aria-checked":c.value},null,10,wre)]),T("button",{type:"button",class:"srow",onClick:b},[T("span",Sre,[T("span",Cre,R(A(n)("status.statusPermission")),1),T("span",{class:"srow-sub",style:Yt({color:u.value})},R(d.value),5)]),C[7]||(C[7]=T("span",{class:"chev"},"›",-1))]),T("div",xre,[T("span",Are,[T("span",Tre,R(A(n)("status.statusContext")),1),T("span",Mre,R(p.value),1)]),T("span",{class:"ctx-meter","aria-label":p.value},[T("i",{style:Yt({width:h.value+"%"})},null,4)],8,Ere)]),T("div",Ire,R(A(n)("mobile.groupApp")),1),T("div",$re,[T("span",Nre,[T("span",Lre,R(A(n)("theme.colorSchemeLabel")),1)]),se(Xs,{"model-value":e.colorScheme??"system",options:[{value:"light",label:A(n)("theme.light")},{value:"dark",label:A(n)("theme.dark")},{value:"system",label:A(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),T("div",Ore,[T("span",Pre,[T("span",Rre,R(A(n)("sidebar.language")),1)]),se(g3)]),T("div",Dre,[T("span",Bre,[T("span",Fre,R(A(n)("settings.uiFontSize")),1)]),T("label",Hre,[T("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":A(n)("settings.uiFontSize"),onInput:C[2]||(C[2]=L=>s("setUiFontSize",Number(L.target.value)))},null,40,Wre),C[8]||(C[8]=T("span",{class:"num-unit"},"px",-1))])]),T("button",{type:"button",class:"srow",onClick:C[3]||(C[3]=L=>s("setConversationToc",!e.conversationToc))},[T("span",zre,[T("span",Ure,R(A(n)("settings.conversationToc")),1),T("span",qre,R(A(n)("settings.conversationTocHint")),1)]),T("span",{class:De(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,jre)]),e.authReady?(w(),N("button",{key:0,type:"button",class:"srow acct out",onClick:v},[T("span",Vre,[T("span",Kre,R(A(n)("sidebar.signOut")),1)])])):(w(),N("button",{key:1,type:"button",class:"srow acct in",onClick:g},[T("span",Gre,[T("span",Yre,R(A(n)("sidebar.signIn")),1)])])),e.serverVersion?(w(),N("div",Xre,[T("span",Qre,[T("span",Zre,R(A(n)("settings.serverVersion")),1)]),T("span",Jre,R(e.serverVersion),1)])):ie("",!0)]),_:1},8,["model-value","title"]))}}),tle=ft(ele,[["__scopeId","data-v-6c7aa567"]]),k3=["blue","mono"],b3=["light","dark","system"],_3=14,nle=12,ole=20;function sle(){const e=Jn($t.accent);return e&&k3.includes(e)?e:"blue"}function ile(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function rle(){const e=Jn($t.colorScheme);return e&&b3.includes(e)?e:"system"}function lle(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(o=>{const i=(o.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";o.setAttribute("content",n??i)})}function uy(e){return Number.isFinite(e)?Math.min(ole,Math.max(nle,Math.round(e))):_3}function ale(){const e=Jn($t.uiFontSize);return e===null?_3:uy(Number(e))}function cle(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${uy(e)}px`)}const dy=Z(rle()),fy=Z(sle()),py=Z(ale());Ge(dy,lle,{immediate:!0});Ge(fy,ile,{immediate:!0});Ge(py,cle,{immediate:!0});function ule(e){b3.includes(e)&&(dy.value=e,no($t.colorScheme,e))}function dle(e){k3.includes(e)&&(fy.value=e,no($t.accent,e))}function fle(e){const t=uy(e);py.value=t,no($t.uiFontSize,String(t))}const ple=600,hle=250,$h=250,mle=1e3,gle=160,Rp=Z(!1);let $l=[],Pl=null,Dp=-$h;function vle(){$l=[],Dp=-$h,Rp.value=!1,Pl!==null&&(clearTimeout(Pl),Pl=null)}function yle(){Rp.value=!0,Pl!==null&&clearTimeout(Pl),Pl=setTimeout(()=>{Pl=null,$l=[],Dp=-$h,Rp.value=!1},mle)}function kle(e){if(e<=0)return;const t=Date.now();$l.push({time:t,chars:e});const n=t-ple;if($l=$l.filter(l=>l.time>=n),t-Dp<$h)return;Dp=t;const o=$l[0]?.time??t,s=Math.max(t-o,hle);$l.reduce((l,a)=>l+a.chars,0)/s*1e3>=gle&&yle()}function w3(){return{colorScheme:dy,accent:fy,uiFontSize:py,fastMoon:Rp,setColorScheme:ule,setAccent:dle,setUiFontSize:fle,resetFastMoon:vle,recordMoonDelta:kle}}const ble={class:"ob-brand"},_le={class:"ob-brand-text"},wle={class:"ob-title"},Sle={class:"ob-sub"},Cle={class:"ob-sec"},xle={class:"ob-label"},Ale={class:"ob-sec"},Tle={class:"ob-label"},Mle={class:"ob-sec"},Ele={class:"ob-label"},Ile=Ve({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=Nt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=w3();function c(d){s.value!==d&&_A(d)}function u(){n("complete")}return(d,f)=>(w(),ge(rr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:ke(()=>[T("div",ble,[f[4]||(f[4]=T("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[T("defs",null,[T("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[T("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),T("g",{class:"ob-eyes",fill:"#000"},[T("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),T("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),T("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),T("div",_le,[T("div",wle,R(A(o)("onboarding.title")),1),T("div",Sle,R(A(o)("onboarding.subtitle")),1)])])]),default:ke(()=>[T("section",Cle,[T("div",xle,R(A(o)("onboarding.languageLabel")),1),se(Xs,{"model-value":A(s),options:A(bA).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),T("section",Ale,[T("div",Tle,R(A(o)("theme.colorSchemeLabel")),1),se(Xs,{"model-value":A(i),options:[{value:"light",label:A(o)("theme.light")},{value:"dark",label:A(o)("theme.dark")},{value:"system",label:A(o)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>A(l)(h))},null,8,["model-value","options"])]),T("section",Mle,[T("div",Ele,R(A(o)("theme.accentLabel")),1),se(Xs,{"model-value":A(r),options:[{value:"blue",label:A(o)("theme.accentBlue")},{value:"mono",label:A(o)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>A(a)(h))},null,8,["model-value","options"])]),se(Rt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:ke(()=>[je(R(A(o)("onboarding.start")),1)]),_:1})]),_:1}))}}),$le=ft(Ile,[["__scopeId","data-v-fbdd3eab"]]),Nle=["aria-label"],Lle={class:"gload-box"},Ole={class:"gload-text"},Ple=Ve({__name:"GlobalLoading",setup(e){const{t}=Nt();return(n,o)=>(w(),N("div",{class:"gload",role:"status","aria-label":A(t)("app.connecting")},[T("div",Lle,[o[0]||(o[0]=e0('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-8d6a5c44><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-8d6a5c44></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-8d6a5c44></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-8d6a5c44></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-8d6a5c44></path></svg>',1)),se(Zs,{size:"md",label:A(t)("app.connecting")},null,8,["label"]),T("div",Ole,R(A(t)("app.connecting")),1)])],8,Nle))}}),Rle=ft(Ple,[["__scopeId","data-v-8d6a5c44"]]),Dle={class:"kap-root"},Ble={class:"kap-head"},Fle={class:"kap-count"},Hle={class:"kap-head-actions"},Wle={class:"kap-filters"},zle=["value"],Ule={class:"kap-check"},qle={class:"kap-check"},jle={class:"kap-view-toggle",role:"group"},Vle={key:0,class:"kap-empty"},Kle=["onClick"],Gle={class:"kap-ts"},Yle={class:"kap-label"},Xle={key:0,class:"kap-detail"},Qle={class:"kap-detail-actions"},Zle=["onClick"],Jle={key:1,class:"kap-agg"},eae={class:"mono"},tae={class:"mono"},nae={class:"num"},oae={class:"num"},sae={key:0},iae={class:"mono"},rae={class:"num"},lae={class:"num"},aae={key:0},cae=Ve({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=Z("all"),s=Z(""),i=Z(""),r=Z(!1),l=Z("timeline"),a=W(()=>(cy.value,[...Kne()])),c=W(()=>{const M=new Set;for(const E of a.value)E.sessionId&&M.add(E.sessionId);return[...M].sort()});function u(M){return M.kind==="rest:error"||M.code!==void 0&&M.code!==0||M.eventType==="error"||M.eventType==="parse-error"}const d=W(()=>{const M=s.value.trim().toLowerCase();return a.value.filter(E=>!(o.value!=="all"&&E.source!==o.value||i.value&&E.sessionId!==i.value||r.value&&!u(E)||M&&!`${E.label} ${E.kind} ${E.eventType??""} ${E.sessionId??""} ${E.requestId??""}`.toLowerCase().includes(M)))}),f=W(()=>{const M=new Map;for(const E of d.value){if(E.kind!=="ws:in"&&E.kind!=="ws:out")continue;const O=E.kind==="ws:in"?"←":"→",S=`${O} ${E.eventType??"?"} @ ${E.sessionId??"-"}`,I=M.get(S)??{key:S,sessionId:E.sessionId??"-",eventType:E.eventType??"?",dir:O,count:0};I.count++,E.seq!==void 0&&(I.lastSeq=E.seq),M.set(S,I)}return[...M.values()].sort((E,O)=>O.count-E.count)}),h=W(()=>{const M=new Map;for(const E of d.value){if(E.source!=="rest"||E.kind==="rest:request")continue;const O=`${E.method??"?"} ${E.path??"?"}`,S=M.get(O)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(E)&&S.errors++,E.durationMs!==void 0&&(S.totalMs+=E.durationMs,S.timed++),M.set(O,S)}return[...M.entries()].map(([E,O])=>({key:E,count:O.count,errors:O.errors,avgMs:O.timed>0?Math.round(O.totalMs/O.timed):0})).sort((E,O)=>O.count-E.count)}),p=Z(null),m=Z(!0),b=Z(null),_=Z(null);Ge(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await gt();const M=b.value;M&&(M.scrollTop=M.scrollHeight)});function g(M){p.value=p.value===M?null:M}function v(M){const E=new Date(M),O=(S,I=2)=>String(S).padStart(I,"0");return`${O(E.getHours())}:${O(E.getMinutes())}:${O(E.getSeconds())}.${O(E.getMilliseconds(),3)}`}function y(M){return JSON.stringify(M,null,2)}async function C(M){await Wo(y(M))&&(_.value=M.id,setTimeout(()=>{_.value===M.id&&(_.value=null)},1500))}function L(){v3(d.value)}function $(M){return u(M)||M.source==="client"?"b-err":M.source==="rest"?"b-rest":M.kind==="ws:lifecycle"?"b-life":M.kind==="ws:out"?"b-out":"b-in"}function k(M){return M.source==="rest"?"REST":M.source==="client"?"APP":"WS"}return(M,E)=>(w(),N("section",Dle,[T("header",Ble,[E[11]||(E[11]=T("strong",null,"KAP debug",-1)),T("span",Fle,R(d.value.length)+"/"+R(a.value.length),1),T("div",Hle,[T("button",{type:"button",class:De({on:A(Jc)}),onClick:E[0]||(E[0]=O=>Jc.value=!A(Jc))},R(A(Jc)?"resume":"pause"),3),T("button",{type:"button",onClick:E[1]||(E[1]=O=>A(Gne)())},"clear"),T("button",{type:"button",onClick:E[2]||(E[2]=O=>L())},"export jsonl"),se(zt,{text:"Close window"},{default:ke(()=>[T("button",{type:"button",onClick:E[3]||(E[3]=O=>n("close"))},"✕")]),_:1})])]),T("div",Wle,[En(T("select",{"onUpdate:modelValue":E[4]||(E[4]=O=>o.value=O),"aria-label":"Source filter"},[...E[12]||(E[12]=[T("option",{value:"all"},"rest + ws + app",-1),T("option",{value:"rest"},"rest",-1),T("option",{value:"ws"},"ws",-1),T("option",{value:"client"},"app errors",-1)])],512),[[Mv,o.value]]),En(T("select",{"onUpdate:modelValue":E[5]||(E[5]=O=>i.value=O),"aria-label":"Session filter"},[E[13]||(E[13]=T("option",{value:""},"all sessions",-1)),(w(!0),N(Oe,null,st(c.value,O=>(w(),N("option",{key:O,value:O},R(O),9,zle))),128))],512),[[Mv,i.value]]),En(T("input",{"onUpdate:modelValue":E[6]||(E[6]=O=>s.value=O),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[ms,s.value]]),T("label",Ule,[En(T("input",{"onUpdate:modelValue":E[7]||(E[7]=O=>r.value=O),type:"checkbox"},null,512),[[np,r.value]]),E[14]||(E[14]=je(" errors",-1))]),T("label",qle,[En(T("input",{"onUpdate:modelValue":E[8]||(E[8]=O=>m.value=O),type:"checkbox"},null,512),[[np,m.value]]),E[15]||(E[15]=je(" follow",-1))]),T("div",jle,[T("button",{type:"button",class:De({on:l.value==="timeline"}),onClick:E[9]||(E[9]=O=>l.value="timeline")},"timeline",2),T("button",{type:"button",class:De({on:l.value==="aggregate"}),onClick:E[10]||(E[10]=O=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(w(),N("div",{key:0,ref_key:"listRef",ref:b,class:"kap-list"},[d.value.length===0?(w(),N("div",Vle," No trace entries yet. REST calls and WS frames will appear here. ")):ie("",!0),(w(!0),N(Oe,null,st(d.value,O=>(w(),N("div",{key:O.id,class:"kap-row-wrap"},[T("button",{type:"button",class:De(["kap-row",{expanded:p.value===O.id}]),onClick:S=>g(O.id)},[T("span",Gle,R(v(O.ts)),1),T("span",{class:De(["kap-badge",$(O)])},R(k(O)),3),T("span",Yle,R(O.label),1)],10,Kle),p.value===O.id?(w(),N("div",Xle,[T("div",Qle,[T("button",{type:"button",onClick:S=>C(O)},R(_.value===O.id?"copied ✓":"copy json"),9,Zle)]),T("pre",null,R(y(O)),1)])):ie("",!0)]))),128))],512)):(w(),N("div",Jle,[E[20]||(E[20]=T("h4",null,"WS frames by session / type",-1)),T("table",null,[E[17]||(E[17]=T("thead",null,[T("tr",null,[T("th",null,"dir"),T("th",null,"type"),T("th",null,"session"),T("th",null,"count"),T("th",null,"last seq")])],-1)),T("tbody",null,[(w(!0),N(Oe,null,st(f.value,O=>(w(),N("tr",{key:O.key},[T("td",null,R(O.dir),1),T("td",eae,R(O.eventType),1),T("td",tae,R(O.sessionId),1),T("td",nae,R(O.count),1),T("td",oae,R(O.lastSeq??"—"),1)]))),128)),f.value.length===0?(w(),N("tr",sae,[...E[16]||(E[16]=[T("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ie("",!0)])]),E[21]||(E[21]=T("h4",null,"REST by endpoint",-1)),T("table",null,[E[19]||(E[19]=T("thead",null,[T("tr",null,[T("th",null,"endpoint"),T("th",null,"count"),T("th",null,"errors"),T("th",null,"avg ms")])],-1)),T("tbody",null,[(w(!0),N(Oe,null,st(h.value,O=>(w(),N("tr",{key:O.key},[T("td",iae,R(O.key),1),T("td",rae,R(O.count),1),T("td",{class:De(["num",{err:O.errors>0}])},R(O.errors),3),T("td",lae,R(O.avgMs),1)]))),128)),h.value.length===0?(w(),N("tr",aae,[...E[18]||(E[18]=[T("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ie("",!0)])])]))]))}}),uae=ft(cae,[["__scopeId","data-v-3cda6fe3"]]),dae=Ve({__name:"DebugPanel",setup(e){const t=Z(!1);let n=null,o=null,s=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const h of i){const p=d.getAttribute(h);p!==null?f.setAttribute(h,p):f.removeAttribute(h)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const p of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(p.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=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),f=op(uae,{onClose:()=>u.close()});f.mount(d),o=f,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return bn(()=>{c()}),vo(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(w(),ge(zt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:ke(()=>[T("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),fae=ft(dae,[["__scopeId","data-v-21346738"]]);function S3(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 x1(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 pae(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 xi(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:x1(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:S3(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 bu(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 $S(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 hy(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:$S(e.source)};case"video":return{type:"video",source:$S(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 A1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(hy),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function hae(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 mae(e){return{content:e.content.map(hae),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 gae(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function C3(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 vae(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function yae(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(vae),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function x3(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(yae),createdAt:e.created_at}}function kae(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 bae(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=kae(o);return{answers:t,method:e.method,note:e.note}}function T1(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,runInBackground:e.kind==="subagent"?!0:void 0}}function NS(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 xr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function wa(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Bs(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function _ae(e){if(!e||typeof e!="object")return null;const t=e,n=xr(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const o=t.budget,s=o&&typeof o=="object"?o:{};return{goalId:xr(t,"goalId")??xr(t,"goal_id")??"goal",objective:xr(t,"objective")??"",completionCriterion:xr(t,"completionCriterion")??xr(t,"completion_criterion"),status:n,turnsUsed:wa(t,"turnsUsed")??wa(t,"turns_used")??0,tokensUsed:wa(t,"tokensUsed")??wa(t,"tokens_used")??0,wallClockMs:wa(t,"wallClockMs")??wa(t,"wall_clock_ms")??0,terminalReason:xr(t,"terminalReason")??xr(t,"terminal_reason"),budget:{tokenBudget:Bs(s,"tokenBudget")??Bs(s,"token_budget"),remainingTokens:Bs(s,"remainingTokens")??Bs(s,"remaining_tokens"),turnBudget:Bs(s,"turnBudget")??Bs(s,"turn_budget"),remainingTurns:Bs(s,"remainingTurns")??Bs(s,"remaining_turns"),wallClockBudgetMs:Bs(s,"wallClockBudgetMs")??Bs(s,"wall_clock_budget_ms"),remainingWallClockMs:Bs(s,"remainingWallClockMs")??Bs(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function wae(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:xi(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:xi(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:bu(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:bu(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:x1(t.payload.status),previousStatus:x1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:S3(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=_ae(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:A1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(hy),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:C3(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:x3(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.task.created":return{type:"taskCreated",sessionId:t.session_id,task:T1(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:M1(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function Sae(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function LS(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 M1(e){const t={};for(const[n,o]of Object.entries(e.providers))t[n]={type:o.type,baseUrl:o.base_url,defaultModel:o.default_model,hasApiKey:o.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,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 Cae(e){return e.session_id}function xae(e){return e.seq}const Aae="main",Tae=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 Lr(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 Mae(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 OS(){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 rs(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Tl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Fs(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Eae(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=rs(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=rs(t,"goalId")??rs(t,"goal_id")??"goal",r=rs(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:rs(t,"completionCriterion")??rs(t,"completion_criterion"),status:s,turnsUsed:Tl(t,"turnsUsed")??Tl(t,"turns_used")??0,tokensUsed:Tl(t,"tokensUsed")??Tl(t,"tokens_used")??0,wallClockMs:Tl(t,"wallClockMs")??Tl(t,"wall_clock_ms")??0,terminalReason:rs(t,"terminalReason")??rs(t,"terminal_reason"),budget:{tokenBudget:Fs(o,"tokenBudget")??Fs(o,"token_budget"),remainingTokens:Fs(o,"remainingTokens")??Fs(o,"remaining_tokens"),turnBudget:Fs(o,"turnBudget")??Fs(o,"turn_budget"),remainingTurns:Fs(o,"remainingTurns")??Fs(o,"remaining_turns"),wallClockBudgetMs:Fs(o,"wallClockBudgetMs")??Fs(o,"wall_clock_budget_ms"),remainingWallClockMs:Fs(o,"remainingWallClockMs")??Fs(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Ra(e,t,n,o){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"},...o,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function Iae(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=rs(t,"name")??rs(t,"toolName")??"tool",o=nd($ae(n)),s=Nae(n,t.args??t.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const s=rs(n,"text");if(s)return ev(s);const i=rs(n,"message");if(i)return ev(i)}const o=rs(t,"message");if(o)return ev(o)}return null}function $ae(e){return e.replace(/_\d+$/,"")}const PS=2e3;function ev(e){return e.length>PS?`${e.slice(0,PS)}…`:e}function Nae(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Pu(e,n)}function Lae(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=rs(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Ra(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return f&&h.push({type:"taskCreated",sessionId:t,task:f}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=Iae(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Ra(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 hf(e){return{...e,content:e.content.map(t=>({...t}))}}function RS(e,t,n){const o={id:Lr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function Oae(e,t,n,o,s,i){const r={id:o,sessionId:t,role:"user",content:s,createdAt:i,promptId:n};return e.messages.push(r),r}function Pae(e){return Array.isArray(e)?e.map(t=>hy(t)):[]}function DS(e,t,n,o){const s=e.messages.find(r=>r.id===t);if(!s)return-1;const i=s.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=o:i.thinking+=o,s.content.length-1):(s.content.push(n==="text"?{type:"text",text:o}:{type:"thinking",thinking:o}),s.content.length-1)}function Rae(e,t,n,o,s,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:o,input:s,outputLines:i})}function Dae(e){const t=e.update,n=t&&typeof t=="object"?t:null,s=(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:s}:null}function BS(e,t){e.messages.find(n=>n.id===t)}function Bae(e,t,n,o,s,i){const r={id:Lr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:o,isError:s}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function tv(e,t){return e.messages.find(n=>n.id===t)}function FS(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 Fae(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=OS(),e.set(u,d)),d}function o(u){e.set(u,OS())}function s(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){o(u);const f=n(u),h=d.promptId??Lr("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=RS(f,u,h);d.thinkingText.length>0&&p.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&p.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const b=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:b}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:h},{type:"messageCreated",message:hf(p)}]}function l(u,d,f,h){try{return c(u,d,f,h)}catch(p){return console.error("[agentProjector] Error projecting event:",u,p instanceof Error?p.message:p),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,h){const p=n(f),m=d,b=[],_=m?.agentId;if(typeof _=="string"&&_!==Aae){const g=t.has(_);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:_,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:_,reason:m?.reason}];if(Tae.has(u))return Lae(p,f,_,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,y={};typeof g=="string"&&g.length>0&&(y.title=g),typeof v=="string"&&(y.lastPrompt=v),(y.title!==void 0||y.lastPrompt!==void 0)&&b.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=Pae(m?.content);if(y.length===0)break;p.currentPromptId=g;const C=Oae(p,f,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());b.push({type:"messageCreated",message:hf(C)});break}case"turn.started":{const g=m?.turnId,v=p.currentPromptId??Lr("pr_");p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v),p.turnTextLen=0,p.turnThinkLen=0,b.push({type:"sessionStatusChanged",sessionId:f,status:"running",previousStatus:"idle",currentPromptId:v});break}case"turn.step.started":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;v||(v=Lr("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const y=RS(p,f,v);p.currentAssistantMsgId=y.id,b.push({type:"messageCreated",message:hf(y)});break}case"thinking.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const y=a(p.turnThinkLen,h?.offset);if(y==="skip")break;if(y==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const C=DS(p,g,"thinking",v);if(C<0)break;p.turnThinkLen+=v.length,b.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:C,delta:{thinking:v}});break}case"assistant.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const y=a(p.turnTextLen,h?.offset);if(y==="skip")break;if(y==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const C=DS(p,g,"text",v);if(C<0)break;p.turnTextLen+=v.length,b.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:C,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=p.currentAssistantMsgId,v=m?.turnId,y=p.turnPromptId.get(v)??p.currentPromptId;if(!g||!y)break;const C=m?.toolCallId,L=m?.name??m?.toolName??"",$=m?.args??m?.input??{};Rae(p,g,C,L,$);const k=tv(p,g);k&&k.content.length-1,p.toolStartTimes.set(C,Date.now()),k&&b.push({type:"messageUpdated",sessionId:f,messageId:g,content:k.content.map(M=>({...M})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=Dae(m??{});g&&v&&b.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;v||(v=Lr("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const y=m?.toolCallId,C=m?.output,L=m?.isError??!1;p.toolStartTimes.get(y)??Date.now(),p.toolStartTimes.delete(y);const $=Bae(p,f,y,C,L,v);b.push({type:"messageCreated",message:hf($)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=p.currentAssistantMsgId,v=Mae(m?.usage);if(p.totalInput+=v.input,p.totalOutput+=v.output,p.totalCacheRead+=v.cacheRead,p.totalCacheCreate+=v.cacheCreate,g){BS(p,g);const y=tv(p,g);y&&b.push({type:"messageUpdated",sessionId:f,messageId:g,content:y.content.map(C=>({...C})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(p.model=m.model),m?.contextTokens!==void 0&&(p.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(p.contextLimit=m.maxContextTokens),b.push({type:"sessionUsageUpdated",sessionId:f,usage:FS(p),model:p.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const g=p.currentAssistantMsgId,v=m?.reason??"completed",y=Tl(m??{},"durationMs");if(g){BS(p,g);const $=tv(p,g);$&&b.push({type:"messageUpdated",sessionId:f,messageId:g,content:$.content.map(k=>({...k})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:y})}p.turnCount++;const C=FS(p);b.push({type:"sessionUsageUpdated",sessionId:f,usage:C});const L=v==="cancelled"||v==="failed"||v==="filtered"?"aborted":"idle";b.push({type:"sessionStatusChanged",sessionId:f,status:L,previousStatus:"running"}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{p.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:Lr("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};p.subagentMeta.set(v.id,v),b.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=Ra(p,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&b.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=Ra(p,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&b.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Ra(p,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&b.push({type:"taskCreated",sessionId:f,task:v}),b.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=Ra(p,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&b.push({type:"taskCreated",sessionId:f,task:v}),b.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"background.task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,y=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):Lr("task_"),C=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:qn.global.t("tasks.defaultDescription"),L=typeof g.command=="string"?g.command:void 0;b.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:C,command:L,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"background.task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;b.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};b.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{b.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{b.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=Eae(m?.snapshot??null);b.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}}return b}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const Hae=new Set(["server_hello","ack","ping","resync_required","error","pong"]),HS=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"]),Wae=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","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"]),zae=new Set(["assistant.delta","thinking.delta"]);function Uae(e,t){if(Hae.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return zae.has(o)?qae(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?Wae.has(o)?{route:"protocol"}:HS.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:HS.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function qae(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 E1 extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class eu extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;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,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}function Jr(e){return e instanceof E1||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function A3(e){return e instanceof eu||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const my="kimi-web.server-credential",jae="token";let Vu;const I1=new Set;function Vae(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(jae);if(!n)return;const o=new URL(window.location.href);return o.hash="",window.history.replaceState(window.history.state,"",`${o.pathname}${o.search}`),n}function Kae(){try{return globalThis.sessionStorage?.getItem(my)??void 0}catch{return}}function Gae(){const e=Vae();return e?(M3(e),!0):(Vu=Kae(),Vu!==void 0)}function T3(){return Vu}function M3(e){Vu=e;try{globalThis.sessionStorage?.setItem(my,e)}catch{}}function Yae(){Vu=void 0;try{globalThis.sessionStorage?.removeItem(my)}catch{}}function Xae(e){return I1.add(e),()=>{I1.delete(e)}}function Qae(){Yae();for(const e of I1)try{e()}catch{}}const tu=3e4,E3="0123456789ABCDEFGHJKMNPQRSTVWXYZ",WS=500,Zae=40101;function zS(){try{return AbortSignal.timeout(tu)}catch{return}}function Jae(e,t){let n="",o=e;for(let s=0;s<t;s++)n=E3[o%32]+n,o=Math.floor(o/32);return n}function ece(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=>E3[n%32]).join("")}function US(){return`${Jae(Date.now(),10)}${ece(16)}`}function tce(e){try{const t=[];return e.forEach((n,o)=>{typeof n=="string"?t.push({field:o,value:n}):t.push({field:o,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function qS(e){try{const t=await e.text();return t?t.length>WS?`${t.slice(0,WS)}...`:t:void 0}catch{return}}class nce{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,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postForm(t,n){const o=lp(this.origin,t),s=US(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();TS({method:"POST",path:t,url:o,requestId:s,body:tce(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:zS()})}catch(u){throw pf({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new eu({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:tu,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw pf({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new eu({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:tu,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await qS(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(MS({method:"POST",path:t,requestId:s,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new E1({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});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,o,s,i=[]){let r=lp(this.origin,n);if(s){const h=new URLSearchParams;for(const[m,b]of Object.entries(s))b!==void 0&&h.set(m,String(b));const p=h.toString();p&&(r=`${r}?${p}`)}const l=US(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();TS({method:t,path:n,url:r,requestId:l,body:o});let u;try{u=await fetch(r,{method:t,headers:a,body:o!==void 0?JSON.stringify(o):void 0,signal:zS()})}catch(h){throw pf({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new eu({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:tu,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw pf({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new eu({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:tu,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await qS(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(MS({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}),this.checkAuthRequired(u,d.code),d.code!==0&&!i.includes(d.code))throw new E1({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details,timestamp:Date.now(),durationMs:Date.now()-c});return d.data}addClientHeaders(t){const n=T3();n!==void 0&&(t.Authorization=`Bearer ${n}`),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)}checkAuthRequired(t,n){(t.status===401||n===Zae)&&Qae()}}const oce="kimi-code.bearer.";class sce{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}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;_a("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=T3(),n=t!==void 0?[`${oce}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{_a("open")},o.onmessage=s=>{try{const i=JSON.parse(String(s.data));Xne(i),this.handleFrame(i)}catch(i){_a("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{_a("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{_a("close",s?{code:s.code,reason:s.reason,wasClean:s.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,_a("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 o=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);o!==-1&&this.pendingSubscriptions.splice(o,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),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,o){const s=mf(t,n),i=this.terminalAttachments.get(s),r=o??i?.lastSeq??0;this.terminalAttachments.set(s,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,o){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:o}})}terminalResize(t,n,o,s){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:o,rows:s}})}terminalDetach(t,n){this.terminalAttachments.delete(mf(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(mf(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 o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,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 o=n.session_id,s=n.terminal_id,i=n.seq,r=mf(o,s),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?.(o,s,a,i);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(o,s,r);break}default:{this.trackCursor(n);const o=n.type,s=Uae(o,n.payload);if(s.route==="protocol"){this.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:s.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 o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,o){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:o>0?o:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,o=t.seq;if(typeof n!="string"||typeof o!="number")return;const s=this.subscriptions.get(n);if(!s||o<=s.seq&&s.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:s.epoch;this.subscriptions.set(n,{seq:Math.max(o,s.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Yne(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function mf(e,t){return`${e}\0${t}`}function nv(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 jS(e){return e==="auto_compact"||e==="manual_compact"}class ice{http;config;constructor(t){this.config=t,this.http=new nce(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?pae(t.status):void 0,include_archive:t?.includeArchive,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(xi),hasMore:o.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 o=await this.http.post("/sessions",n);return xi(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return xi(n)}async updateSession(t,n){const o={};n.title!==void 0&&(o.title=n.title),n.cwd!==void 0&&(o.metadata={cwd:n.cwd});const s={};n.model!==void 0&&(s.model=n.model),n.permissionMode!==void 0&&(s.permission_mode=n.permissionMode),n.planMode!==void 0&&(s.plan_mode=n.planMode),n.swarmMode!==void 0&&(s.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(s.goal_objective=n.goalObjective),n.goalControl!==void 0&&(s.goal_control=n.goalControl),n.thinking!==void 0&&(s.thinking=n.thinking),Object.keys(s).length>0&&(o.agent_config=s);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return xi(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,thinkingEffort: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 getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async listMessages(t,n){const o={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,o);return{items:s.items.map(A1),hasMore:s.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:xi(n.session),messages:n.messages.items.map(A1),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(o=>({toolCallId:o.tool_call_id,name:o.name,args:o.args,description:o.description,lastProgress:o.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(C3),pendingQuestions:n.pending_questions.map(x3)}}async submitPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,mae(n));return{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}async steerPrompts(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:o.steered,promptIds:o.prompt_ids}}async abortPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:o.aborted,atSeq:o.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 o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,o);return xi(s)}async createChildSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,o);return xi(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(xi)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,gae(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,bae(o));return{resolved:s.resolved,resolvedAt:s.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 o={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,o)).items.map(T1)}async getTask(t,n,o){const s={with_output:o?.withOutput,output_bytes:o?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,s);return T1(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(nv)}async createTerminal(t,n={}){const o={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},s=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,o);return nv(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return nv(o)}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(o=>({name:o.name,description:o.description,source:o.source}))}async activateSkill(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,o!==void 0&&o.length>0?{args:o}:{});return{activated:s.activated,skillName:s.skill_name}}async listDirectory(t,n){const o={};n.path!==void 0&&(o.path=n.path),n.depth!==void 0&&(o.depth=n.depth),n.includeGitStatus!==void 0&&(o.include_git_status=n.includeGitStatus);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,o),i=s.children_by_path?Object.fromEntries(Object.entries(s.children_by_path).map(([r,l])=>[r,l.map(NS)])):void 0;return{items:s.items.map(NS),childrenByPath:i,truncated:s.truncated}}async readFile(t,n){const o={path:n.path};n.offset!==void 0&&(o.offset=n.offset),n.length!==void 0&&(o.length=n.length);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,o);return{path:s.path,content:s.content,encoding:s.encoding,size:s.size,truncated:s.truncated,etag:s.etag,mime:s.mime,languageId:s.language_id,lineCount:s.line_count,isBinary:s.is_binary}}async searchFiles(t,n){const o={query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,o);return{items:s.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const o={pattern:n.pattern};n.regex!==void 0&&(o.regex=n.regex),n.caseSensitive!==void 0&&(o.case_sensitive=n.caseSensitive);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,o);return{files:s.files,filesScanned:s.files_scanned,truncated:s.truncated,elapsedMs:s.elapsed_ms}}async getGitStatus(t,n){const o={};n!==void 0&&(o.paths=n);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,o);return{branch:s.branch,ahead:s.ahead,behind:s.behind,entries:s.entries,additions:s.additions,deletions:s.deletions,pullRequest:s.pullRequest??null}}async getFileDiff(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:o.path,diff:o.diff}}getFileDownloadUrl(t,n){const o=n.split("/").map(s=>encodeURIComponent(s)).join("/");return lp(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${o}:download`)}async openFile(t,n){const o={path:n.path};return n.line!==void 0&&(o.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,o)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,o,s){const i={app_id:n,path:o};s!==void 0&&(i.line=s),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(bu)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const o=await this.http.post("/workspaces",n);return bu(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const o=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return bu(o)}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(o=>({name:o.name,path:o.path,isDir:o.is_dir,isGitRepo:o.is_git_repo,branch:o.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(Sae)}async listProviders(){return(await this.http.get("/providers")).items.map(LS)}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 o=await this.http.post("/providers",n);return LS(o)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return ov(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return ov(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return ov(t)}async getConfig(){const t=await this.http.get("/config");return M1(t)}async setConfig(t){const n={},o={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",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=o[i];l!==void 0&&(n[l]=r)}const s=await this.http.post("/config",n);return M1(s)}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 o=await this.http.postForm("/files",n);return{id:o.id,name:o.name,mediaType:o.media_type,size:o.size}}getFileUrl(t){return lp(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=S5(this.config.serverHttpUrl,this.config.clientId),o=Fae(),s=new sce(n,this.config.clientId,{onWireEvent:i=>{const r=Cae(i),l=xae(i),a=wae(i);a.type==="historyCompacted"&&!jS(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=o.project(r,c,a,{offset:u});for(const f of d)f.type==="historyCompacted"&&!jS(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l})},onResync:(i,r,l)=>{o.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 s.connect(),{subscribe(i,r){s.subscribe(i,r??{seq:0})},unsubscribe(i){s.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){o.reset(i);return}const l=o.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){o.bindNextPromptId(i,r)},abort(i,r){s.abort(i,r)},terminalAttach(i,r,l){s.terminalAttach(i,r,l)},terminalInput(i,r,l){s.terminalInput(i,r,l)},terminalResize(i,r,l,a){s.terminalResize(i,r,l,a)},terminalDetach(i,r){s.terminalDetach(i,r)},terminalClose(i,r){s.terminalClose(i,r)},markSideChannelAgent(i){o.markSideChannelAgent(i)},close(){s.close()}}}}function ov(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}let VS;function mt(){return VS??=new ice(y5()),VS}function rce(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function lce(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function ace(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,activeRoot:s,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(o),a=new Map;for(const h of t)l.has(h.root)||a.has(h.root)||a.set(h.root,{...h});for(const h of n){const p=h.cwd;p&&(l.has(p)||a.has(p)||a.set(p,{id:h.workspaceId??p,root:p,name:rce(p),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const h of n){const p=lce(t,h);c.set(p,(c.get(p)??0)+1)}const u=[...new Set(t.filter(h=>!l.has(h.root)).map(h=>h.root))],d=[...a.keys()].filter(h=>!u.includes(h));d.sort((h,p)=>h.localeCompare(p));const f=[];for(const h of[...u,...d]){const p=a.get(h),m=c.get(p.id)??c.get(p.root)??0,b=r[p.id]===!1?m:Math.max(p.sessionCount,m);let _=p.branch;!_&&i&&s===p.root&&(_=i),f.push({...p,sessionCount:b,branch:_})}return f}function cce(e){const t=new Map,n=new Set;function o(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&o(i)});return t.set(i,l),l}function s(i){if(t.has(i)){n.add(i);return}o(i)}return{run:o,request:s}}const uce=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function dce(e){return uce.has(e.type)}function fce(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function pce(e,t,n=fce){let o=[],s=null;const i=()=>{if(s=null,o.length===0)return;const l=o;o=[];for(const a of l)e(a)},r=(l=>{if(t(l)){o.push(l),s===null&&(s=n(i));return}i(),e(l)});return r.flush=i,r}function I3(e,t){const n=Jn(e);return n===null?t:n==="1"}const gy=Z(I3($t.notifyOnComplete,!0)),vy=Z(I3($t.notifyOnQuestion,!1)),yy=Z(typeof Notification<"u"?Notification.permission:"denied");async function $3(e,t,n){if(!n){e.value=!1,no(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}yy.value=o,o==="granted"&&(e.value=!0,no(t,"1"))}function hce(e){return $3(gy,$t.notifyOnComplete,e)}function mce(e){return $3(vy,$t.notifyOnQuestion,e)}function N3(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{yy.value=i,i==="granted"&&KS(t,n,o)});return}KS(t,n,o)}}function KS(e,t,n){if(e.isActiveAndVisible)return;const o=e.sessionTitle.trim()||"Kimi Code";try{const s=new Notification(o,{body:t,tag:n});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function gce(e,t){N3(gy.value,t,qn.global.t("settings.notifyBody"),`kimi-complete-${e}`)}function vce(e,t){const n=t.questionPreview||qn.global.t("settings.notifyQuestionBody");N3(vy.value,t,n,`kimi-question-${e}`)}function yce(){return{notifyOnComplete:gy,notifyOnQuestion:vy,notifyPermission:yy,setNotifyOnComplete:hce,setNotifyOnQuestion:mce,maybeNotifyCompletion:gce,maybeNotifyQuestion:vce}}function kce(){return Jn($t.soundOnComplete)==="1"}const cd=Z(kce());function bce(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let sv=null;function L3(){const e=bce();if(!e)return null;if(sv===null)try{sv=new e}catch{return null}return sv}function O3(){if(!cd.value)return;const e=L3();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Nr("sound: audio context resumed",{state:e.state})},t=>{Nr("sound: audio context resume rejected",{error:String(t)})})}let GS=!1;function _ce(){if(GS||typeof window>"u")return;GS=!0;const e=()=>{O3()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}_ce();function wce(e){cd.value=e,no($t.soundOnComplete,e?"1":"0"),e&&O3()}function YS(e,t,n,o,s){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(s,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+o),i.start(l),i.stop(l+o+.02)}function P3(){const e=L3();if(e===null){Nr("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Nr("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Nr("sound: context resumed for next time",{state:e.state})},t=>{Nr("sound: resume rejected",{error:String(t)})});return}try{YS(e,880,0,.16,.18),YS(e,1320,.1,.22,.16),Nr("sound: chime scheduled",{state:e.state})}catch(t){Nr("sound: failed to play",{error:String(t)})}}function Sce(){cd.value&&P3()}function Cce(){cd.value&&P3()}function xce(){return{soundOnComplete:cd,setSoundOnComplete:wce,maybePlayCompletionSound:Sce,maybePlayQuestionSound:Cce}}function XS(e,t){const n=new Set(e.map(s=>s.id)),o=t.filter(s=>s.kind==="subagent"&&!n.has(s.id));return o.length===0?e:[...e,...o]}const Ace=1e3,Tce=4096,QS=32*1024;function Mce(e,t){let n=null,o;const s=new Set;async function i(f){try{const p=await mt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:XS(p,e.tasksBySession[f]??[])},await r(f,p)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const p=h??e.tasksBySession[f]??[],m=mt(),b=new Map;if(await Promise.all(p.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!s.has(g.id)&&!((g.outputLines?.length??0)>0))try{const y=await m.getTask(f,g.id,{withOutput:!0,outputBytes:QS});y.outputPreview!==void 0&&b.set(g.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{s.add(g.id)}})),b.size===0)return;const _=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:_.map(g=>{const v=b.get(g.id);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const h=mt();let p;try{p=await h.listTasks(f)}catch{return}const m=new Map;await Promise.all(p.map(async v=>{const y=v.status==="running",C=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!y&&!C)&&!(C&&(s.has(v.id)||(v.outputLines?.length??0)>0)))try{const L=await h.getTask(f,v.id,{withOutput:!0,outputBytes:y?Tce:QS});L.outputPreview!==void 0&&m.set(v.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{C&&s.add(v.id)}}));const b=e.tasksBySession[f]??[],_=new Map(b.map(v=>[v.id,v])),g=p.map(v=>{const y=_.get(v.id),C=m.get(v.id);return{...v,outputLines:y?.outputLines,text:y?.text,outputPreview:C?.preview??y?.outputPreview,outputBytes:C?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:XS(g,b)}}function a(f){n!==null&&o===f||(c(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},Ace))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=Z(0);let d=null;return Ge(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Ge(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,m)=>{let b;h&&f!==void 0?a(f):f!==void 0?b=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{b!==void 0&&clearTimeout(b)})},{deep:!0,immediate:!0}),{taskClock:W(()=>u.value),loadTasksForSession:i}}const R3=$t.starredModels;function Ece(){try{const e=Jn(R3);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Ice(e){try{no(R3,JSON.stringify(e))}catch{}}function $ce(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=Z([]),d=Z(Ece()),f=Z({}),h=Z([]),p=Z(null);function m(z){if(!(z==null||z.length===0))return u.value.find(U=>U.id===z||U.model===z)}function b(){const z=e.activeSessionId?e.sessions.find(U=>U.id===e.activeSessionId):void 0;return m(z?.model??p.value??e.defaultModel)}function _(z){const U=kS(b(),z);return e.thinking=U,l(U),U}async function g(z){try{const Q=await mt().listSkills(z);f.value={...f.value,[z]:Q}}catch{}}async function v(){try{const z=mt();u.value=await z.listModels(),_(e.thinking)}catch(z){n("loadModels",z)}}async function y(){try{const z=await mt().refreshOAuthProviderModels();for(const U of z.failed)n("refreshOAuthProviderModels",new Error(U.reason),{message:U.provider})}catch{}}async function C(){try{const z=mt();h.value=await z.listProviders()}catch(z){n("loadProviders",z)}}async function L(z){const U=e.activeSessionId,Q=kS(m(z),e.thinking),X=e.thinking;if(!U){p.value=z,_(Q);return}const ue=e.sessions.find(me=>me.id===U)?.model;a(U,me=>({...me,model:z})),Q!==X&&(e.thinking=Q,l(Q));try{await mt().updateSession(U,{model:z,thinking:Q!==X?Q:void 0})}catch(me){a(U,Ae=>({...Ae,model:ue??Ae.model})),Q!==X&&(e.thinking=X,l(X)),n("setModel",me,{sessionId:U});return}await o(U)}function $(z){const U=new Set(d.value);U.has(z)?U.delete(z):U.add(z),d.value=Array.from(U),Ice(d.value)}async function k(z,U){const Q=e.activeSessionId;if(!Q)return;const X=i.value==="idle"&&!r.has(Q),ue=`msg_skill_opt_${Date.now().toString(36)}`;if(X){r.add(Q),e.sendingBySession={...e.sendingBySession,[Q]:!0};const me={id:ue,sessionId:Q,role:"user",content:[{type:"text",text:`/${z}${U?` ${U}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:z,skillArgs:U}}};c(Q,Ae=>[...Ae,me])}try{await mt().activateSkill(Q,z,U)}catch(me){X&&(r.delete(Q),e.sendingBySession={...e.sendingBySession,[Q]:!1},c(Q,Ae=>Ae.filter(be=>be.id!==ue))),n("activateSkill",me,{sessionId:Q})}}async function M(z){try{await mt().addProvider(z),await Promise.all([C(),v()])}catch(U){n("addProvider",U)}}async function E(z){try{await mt().deleteProvider(z),await Promise.all([C(),v()])}catch(U){n("deleteProvider",U)}}async function O(z){try{const U=await mt().refreshProvider(z);for(const Q of U.failed)n("refreshProvider",new Error(Q.reason),{message:Q.provider});await Promise.all([C(),v()])}catch(U){n("refreshProvider",U)}}async function S(){try{const z=await mt().refreshAllProviders();for(const U of z.failed)n("refreshAllProviders",new Error(U.reason),{message:U.provider});await Promise.all([C(),v()])}catch(z){n("refreshAllProviders",z)}}async function I(){try{return await mt().startOAuthLogin()}catch{return null}}async function P(){try{return await mt().pollOAuthLogin()}catch{return null}}async function D(){try{await mt().cancelOAuthLogin()}catch{}}function H(z){const U=_(z);s({thinking:U})}return{models:u,starredModelIds:d,providers:h,draftModel:p,skillsBySession:f,loadSkillsForSession:g,loadModels:v,refreshOAuthProviderModels:y,loadProviders:C,setModel:L,toggleStarModel:$,activateSkill:k,addProvider:M,deleteProvider:E,refreshProvider:O,refreshAllProviders:S,startOAuthLogin:I,pollOAuthLogin:P,cancelOAuthLogin:D,setThinking:H}}const D3="kimiWeb.compaction",Nce=["queued","working","suspended","completed","failed"];function B3(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function Lce(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Oce(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const o=n.parentToolCallId??"swarm",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:B3(n),summary:n.outputPreview,outputLines:n.outputLines,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=Lce();for(const r of s)i[r.phase]++;return{id:n,members:s,counts:i}}).filter(n=>n.members.length>1).toSorted((n,o)=>{const s=n.members.at(0)?.swarmIndex??0,i=o.members.at(0)?.swarmIndex??0;return s!==i?s-i:n.id.localeCompare(o.id)})}function Pce(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of Nce)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}const Rce=/^read[_-]?media(?:file)?$/i,Dce=/^data:([^;]+);base64,(.*)$/s,Bce=/^<(image|video|audio)\s+path="([^"]+)">$/,Fce=/Mime type:\s*([^.\s]+)/i,Hce=/Size:\s*(\d+)\s*bytes/i,Wce=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function zce(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 Uce(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 qce(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 s=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof s!="object"||s===null)return null;const i=s.url;return typeof i=="string"?{kind:n,url:i}:null}function jce(e,t){if(!Rce.test(e))return;const n=Uce(t);if(n===null)return;let o,s,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 h=d.text,p=Bce.exec(h);p&&(s=p[1],o=p[2]);const m=Fce.exec(h);m?.[1]&&(i=m[1]);const b=Hce.exec(h);b?.[1]&&(r=Number(b[1]));const _=Wce.exec(h);_?.[1]&&_[2]&&(l=`${_[1]}x${_[2]}`);continue}const f=qce(d);f&&(a=f)}if(a===null)return;const c=Dce.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=zce(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Vce(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
262
|
+
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
263
|
+
`));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
|
|
264
|
+
`)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
|
|
265
|
+
`)):o.type==="image_url"||o.type==="image"?t.push("[image]"):typeof o.type=="string"?t.push(`[${o.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Kce(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,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function Gce(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,o=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==o?n-o:e.createdAt.localeCompare(t.createdAt)}function Yce(e,t){const n=e.split(`
|
|
266
|
+
`),o=t.split(`
|
|
267
|
+
`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function Xce(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:Yce(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command")return{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};if(n==="file_content"||n==="file")return{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};if(n==="file_op"||n==="fileop")return{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};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{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};if(n==="todo"||n==="todo_list")return{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"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Qce(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function Zce(e){return e.metadata?.origin?.kind==="compaction_summary"}function Jce(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function eue(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function F3(e,t,n,o=!0,s=[],i={}){const r=[];let l=1;const a=new Map;for(const p of t)a.set(p.toolCallId,p);const c=new Map;for(const p of s){if(p.kind!=="subagent")continue;const m=[p.parentToolCallId,p.id].filter(b=>typeof b=="string"&&b.length>0);for(const b of m){const _=c.get(b)??[];_.push(p),c.set(b,_)}}for(const[p,m]of c.entries())c.set(p,m.toSorted(Gce));let u=null;function d(p=!1){if(!u)return;const m=u;if(u=null,!p||!o)for(let b=0;b<m.tools.length;b++){const _=m.tools[b];if(_.status!=="running")continue;const g={..._,status:"ok"};m.tools[b]=g;const v=m.blocks.find(y=>y.kind==="tool"&&y.tool.id===g.id);v&&v.kind==="tool"&&(v.tool=g)}r.push({id:m.id,role:"assistant",no:l++,text:m.textParts.join(`
|
|
268
|
+
`),thinking:m.thinkingParts.length>0?m.thinkingParts.join(`
|
|
269
|
+
`):void 0,tools:m.tools.length>0?m.tools:void 0,blocks:m.blocks.length>0?m.blocks:void 0,approval:m.approval,approvalId:m.approvalId,durationMs:m.durationMs})}function f(p,m){for(const b of m)if(b.type==="text"){if(b.text){p.textParts.push(b.text);const _=p.blocks.at(-1);_&&_.kind==="text"?_.text+=`
|
|
270
|
+
`+b.text:p.blocks.push({kind:"text",text:b.text})}}else if(b.type==="thinking"){if(b.thinking){p.thinkingParts.push(b.thinking);const _=p.blocks.at(-1);_&&_.kind==="thinking"?_.thinking+=`
|
|
271
|
+
`+b.thinking:p.blocks.push({kind:"thinking",thinking:b.thinking})}}else if(b.type==="toolUse"){const _=c.get(b.toolCallId);if(_&&_.length>0){const y=_.filter(C=>C.swarmIndex!==void 0);if(y.length>1&&y.some(L=>{const $=B3(L);return $!=="completed"&&$!=="failed"}))continue}const g=a.get(b.toolCallId),v={id:b.toolCallId,name:b.toolName,arg:typeof b.input=="string"?b.input:JSON.stringify(b.input),status:"running",output:b.outputLines,planPath:b.toolName==="ExitPlanMode"?i[b.toolCallId]?.path:void 0};p.tools.push(v),p.blocks.push({kind:"tool",tool:v}),g&&(p.approval=Xce(g),p.approvalId=g.approvalId)}else if(b.type==="toolResult"){const _=p.tools.findIndex(g=>g.id===b.toolCallId);if(_!==-1){const g=p.tools[_],v={...g,status:b.isError?"error":"ok",output:Vce(b.output),media:b.isError?void 0:jce(g.name,b.output)};v.name==="ExitPlanMode"&&!v.planPath&&(v.planPath=eue(v.output)),p.tools[_]=v;const y=p.blocks.find(C=>C.kind==="tool"&&C.tool.id===b.toolCallId);y&&y.kind==="tool"&&(y.tool=v)}}}function h(p){if(p.type==="image"||p.type==="video"){const m=p.type,b=p.source;if(b.kind==="url")return{url:b.url,kind:m};if(b.kind==="base64")return{url:`data:${b.mediaType};base64,${b.data}`,kind:m};if(b.kind==="file"&&n)return{url:n(b.fileId),kind:m}}if(p.type==="file"&&n){if(p.mediaType.startsWith("image/"))return{url:n(p.fileId),kind:"image"};if(p.mediaType.startsWith("video/"))return{url:n(p.fileId),kind:"video"}}}for(const p of e){if(p.role==="system")continue;if(Zce(p)){d();const v=p.metadata?.[D3];r.push({id:p.id,role:"compaction",no:l,text:p.content.filter(y=>y.type==="text").map(y=>y.text).join(`
|
|
272
|
+
`),compaction:{trigger:v?.trigger,tokensBefore:v?.tokensBefore,tokensAfter:v?.tokensAfter}});continue}if(p.role==="user"){if(d(),!Qce(p))continue;const v=p.metadata?.origin,y=v?.kind==="skill_activation"&&v?.trigger==="user-slash",C=v?.kind==="plugin_command"&&v?.trigger==="user-slash",L=[],$=[];for(const k of p.content){k.type==="text"&&(y?L.push(v.skillArgs??""):C?L.push(v.commandArgs??""):L.push(k.text));const M=h(k);M&&$.push({url:M.url,kind:M.kind,alt:k.type==="file"?k.name:void 0})}r.push({id:p.id,role:"user",no:l++,text:L.join(`
|
|
273
|
+
`),images:$.length>0?$:void 0,skillActivation:y?{name:v.skillName,args:v.skillArgs}:void 0,pluginCommand:C?{pluginId:v.pluginId,commandName:v.commandName,args:v.commandArgs}:void 0,createdAt:p.createdAt});continue}if(p.role==="tool"){u&&f(u,p.content);continue}const m=p.promptId;Jce(u,m)?u!==null&&u.promptId===void 0&&m!==void 0&&(u.promptId=m):(d(),u={id:p.id,promptId:m,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:p.durationMs});const _=u;if(_===null)continue;const g=JSON.stringify(p.content);_.promptId!==void 0&&_.seenSigs.has(g)||(_.seenSigs.add(g),f(_,p.content))}return d(!0),r}function tue(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i}=t,r=Z({}),l=W(()=>{const $=e.activeSessionId;if(!$)return null;const k=r.value[$];return k?{parentId:$,agentId:k.agentId}:null}),a=W(()=>l.value?.parentId??null),c=W(()=>l.value!==null),u=W(()=>{const $=l.value;return $?!!e.sideChatSendingByAgent[$.agentId]:!1}),d=W(()=>{const $=l.value;return $?e.sideChatSendingByAgent[$.agentId]?!0:(e.tasksBySession[$.parentId]??[]).some(k=>k.id===$.agentId&&k.status==="running"):!1}),f=W(()=>{const $=l.value;if(!$)return[];const k=e.sideChatMessagesByAgent[$.agentId]??[];return F3(k,[],M=>mt().getFileUrl(M),d.value,[])});function h($,k){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[$]:k(e.sideChatMessagesByAgent[$]??[])}}function p($,k){h($,M=>[...M,k])}function m($){h($,k=>{const M=[...k].reverse().findIndex(O=>O.role==="user");if(M===-1)return k;const E=k.length-1-M;return k.filter((O,S)=>S!==E)})}function b($,k){h($,M=>{const E=[...M];for(let O=E.length-1;O>=0;O-=1){const S=E[O];if(S.role==="user")return E[O]={...S,promptId:S.promptId??k},E}return M})}function _($,k,M){M&&h($,E=>{const O=E.at(-1);if(O?.role==="assistant"){const S=O.content[0],I=S?.type==="text"?S.text:"";return[...E.slice(0,-1),{...O,content:[{type:"text",text:`${I}${M}`}]}]}return[...E,{id:o(),sessionId:k,role:"assistant",content:[{type:"text",text:M}],createdAt:new Date().toISOString()}]})}function g($,k,M){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[$]:!1},!M)return;const O=(e.sideChatMessagesByAgent[$]??[]).at(-1);(O?.role==="assistant"&&O.content[0]?.type==="text"?O.content[0].text:"").trim().length>0||_($,k,M)}async function v($){const k=e.activeSessionId;if(k){if(!r.value[k]){let M;try{({agentId:M}=await mt().startBtw(k))}catch(E){n("openSideChat",E,{sessionId:k});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[M]:e.sideChatMessagesByAgent[M]??[]},r.value={...r.value,[k]:{agentId:M}},s(),i()?.markSideChannelAgent(M)}$&&$.trim()&&await C($.trim())}}function y(){const $=e.activeSessionId;if(!$)return;const{[$]:k,...M}=r.value;r.value=M}async function C($){const k=l.value,M=$.trim();if(!k||!M)return;const E=k.parentId,O=k.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[O]:!0};const S={id:o(),sessionId:E,role:"user",content:[{type:"text",text:M}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};p(O,S);try{const I=await mt().submitPrompt(E,{content:[{type:"text",text:M}],agentId:O});b(O,I.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[E]:[...e.sideChatUserMessageIdsBySession[E]??[],I.userMessageId]}}catch(I){n("sendSideChatPrompt",I,{sessionId:E}),m(O),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[O]:!1}}}function L($){if(!r.value[$])return;const{[$]:k,...M}=r.value;r.value=M}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:_,finishSideChatAgent:g,openSideChat:v,closeSideChat:y,sendSideChatPrompt:C,clearSideChatForSession:L}}function nue(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 oue(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
|
|
274
|
+
`)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&nue(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),o=Number.parseInt(a[2],10)),s=!0,t.push({type:"hunk",text:i});continue}if(!s||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:o}),o+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:o}),n+=1,o+=1)}return t}const $1="/sessions/";function ZS(e){const{pathname:t}=e;if(!t.startsWith($1))return;const n=t.slice($1.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function sue(e){return e===void 0||e.length===0?"/":`${$1}${encodeURIComponent(e)}`}const iue=50,N1=5,rue=40402,lue=40410,aue=40902;function iv(e){return Jr(e)&&e.code===aue}const cue=40904;function uue(e){return Jr(e)&&e.code===cue}const Al=No({}),gf=No({}),rv=No({});function due(e,t){const{t:n}=qn.global,{confirm:o}=ol(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,inFlightPromptSessions:c,sessionsKnownEmpty:u,setSessions:d,updateSession:f,upsertSessionFront:h,appendSession:p,forgetSession:m,setActiveSessionId:b,updateSessionMessages:_,nextOptimisticMsgId:g,getEventConn:v,syncSessionFromSnapshot:y,reopenSession:C,hasLoadedMessages:L,refreshSessionStatus:$,persistSessionProfile:k,mergedWorkspaces:M,workspacesView:E,status:O,workspaceIdForSession:S,savePermissionToStorage:I,savePlanModeToStorage:P,saveSwarmModeToStorage:D,saveGoalModeToStorage:H,draftModes:z,saveUnread:U,saveActiveWorkspaceToStorage:Q,saveHiddenWorkspacesToStorage:X,goalErrorMessage:ue,resetFastMoon:me,initialized:Ae,selectedDiffPath:be,fileDiffLines:ze,fileDiffLoading:qe}=t;async function Fe(oe){if(e.messagesLoadingMoreBySession[oe])return;const Se=e.messagesBySession[oe];if(!Se||Se.length===0)return;const Te=Se[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[oe]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[oe]:!1};try{const Ue=await mt().listMessages(oe,{beforeId:Te,pageSize:iue}),tt=[...Ue.items].reverse();_(oe,at=>[...tt,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[oe]:Ue.hasMore}}catch(Ue){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[oe]:!0},l("loadOlderMessages",Ue,{sessionId:oe})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[oe]:!1}}}function Le(oe){s.loadTasksForSession(oe),te(oe),$(oe),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,oe)||r.loadSkillsForSession(oe)}async function le(oe){const Se=e.activeSessionId;if(Se){be.value=oe,ze.value=[],qe.value=!0;try{const Ue=await mt().getFileDiff(Se,oe);if(be.value!==oe)return;ze.value=oue(Ue.diff)}catch(Te){be.value===oe&&(ze.value=[]),console.warn("[loadFileDiff] diff unavailable for",oe,Te)}finally{be.value===oe&&(qe.value=!1)}}}function F(){be.value=null,ze.value=[],qe.value=!1}async function te(oe){try{const Te=await mt().getGitStatus(oe);e.gitStatusBySession={...e.gitStatusBySession,[oe]:Te}}catch{}}async function ee(){try{const Se=await mt().getAuth();e.authReady=Se.ready,e.defaultModel=Se.defaultModel,e.managedProviderStatus=Se.managedProvider?.status??null}catch{}}async function q(){try{const oe=mt();e.config=await oe.getConfig()}catch{}}async function Y(oe){try{const Te=await mt().setConfig(oe);return e.config=Te,e.defaultModel=Te.defaultModel??null,!0}catch(Se){return l("setConfig",Se),!1}}const de=100,ne=30,ce=720*60*1e3;async function j(){const oe=mt(),Se=[];let Te;for(;;){const Ue=await oe.listSessions({pageSize:de,beforeId:Te,excludeEmpty:!0});if(Se.push(...Ue.items),!Ue.hasMore||Ue.items.length===0)break;Te=Ue.items[Ue.items.length-1].id}return Se}async function G(oe){const Se=mt(),Te=[],Ue=Date.now(),tt=Wt=>Ue-new Date(Wt.updatedAt).getTime();let at,Ft=!1,Xt=!0;for(;;){let Wt;try{Wt=await Se.listSessions({workspaceId:oe,pageSize:N1,beforeId:at,excludeEmpty:!0})}catch(gn){if(Xt)throw gn;break}if(Ft=Wt.hasMore,Wt.items.length===0)break;const Ls=Wt.items[Wt.items.length-1],Os=tt(Ls)>=ce;if(!Xt&&Os){const gn=Wt.items.findIndex(Ln=>tt(Ln)>=ce),oo=gn>=0?gn+1:Wt.items.length;Te.push(...Wt.items.slice(0,oo)),Ft=Wt.hasMore||oo<Wt.items.length;break}if(Te.push(...Wt.items),Xt=!1,!Wt.hasMore||Os)break;at=Ls.id}return{workspaceId:oe,page:{items:Te,hasMore:Ft}}}async function re(){const oe=e.workspaces;if(oe.length===0){const Ft=await j().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=!0,Ft}const Se=await Promise.all(oe.map(Ft=>G(Ft.id).catch(()=>({workspaceId:Ft.id,page:{items:[],hasMore:!1}})))),Te=[],Ue={},tt={},at={};for(const{workspaceId:Ft,page:Xt}of Se)Te.push(...Xt.items),Ue[Ft]=Xt.hasMore,tt[Ft]=Xt.items.length>0?Xt.items[Xt.items.length-1].id:void 0,at[Ft]=Math.max(Xt.items.length,N1);return e.sessionsHasMoreByWorkspace=Ue,e.sessionsCursorByWorkspace=tt,e.sessionsInitialCountByWorkspace=at,e.sessionsFullyLoaded=!1,Te.sort((Ft,Xt)=>new Date(Xt.updatedAt).getTime()-new Date(Ft.updatedAt).getTime()),Te}async function he(oe){if(e.sessionsLoadingMoreByWorkspace[oe]||e.sessionsHasMoreByWorkspace[oe]===!1)return;const Se=e.sessionsCursorByWorkspace[oe];if(Se!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[oe]:!0};try{const Te=await mt().listSessions({workspaceId:oe,pageSize:ne,beforeId:Se,excludeEmpty:!0}),Ue=new Set(e.sessions.map(at=>at.id)),tt=Te.items.filter(at=>!Ue.has(at.id));tt.length>0&&d([...e.sessions,...tt]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[oe]:Te.items.length>0?Te.items[Te.items.length-1].id:Se},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[oe]:Te.hasMore}}catch(Te){l("loadMoreSessions",Te)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[oe]:!1}}}}async function Ce(){if(e.sessionsFullyLoaded)return;const oe=await j().catch(()=>null);if(oe===null)return;d(oe),e.sessionsFullyLoaded=!0;const Se={};for(const Te of e.workspaces)Se[Te.id]=!1;e.sessionsHasMoreByWorkspace=Se}async function Ee(){e.loading=!0;try{const oe=mt();await Promise.all([oe.getHealth().catch(()=>null),oe.getMeta().then(Ft=>{e.serverVersion=Ft.serverVersion,e.availableOpenInApps=Ft.openInApps}).catch(()=>null),r.loadModels()]),await ee(),await q(),await ae();const Se=await re();d(Se);const Te=Se[0],Ue=e.activeWorkspaceId;!(Ue!==null&&M.value.some(Ft=>Ft.id===Ue))&&Te&&Ke(S(Te)),wn();const at=typeof window<"u"?ZS(window.location):void 0;!e.activeSessionId&&at!==void 0&&(e.sessions.some(Xt=>Xt.id===at)||await pn(at))&&await hn(at,{urlMode:"replace"}),!e.activeSessionId&&Se.length>0&&await hn(Se[0].id,{urlMode:"replace"})}catch(oe){l("load",oe)}finally{e.loading=!1,Ae.value=!0}}async function ae(){try{const oe=mt(),[Se,Te]=await Promise.all([oe.listWorkspaces().catch(()=>[]),oe.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=xe(Se),e.fsHome=Te.home||null,e.recentRoots=Te.recentRoots}catch{}}function xe(oe){const Se=Yd();return Object.keys(Se).length===0?oe:oe.map(Te=>{const Ue=Se[Te.root];return Ue!==void 0?{...Te,name:Ue}:Te})}function Ke(oe){e.activeWorkspaceId=oe,Q(oe)}function ot(oe){Ke(oe);const Se=e.sessions.filter(Te=>S(Te)===oe);if(Se.length>0){const Te=Se[0];Te&&Te.id!==e.activeSessionId&&hn(Te.id)}else b(void 0),Dt(void 0,"push")}function _t(oe){const Se=Yd()[oe.root],Te=Se!==void 0?{...oe,name:Se}:oe;e.hiddenWorkspaceRoots.includes(Te.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(at=>at!==Te.root),X(e.hiddenWorkspaceRoots));const Ue=e.workspaces.findIndex(at=>at.id===Te.id||at.root===Te.root);if(Ue===-1){e.workspaces=[Te,...e.workspaces];return}const tt=[...e.workspaces];tt[Ue]=Te,e.workspaces=tt}function wt(oe){if(oe.type==="workspaceCreated"||oe.type==="workspaceUpdated"){_t(oe.workspace);return}const Se=e.workspaces.find(Ue=>Ue.id===oe.workspaceId)?.root??oe.root;if(Se&&!e.hiddenWorkspaceRoots.includes(Se)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Se],X(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Ue=>Ue.id!==oe.workspaceId&&Ue.root!==Se),e.activeWorkspaceId===oe.workspaceId||e.activeWorkspaceId===Se){const Ue=E.value[0]?.id??null;if(e.activeWorkspaceId=Ue,Ue)Q(Ue);else try{sc($t.activeWorkspace)}catch{}b(void 0),e.sessionLoading=!1,F(),Dt(void 0,"replace")}}function It(){b(void 0),Dt(void 0,"push")}function Pt(oe){Ke(oe),It(),F()}async function bt(oe,Se,Te){const Ue=M.value.find(tt=>tt.id===oe);if(Ue)try{const tt=mt();let at,Ft=Ue.root;try{const gn=await tt.addWorkspace({root:Ue.root});at=gn.id,Ft=gn.root,_t(gn)}catch{}const Xt=r.draftModel.value??void 0,Wt=await tt.createSession({workspaceId:at,cwd:Ft,model:Xt});r.draftModel.value=null;const Ls=Xt!==void 0&&(!Wt.model||Wt.model.length===0)?{...Wt,model:Xt}:Wt;h(Ls),Ke(Wt.workspaceId??at??oe),await hn(Wt.id);const Os=Wt.id;z.planMode&&(e.planModeBySession={...e.planModeBySession,[Os]:!0},P()),z.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Os]:!0},D()),z.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Os]:!0},H()),z.planMode=!1,z.swarmMode=!1,z.goalMode=!1,await Bn(Wt.id,Se,Te)}catch(tt){l("startSessionAndSendPrompt",tt)}}async function Kt(oe){const Se=oe.trim();if(!Se)return!1;const Te=mt();try{const Ue=await Te.addWorkspace({root:Se});return _t(Ue),Pt(Ue.id),!0}catch{return!1}}async function Dn(oe){try{return await mt().browseFs(oe)}catch{return{path:"",parent:null,entries:[]}}}async function In(){try{return await mt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Dt(oe,Se){if(Se==="none"||typeof window>"u"||!window.history)return;const Te=sue(oe);if(window.location.pathname!==Te)try{Se==="push"?window.history.pushState(null,"",Te):window.history.replaceState(null,"",Te)}catch{}}async function pn(oe){try{const Se=await mt().getSession(oe);return e.sessions.some(Te=>Te.id===Se.id)||p(Se),!0}catch{return!1}}function Kn(){const oe=ZS(window.location);if(oe===void 0){b(void 0);return}if(oe!==e.activeSessionId){if(e.sessions.some(Se=>Se.id===oe)){hn(oe,{urlMode:"none"});return}(async()=>{if(await pn(oe)){await hn(oe,{urlMode:"none"});return}const Se=e.sessions[0];Se?await hn(Se.id,{urlMode:"replace"}):(b(void 0),Dt(void 0,"replace"))})()}}let nt=!1;function wn(){nt||typeof window>"u"||(nt=!0,window.addEventListener("popstate",Kn))}async function hn(oe,Se){const Te=L(oe),Ue=!Te&&u.has(oe);u.delete(oe);try{Dt(oe,Se?.urlMode??"push"),e.sessionLoading=!Te&&!Ue,b(oe),me(),e.unreadBySession[oe]&&(e.unreadBySession={...e.unreadBySession,[oe]:!1},U({[oe]:!1})),F();const tt=e.sessions.find(at=>at.id===oe);if(tt){const at=S(tt);e.activeWorkspaceId!==at&&Ke(at)}if(Te){if(await C(oe)==="not-found")return}else if(await y(oe)==="not-found")return;Le(oe)}catch(tt){l("selectSession",tt,{sessionId:oe})}finally{e.activeSessionId===oe&&(e.sessionLoading=!1)}}async function Bn(oe,Se,Te){c.add(oe),e.sendingBySession={...e.sendingBySession,[oe]:!0};const Ue=g();try{const tt=mt(),at=[];Se&&at.push({type:"text",text:Se});for(const Ln of Te??[])Ln.kind==="video"?at.push({type:"video",source:{kind:"file",fileId:Ln.fileId}}):at.push({type:"image",source:{kind:"file",fileId:Ln.fileId}});if(at.length===0)return c.delete(oe),e.sendingBySession={...e.sendingBySession,[oe]:!1},!1;const Ft={id:Ue,sessionId:oe,role:"user",content:at,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};_(oe,Ln=>[...Ln,Ft]);const Xt=e.sessions.find(Ln=>Ln.id===oe),Wt=(Xt?.model&&Xt.model.length>0?Xt.model:e.defaultModel)??void 0,Ls=e.planModeBySession[oe]??!1,Os=e.swarmModeBySession[oe]??!1,gn=e.goalModeBySession[oe]??!1;if(gn&&Se)try{await tt.updateSession(oe,{goalObjective:Se.trim()})}catch(Ln){return l("createGoal",Ln,{sessionId:oe}),c.delete(oe),e.sendingBySession={...e.sendingBySession,[oe]:!1},_(oe,So=>So.some(Co=>Co.id===Ue)?So.filter(Co=>Co.id!==Ue):So),!1}const oo=await tt.submitPrompt(oe,{content:at,model:Wt,thinking:e.thinking,permissionMode:e.permission,planMode:Ls,swarmMode:Os});return gn&&(e.goalModeBySession={...e.goalModeBySession,[oe]:!1},H()),e.promptIdBySession={...e.promptIdBySession,[oe]:oo.promptId},_(oe,Ln=>{const So=Ln.findIndex(lr=>lr.id===Ue);if(So===-1)return Ln;const Co=[...Ln];return Co[So]={...Co[So],promptId:Co[So].promptId??oo.promptId},Co}),v()?.bindNextPromptId(oe,oo.promptId),!0}catch(tt){return c.delete(oe),e.sendingBySession={...e.sendingBySession,[oe]:!1},_(oe,at=>at.some(Ft=>Ft.id===Ue)?at.filter(Ft=>Ft.id!==Ue):at),l("sendPrompt",tt,{sessionId:oe}),!1}}async function Gn(oe,Se){const Te=e.activeSessionId;if(Te){if(a.value!=="idle"||c.has(Te)){At(oe,Se);return}await Bn(Te,oe,Se)}}async function Ye(oe,Se){const Te=e.activeSessionId;if(!Te)return;const Ue=e.queuedBySession[Te]??[],tt=[],at=[];for(const gn of Ue){const oo=gn.text.trim();oo&&tt.push(oo),gn.attachments?.length&&at.push(...gn.attachments)}const Ft=oe.trim();if(Ft&&tt.push(Ft),Se?.length&&at.push(...Se),tt.length===0&&at.length===0)return;Ue.length>0&&(e.queuedBySession={...e.queuedBySession,[Te]:[]});const Xt=tt.join(`
|
|
275
|
+
|
|
276
|
+
`);if(a.value==="idle"&&!c.has(Te)){await Bn(Te,Xt,at);return}const Wt=[];Xt&&Wt.push({type:"text",text:Xt});for(const gn of at)gn.kind==="video"?Wt.push({type:"video",source:{kind:"file",fileId:gn.fileId}}):Wt.push({type:"image",source:{kind:"file",fileId:gn.fileId}});const Ls=g(),Os={id:Ls,sessionId:Te,role:"user",content:Wt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};_(Te,gn=>[...gn,Os]);try{const gn=mt(),oo=e.sessions.find(Co=>Co.id===Te),Ln=(oo?.model&&oo.model.length>0?oo.model:e.defaultModel)??void 0,So=await gn.submitPrompt(Te,{content:Wt,model:Ln,thinking:e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[Te]??!1,swarmMode:e.swarmModeBySession[Te]??!1});if(_(Te,Co=>{const lr=Co.findIndex(ts=>ts.id===Ls);if(lr===-1)return Co;const xo=[...Co];return xo[lr]={...xo[lr],promptId:xo[lr].promptId??So.promptId},xo}),So.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Te]:So.promptId},v()?.bindNextPromptId(Te,So.promptId);return}try{await gn.steerPrompts(Te,[So.promptId])}catch{}}catch(gn){_(Te,oo=>oo.filter(Ln=>Ln.id!==Ls)),l("steer",gn,{sessionId:Te})}}async function Xe(oe,Se){try{const Ue=await mt().uploadFile({file:oe,name:Se});return{fileId:Ue.id,name:Ue.name,mediaType:Ue.mediaType}}catch(Te){return l("uploadImage",Te),null}}function At(oe,Se){const Te=e.activeSessionId;if(!Te)return;const Ue=e.queuedBySession[Te]??[];e.queuedBySession={...e.queuedBySession,[Te]:[...Ue,{text:oe,attachments:Se}]}}async function Lt(){const oe=e.activeSessionId;if(!oe)return;const Se=e.sessions.find(tt=>tt.id===oe);let Te=e.promptIdBySession[oe];if(Te===void 0){const tt=Se?.currentPromptId;tt?.startsWith("prompt_")&&(Te=tt)}const Ue=mt();if(Te!==void 0)try{if((await Ue.abortPrompt(oe,Te)).aborted)return;const at={...e.promptIdBySession};delete at[oe],e.promptIdBySession=at}catch(tt){if(Jr(tt)&&tt.code===rue){const at={...e.promptIdBySession};delete at[oe],e.promptIdBySession=at}else{l("abortCurrentPrompt",tt,{sessionId:oe});return}}try{await Ue.abortSession(oe)}catch(tt){l("abortCurrentPrompt",tt,{sessionId:oe})}}function $n(oe,Se){const Te=e.approvalsBySession[oe]??[];e.approvalsBySession={...e.approvalsBySession,[oe]:Te.filter(Ue=>Ue.approvalId!==Se)}}function cn(oe,Se){const Te=e.questionsBySession[oe]??[];e.questionsBySession={...e.questionsBySession,[oe]:Te.filter(Ue=>Ue.questionId!==Se)}}async function Nn(oe,Se){const Te=e.activeSessionId;if(Te&&!gf[oe]){gf[oe]=!0;try{const Ue=mt(),tt={decision:Se.decision,scope:Se.scope,feedback:Se.feedback,selectedLabel:Se.selectedLabel};await Ue.respondApproval(Te,oe,tt),$n(Te,oe)}catch(Ue){iv(Ue)?$n(Te,oe):l("respondApproval",Ue,{sessionId:Te})}finally{delete gf[oe]}}}async function Fn(oe,Se){const Te=e.activeSessionId;if(Te&&!Al[oe]){Al[oe]="answer";try{await mt().respondQuestion(Te,oe,Se),cn(Te,oe)}catch(Ue){iv(Ue)?cn(Te,oe):l("respondQuestion",Ue,{sessionId:Te})}finally{delete Al[oe]}}}async function eo(oe){const Se=e.activeSessionId;if(Se&&!Al[oe]){Al[oe]="dismiss";try{await mt().dismissQuestion(Se,oe),cn(Se,oe)}catch(Te){iv(Te)?cn(Se,oe):l("dismissQuestion",Te,{sessionId:Se})}finally{delete Al[oe]}}}async function Mt(oe){const Se=e.activeSessionId;if(Se&&!rv[oe]){rv[oe]=!0;try{await mt().cancelTask(Se,oe);const Ue=e.tasksBySession[Se]??[];e.tasksBySession={...e.tasksBySession,[Se]:Ue.map(tt=>tt.id===oe?{...tt,status:"cancelled"}:tt)}}catch(Te){uue(Te)||l("cancelTask",Te,{sessionId:Se})}finally{delete rv[oe]}}}function Yn(oe){const Se=e.activeSessionId;Se?(e.planModeBySession={...e.planModeBySession,[Se]:oe},P(),k({planMode:oe})):z.planMode=oe}function mn(){const oe=e.activeSessionId,Se=oe?e.planModeBySession[oe]??!1:z.planMode;Yn(!Se)}function wo(oe){const Se=e.activeSessionId;Se?(e.swarmModeBySession={...e.swarmModeBySession,[Se]:oe},D(),k({swarmMode:oe})):z.swarmMode=oe}async function ei(){const oe=e.activeSessionId,Te=!(oe?e.swarmModeBySession[oe]??!1:z.swarmMode);Te&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||wo(Te)}function Ns(oe){const Se=e.activeSessionId;Se?(e.goalModeBySession={...e.goalModeBySession,[Se]:oe},H()):z.goalMode=oe}function et(){const oe=e.activeSessionId,Se=oe?e.goalModeBySession[oe]??!1:z.goalMode;Ns(!Se)}async function it(oe){const Se=oe.trim();if(!Se||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:Se}),variant:"primary"}))return;const Te=e.activeSessionId;if(Te){try{await mt().updateSession(Te,{goalObjective:Se})}catch(Ue){l("createGoal",Ue,{sessionId:Te,message:ue(Ue)});return}await Gn(Se)}}function lt(oe){const Se=e.activeSessionId;Se&&Promise.resolve(mt().updateSession(Se,{goalControl:oe})).catch(Te=>{l("controlGoal",Te,{sessionId:Se,message:ue(Te)})})}function pt(oe){e.permission=oe,I(oe),k({permissionMode:oe})}function ti(oe){const Se=[...e.warnings];Se.splice(oe,1),e.warnings=Se}async function mi(oe,Se){try{await mt().updateSession(oe,{title:Se}),f(oe,Ue=>({...Ue,title:Se}))}catch(Te){l("renameSession",Te,{sessionId:oe})}}async function Ie(oe,Se){const Te=e.workspaces.find(tt=>tt.id===oe)?.root,Ue=()=>{e.workspaces=e.workspaces.map(tt=>tt.id===oe?{...tt,name:Se}:tt)};try{if(await mt().updateWorkspace(oe,{name:Se}),Te!==void 0){const tt=Yd();Te in tt&&(delete tt[Te],h_(tt))}Ue()}catch(tt){if(Te!==void 0&&Jr(tt)&&tt.code===lue){h_({...Yd(),[Te]:Se}),Ue();return}l("renameWorkspace",tt)}}async function _e(oe){const Se=e.workspaces.find(at=>at.id===oe)?.root??M.value.find(at=>at.id===oe)?.root??oe,Te=e.activeSessionId?e.sessions.find(at=>at.id===e.activeSessionId):void 0,Ue=e.activeWorkspaceId===oe||e.activeWorkspaceId===Se,tt=!!(Te&&(Te.cwd===Se||Te.workspaceId===oe||S(Te)===oe));Se&&!e.hiddenWorkspaceRoots.includes(Se)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Se],X(e.hiddenWorkspaceRoots));try{await mt().deleteWorkspace(oe)}catch{}if(e.workspaces=e.workspaces.filter(at=>at.id!==oe&&at.root!==Se),Ue||tt){const at=E.value[0]?.id??null;if(e.activeWorkspaceId=at,at)Q(at);else try{sc($t.activeWorkspace)}catch{}}(Ue||tt)&&(b(void 0),e.sessionLoading=!1,F(),Dt(void 0,"replace"))}async function Re(oe){try{await mt().archiveSession(oe),m(oe),i.clearSideChatForSession(oe);const{[oe]:Te,...Ue}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Ue,e.activeSessionId===oe){const tt=e.sessions[0];tt?await hn(tt.id,{urlMode:"replace"}):(b(void 0),Dt(void 0,"replace"))}}catch(Se){l("archiveSession",Se,{sessionId:oe})}}async function on(){try{await mt().logout(),await ee(),await Ee()}catch(oe){l("logout",oe)}}function Ut(oe){const Se=e.activeSessionId;Se&&mt().compactSession(Se,oe).catch(Te=>{l("compact",Te,{sessionId:Se})})}async function fo(oe){const Se=oe??e.activeSessionId;if(Se)try{const Te=await mt().forkSession(Se);h(Te),await hn(Te.id)}catch(Te){l("fork",Te,{sessionId:Se})}}async function Hn(oe=1){const Se=e.activeSessionId;if(!Se)return null;const Te=(()=>{const Ue=e.messagesBySession[Se]??[];for(let tt=Ue.length-1;tt>=0;tt--){const at=Ue[tt];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter(Ft=>Ft.type==="text").map(Ft=>Ft.text).join(`
|
|
277
|
+
`)}return null})();try{return await mt().undoSession(Se,oe),await y(Se),Te}catch(Ue){return l("undo",Ue,{sessionId:Se}),null}}function gs(oe){const Se=e.activeSessionId;if(!Se)return;const Te=e.queuedBySession[Se]??[];if(oe<0||oe>=Te.length)return;const Ue=[...Te];Ue.splice(oe,1),e.queuedBySession={...e.queuedBySession,[Se]:Ue}}function ni(oe,Se){const Te=e.activeSessionId;if(!Te)return;const Ue=e.queuedBySession[Te]??[];if(oe===Se||oe<0||oe>=Ue.length||Se<0||Se>=Ue.length)return;const tt=[...Ue],[at]=tt.splice(oe,1);at!==void 0&&(tt.splice(Se,0,at),e.queuedBySession={...e.queuedBySession,[Te]:tt})}async function yo(oe){const Se=e.activeSessionId;if(!Se)return[];try{return(await mt().listDirectory(Se,{path:oe,includeGitStatus:!0})).items}catch{return[]}}async function rl(oe){const Se=e.activeSessionId;if(!Se)return null;try{const Ue=await mt().readFile(Se,{path:oe});return{path:Ue.path,content:Ue.content,encoding:Ue.encoding,mime:Ue.mime,languageId:Ue.languageId,isBinary:Ue.isBinary,size:Ue.size,lineCount:Ue.lineCount}}catch{return null}}const ll=10485760;function gc(oe){const Se=e.activeSessionId;return Se?mt().getFileDownloadUrl(Se,oe):null}async function dt(oe,Se){const Te=e.activeSessionId;if(!Te)return!1;try{return await mt().openFile(Te,{path:oe,line:Se}),!0}catch(Ue){return l("openFile",Ue,{sessionId:Te}),!1}}async function pe(oe){const Se=e.activeSessionId;if(!Se)return;const Te=O.value.cwd||".";try{await mt().openInApp(Se,oe,Te)}catch(Ue){l("openInApp",Ue,{sessionId:Se})}}async function Ne(oe){const Se=e.activeSessionId;if(!Se)return!1;try{return await mt().revealFile(Se,{path:oe}),!0}catch(Te){return l("revealFile",Te,{sessionId:Se}),!1}}async function Sn(oe){if(/^(https?:|data:|blob:)/i.test(oe))return oe;const Se=e.activeSessionId;if(!Se)return oe;let Te=oe;if(Te.startsWith("/")){const Ue=e.sessions.find(tt=>tt.id===Se)?.cwd;if(Ue&&(Te===Ue||Te.startsWith(Ue.endsWith("/")?Ue:`${Ue}/`))){if(Te=Te.slice(Ue.length).replace(/^\//,""),!Te)return oe}else return oe}try{const tt=await mt().readFile(Se,{path:Te,length:ll});return!tt.isBinary||tt.encoding!=="base64"||tt.truncated?oe:`data:${tt.mime};base64,${tt.content}`}catch{return oe}}async function dd(oe){const Se=e.activeSessionId;if(!Se)return[];try{return(await mt().searchFiles(Se,{query:oe,limit:20})).items.map(tt=>({path:tt.path,name:tt.name}))}catch{return[]}}return{loadFileDiff:le,clearFileDiff:F,loadGitStatus:te,checkAuth:ee,loadConfig:q,updateConfig:Y,listAllSessionsGlobal:j,load:Ee,loadWorkspaces:ae,loadMoreSessions:he,loadAllSessions:Ce,selectWorkspace:Ke,openWorkspace:ot,upsertWorkspacePreserveOrder:_t,applyWorkspaceEvent:wt,clearActiveSession:It,openWorkspaceDraft:Pt,startSessionAndSendPrompt:bt,addWorkspaceByPath:Kt,browseFs:Dn,getFsHome:In,writeSessionUrl:Dt,fetchSessionIntoList:pn,onSessionRoutePopState:Kn,bindSessionRoute:wn,selectSession:hn,submitPromptInternal:Bn,sendPrompt:Gn,steerPrompt:Ye,uploadImage:Xe,enqueue:At,unqueue:gs,reorderQueue:ni,abortCurrentPrompt:Lt,respondApproval:Nn,respondQuestion:Fn,dismissQuestion:eo,pendingQuestionActions:Al,pendingApprovalActions:gf,cancelTask:Mt,setPlanMode:Yn,togglePlanMode:mn,setSwarmMode:wo,toggleSwarmMode:ei,setGoalMode:Ns,toggleGoalMode:et,createGoal:it,controlGoal:lt,setPermission:pt,dismissWarning:ti,renameSession:mi,renameWorkspace:Ie,deleteWorkspace:_e,archiveSession:Re,logout:on,compact:Ut,forkSession:fo,undo:Hn,listDir:yo,readFileContent:rl,getFileDownloadUrl:gc,openWorkspaceFile:dt,openInApp:pe,revealWorkspaceFile:Ne,resolveImageUrl:Sn,searchFiles:dd,loadOlderMessages:Fe,refreshSessionSidecars:Le}}const fue="kimiWeb.optimisticUserMessage";function pue(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function hue(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function mue(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const o=e.lastSeqBySession[t]??0;n>o&&(e.lastSeqBySession[t]=n)}}function lv(e){return e.role==="user"&&e.metadata?.[fue]===!0}function gue(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function JS(e){let t="",n=0;for(const o of e.content)o.type==="text"?t+=o.text:(o.type==="image"||o.type==="file")&&(n+=1);return{text:t,media:n}}function vue(e,t){const n=JS(e),o=JS(t);return n.text===o.text&&n.media===o.media}function yue(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(lv(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(lv(s)&&gue(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(lv(s)&&vue(s,t))return o}return-1}function kue(e,t,n){let o=!1;const s=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?(o=!0,{...i,content:l}):i});return o?s:e}function bue(e,t,n){const o=hue(e);switch(mue(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(i=>i.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?t.session:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(i=>i.id!==s),delete o.messagesBySession[s],delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionStatusChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const i=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,i=o.compactionBySession[s],{[s]:r,...l}=o.compactionBySession;if(o.compactionBySession=l,Object.prototype.hasOwnProperty.call(o.messagesBySession,s)){const a=o.messagesBySession[s]??[],c=`compaction_${s}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};o.messagesBySession[s]=[...a,{id:c,sessionId:s,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[D3]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:s,...i}=o.compactionBySession;o.compactionBySession=i;break}case"messageCreated":{const s=t.message.sessionId,i=t.message.createdAt;o.sessions=o.sessions.map(a=>a.id===s&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=o.messagesBySession[s]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"){const a=yue(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},o.messagesBySession[s]=c;break}}o.messagesBySession[s]=[...r,t.message]}break}case"messageUpdated":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=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 s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=kue(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const s=t.sessionId,i=o.approvalsBySession[s]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,i=t.approvalId,r=o.approvalsBySession[s]??[];o.approvalsBySession[s]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const s=t.sessionId,i=o.questionsBySession[s]??[];i.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,i=t.questionId,r=o.questionsBySession[s]??[];o.questionsBySession[s]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const s=t.sessionId,i=o.tasksBySession[s]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)o.tasksBySession[s]=[...i,t.task];else{const l=[...i];l[r]={...t.task,outputLines:i[r].outputLines,text:i[r].text},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const s=t.sessionId;t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&(s._agentError||s._agentWarning)){const i=s._agentError?qn.global.t("warnings.errorLabel"):qn.global.t("warnings.noteLabel"),r=s.message??s.code??"agent error";o.warnings=[...o.warnings,`${i}: ${r}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function _ue(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function wue(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type!=="toolUse"||Xl(s.toolName)!=="todo")continue;let i=s.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:_ue(a.status)}]:[]})}}return[]}const Ti=w3(),Nl=yce(),Bp=xce(),H3=$t.permission,W3=$t.activeWorkspace,z3=$t.thinking,U3=$t.planMode,q3=$t.swarmMode,j3=$t.goalMode,eC=40401,V3=$t.onboarded,Sue=["off","low","medium","high","xhigh","max"];sc($t.codeFont);sc($t.theme);function Cue(){try{const e=Jn(H3);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function xue(e){try{no(H3,e)}catch{}}function Aue(){try{const e=Jn(z3);if(e&&Sue.includes(e))return e}catch{}return"high"}function Tue(e){try{no(z3,e)}catch{}}function av(e){const t=Jn(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const o={};for(const[s,i]of Object.entries(n))i===!0&&(o[s]=!0);return o}catch{return{}}}function ky(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);no(e,JSON.stringify(n))}catch{}}function K3(){ky(U3,ye.planModeBySession)}function G3(){ky(q3,ye.swarmModeBySession)}function Y3(){ky(j3,ye.goalModeBySession)}function Mue(){try{return Jn(W3)}catch{return null}}const X3=$t.hiddenWorkspaces;function Eue(){try{const e=Jn(X3);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Iue(e){try{no(X3,JSON.stringify(e))}catch{}}function $ue(e){try{no(W3,e)}catch{}}function Nue(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const ye=No({...pue(),connected:!1,serverVersion:"",workspaceName:"kimi-web",connection:"disconnected",permission:Cue(),thinking:Aue(),planModeBySession:av(U3),swarmModeBySession:av(q3),goalModeBySession:av(j3),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:f0(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Mue(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Eue(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),Nh=No({planMode:!1,swarmMode:!1,goalMode:!1});function Q3(e){ye.sessions=e}function Lh(e,t){ye.sessions=ye.sessions.map(n=>n.id===e?t(n):n)}function Lue(e){ye.sessions=[e,...ye.sessions.filter(t=>t.id!==e.id)]}function Oue(e){ye.sessions=[...ye.sessions,e]}function Pue(e){ye.sessions=ye.sessions.filter(t=>t.id!==e)}function Z3(){const e=ye.activeSessionId;e&&ye.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(ye.unreadBySession={...ye.unreadBySession,[e]:!1},p0({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===$t.unread&&(ye.unreadBySession=f0(),Z3())});typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&Z3()});function by(e){ye.activeSessionId=e}function Rue(e){ye.messagesBySession=e}function Due(e,t){ye.messagesBySession={...ye.messagesBySession,[e]:t}}function J3(e,t){ye.messagesBySession={...ye.messagesBySession,[e]:t(ye.messagesBySession[e]??[])}}function Bue(e){const{[e]:t,...n}=ye.messagesBySession;ye.messagesBySession=n}function e4(e){di?.unsubscribe(e),rde(e),Ku.flush(),Pue(e),Bue(e),delete ye.approvalsBySession[e],delete ye.questionsBySession[e],delete ye.tasksBySession[e],delete ye.goalBySession[e],delete ye.gitStatusBySession[e],delete ye.lastSeqBySession[e],delete ye.compactionBySession[e],delete ye.messagesLoadingMoreBySession[e],delete ye.messagesHasMoreBySession[e],delete ye.messagesLoadMoreErrorBySession[e],delete Rh[e],u4.delete(e),Ph.delete(e),delete ye.queuedBySession[e],delete ye.promptIdBySession[e],delete ye.sendingBySession[e],delete ye.planModeBySession[e],delete ye.swarmModeBySession[e],delete ye.goalModeBySession[e],K3(),G3(),Y3()}const t4=Z(null),n4=Z([]),o4=Z(!1),s4=Z(!1);async function Oh(e){let t;try{t=await mt().getSessionStatus(e)}catch{return}Lh(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),ye.swarmModeBySession={...ye.swarmModeBySession,[e]:t.swarmMode},ye.planModeBySession={...ye.planModeBySession,[e]:t.planMode}}function i4(e){const t=ye.activeSessionId;t&&Promise.resolve(mt().updateSession(t,e)).then(()=>Oh(t)).catch(()=>{})}const r4=$t.conversationToc;function Fue(){try{const e=Jn(r4);return e===null?!0:e==="true"}catch{return!0}}function Hue(e){try{no(r4,e?"true":"false")}catch{}}const l4=Z(Fue());function Wue(e){l4.value=e,Hue(e)}function zue(e){try{return Jn(e)??""}catch{return""}}const a4=Z(zue(V3)==="1");function Uue(e){a4.value=e;try{no(V3,e?"1":"0")}catch{}}let di=null,tC=0;function c4(){return tC+=1,`msg_opt_${Date.now().toString(36)}_${tC}`}const Ph=new Set;function que(e,t,n){const o={sessions:ye.sessions,activeSessionId:ye.activeSessionId,messagesBySession:ye.messagesBySession,approvalsBySession:ye.approvalsBySession,planReviewByToolCallId:ye.planReviewByToolCallId,questionsBySession:ye.questionsBySession,tasksBySession:ye.tasksBySession,goalBySession:ye.goalBySession,lastSeqBySession:ye.lastSeqBySession,compactionBySession:ye.compactionBySession,config:ye.config,warnings:ye.warnings},s=bue(o,e,{sessionId:t,seq:n});Q3(s.sessions),by(s.activeSessionId),Rue(s.messagesBySession),ye.approvalsBySession=s.approvalsBySession,ye.planReviewByToolCallId=s.planReviewByToolCallId,ye.questionsBySession=s.questionsBySession,ye.tasksBySession=s.tasksBySession,ye.goalBySession=s.goalBySession,ye.lastSeqBySession=s.lastSeqBySession,ye.compactionBySession=s.compactionBySession,ye.config=s.config??null,ye.warnings=s.warnings,e.type==="configChanged"&&(ye.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(zn.loadModels(),zn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(ye.swarmModeBySession={...ye.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(ye.planModeBySession={...ye.planModeBySession,[e.sessionId]:e.planMode}))}function jue(e,t){que(e,t.sessionId,t.seq);const n=Do.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:o}=n,s=t.sessionId;e.type==="agentDelta"&&e.agentId===o?e.delta.text&&Do.appendSideChatAssistantText(o,s,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===o?Do.finishSideChatAgent(o,s):e.type==="taskProgress"&&e.taskId===o?Do.appendSideChatAssistantText(o,s,e.outputChunk):e.type==="taskCompleted"&&e.taskId===o&&Do.finishSideChatAgent(o,s,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const o=e.message.sessionId;ye.promptIdBySession[o]!==e.message.promptId&&(ye.promptIdBySession={...ye.promptIdBySession,[o]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===ye.activeSessionId&&Ti.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&lfe(e.sessionId,e.status),e.type==="questionRequested"&&afe(e.sessionId,e.question)}const Ku=pce(({appEvent:e,meta:t})=>jue(e,t),({appEvent:e})=>dce(e));function _y(){if(di!==null||typeof WebSocket>"u")return;ye.connection="connecting",di=mt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){vt.applyWorkspaceEvent(t);return}Ku({appEvent:t,meta:n})},onResync(t,n,o){Ku.flush(),o!==void 0&&(Rh[t]=o),ode.request(t)},onError(t,n,o){wy({severity:"error",title:qn.global.t("warnings.wsTitle"),message:n,details:[Wn("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){ye.connected=t,ye.connection=t?"connected":"disconnected"}})}const Rh={},u4=new Set;function Vue(e){return Jr(e)&&e.code===eC?!0:typeof e=="object"&&e!==null&&e.code===eC}function Wn(e,t){if(!(t==null||t===""))return{label:qn.global.t(`warnings.details.${e}`),value:d4(t)}}function d4(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack: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 Kue(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Gue(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Yue(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function Xue(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function nC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function Que(e,t,n){const o=A3(t),s=Jr(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[Wn("operation",e),Wn("sessionId",n??ye.activeSessionId),Wn("connection",ye.connection),Wn("timestamp",Xue(i??Date.now()))];return o?l.push(Wn("duration",nC(r)),Wn("request",`${t.method} ${t.path}`),Wn("endpoint",t.url),Wn("requestId",t.requestId),Wn("phase",t.phase),Wn("timeout",`${t.timeoutMs}ms`),Wn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Wn("contentType",t.contentType),Wn("responsePreview",t.bodyPreview),Wn("cause",t.cause)):s?l.push(Wn("duration",nC(r)),Wn("code",t.code),Wn("requestId",t.requestId),Wn("message",t.message),Wn("details",t.details)):l.push(Wn("errorName",Kue(t)),Wn("message",Gue(t)??d4(t)),Wn("stack",Yue(t))),l.filter(a=>a!==void 0)}function Zue(e,t,n={}){const o=A3(t),s=Jr(t),i=n.title??(o?qn.global.t("warnings.daemonNetworkTitle"):s?qn.global.t("warnings.daemonApiTitle"):qn.global.t("warnings.operationFailedTitle")),r=n.message??(o?qn.global.t("warnings.daemonNetworkMessage"):s?t.message:qn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:Que(e,t,n.sessionId)}}function wy(e){ye.warnings=[...ye.warnings,e]}function Dh(e,t,n){wy(Zue(e,t,n))}const Jue={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function ede(e){if(!Jr(e))return;const t=Jue[e.code];return t?qn.global.t(t):void 0}async function tde(e){if(e4(e),ye.activeSessionId!==e)return;const t=ye.sessions[0];t?await vt.selectSession(t.id,{urlMode:"replace"}):(by(void 0),ye.sessionLoading=!1,vt.writeSessionUrl(void 0,"replace"))}const oC=new Set;async function nde(e){if(!oC.has(e)){oC.add(e);try{const t=await mt().getSessionWarnings(e),n=qn.global.t("warnings.noteLabel");for(const o of t)wy(`${n}: ${o.message}`)}catch{}}}async function Sy(e){try{const n=await mt().getSessionSnapshot(e);Ku.flush(),Lh(e,o=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:o.model})),Due(e,n.messages),ye.messagesHasMoreBySession={...ye.messagesHasMoreBySession,[e]:n.hasMoreMessages},ye.approvalsBySession={...ye.approvalsBySession,[e]:n.pendingApprovals};for(const o of n.pendingApprovals){const s=o.display;s?.kind==="plan_review"&&typeof s.plan=="string"&&s.plan.length>0&&(ye.planReviewByToolCallId={...ye.planReviewByToolCallId,[o.toolCallId]:{plan:s.plan,path:typeof s.path=="string"?s.path:void 0}})}return ye.questionsBySession={...ye.questionsBySession,[e]:n.pendingQuestions},ye.lastSeqBySession={...ye.lastSeqBySession,[e]:n.asOfSeq},Rh[e]=n.epoch,_y(),di&&(di.seedSnapshot(e,n),di.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch}),f4(e)),Bh.delete(e),nde(e),"ok"}catch(t){return Vue(t)?(await tde(e),"not-found"):(Dh("getSessionSnapshot",t,{title:qn.global.t("warnings.sessionSnapshotTitle"),message:qn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const ode=cce(Sy);function sde(e){return Object.prototype.hasOwnProperty.call(ye.messagesBySession,e)}const ide=4,Ui=[],Bh=new Set;function f4(e){const t=Ui.indexOf(e);for(t!==-1&&Ui.splice(t,1),Ui.unshift(e);Ui.length>ide;){let n=-1;for(let s=Ui.length-1;s>=0;s--)if(Ui[s]!==ye.activeSessionId){n=s;break}if(n===-1)break;const[o]=Ui.splice(n,1);if(o===void 0)break;di?.unsubscribe(o),Bh.add(o)}}function rde(e){const t=Ui.indexOf(e);t!==-1&&Ui.splice(t,1),Bh.delete(e)}function lde(e){if(_y(),di){Ku.flush();const t=ye.lastSeqBySession[e]??0,n=Rh[e];di.subscribe(e,{seq:t,epoch:n}),f4(e)}}async function ade(e){return Bh.has(e)?Sy(e):(lde(e),"ok")}function Fh(e){const t=ye.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=Do.sideChatTargetBySession.value[e]?.agentId,s=(ye.tasksBySession[e]??[]).filter(i=>i.status==="running");return s.length===0?!(n&&ye.sideChatSendingByAgent[n]):s.some(i=>i.id!==n)}function Cy(e,t){try{const n=new Date(e),s=Date.now()-n.getTime(),i=s/36e5;if(s<6e4)return qn.global.t("sessions.justNow");if(i<1)return`${Math.round(s/6e4)}m`;if(i<24)return`${Math.round(i)}h`;const r=s/864e5;return r<7?`${Math.round(r)}d`:r<30?`${Math.round(r/7)}w`:r<365?`${Math.round(r/30)}m`:`${Math.round(r/365)}y`}catch{return e}}const cde=3e4,Gu=Z(0);let cv=null;function ude(){cv===null&&(cv=setInterval(()=>{Gu.value=(Gu.value+1)%Number.MAX_SAFE_INTEGER},cde),cv.unref?.())}function dde(e,t){const n=e.split(`
|
|
278
|
+
`),o=t.split(`
|
|
279
|
+
`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function fde(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:dde(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:o,cwd:s,danger:i}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:i}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:i}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:i}}if(n==="todo"||n==="todo_list")return{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"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function pde(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 hde(e){const t=ye.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const i of s.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 o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const i of s.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(o)){const l=n.get(i.toolCallId);if(l)return l}}}function mde(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=qn.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=qn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??hde(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const gde=W(()=>{const e=ye.sessions.find(n=>n.id===ye.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:ye.workspaceName,branch:t}}),vde=W(()=>(Gu.value,ye.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Cy(e.updatedAt,e.status),status:e.status,busy:Fh(e.id)})))),yde=W(()=>ye.activeSessionId??""),kde=W(()=>{const e=ye.activeSessionId;return e?zn.skillsBySession.value[e]??[]:[]}),bde=W(()=>{const e=ye.activeSessionId;return e?ye.sendingBySession[e]??!1:!1}),Do=tue(ye,{pushOperationFailure:Dh,nextOptimisticMsgId:c4,connectEventsIfNeeded:_y,getEventConn:()=>di}),ud=W(()=>{const e=ye.activeSessionId;if(!e)return[];const t=Do.sideChatTargetBySession.value[e]?.agentId;return(ye.tasksBySession[e]??[]).filter(n=>n.id!==t)}),p4=Mce(ye,ud),_de=W(()=>{const e=ye.activeSessionId;if(!e)return[];const t=new Set(ye.sideChatUserMessageIdsBySession[e]??[]),n=(ye.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=ye.approvalsBySession[e]??[];return F3(n,o,s=>mt().getFileUrl(s),Hh.value!=="idle",ud.value,ye.planReviewByToolCallId)}),wde=W(()=>(p4.taskClock.value,ud.value.map(mde))),h4=W(()=>Oce(ud.value)),Ma=W(()=>{const e=ye.activeSessionId;return e?ye.goalBySession[e]??null:null}),Sde=W(()=>{const e=ye.activeSessionId;return e?wue(ye.messagesBySession[e]??[]):[]}),Cde=W(()=>{const e=ye.activeSessionId;return e?ye.compactionBySession[e]??null:null}),xde=W(()=>ye.connection),Ade=W(()=>ye.loading),Tde=W(()=>ye.sessionLoading),Mde=W(()=>{const e=ye.activeSessionId;return e?ye.messagesLoadingMoreBySession[e]??!1:!1}),Ede=W(()=>{const e=ye.activeSessionId;return e?ye.messagesHasMoreBySession[e]??!1:!1}),Ide=W(()=>{const e=ye.activeSessionId;return e?ye.messagesLoadMoreErrorBySession[e]??!1:!1}),$de=W(()=>ye.serverVersion),Nde=W(()=>ye.permission),Lde=W(()=>ye.thinking),m4=W(()=>{const e=ye.activeSessionId;return e?ye.planModeBySession[e]??!1:Nh.planMode}),Ode=W(()=>{const e=ye.activeSessionId;return e?ye.swarmModeBySession[e]??!1:Nh.swarmMode}),Pde=W(()=>{const e=ye.activeSessionId;return e?ye.goalModeBySession[e]??!1:Nh.goalMode}),Rde=W(()=>{const e=Pce(h4.value);return{plan:m4.value,goal:Ma.value&&Ma.value.status!=="complete"?{status:Ma.value.status,turnsUsed:Ma.value.turnsUsed,elapsedMs:Ma.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Dde=W(()=>{const e=ye.activeSessionId;if(!e)return[];const t=mt();return(ye.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(o=>({fileId:o.fileId,kind:o.kind,url:t.getFileUrl(o.fileId)}))}))}),Bde=W(()=>ye.warnings),Fde=W(()=>{const e=ye.activeSessionId;return e?(ye.questionsBySession[e]??[]).map(pde):[]}),Hde=W(()=>{const e=ye.activeSessionId;return e?(ye.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:fde(t),agentName:t.agentName})):[]}),Hh=W(()=>{const e=ye.activeSessionId;return e?(ye.approvalsBySession[e]??[]).length>0?"awaiting-approval":(ye.questionsBySession[e]??[]).length>0?"awaiting-question":Fh(e)?"running":"idle":"idle"}),zn=$ce(ye,{pushOperationFailure:Dh,refreshSessionStatus:Oh,persistSessionProfile:i4,activity:Hh,inFlightPromptSessions:Ph,saveThinkingToStorage:Tue,updateSession:Lh,updateSessionMessages:J3}),Fp=W(()=>{const e=ye.activeSessionId;if(!e)return null;const t=ye.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Wde=W(()=>{const e=ye.activeSessionId;return e?ye.gitStatusBySession[e]?.pullRequest??null:null}),zde=W(()=>{const e=ye.activeSessionId;if(!e)return[];const t=ye.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),Ude=W(()=>{const e=ye.activeSessionId;if(!e)return null;const t=ye.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),g4=W(()=>{const e=ye.sessions.find(r=>r.id===ye.activeSessionId),t=Fp.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?zn.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??ye.defaultModel)??"—",s=zn.models.value.find(r=>r.id===o||r.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:ye.permission,branch:t,cwd:e?.cwd??"",isGitRepo:Fp.value!==null}}),qde=W(()=>n4.value),jde=W(()=>ye.sessions.find(t=>t.id===ye.activeSessionId)?.usage.totalCostUsd??0),Vde=W(()=>ye.authReady),Kde=W(()=>ye.defaultModel),Gde=W(()=>ye.managedProviderStatus),Yde=W(()=>ye.config),Xde=W(()=>{const e=ye.activeSessionId;if(!e)return{};const t=ye.gitStatusBySession[e];return t?{...t.entries}:{}});function lc(e){return ye.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const xy=W(()=>ace({workspaces:ye.workspaces,sessions:ye.sessions,hiddenWorkspaceRoots:ye.hiddenWorkspaceRoots,activeRoot:ye.sessions.find(e=>e.id===ye.activeSessionId)?.cwd,activeBranch:Fp.value?.branch??null,sessionsHasMoreByWorkspace:ye.sessionsHasMoreByWorkspace})),Hp=Z(h5()),ac=Z(m5()==="manual"?"manual":"recent");Ge(()=>[xy.value.map(e=>e.id).join("\0"),ye.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=T5(n,Hp.value);o!==null&&(Hp.value=o,fA(o))});const Kl=W(()=>{const e=xy.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Nue(t.root,ye.fsHome),branch:t.branch,sessionCount:t.sessionCount}));if(ac.value==="recent"){const t=new Map;for(const n of ye.sessions){if(n.parentSessionId)continue;const o=lc(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return I5(e,t)}return M5(e,Hp.value)}),v4=W(()=>{const e=ye.activeWorkspaceId,t=Kl.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),Qde=W(()=>{const e=v4.value;return e?Kl.value.find(t=>t.id===e)??null:null}),Zde=W(()=>{Gu.value;const e=new Set(Kl.value.map(n=>n.id)),t=new Map(Kl.value.map(n=>[n.id,n.name]));return ye.sessions.filter(n=>!n.parentSessionId&&e.has(lc(n))).map(n=>{const o=lc(n);return{id:n.id,title:n.title,time:Cy(n.updatedAt,n.status),status:n.status,busy:Fh(n.id),lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),Jde=W(()=>{Gu.value;const e=new Map;for(const t of ye.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=lc(t),o={id:t.id,title:t.title,time:Cy(t.updatedAt,t.status),status:t.status,busy:Fh(t.id),updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return Kl.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:ye.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:ye.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:ye.sessionsInitialCountByWorkspace[t.id]??N1}))});function efe(e){Hp.value=e,fA(e),ac.value!=="manual"&&(ac.value="manual",pA("manual"))}function tfe(e){ac.value!==e&&(ac.value=e,pA(e))}const y4=W(()=>{const e={};for(const[t,n]of Object.entries(ye.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(ye.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),nfe=W(()=>{const e={};for(const[t,n]of Object.entries(ye.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(ye.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),ofe=W(()=>{const e={};for(const[t,n]of Object.entries(ye.unreadBySession))n&&(e[t]=!0);return e}),sfe=W(()=>{const e={},t=y4.value;for(const n of ye.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=lc(n);e[s]=(e[s]??0)+o}return e}),ife=W(()=>ye.recentRoots),rfe=W(()=>ye.availableOpenInApps),vt=due(ye,{taskPoller:p4,sideChat:Do,modelProvider:zn,pushOperationFailure:Dh,activity:Hh,inFlightPromptSessions:Ph,sessionsKnownEmpty:u4,setSessions:Q3,updateSession:Lh,upsertSessionFront:Lue,appendSession:Oue,forgetSession:e4,setActiveSessionId:by,updateSessionMessages:J3,nextOptimisticMsgId:c4,getEventConn:()=>di,syncSessionFromSnapshot:Sy,reopenSession:ade,hasLoadedMessages:sde,refreshSessionStatus:Oh,persistSessionProfile:i4,mergedWorkspaces:xy,workspacesView:Kl,status:g4,workspaceIdForSession:lc,savePermissionToStorage:xue,savePlanModeToStorage:K3,saveSwarmModeToStorage:G3,saveGoalModeToStorage:Y3,draftModes:Nh,saveUnread:p0,saveActiveWorkspaceToStorage:$ue,saveHiddenWorkspacesToStorage:Iue,goalErrorMessage:ede,resetFastMoon:Ti.resetFastMoon,initialized:s4,selectedDiffPath:t4,fileDiffLines:n4,fileDiffLoading:o4});function lfe(e,t){if(Ph.delete(e),ye.sendingBySession={...ye.sendingBySession,[e]:!1},ye.promptIdBySession[e]!==void 0){const i={...ye.promptIdBySession};delete i[e],ye.promptIdBySession=i}e===ye.activeSessionId?(Ti.resetFastMoon(),vt.loadGitStatus(e),Oh(e)):t==="idle"&&(ye.unreadBySession={...ye.unreadBySession,[e]:!0},p0({[e]:!0})),Nl.maybeNotifyCompletion(e,{isActiveAndVisible:e===ye.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:ye.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{vt.selectSession(e)}}),t==="idle"&&Bp.maybePlayCompletionSound();const n=ye.queuedBySession[e]??[];if(n.length===0)return;const[o,...s]=n;ye.queuedBySession={...ye.queuedBySession,[e]:s},o!==void 0&&vt.submitPromptInternal(e,o.text,o.attachments).then(i=>{if(!i){const r=ye.queuedBySession[e]??[];ye.queuedBySession={...ye.queuedBySession,[e]:[o,...r]}}})}function afe(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;Nl.maybeNotifyQuestion(e,{isActiveAndVisible:e===ye.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:ye.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,onClick:()=>{vt.selectSession(e)}}),Bp.maybePlayQuestionSound()}function cfe(){return ude(),{workspace:gde,sessions:vde,activeSessionId:yde,workspacesView:Kl,workspaceSortMode:ac,visibleWorkspace:Qde,activeWorkspaceId:v4,sessionsForView:Zde,workspaceGroups:Jde,attentionBySession:y4,pendingBySession:nfe,attentionByWorkspace:sfe,unreadBySession:ofe,recentRoots:ife,turns:_de,tasks:wde,activeAppTasks:ud,todos:Sde,goal:Ma,swarms:h4,activationBadges:Rde,compaction:Cde,status:g4,sessionCost:jde,fileDiff:qde,selectedDiffPath:t4,fileDiffLoading:o4,changes:zde,gitInfo:Fp,gitDiffStats:Ude,activePullRequest:Wde,changesByPath:Xde,pendingApprovals:Hde,availableOpenInApps:rfe,connection:xde,loading:Ade,sessionLoading:Tde,loadingMoreMessages:Mde,hasMoreMessages:Ede,loadMoreMessagesError:Ide,serverVersion:$de,initialized:s4,permission:Nde,thinking:Lde,planMode:m4,swarmMode:Ode,goalMode:Pde,queued:Dde,warnings:Bde,questions:Fde,activity:Hh,isSending:bde,fastMoon:Ti.fastMoon,models:zn.models,starredModelIds:zn.starredModelIds,providers:zn.providers,uiFontSize:Ti.uiFontSize,setUiFontSize:Ti.setUiFontSize,conversationToc:l4,setConversationToc:Wue,colorScheme:Ti.colorScheme,setColorScheme:Ti.setColorScheme,accent:Ti.accent,setAccent:Ti.setAccent,notifyOnComplete:Nl.notifyOnComplete,notifyOnQuestion:Nl.notifyOnQuestion,notifyPermission:Nl.notifyPermission,setNotifyOnComplete:Nl.setNotifyOnComplete,setNotifyOnQuestion:Nl.setNotifyOnQuestion,soundOnComplete:Bp.soundOnComplete,setSoundOnComplete:Bp.setSoundOnComplete,onboarded:a4,setOnboarded:Uue,load:vt.load,selectSession:vt.selectSession,clearActiveSession:vt.clearActiveSession,loadOlderMessages:vt.loadOlderMessages,loadWorkspaces:vt.loadWorkspaces,loadMoreSessions:vt.loadMoreSessions,loadAllSessions:vt.loadAllSessions,selectWorkspace:vt.selectWorkspace,openWorkspace:vt.openWorkspace,openWorkspaceDraft:vt.openWorkspaceDraft,startSessionAndSendPrompt:vt.startSessionAndSendPrompt,addWorkspaceByPath:vt.addWorkspaceByPath,browseFs:vt.browseFs,getFsHome:vt.getFsHome,sendPrompt:vt.sendPrompt,steerPrompt:vt.steerPrompt,sideChatVisible:Do.sideChatVisible,sideChatSessionId:Do.sideChatSessionId,sideChatTurns:Do.sideChatTurns,sideChatRunning:Do.sideChatRunning,sideChatSending:Do.sideChatSending,openSideChat:Do.openSideChat,closeSideChat:Do.closeSideChat,sendSideChatPrompt:Do.sendSideChatPrompt,uploadImage:vt.uploadImage,abortCurrentPrompt:vt.abortCurrentPrompt,respondApproval:vt.respondApproval,respondQuestion:vt.respondQuestion,dismissQuestion:vt.dismissQuestion,pendingQuestionActions:vt.pendingQuestionActions,pendingApprovalActions:vt.pendingApprovalActions,cancelTask:vt.cancelTask,setPermission:vt.setPermission,setThinking:zn.setThinking,setPlanMode:vt.setPlanMode,togglePlanMode:vt.togglePlanMode,setSwarmMode:vt.setSwarmMode,toggleSwarmMode:vt.toggleSwarmMode,setGoalMode:vt.setGoalMode,toggleGoalMode:vt.toggleGoalMode,createGoal:vt.createGoal,controlGoal:vt.controlGoal,enqueue:vt.enqueue,dismissWarning:vt.dismissWarning,renameSession:vt.renameSession,renameWorkspace:vt.renameWorkspace,deleteWorkspace:vt.deleteWorkspace,reorderWorkspaces:efe,setWorkspaceSortMode:tfe,archiveSession:vt.archiveSession,compact:vt.compact,forkSession:vt.forkSession,undo:vt.undo,unqueue:vt.unqueue,reorderQueue:vt.reorderQueue,searchFiles:vt.searchFiles,loadGitStatus:vt.loadGitStatus,loadFileDiff:vt.loadFileDiff,clearFileDiff:vt.clearFileDiff,listDir:vt.listDir,readFileContent:vt.readFileContent,getFileDownloadUrl:vt.getFileDownloadUrl,openWorkspaceFile:vt.openWorkspaceFile,openInApp:vt.openInApp,revealWorkspaceFile:vt.revealWorkspaceFile,resolveImageUrl:vt.resolveImageUrl,refreshOAuthProviderModels:zn.refreshOAuthProviderModels,loadModels:zn.loadModels,loadProviders:zn.loadProviders,skills:kde,activateSkill:zn.activateSkill,setModel:zn.setModel,toggleStarModel:zn.toggleStarModel,addProvider:zn.addProvider,deleteProvider:zn.deleteProvider,refreshProvider:zn.refreshProvider,refreshAllProviders:zn.refreshAllProviders,authReady:Vde,defaultModel:Kde,managedProviderStatus:Gde,config:Yde,updateConfig:vt.updateConfig,checkAuth:vt.checkAuth,startOAuthLogin:zn.startOAuthLogin,pollOAuthLogin:zn.pollOAuthLogin,cancelOAuthLogin:zn.cancelOAuthLogin,logout:vt.logout}}function ufe({client:e,authLogoRef:t}){const n=W(()=>e.authReady.value),o=W(()=>e.initialized.value&&!n.value),s="/login",i=Z(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Ge(o,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==s&&(i.value=l(),a(s));return}window.location.pathname===s&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return _n(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function dfe({running:e,showAuthGate:t}){const{t:n}=Nt(),o=["◐","◓","◑","◒"],s=Z(0);let i=null;function r(){i===null&&(s.value=0,i=setInterval(()=>{s.value=(s.value+1)%o.length},250))}function l(){i!==null&&(clearInterval(i),i=null),s.value=0}Ge(e,c=>{c?r():l()},{immediate:!0});const a=W(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});cI(()=>{typeof document<"u"&&(document.title=a.value)}),_n(()=>{l()})}const k4=Z(typeof window>"u"?0:window.innerWidth);let vf=0,Wp=!1;function L1(){k4.value=window.innerWidth}function ffe(){Wp||typeof window>"u"||(window.addEventListener("resize",L1),Wp=!0,L1())}function pfe(){!Wp||typeof window>"u"||(window.removeEventListener("resize",L1),Wp=!1)}function b4(e,t,n){return Math.max(t,e-n)}function O1(e,t,n){return Math.min(n,Math.max(t,e))}function _4(){return bn(()=>{vf+=1,ffe()}),vo(()=>{vf=Math.max(0,vf-1),vf===0&&pfe()}),{viewportWidth:k4}}const hfe="kimi-web.file-preview-width",Ea=320;function mfe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=_4(),i=W(()=>Math.max(0,s.value-t.value)),r=W(()=>b4(i.value,Ea,Ea));function l(ee){return O1(Math.round(ee),Ea,r.value)}function a(){return l(i.value/2)}const c=W(()=>a()),u=Z(c.value),d=W(()=>O1(u.value,Ea,r.value)),f=Z(null),h=W(()=>{const ee=f.value;if(!ee)return null;const Y=e.turns.value.find(de=>de.id===ee.turnId)?.blocks?.[ee.blockIndex];return Y?.kind==="thinking"?Y.thinking:null}),p=W(()=>h.value!==null);function m(ee){const q=f.value;if(q&&q.turnId===ee.turnId&&q.blockIndex===ee.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=ee}function b(){f.value=null,n.value==="thinking"&&(n.value=null)}const _=Z(null),g=W(()=>{const ee=_.value;if(!ee)return null;const q=e.turns.value.find(Y=>Y.id===ee.turnId);return q?.role==="compaction"&&q.text?q.text:null}),v=W(()=>g.value!==null);function y(ee){if(_.value?.turnId===ee.turnId){_.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",_.value=ee}function C(){_.value=null,n.value==="compaction"&&(n.value=null)}const L=Z(null);function $(ee){const q=e.activeAppTasks.value,Y=q.find(ne=>ne.id===ee)??q.find(ne=>ne.parentToolCallId===ee);if(Y)return Y.id;const de=q.filter(ne=>ne.kind==="subagent"&&!ne.parentToolCallId);if(de.length===1)return de[0].id}const k=W(()=>{const ee=L.value;if(!ee)return null;const q=e.activeAppTasks.value.find(Y=>Y.id===ee.subagentId);return q?Kce(q):null}),M=W(()=>k.value!==null);function E(ee){const q=$(ee);if(q){if(L.value?.subagentId===q){L.value=null,n.value==="agent"&&(n.value=null);return}L.value={subagentId:q},n.value="agent"}}function O(){L.value=null,n.value==="agent"&&(n.value=null)}const S=Z(null),I=W(()=>{const ee=S.value;if(!ee)return null;const q=oP(e.turns.value,ee);return q?{id:ee,title:nd(q.name),path:nP(q.arg),lines:q.status==="error"?null:CA(q),output:q.output}:null}),P=W(()=>I.value!==null);function D(ee){if(n.value==="toolDiff"&&S.value===ee){H();return}n.value="toolDiff",S.value=ee}function H(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const z=Z("list"),U=Z(null);function Q(){if(n.value==="diff"){X();return}n.value="diff",z.value="list",U.value=null,e.loadGitStatus(e.activeSessionId.value)}function X(){n.value==="diff"&&(n.value=null),z.value="list",U.value=null,e.clearFileDiff()}async function ue(ee){z.value="detail",U.value=ee,await e.loadFileDiff(ee)}async function me(ee){await e.openSideChat(ee),n.value="btw"}function Ae(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function be(){n.value==="btw"&&(n.value=null)}const ze=W(()=>e.sideChatVisible.value),qe=W(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||M.value)&&(n.value!=="toolDiff"||P.value)&&(n.value!=="btw"||ze.value)),Fe=Z(!1),Le=Z({});function le(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return _.value?{kind:"compaction",..._.value}:null;case"agent":return L.value?{kind:"agent",...L.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function F(ee){if(ee)switch(ee.kind){case"thinking":f.value={turnId:ee.turnId,blockIndex:ee.blockIndex},n.value="thinking";break;case"compaction":_.value={turnId:ee.turnId},n.value="compaction";break;case"agent":L.value={subagentId:ee.subagentId},n.value="agent";break;case"toolDiff":S.value=ee.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function te(){return n.value==="thinking"&&p.value?(b(),!0):n.value==="compaction"&&v.value?(C(),!0):n.value==="agent"&&M.value?(O(),!0):n.value==="toolDiff"&&P.value?(H(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(X(),!0):n.value==="btw"?(Ae(),!0):!1}return Ge(e.activeSessionId,(ee,q)=>{if(q){const Y=le();Y?Le.value[q]=Y:delete Le.value[q]}o(),b(),C(),O(),H(),X(),be(),ee&&F(Le.value[ee])}),{PREVIEW_WIDTH_KEY:hfe,PREVIEW_MIN:Ea,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:m,closeThinkingPanel:b,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:y,closeCompactionPanel:C,agentPanelMember:k,agentPanelVisible:M,openAgentPanel:E,closeAgentPanel:O,toolDiffTarget:I,toolDiffVisible:P,openToolDiff:D,closeToolDiff:H,detailDiffMode:z,detailDiffPath:U,openDiffDetail:Q,closeDiffDetail:X,selectDiffFile:ue,btwVisible:ze,openSideChatTab:me,closeSideChat:Ae,hideSideChatPanel:be,sidePanelVisible:qe,panelDragging:Fe,closeOpenSidePanel:te}}const gfe=$t.sidebarWidth,sC=$t.sidebarCollapsed,iC=270,uv=170,vfe=36,yfe=320;function kfe(e={}){const{viewportWidth:t}=_4(),n=Z(iC),o=Z(!1),s=W(()=>{const c=yfe+(EC(e.previewOpen)?Ea:0);return b4(t.value,uv,c)}),i=W(()=>o.value?vfe:O1(n.value,uv,s.value));function r(){try{o.value=Jn(sC)==="true"}catch{o.value=!1}}function l(){try{no(sC,String(o.value))}catch{}}function a(){o.value=!o.value,l()}return{SIDEBAR_WIDTH_KEY:gfe,SIDEBAR_DEFAULT:iC,SIDEBAR_MIN:uv,sidebarMax:s,sessionColWidth:n,sidebarCollapsed:o,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function bfe({client:e,detailTarget:t}){const{t:n}=Nt(),o=Z(null),s=Z(null),i=Z(!1),r=Z(null),l=Z(null);let a=0;const c=W(()=>{const y=l.value;return y?e.getFileDownloadUrl(y):null}),u=W(()=>o.value!==null);function d(y){return y.length>1?y.replace(/\/+$/,""):y}function f(y){const C=[];for(const L of y.split(/[\\/]+/))if(!(!L||L===".")){if(L===".."){C.pop();continue}C.push(L)}return C.join("/")}function h(y){const C=y.trim();if(!C)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(C))return{error:n("filePreview.errors.unsupportedPath")};if(C.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const L=d(e.status.value.cwd);if(C.startsWith("/")){if(!L||C!==L&&!C.startsWith(`${L}/`))return{error:n("filePreview.errors.outsideWorkspace")};const k=C===L?"":C.slice(L.length+1);if(k.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const M=f(k);return M?{path:M}:{error:n("filePreview.errors.isDirectory")}}if(C.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const $=f(C);return $?{path:$}:{error:n("filePreview.errors.emptyPath")}}async function p(y){const C=o.value;if(t.value==="file"&&C&&C.path===y.path&&C.line===y.line){_();return}const L=++a;t.value="file",s.value=null,r.value=null,i.value=!0,o.value=y,l.value=null;const $=h(y.path);if("error"in $){i.value=!1,r.value=$.error;return}l.value=$.path;try{const k=await e.readFileContent($.path);if(L!==a)return;k?s.value={...k,path:k.path||$.path}:s.value={path:$.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(k){if(L!==a)return;r.value=k instanceof Error?k.message:n("filePreview.errors.loadFailed")}finally{L===a&&(i.value=!1)}}function m(y){return/^data:([^;,]+)/i.exec(y)?.[1]}function b(y){y.kind==="image"&&(t.value="file",o.value=null,l.value=null,r.value=null,i.value=!1,s.value={path:y.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:y.mimeType??m(y.url)??"image/*",sourceUrl:y.url,isBinary:!0,size:y.bytes??0})}function _(){o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,t.value==="file"&&(t.value=null)}function g(){const y=s.value?.path??o.value?.path;y&&e.openWorkspaceFile(y,o.value?.line)}function v(){const y=s.value?.path??o.value?.path;y&&e.revealWorkspaceFile(y)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:c,previewExternalActions:u,openFilePreview:p,openMediaPreview:b,closeFilePreview:_,openPreviewInEditor:g,revealPreviewFile:v}}const _fe=640,wfe=`(max-width: ${_fe}px)`;function Sfe(){const e=Z(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(wfe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),_n(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),_n(()=>t.removeListener(n))),e}const Cfe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},xfe={class:"server-auth-card"},Afe={class:"server-auth-body"},Tfe={class:"server-auth-foot"},Mfe=Ve({__name:"ServerAuthDialog",setup(e){const t=Z(""),n=Z(null),o=Z(!1);bn(()=>{gt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,M3(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(w(),N("div",Cfe,[T("div",xfe,[l[1]||(l[1]=T("div",{class:"server-auth-head"},[T("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),T("p",{class:"server-auth-hint"},[je(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),T("code",null,"KIMI_CODE_PASSWORD"),je("). ")])],-1)),T("div",Afe,[se(Za,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:o.value,onKeydown:i},null,8,["modelValue","disabled"])]),T("div",Tfe,[se(Rt,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:ke(()=>[je(R(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),Efe=ft(Mfe,[["__scopeId","data-v-82150ea4"]]),Ife={class:"app-shell"},$fe={key:1,class:"auth-page"},Nfe={class:"auth-page-inner"},Lfe={class:"auth-page-copy"},Ofe={key:0,class:"sidebar-rail"},Pfe=["aria-label","aria-hidden"],Rfe=Ve({__name:"App",setup(e){const t=Gae(),n=Z(!t);let o=null;const s=cfe();On("resolveImage",s.resolveImageUrl);const{t:i}=Nt(),r=hi(),l=Sfe(),a=Z(!1),c=Z(!1),u=W(()=>{const dt=s.activeSessionId.value;return s.sessions.value.find(pe=>pe.id===dt)?.title??""}),d=W(()=>s.visibleWorkspace.value?.sessionCount??0),f=W(()=>s.activity.value!=="idle"),h=Z(null),{showAuthGate:p,blinkAuthLogo:m}=ufe({client:s,authLogoRef:h});dfe({running:f,showAuthGate:p});function b(dt){return dt==="off"?"high":"off"}const _=Z(!s.onboarded.value);function g(){s.setOnboarded(!0),_.value=!1}function v(){_.value=!0}bn(()=>{s.load(),qe(),document.addEventListener("keydown",y,!0),o=Xae(()=>{n.value=!0})}),_n(()=>{document.removeEventListener("keydown",y,!0),o!==null&&(o(),o=null)});function y(dt){dt.key==="Escape"&&($n.value||Kn()&&(dt.stopPropagation(),dt.preventDefault()))}const C=Z(null),L=Z(!1);Ge(s.activeSessionId,()=>{L.value=!0,gt(()=>{L.value=!1})});const{previewTarget:$,previewFile:k,previewLoading:M,previewError:E,previewDownloadUrl:O,previewExternalActions:S,openFilePreview:I,openMediaPreview:P,closeFilePreview:D,openPreviewInEditor:H,revealPreviewFile:z}=bfe({client:s,detailTarget:C}),U=W(()=>C.value!==null),{SIDEBAR_WIDTH_KEY:Q,SIDEBAR_DEFAULT:X,SIDEBAR_MIN:ue,sidebarMax:me,sessionColWidth:Ae,sidebarCollapsed:be,sideWidth:ze,loadSidebarCollapsed:qe,toggleSidebarCollapse:Fe}=kfe({previewOpen:U}),{PREVIEW_WIDTH_KEY:Le,PREVIEW_MIN:le,previewDefaultWidth:F,previewMax:te,previewWidth:ee,previewPanelWidth:q,thinkingPanelText:Y,thinkingVisible:de,openThinkingPanel:ne,closeThinkingPanel:ce,compactionPanelText:j,compactionPanelVisible:G,openCompactionPanel:re,closeCompactionPanel:he,agentPanelMember:Ce,openAgentPanel:Ee,closeAgentPanel:ae,toolDiffTarget:xe,openToolDiff:Ke,closeToolDiff:ot,detailDiffMode:_t,detailDiffPath:wt,openDiffDetail:It,closeDiffDetail:Pt,selectDiffFile:bt,btwVisible:Kt,openSideChatTab:Dn,closeSideChat:In,sidePanelVisible:Dt,panelDragging:pn,closeOpenSidePanel:Kn}=mfe({client:s,sideWidth:ze,detailTarget:C,closeFilePreview:D}),nt=Z(null),wn=Z(!1),hn=Z(!1),Bn=Z(!1),Gn=Z(!1),Ye=Z(!1),Xe=Z(!1),At=Z(null),Lt=Z(null),$n=W(()=>Aa.value>0||wn.value||hn.value||Bn.value||Gn.value||Ye.value||Xe.value||_.value||a.value||c.value),cn=Z(!1),Nn=Z(!1),Fn=Z(!1),eo=Z(!1),Mt=Z(!1);async function Yn(){cn.value=!0,Nn.value=!1,wn.value=!0;try{await s.refreshOAuthProviderModels(),await s.loadModels()}catch{Nn.value=!0}finally{cn.value=!1}}async function mn(){Fn.value=!0,eo.value=!1,hn.value=!0;try{await s.loadProviders()}catch{eo.value=!0}finally{Fn.value=!1}}function wo(){Bn.value=!0}async function ei(dt){wn.value=!1,await s.setModel(dt)}async function Ns(dt){await s.addProvider(dt)}async function et(dt){await s.deleteProvider(dt)}async function it(dt){await s.refreshProvider(dt)}async function lt(dt){Mt.value=!0;try{await s.updateConfig(dt)&&await s.checkAuth()}finally{Mt.value=!1}}async function pt(){return s.startOAuthLogin()}async function ti(){return s.pollOAuthLogin()}async function mi(){return s.cancelOAuthLogin()}async function Ie(){Bn.value=!1,await s.checkAuth(),await s.load()}async function _e(dt){await s.undo(1),await gt(),nt.value?.loadComposerForEdit(dt)}function Re(dt){if(dt==="/compact"||dt.startsWith("/compact ")){s.compact(dt.slice(8).trim()||void 0);return}if(dt==="/swarm"||dt.startsWith("/swarm ")){const pe=dt.slice(6).trim();pe==="on"?s.setSwarmMode(!0):pe==="off"?s.setSwarmMode(!1):pe?(s.setSwarmMode(!0),s.sendPrompt(pe)):s.toggleSwarmMode();return}if(dt==="/goal"||dt.startsWith("/goal ")){const pe=dt.slice(5).trim();pe==="pause"||pe==="resume"||pe==="cancel"?s.controlGoal(pe):pe?s.createGoal(pe):s.toggleGoalMode();return}if(dt==="/btw"||dt.startsWith("/btw ")){const pe=dt.slice(4).trim();!pe&&s.sideChatVisible.value?In():Dn(pe||void 0);return}switch(dt){case"/new":case"/clear":rl();break;case"/fork":s.forkSession();break;case"/undo":s.undo();break;case"/permission":{const pe=s.permission.value,Ne=pe==="manual"?"auto":pe==="auto"?"yolo":"manual";s.setPermission(Ne);break}case"/plan":s.togglePlanMode();break;case"/auto":s.setPermission("auto");break;case"/yolo":s.setPermission("yolo");break;case"/thinking":s.setThinking(b(s.thinking.value));break;case"/help":s.dismissWarning(-1);break;case"/status":Ye.value=!0;break;case"/model":Yn();break;case"/provider":break;case"/login":wo();break;default:{const pe=dt.indexOf(" "),Ne=(pe===-1?dt:dt.slice(0,pe)).slice(1),Sn=pe===-1?void 0:dt.slice(pe+1).trim()||void 0;Ne&&s.activateSkill(Ne,Sn);break}}}function on(dt){s.unqueue(dt)}function Ut(dt){s.unqueue(dt)}function fo(dt){s.reorderQueue(dt.from,dt.to)}async function Hn(dt){const pe=s.activeWorkspaceId.value;if(!s.activeSessionId.value&&pe){await s.startSessionAndSendPrompt(pe,dt.text,dt.attachments);return}if(!s.activeSessionId.value&&!pe){At.value=dt,Gn.value=!0;return}s.sendPrompt(dt.text,dt.attachments)}async function gs(dt){if(Lt.value=null,!await s.addWorkspaceByPath(dt)){Lt.value=i("workspace.addFailed");return}Gn.value=!1;const Ne=At.value;At.value=null;const Sn=s.activeWorkspaceId.value;Ne&&Sn&&await s.startSessionAndSendPrompt(Sn,Ne.text,Ne.attachments)}function ni(){At.value=null,Lt.value=null,Gn.value=!1}function yo(){gt(()=>{nt.value?.focusComposer()})}function rl(){const dt=s.activeWorkspaceId.value;dt?s.openWorkspaceDraft(dt):s.clearActiveSession(),yo()}function ll(dt){s.openWorkspaceDraft(dt),yo()}function gc(dt){dt&&window.open(dt,"_blank","noopener")}return(dt,pe)=>(w(),N("div",Ife,[n.value?(w(),ge(Efe,{key:0})):ie("",!0),A(p)?(w(),N("section",$fe,[T("div",Nfe,[(w(),N("svg",{ref_key:"authLogoRef",ref:h,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:pe[0]||(pe[0]=yt(()=>{},["prevent"])),onClick:pe[1]||(pe[1]=(...Ne)=>A(m)&&A(m)(...Ne))},[...pe[94]||(pe[94]=[e0('<defs data-v-7ac9791f><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-7ac9791f><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-7ac9791f></rect><g class="ch-eyes" fill="#000" data-v-7ac9791f><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-7ac9791f></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-7ac9791f></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-7ac9791f></rect>',2)])],544)),T("div",Lfe,[T("h1",null,R(A(i)("app.authPageTitle")),1),T("p",null,R(A(i)("app.authPageMessage")),1)]),se(Rt,{class:"auth-page-btn",variant:"primary",onClick:wo},{default:ke(()=>[se(Je,{name:"log-in",size:"md"}),T("span",null,R(A(i)("app.authPageLogin")),1)]),_:1})])])):(w(),N("div",{key:2,class:De(["app",{mobile:A(l),"sidebar-collapsed":A(be)&&!A(l)}]),style:Yt({"--side-w":A(ze)+"px","--preview-w":A(q)+"px"})},[A(l)?(w(),ge(Bie,{key:1,workspace:A(s).visibleWorkspace.value,"session-title":u.value,running:f.value,branch:A(s).status.value.branch,"session-count":d.value,onOpenSwitcher:pe[17]||(pe[17]=Ne=>a.value=!0),onOpenSettings:pe[18]||(pe[18]=Ne=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(w(),N(Oe,{key:0},[En(se(vL,{"col-width":A(ze),"active-workspace":A(s).visibleWorkspace.value,"active-workspace-id":A(s).activeWorkspaceId.value,sessions:A(s).sessionsForView.value,groups:A(s).workspaceGroups.value,"active-id":A(s).activeSessionId.value,"attention-by-session":A(s).attentionBySession.value,"pending-by-session":A(s).pendingBySession.value,"unread-by-session":A(s).unreadBySession.value,"workspace-sort-mode":A(s).workspaceSortMode.value,onSelect:pe[2]||(pe[2]=Ne=>A(s).selectSession(Ne)),onCreate:rl,onCreateInWorkspace:pe[3]||(pe[3]=Ne=>ll(Ne)),onSelectWorkspace:pe[4]||(pe[4]=Ne=>A(s).openWorkspace(Ne)),onAddWorkspace:pe[5]||(pe[5]=Ne=>Gn.value=!0),onRename:pe[6]||(pe[6]=(Ne,Sn)=>A(s).renameSession(Ne,Sn)),onArchive:pe[7]||(pe[7]=Ne=>A(s).archiveSession(Ne)),onFork:pe[8]||(pe[8]=Ne=>A(s).forkSession(Ne)),onRenameWorkspace:pe[9]||(pe[9]=(Ne,Sn)=>A(s).renameWorkspace(Ne,Sn)),onDeleteWorkspace:pe[10]||(pe[10]=Ne=>A(s).deleteWorkspace(Ne)),onReorderWorkspaces:pe[11]||(pe[11]=Ne=>A(s).reorderWorkspaces(Ne)),onSetWorkspaceSortMode:pe[12]||(pe[12]=Ne=>A(s).setWorkspaceSortMode(Ne)),onLoadMoreSessions:pe[13]||(pe[13]=Ne=>void A(s).loadMoreSessions(Ne)),onLoadAllSessions:pe[14]||(pe[14]=Ne=>void A(s).loadAllSessions()),onOpenSettings:pe[15]||(pe[15]=Ne=>Xe.value=!0),onCollapse:A(Fe)},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","onCollapse"]),[[Vs,!A(be)]]),En(se(__,{"storage-key":A(Q),"default-width":A(X),min:A(ue),max:A(me),"onUpdate:width":pe[16]||(pe[16]=Ne=>Ae.value=Ne)},null,8,["storage-key","default-width","min","max"]),[[Vs,!A(be)]]),A(be)?(w(),N("div",Ofe,[se(vn,{size:"sm",label:A(i)("sidebar.expandSidebar"),onClick:A(Fe)},{default:ke(()=>[se(Je,{name:"panel-expand",size:"sm"})]),_:1},8,["label","onClick"])])):ie("",!0)],64)),se(rJ,{ref_key:"conversationPaneRef",ref:nt,mobile:A(l),turns:A(s).turns.value,"session-id":A(s).activeSessionId.value,approvals:A(s).pendingApprovals.value,changes:A(s).changes.value,"git-info":A(s).gitInfo.value,tasks:A(s).tasks.value,todos:A(s).todos.value,goal:A(s).goal.value,swarms:A(s).swarms.value,"activation-badges":A(s).activationBadges.value,status:A(s).status.value,thinking:A(s).thinking.value,"plan-mode":A(s).planMode.value,"swarm-mode":A(s).swarmMode.value,"goal-mode":A(s).goalMode.value,models:A(s).models.value,"starred-ids":A(s).starredModelIds.value,skills:A(s).skills.value,questions:A(s).questions.value,"pending-question-actions":A(s).pendingQuestionActions,"pending-approval-actions":A(s).pendingApprovalActions,running:f.value,queued:A(s).queued.value,"search-files":A(s).searchFiles,"upload-image":A(s).uploadImage,sending:A(s).isSending.value,"fast-moon":A(s).fastMoon.value,"file-reload-key":A(s).activeSessionId.value,"session-loading":A(s).sessionLoading.value,compaction:A(s).compaction.value,"has-more-messages":A(s).hasMoreMessages.value,"loading-more":A(s).loadingMoreMessages.value,"loading-more-error":A(s).loadMoreMessagesError.value,"load-older-messages":A(s).loadOlderMessages,"workspace-name":A(s).visibleWorkspace.value?.name,"workspace-root":A(s).visibleWorkspace.value?.root??A(s).status.value.cwd,"git-diff-stats":A(s).gitDiffStats.value,workspaces:A(s).workspacesView.value,"active-workspace-id":A(s).activeWorkspaceId.value,"session-title":u.value,pr:A(s).activePullRequest.value,"conversation-toc":A(s).conversationToc.value,onOpenChanges:pe[19]||(pe[19]=Ne=>A(It)()),onSelectWorkspace:pe[20]||(pe[20]=Ne=>ll(Ne)),onAddWorkspace:pe[21]||(pe[21]=Ne=>Gn.value=!0),onOpenPr:gc,onSubmit:pe[22]||(pe[22]=Ne=>Hn(Ne)),onSteer:pe[23]||(pe[23]=Ne=>A(s).steerPrompt(Ne.text,Ne.attachments)),onApproval:pe[24]||(pe[24]=(Ne,Sn)=>A(s).respondApproval(Ne,Sn)),onCancelTask:pe[25]||(pe[25]=Ne=>A(s).cancelTask(Ne)),onAnswer:pe[26]||(pe[26]=(Ne,Sn)=>A(s).respondQuestion(Ne,Sn)),onDismiss:pe[27]||(pe[27]=Ne=>A(s).dismissQuestion(Ne)),onCommand:Re,onInterrupt:pe[28]||(pe[28]=Ne=>A(s).abortCurrentPrompt()),onUnqueue:on,onEditQueued:Ut,onReorderQueue:fo,onSetPermission:pe[29]||(pe[29]=Ne=>A(s).setPermission(Ne)),onSetThinking:pe[30]||(pe[30]=Ne=>A(s).setThinking(Ne)),onTogglePlan:pe[31]||(pe[31]=Ne=>A(s).togglePlanMode()),onToggleSwarm:pe[32]||(pe[32]=Ne=>A(s).toggleSwarmMode()),onToggleGoal:pe[33]||(pe[33]=Ne=>A(s).toggleGoalMode()),onCreateGoal:pe[34]||(pe[34]=Ne=>A(s).createGoal(Ne)),onControlGoal:pe[35]||(pe[35]=Ne=>A(s).controlGoal(Ne)),onRefreshGitStatus:pe[36]||(pe[36]=Ne=>A(s).activeSessionId.value&&A(s).loadGitStatus(A(s).activeSessionId.value)),onRenameSession:pe[37]||(pe[37]=(Ne,Sn)=>A(s).renameSession(Ne,Sn)),onForkSession:pe[38]||(pe[38]=Ne=>A(s).forkSession(Ne)),onArchiveSession:pe[39]||(pe[39]=Ne=>A(s).archiveSession(Ne)),onCompact:pe[40]||(pe[40]=Ne=>A(s).compact()),onPickModel:pe[41]||(pe[41]=Ne=>Yn()),onSelectModel:pe[42]||(pe[42]=Ne=>A(s).setModel(Ne)),onOpenFile:pe[43]||(pe[43]=Ne=>A(I)(Ne)),onOpenMedia:pe[44]||(pe[44]=Ne=>A(P)(Ne)),onOpenThinking:pe[45]||(pe[45]=Ne=>A(ne)(Ne)),onOpenCompaction:pe[46]||(pe[46]=Ne=>A(re)(Ne)),onOpenAgent:pe[47]||(pe[47]=Ne=>A(Ee)(Ne)),onOpenToolDiff:pe[48]||(pe[48]=Ne=>A(Ke)(Ne)),onEditMessage:_e},null,8,["mobile","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","pending-question-actions","pending-approval-actions","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","conversation-toc"]),A(Dt)&&!A(l)?(w(),ge(__,{key:2,"storage-key":A(Le),"default-width":A(F),min:A(le),max:A(te),reverse:"","aria-label":A(i)("layout.resizePreviewAria"),"onUpdate:width":pe[49]||(pe[49]=Ne=>ee.value=Ne),"onUpdate:dragging":pe[50]||(pe[50]=Ne=>pn.value=Ne)},null,8,["storage-key","default-width","min","max","aria-label"])):ie("",!0),!A(l)||A(Dt)?(w(),N("aside",{key:3,class:De(["global-preview",{open:A(Dt),mobile:A(l),"no-anim":A(pn)||L.value}]),role:"complementary","aria-label":A(i)("layout.detailPanelAria"),"aria-hidden":!A(Dt)},[C.value==="thinking"&&A(de)?(w(),ge(SS,{key:0,text:A(Y)??"",onClose:A(ce)},null,8,["text","onClose"])):C.value==="compaction"&&A(G)?(w(),ge(SS,{key:1,text:A(j)??"",subtitle:A(i)("conversation.summaryTitle"),onClose:A(he)},null,8,["text","subtitle","onClose"])):C.value==="agent"&&A(Ce)?(w(),ge(Tee,{key:2,member:A(Ce),onClose:A(ae)},null,8,["member","onClose"])):C.value==="btw"&&A(Kt)?(w(),ge(Gee,{key:3,turns:A(s).sideChatTurns.value,running:A(s).sideChatRunning.value,sending:A(s).sideChatSending.value,onSend:pe[51]||(pe[51]=Ne=>A(s).sendSideChatPrompt(Ne)),onClose:A(In)},null,8,["turns","running","sending","onClose"])):C.value==="diff"?(w(),ge(wte,{key:4,mode:A(_t),changes:A(s).changes.value,"git-info":A(s).gitInfo.value,"file-diff":A(s).fileDiff.value,"selected-diff-path":A(s).selectedDiffPath.value,"file-diff-loading":A(s).fileDiffLoading.value,closable:"",onOpen:A(bt),onBack:pe[52]||(pe[52]=Ne=>{_t.value="list",wt.value=null,A(s).clearFileDiff()}),onClose:A(Pt)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):C.value==="toolDiff"&&A(xe)?(w(),ge(Hee,{key:5,target:A(xe),onClose:A(ot)},null,8,["target","onClose"])):C.value==="file"?(w(),ge(aee,{key:6,file:A(k),loading:A(M),error:A(E),line:A($)?.line,"download-url":A(O),closable:"","external-actions":A(S),"open-file":A(I),onClose:A(D),onOpenExternal:A(H),onReveal:A(z)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ie("",!0)],10,Pfe)):ie("",!0),wn.value?(w(),ge(Wte,{key:4,models:A(s).models.value,current:A(s).status.value.modelId,"starred-ids":A(s).starredModelIds.value,loading:cn.value,unavailable:Nn.value,onSelect:pe[53]||(pe[53]=Ne=>ei(Ne)),onToggleStar:pe[54]||(pe[54]=Ne=>A(s).toggleStarModel(Ne)),onClose:pe[55]||(pe[55]=Ne=>wn.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ie("",!0),Xe.value?(w(),ge(Mse,{key:5,"color-scheme":A(s).colorScheme.value,accent:A(s).accent.value,"ui-font-size":A(s).uiFontSize.value,"auth-ready":A(s).authReady.value,"account-model":A(s).defaultModel.value,notify:A(s).notifyOnComplete.value,"notify-question":A(s).notifyOnQuestion.value,"notify-permission":A(s).notifyPermission.value,sound:A(s).soundOnComplete.value,"conversation-toc":A(s).conversationToc.value,config:A(s).config.value,models:A(s).models.value,"config-saving":Mt.value,"server-version":A(s).serverVersion.value,onSetColorScheme:pe[56]||(pe[56]=Ne=>A(s).setColorScheme(Ne)),onSetAccent:pe[57]||(pe[57]=Ne=>A(s).setAccent(Ne)),onSetUiFontSize:pe[58]||(pe[58]=Ne=>A(s).setUiFontSize(Ne)),onSetNotify:pe[59]||(pe[59]=Ne=>A(s).setNotifyOnComplete(Ne)),onSetNotifyQuestion:pe[60]||(pe[60]=Ne=>A(s).setNotifyOnQuestion(Ne)),onSetSound:pe[61]||(pe[61]=Ne=>A(s).setSoundOnComplete(Ne)),onSetConversationToc:pe[62]||(pe[62]=Ne=>A(s).setConversationToc(Ne)),onUpdateConfig:pe[63]||(pe[63]=Ne=>lt(Ne)),onLogin:pe[64]||(pe[64]=()=>{Xe.value=!1,wo()}),onLogout:A(s).logout,onOpenOnboarding:pe[65]||(pe[65]=()=>{Xe.value=!1,v()}),onOpenProviders:pe[66]||(pe[66]=()=>{Xe.value=!1,mn()}),onClose:pe[67]||(pe[67]=Ne=>Xe.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","onLogout"])):ie("",!0),hn.value?(w(),ge(fne,{key:6,providers:A(s).providers.value,loading:Fn.value,unavailable:eo.value,onAdd:pe[68]||(pe[68]=Ne=>Ns(Ne)),onRefresh:pe[69]||(pe[69]=Ne=>it(Ne)),onDelete:pe[70]||(pe[70]=Ne=>et(Ne)),onOpenLogin:pe[71]||(pe[71]=()=>{hn.value=!1,wo()}),onClose:pe[72]||(pe[72]=Ne=>hn.value=!1)},null,8,["providers","loading","unavailable"])):ie("",!0),Ye.value?(w(),ge(vie,{key:7,status:A(s).status.value,thinking:A(s).thinking.value,"plan-mode":A(s).planMode.value,"swarm-mode":A(s).swarmMode.value,"cost-usd":A(s).sessionCost.value,onClose:pe[73]||(pe[73]=Ne=>Ye.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ie("",!0),Gn.value?(w(),ge(tie,{key:8,"browse-fs":A(s).browseFs,"get-fs-home":A(s).getFsHome,"default-path":A(s).visibleWorkspace.value?.root??A(s).status.value.cwd,error:Lt.value,onAdd:pe[74]||(pe[74]=Ne=>gs(Ne)),onClose:ni},null,8,["browse-fs","get-fs-home","default-path","error"])):ie("",!0),se(Kr,{name:"gload-fade"},{default:ke(()=>[A(s).initialized.value?ie("",!0):(w(),ge(Rle,{key:0}))]),_:1}),_.value&&!A(p)?(w(),ge($le,{key:9,onComplete:g,onSkip:g})):ie("",!0),se(Eie,{warnings:A(s).warnings.value,onDismiss:A(s).dismissWarning},null,8,["warnings","onDismiss"]),A(r)?(w(),ge(fae,{key:10})):ie("",!0),se(iie),A(l)?(w(),ge(lre,{key:11,modelValue:a.value,"onUpdate:modelValue":pe[75]||(pe[75]=Ne=>a.value=Ne),groups:A(s).workspaceGroups.value,"active-workspace-id":A(s).activeWorkspaceId.value,"active-id":A(s).activeSessionId.value,"attention-by-session":A(s).attentionBySession.value,"attention-by-workspace":A(s).attentionByWorkspace.value,onSelect:pe[76]||(pe[76]=Ne=>A(s).selectSession(Ne)),onCreate:rl,onCreateInWorkspace:pe[77]||(pe[77]=Ne=>ll(Ne)),onAddWorkspace:pe[78]||(pe[78]=Ne=>Gn.value=!0),onRename:pe[79]||(pe[79]=(Ne,Sn)=>A(s).renameSession(Ne,Sn)),onArchive:pe[80]||(pe[80]=Ne=>A(s).archiveSession(Ne)),onDeleteWorkspace:pe[81]||(pe[81]=Ne=>A(s).deleteWorkspace(Ne)),onLoadMore:pe[82]||(pe[82]=Ne=>void A(s).loadMoreSessions(Ne))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ie("",!0),A(l)?(w(),ge(tle,{key:12,modelValue:c.value,"onUpdate:modelValue":pe[83]||(pe[83]=Ne=>c.value=Ne),status:A(s).status.value,thinking:A(s).thinking.value,"plan-mode":A(s).planMode.value,"swarm-mode":A(s).swarmMode.value,"color-scheme":A(s).colorScheme.value,"ui-font-size":A(s).uiFontSize.value,"auth-ready":A(s).authReady.value,"conversation-toc":A(s).conversationToc.value,"server-version":A(s).serverVersion.value,onPickModel:pe[84]||(pe[84]=Ne=>Yn()),onSetThinking:pe[85]||(pe[85]=Ne=>A(s).setThinking(Ne)),onTogglePlan:pe[86]||(pe[86]=Ne=>A(s).togglePlanMode()),onToggleSwarm:pe[87]||(pe[87]=Ne=>A(s).toggleSwarmMode()),onSetPermission:pe[88]||(pe[88]=Ne=>A(s).setPermission(Ne)),onSetColorScheme:pe[89]||(pe[89]=Ne=>A(s).setColorScheme(Ne)),onSetUiFontSize:pe[90]||(pe[90]=Ne=>A(s).setUiFontSize(Ne)),onSetConversationToc:pe[91]||(pe[91]=Ne=>A(s).setConversationToc(Ne)),onLogin:pe[92]||(pe[92]=()=>{c.value=!1,wo()}),onLogout:A(s).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):ie("",!0)],6)),Bn.value?(w(),ge(zne,{key:3,"on-start-o-auth-login":pt,"on-poll-o-auth-login":ti,"on-cancel-o-auth-login":mi,onSuccess:Ie,onClose:pe[93]||(pe[93]=Ne=>Bn.value=!1)})):ie("",!0)]))}}),Dfe=ft(Rfe,[["__scopeId","data-v-7ac9791f"]]);Zne();op(Dfe).use(qn).mount("#app");export{AE as $,G1 as A,gI as B,ro as C,Rpe as D,fC as E,Oe as F,e0 as G,je as H,se as I,YE as J,lpe as K,li as L,Ve as M,z$ as N,dpe as O,fpe as P,mpe as Q,Ff as R,Ua as S,oh as T,ppe as U,n0 as V,upe as W,Bpe as X,hpe as Y,$pe as Z,Ffe as _,WC as a,Fo as a$,Oo as a0,D1 as a1,Kfe as a2,U1 as a3,f$ as a4,ln as a5,uc as a6,Jfe as a7,Wpe as a8,ope as a9,VC as aA,TI as aB,LI as aC,bn as aD,NI as aE,$I as aF,B1 as aG,II as aH,_n as aI,j1 as aJ,eI as aK,w as aL,F$ as aM,Qfe as aN,On as aO,IC as aP,Xfe as aQ,qf as aR,No as aS,Wf as aT,Z as aU,xpe as aV,s6 as aW,st as aX,An as aY,PI as aZ,ape as a_,rpe as aa,ipe as ab,spe as ac,Tpe as ad,zpe as ae,jt as af,y$ as ag,th as ah,Hr as ai,nr as aj,to as ak,Ape as al,Cs as am,Vr as an,Rr as ao,ype as ap,kpe as aq,un as ar,gt as as,S$ as at,De as au,Bfe as av,Yt as aw,AI as ax,EI as ay,vo as az,Yfe as b,xq as b$,Ope as b0,xu as b1,Xf as b2,Npe as b3,jr as b4,jE as b5,Wfe as b6,Yl as b7,lI as b8,Lpe as b9,ms as bA,Vs as bB,k$ as bC,Epe as bD,Ge as bE,cI as bF,epe as bG,uI as bH,_pe as bI,ke as bJ,gpe as bK,En as bL,ai as bM,Mpe as bN,yt as bO,Zfe as bP,an as bQ,Go as bR,Zpe as bS,hj as bT,PM as bU,ehe as bV,UU as bW,Y0 as bX,Jpe as bY,n1 as bZ,rhe as b_,Hfe as ba,R as bb,yf as bc,cpe as bd,Gt as be,qfe as bf,Ufe as bg,EC as bh,Cpe as bi,zfe as bj,A as bk,Ju as bl,Hpe as bm,Dpe as bn,q$ as bo,tpe as bp,wpe as bq,aI as br,Fpe as bs,vpe as bt,npe as bu,HC as bv,np as bw,J$ as bx,Nx as by,Mv as bz,Ipe as c,Cq as c0,V0 as c1,Sq as c2,Ype as c3,RU as c4,Gpe as c5,Mp as c6,jpe as c7,wq as c8,EM as c9,ihe as ca,Vpe as cb,ahe as cc,a1 as cd,Pa as ce,r1 as cf,che as cg,lhe as ch,Qpe as ci,_s as cj,Kpe as ck,Xpe as cl,jU as cm,she as cn,l1 as co,i1 as cp,ohe as cq,qpe as cr,nhe as cs,the as ct,ft as cu,Upe as cv,hA as cw,j5 as cx,Spe as d,Wr as e,jfe as f,Kr as g,K$ as h,Vfe as i,Gfe as j,Qs as k,Xu as l,go as m,Kp as n,or as o,Ppe as p,W as q,op as r,ge as s,ie as t,N as u,T as v,o$ as w,bpe as x,n$ as y,i6 as z};
|