@moonshot-ai/kimi-code 0.20.1 → 0.20.3
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 +8024 -7604
- package/dist-web/assets/CodeBlockNode-QzsUDFhj.js +22 -0
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-DPPhMZ1J.js → CodeBlockShell.vue_vue_type_style_index_0_lang-COQWnG7I.js} +1 -1
- package/dist-web/assets/{Tooltip-D4SNb85I.js → Tooltip-DjdYJu5x.js} +1 -1
- package/dist-web/assets/{arc-ByMO5pI7.js → arc-BgPs0rMd.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-Dvmwtelo.js → architectureDiagram-3BPJPVTR-D0xfzSKA.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-lDGeez1y.js → blockDiagram-GPEHLZMM-jtPOGuGl.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-BpX1rFb4.js → c4Diagram-AAUBKEIU-BPIjsoUA.js} +1 -1
- package/dist-web/assets/channel-DnBCccMg.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-jodlcE5W.js → chunk-2J33WTMH-ChbTHkcK.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-BrZvBuhT.js → chunk-4BX2VUAB-br1aQrtt.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-BMZITsHm.js → chunk-55IACEB6-CoLSy_-M.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-Cmhtbm26.js → chunk-727SXJPM-Ch73eH6y.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-yt2A8pJF.js → chunk-AQP2D5EJ-7Y0GIirZ.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-C5EABTZN.js → chunk-FMBD7UC4-D7IRCdHF.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-CVMSNFBB.js → chunk-ND2GUHAM-WfKpgeWa.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-F9qv3qjM.js → chunk-QZHKN3VN-BgQBqGri.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DezksBKS.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DezksBKS.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-BTsTGLXV.js → cose-bilkent-S5V4N54A-Du7Q4b9R.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-DrzkpEQT.js → dagre-BM42HDAG-BBLoya79.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-e1GfngTa.js → diagram-2AECGRRQ-kByHrOvZ.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-ousok5qp.js → diagram-5GNKFQAL-Dnkgbduh.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-DyZixoAA.js → diagram-KO2AKTUF-CKfrJMO5.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-DYvup0AJ.js → diagram-LMA3HP47-D3GoTx0o.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-DjeAOuOP.js → diagram-OG6HWLK6-B057HNTB.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-DW158lKF.js → erDiagram-TEJ5UH35-CMFH1-0F.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-CNe29HBu.js → flowDiagram-I6XJVG4X-Ue7D_If3.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-DNXeqbuv.js → ganttDiagram-6RSMTGT7-C3vvEQsr.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-DxrQ7BFf.js → gitGraphDiagram-PVQCEYII-D-L62M3k.js} +1 -1
- package/dist-web/assets/index-BOozFshs.js +284 -0
- package/dist-web/assets/{index-JMCtP-Ps.js → index-DRCzCVsJ.js} +1 -1
- package/dist-web/assets/{index-CO3YU1Qs.js → index-YYCI79IV.js} +2 -2
- package/dist-web/assets/index-gP3qbaq1.css +1 -0
- package/dist-web/assets/{index10-CgqlibfL.js → index10-C0e1uOHF.js} +2 -2
- package/dist-web/assets/{index11-DEbZPqF_.js → index11-qzoItZ5X.js} +2 -2
- package/dist-web/assets/{index5-6RR-0mhw.js → index5-BD3g_HrT.js} +1 -1
- package/dist-web/assets/{index6-Dd2WDK6a.js → index6-BsyLzjzN.js} +1 -1
- package/dist-web/assets/index7-BU9c3C-0.js +1 -0
- package/dist-web/assets/index8-DC4X3Xlc.js +2 -0
- package/dist-web/assets/{infoDiagram-5YYISTIA-bsQXw5Cf.js → infoDiagram-5YYISTIA-DuKrZwyg.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-k8l6Qdjw.js → ishikawaDiagram-YF4QCWOH-DvYYK586.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-cYfBbMdz.js → journeyDiagram-JHISSGLW-CijMU22u.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-CTnpueoW.js → kanban-definition-UN3LZRKU-BmaUhICc.js} +1 -1
- package/dist-web/assets/katex-DnlPpQZa.js +257 -0
- package/dist-web/assets/{linear-CdKUj4Ug.js → linear-C5DmXyYK.js} +1 -1
- package/dist-web/assets/{mermaid.core-UWDZO4h_.js → mermaid.core-CxStNiKR.js} +4 -4
- package/dist-web/assets/{mhchem-KEf2LMH_.js → mhchem-DtR62fUK.js} +1 -1
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-3z79U-lX.js → mindmap-definition-RKZ34NQL-CH1ykt4a.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-CMDgRqd9.js → pieDiagram-4H26LBE5-D812Mhsu.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-DX1F2ToM.js → quadrantDiagram-W4KKPZXB-WyDSXdZ7.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-DoWnnNLY.js → requirementDiagram-4Y6WPE33-CzaQOU4P.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-ClNy2w1_.js → sankeyDiagram-5OEKKPKP-D2mgS_7C.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-BfJgBlpQ.js → sequenceDiagram-3UESZ5HK-CuoLev25.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-KaDNy_Jo.js → stateDiagram-AJRCARHV-BoTsuaL9.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-8LYkXLp8.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-DaKQHHIC.js → timeline-definition-PNZ67QCA-DkLWuglL.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-Cw9sx89s.js → vennDiagram-CIIHVFJN-DYjvU6dg.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-DNelV8ct.js → vue.runtime.esm-bundler-C_eIrEdV.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-fWMnczak.js → wardley-L42UT6IY-DSIStv05.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-Bi8Phs9U.js → wardleyDiagram-YWT4CUSO-DSPJWT6D.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-DR3dlDte.js → xychartDiagram-2RQKCTM6-C0OPS_b1.js} +1 -1
- package/dist-web/index.html +3 -3
- package/package.json +2 -2
- package/dist-web/assets/CodeBlockNode-Ds9FDojm.js +0 -22
- package/dist-web/assets/channel-CFIWdU7V.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-HfSWUU5X.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-HfSWUU5X.js +0 -1
- package/dist-web/assets/index-Dv5UmLv8.css +0 -1
- package/dist-web/assets/index-uGnch3Jw.js +0 -273
- package/dist-web/assets/index7-DhrSWRIG.js +0 -1
- package/dist-web/assets/index8-C1M9n-68.js +0 -2
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BGR-zf4G.js +0 -1
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-KEf2LMH_.js","assets/katex-HP8lGamR.js","assets/CodeBlockNode-Ds9FDojm.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-DPPhMZ1J.js","assets/index8-C1M9n-68.js","assets/index11-DEbZPqF_.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
|
|
3
|
-
* @vue/shared v3.5.35
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function Gf(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Lt={},ea=[],Io=()=>{},L2=()=>!1,ru=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Yf=e=>e.startsWith("onUpdate:"),nn=Object.assign,M1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},gA=Object.prototype.hasOwnProperty,Kt=(e,t)=>gA.call(e,t),at=Array.isArray,ta=e=>Ca(e)==="[object Map]",fl=e=>Ca(e)==="[object Set]",Ay=e=>Ca(e)==="[object Date]",vA=e=>Ca(e)==="[object RegExp]",kt=e=>typeof e=="function",rn=e=>typeof e=="string",fo=e=>typeof e=="symbol",Gt=e=>e!==null&&typeof e=="object",A1=e=>(Gt(e)||kt(e))&&kt(e.then)&&kt(e.catch),O2=Object.prototype.toString,Ca=e=>O2.call(e),yA=e=>Ca(e).slice(8,-1),Xf=e=>Ca(e)==="[object Object]",Zf=e=>rn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ol=Gf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Jf=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},kA=/-\w/g,Zn=Jf(e=>e.replace(kA,t=>t.slice(1).toUpperCase())),bA=/\B([A-Z])/g,Hs=Jf(e=>e.replace(bA,"-$1").toLowerCase()),Qf=Jf(e=>e.charAt(0).toUpperCase()+e.slice(1)),Cd=Jf(e=>e?`on${Qf(e)}`:""),ls=(e,t)=>!Object.is(e,t),na=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},P2=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},eh=e=>{const t=parseFloat(e);return isNaN(t)?e:t},qd=e=>{const t=rn(e)?Number(e):NaN;return isNaN(t)?e:t};let Ey;const th=()=>Ey||(Ey=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),_A="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",wA=Gf(_A);function Ft(e){if(at(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=rn(s)?TA(s):Ft(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(rn(e)||Gt(e))return e}const SA=/;(?![^(]*\))/g,CA=/:([^]+)/,xA=/\/\*[^]*?\*\//g;function TA(e){const t={};return e.replace(xA,"").split(SA).forEach(n=>{if(n){const s=n.split(CA);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Oe(e){let t="";if(rn(e))t=e;else if(at(e))for(let n=0;n<e.length;n++){const s=Oe(e[n]);s&&(t+=s+" ")}else if(Gt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function ehe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!rn(t)&&(e.class=Oe(t)),n&&(e.style=Ft(n)),e}const MA="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",AA=Gf(MA);function R2(e){return!!e||e===""}function EA(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=$i(e[s],t[s]);return n}function $i(e,t){if(e===t)return!0;let n=Ay(e),s=Ay(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=fo(e),s=fo(t),n||s)return e===t;if(n=at(e),s=at(t),n||s)return n&&s?EA(e,t):!1;if(n=Gt(e),s=Gt(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!$i(e[r],t[r]))return!1}}return String(e)===String(t)}function nh(e,t){return e.findIndex(n=>$i(n,t))}const D2=e=>!!(e&&e.__v_isRef===!0),O=e=>rn(e)?e:e==null?"":at(e)||Gt(e)&&(e.toString===O2||!kt(e.toString))?D2(e)?O(e.value):JSON.stringify(e,B2,2):String(e),B2=(e,t)=>D2(t)?B2(e,t.value):ta(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[jp(s,i)+" =>"]=o,n),{})}:fl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>jp(n))}:fo(t)?jp(t):Gt(t)&&!at(t)&&!Xf(t)?String(t):t,jp=(e,t="")=>{var n;return fo(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function $A(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 Xn;class F2{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&&Xn&&(Xn.active?(this.parent=Xn,this.index=(Xn.scopes||(Xn.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=Xn;try{return Xn=this,t()}finally{Xn=n}}}on(){++this._on===1&&(this.prevScope=Xn,Xn=this)}off(){if(this._on>0&&--this._on===0){if(Xn===this)Xn=this.prevScope;else{let t=Xn;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function IA(e){return new F2(e)}function E1(){return Xn}function $1(e,t=!1){Xn&&Xn.cleanups.push(e)}let fn;const qp=new WeakSet;class zd{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,Xn&&(Xn.active?Xn.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,qp.has(this)&&(qp.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||W2(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,$y(this),U2(this);const t=fn,n=Uo;fn=this,Uo=!0;try{return this.fn()}finally{j2(this),fn=t,Uo=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)L1(t);this.deps=this.depsTail=void 0,$y(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?qp.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){tg(this)&&this.run()}get dirty(){return tg(this)}}let H2=0,yc,kc;function W2(e,t=!1){if(e.flags|=8,t){e.next=kc,kc=e;return}e.next=yc,yc=e}function I1(){H2++}function N1(){if(--H2>0)return;if(kc){let t=kc;for(kc=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;yc;){let t=yc;for(yc=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function U2(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function j2(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),L1(s),NA(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function tg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(q2(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function q2(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Oc)||(e.globalVersion=Oc,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!tg(e))))return;e.flags|=2;const t=e.dep,n=fn,s=Uo;fn=e,Uo=!0;try{U2(e);const o=e.fn(e._value);(t.version===0||ls(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{fn=n,Uo=s,j2(e),e.flags&=-3}}function L1(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)L1(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function NA(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function the(e,t){e.effect instanceof zd&&(e=e.effect.fn);const n=new zd(e);t&&nn(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function nhe(e){e.effect.stop()}let Uo=!0;const z2=[];function Ii(){z2.push(Uo),Uo=!1}function Ni(){const e=z2.pop();Uo=e===void 0?!0:e}function $y(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=fn;fn=void 0;try{t()}finally{fn=n}}}let Oc=0;class LA{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 sh{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(!fn||!Uo||fn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==fn)n=this.activeLink=new LA(fn,this),fn.deps?(n.prevDep=fn.depsTail,fn.depsTail.nextDep=n,fn.depsTail=n):fn.deps=fn.depsTail=n,V2(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=fn.depsTail,n.nextDep=void 0,fn.depsTail.nextDep=n,fn.depsTail=n,fn.deps===n&&(fn.deps=s)}return n}trigger(t){this.version++,Oc++,this.notify(t)}notify(t){I1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{N1()}}}function V2(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)V2(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Vd=new WeakMap,il=Symbol(""),ng=Symbol(""),Pc=Symbol("");function bs(e,t,n){if(Uo&&fn){let s=Vd.get(e);s||Vd.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new sh),o.map=s,o.key=n),o.track()}}function Si(e,t,n,s,o,i){const r=Vd.get(e);if(!r){Oc++;return}const l=a=>{a&&a.trigger()};if(I1(),t==="clear")r.forEach(l);else{const a=at(e),c=a&&Zf(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,f)=>{(f==="length"||f===Pc||!fo(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Pc)),t){case"add":a?c&&l(r.get("length")):(l(r.get(il)),ta(e)&&l(r.get(ng)));break;case"delete":a||(l(r.get(il)),ta(e)&&l(r.get(ng)));break;case"set":ta(e)&&l(r.get(il));break}}N1()}function OA(e,t){const n=Vd.get(e);return n&&n.get(t)}function Pl(e){const t=Bt(e);return t===e?t:(bs(t,"iterate",Pc),io(e)?t:t.map(jo))}function oh(e){return bs(e=Bt(e),"iterate",Pc),e}function oi(e,t){return Li(e)?va(fr(e)?jo(t):t):jo(t)}const PA={__proto__:null,[Symbol.iterator](){return zp(this,Symbol.iterator,e=>oi(this,e))},concat(...e){return Pl(this).concat(...e.map(t=>at(t)?Pl(t):t))},entries(){return zp(this,"entries",e=>(e[1]=oi(this,e[1]),e))},every(e,t){return yi(this,"every",e,t,void 0,arguments)},filter(e,t){return yi(this,"filter",e,t,n=>n.map(s=>oi(this,s)),arguments)},find(e,t){return yi(this,"find",e,t,n=>oi(this,n),arguments)},findIndex(e,t){return yi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return yi(this,"findLast",e,t,n=>oi(this,n),arguments)},findLastIndex(e,t){return yi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return yi(this,"forEach",e,t,void 0,arguments)},includes(...e){return Vp(this,"includes",e)},indexOf(...e){return Vp(this,"indexOf",e)},join(e){return Pl(this).join(e)},lastIndexOf(...e){return Vp(this,"lastIndexOf",e)},map(e,t){return yi(this,"map",e,t,void 0,arguments)},pop(){return Ja(this,"pop")},push(...e){return Ja(this,"push",e)},reduce(e,...t){return Iy(this,"reduce",e,t)},reduceRight(e,...t){return Iy(this,"reduceRight",e,t)},shift(){return Ja(this,"shift")},some(e,t){return yi(this,"some",e,t,void 0,arguments)},splice(...e){return Ja(this,"splice",e)},toReversed(){return Pl(this).toReversed()},toSorted(e){return Pl(this).toSorted(e)},toSpliced(...e){return Pl(this).toSpliced(...e)},unshift(...e){return Ja(this,"unshift",e)},values(){return zp(this,"values",e=>oi(this,e))}};function zp(e,t,n){const s=oh(e),o=s[t]();return s!==e&&!io(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const RA=Array.prototype;function yi(e,t,n,s,o,i){const r=oh(e),l=r!==e&&!io(e),a=r[t];if(a!==RA[t]){const d=a.apply(e,i);return l?jo(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,oi(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,s);return l&&o?o(u):u}function Iy(e,t,n,s){const o=oh(e),i=o!==e&&!io(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=oi(e,c)),n.call(this,c,oi(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](r,...s);return l?oi(e,a):a}function Vp(e,t,n){const s=Bt(e);bs(s,"iterate",Pc);const o=s[t](...n);return(o===-1||o===!1)&&lh(n[0])?(n[0]=Bt(n[0]),s[t](...n)):o}function Ja(e,t,n=[]){Ii(),I1();const s=Bt(e)[t].apply(e,n);return N1(),Ni(),s}const DA=Gf("__proto__,__v_isRef,__isVue"),K2=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(fo));function BA(e){fo(e)||(e=String(e));const t=Bt(this);return bs(t,"has",e),t.hasOwnProperty(e)}class G2{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?eS:Q2:i?J2:Z2).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=at(t);if(!o){let a;if(r&&(a=PA[n]))return a;if(n==="hasOwnProperty")return BA}const l=Reflect.get(t,n,Bn(t)?t:s);if((fo(n)?K2.has(n):DA(n))||(o||bs(t,"get",n),i))return l;if(Bn(l)){const a=r&&Zf(n)?l:l.value;return o&&Gt(a)?Kd(a):a}return Gt(l)?o?Kd(l):so(l):l}}class Y2 extends G2{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=at(t)&&Zf(n);if(!this._isShallow){const c=Li(i);if(!io(s)&&!Li(s)&&(i=Bt(i),s=Bt(s)),!r&&Bn(i)&&!Bn(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:Kt(t,n),a=Reflect.set(t,n,s,Bn(t)?t:o);return t===Bt(o)&&(l?ls(s,i)&&Si(t,"set",n,s):Si(t,"add",n,s)),a}deleteProperty(t,n){const s=Kt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Si(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!fo(n)||!K2.has(n))&&bs(t,"has",n),s}ownKeys(t){return bs(t,"iterate",at(t)?"length":il),Reflect.ownKeys(t)}}class X2 extends G2{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const FA=new Y2,HA=new X2,WA=new Y2(!0),UA=new X2(!0),sg=e=>e,qu=e=>Reflect.getPrototypeOf(e);function jA(e,t,n){return function(...s){const o=this.__v_raw,i=Bt(o),r=ta(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?sg:t?va:jo;return!t&&bs(i,"iterate",a?ng:il),nn(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 zu(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function qA(e,t){const n={get(o){const i=this.__v_raw,r=Bt(i),l=Bt(o);e||(ls(o,l)&&bs(r,"get",o),bs(r,"get",l));const{has:a}=qu(r),c=t?sg:e?va:jo;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&bs(Bt(o),"iterate",il),o.size},has(o){const i=this.__v_raw,r=Bt(i),l=Bt(o);return e||(ls(o,l)&&bs(r,"has",o),bs(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=Bt(l),c=t?sg:e?va:jo;return!e&&bs(a,"iterate",il),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return nn(n,e?{add:zu("add"),set:zu("set"),delete:zu("delete"),clear:zu("clear")}:{add(o){const i=Bt(this),r=qu(i),l=Bt(o),a=!t&&!io(o)&&!Li(o)?l:o;return r.has.call(i,a)||ls(o,a)&&r.has.call(i,o)||ls(l,a)&&r.has.call(i,l)||(i.add(a),Si(i,"add",a,a)),this},set(o,i){!t&&!io(i)&&!Li(i)&&(i=Bt(i));const r=Bt(this),{has:l,get:a}=qu(r);let c=l.call(r,o);c||(o=Bt(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?ls(i,u)&&Si(r,"set",o,i):Si(r,"add",o,i),this},delete(o){const i=Bt(this),{has:r,get:l}=qu(i);let a=r.call(i,o);a||(o=Bt(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&Si(i,"delete",o,void 0),c},clear(){const o=Bt(this),i=o.size!==0,r=o.clear();return i&&Si(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=jA(o,e,t)}),n}function ih(e,t){const n=qA(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(Kt(n,o)&&o in s?n:s,o,i)}const zA={get:ih(!1,!1)},VA={get:ih(!1,!0)},KA={get:ih(!0,!1)},GA={get:ih(!0,!0)},Z2=new WeakMap,J2=new WeakMap,Q2=new WeakMap,eS=new WeakMap;function YA(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function so(e){return Li(e)?e:rh(e,!1,FA,zA,Z2)}function XA(e){return rh(e,!1,WA,VA,J2)}function Kd(e){return rh(e,!0,HA,KA,Q2)}function she(e){return rh(e,!0,UA,GA,eS)}function rh(e,t,n,s,o){if(!Gt(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=YA(yA(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function fr(e){return Li(e)?fr(e.__v_raw):!!(e&&e.__v_isReactive)}function Li(e){return!!(e&&e.__v_isReadonly)}function io(e){return!!(e&&e.__v_isShallow)}function lh(e){return e?!!e.__v_raw:!1}function Bt(e){const t=e&&e.__v_raw;return t?Bt(t):e}function cr(e){return!Kt(e,"__v_skip")&&Object.isExtensible(e)&&P2(e,"__v_skip",!0),e}const jo=e=>Gt(e)?so(e):e,va=e=>Gt(e)?Kd(e):e;function Bn(e){return e?e.__v_isRef===!0:!1}function te(e){return tS(e,!1)}function hl(e){return tS(e,!0)}function tS(e,t){return Bn(e)?e:new ZA(e,t)}class ZA{constructor(t,n){this.dep=new sh,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Bt(t),this._value=n?t:jo(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||io(t)||Li(t);t=s?t:Bt(t),ls(t,n)&&(this._rawValue=t,this._value=s?t:jo(t),this.dep.trigger())}}function ohe(e){e.dep&&e.dep.trigger()}function C(e){return Bn(e)?e.value:e}function nS(e){return kt(e)?e():C(e)}const JA={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Bn(o)&&!Bn(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function sS(e){return fr(e)?e:new Proxy(e,JA)}class QA{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new sh,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function eE(e){return new QA(e)}function ihe(e){const t=at(e)?new Array(e.length):{};for(const n in e)t[n]=oS(e,n);return t}class tE{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=fo(n)?n:String(n),this._raw=Bt(t);let o=!0,i=t;if(!at(t)||fo(this._key)||!Zf(this._key))do o=!lh(i)||io(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Bn(this._raw[this._key])){const n=this._object[this._key];if(Bn(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return OA(this._raw,this._key)}}class nE{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 rhe(e,t,n){return Bn(e)?e:kt(e)?new nE(e):Gt(e)&&arguments.length>1?oS(e,t,n):te(e)}function oS(e,t,n){return new tE(e,t,n)}class sE{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new sh(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Oc-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&fn!==this)return W2(this,!0),!0}get value(){const t=this.dep.track();return q2(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function oE(e,t,n=!1){let s,o;return kt(e)?s=e:(s=e.get,o=e.set),new sE(s,o,n)}const lhe={GET:"get",HAS:"has",ITERATE:"iterate"},ahe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Vu={},Gd=new WeakMap;let or;function che(){return or}function iE(e,t=!1,n=or){if(n){let s=Gd.get(n);s||Gd.set(n,s=[]),s.push(e)}}function rE(e,t,n=Lt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=v=>o?v:io(v)||o===!1||o===0?Ci(v,1):Ci(v);let u,d,f,h,p=!1,g=!1;if(Bn(e)?(d=()=>e.value,p=io(e)):fr(e)?(d=()=>c(e),p=!0):at(e)?(g=!0,p=e.some(v=>fr(v)||io(v)),d=()=>e.map(v=>{if(Bn(v))return v.value;if(fr(v))return c(v);if(kt(v))return a?a(v,2):v()})):kt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Ii();try{f()}finally{Ni()}}const v=or;or=u;try{return a?a(e,3,[h]):e(h)}finally{or=v}}:d=Io,t&&o){const v=d,w=o===!0?1/0:o;d=()=>Ci(v(),w)}const S=E1(),_=()=>{u.stop(),S&&S.active&&M1(S.effects,u)};if(i&&t){const v=t;t=(...w)=>{v(...w),_()}}let y=g?new Array(e.length).fill(Vu):Vu;const b=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(t){const w=u.run();if(o||p||(g?w.some((N,E)=>ls(N,y[E])):ls(w,y))){f&&f();const N=or;or=u;try{const E=[w,y===Vu?void 0:g&&y[0]===Vu?[]:y,h];y=w,a?a(t,3,E):t(...E)}finally{or=N}}}else u.run()};return l&&l(b),u=new zd(d),u.scheduler=r?()=>r(b,!1):b,h=v=>iE(v,!1,u),f=u.onStop=()=>{const v=Gd.get(u);if(v){if(a)a(v,4);else for(const w of v)w();Gd.delete(u)}},t?s?b(!0):y=u.run():r?r(b.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function Ci(e,t=1/0,n){if(t<=0||!Gt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Bn(e))Ci(e.value,t,n);else if(at(e))for(let s=0;s<e.length;s++)Ci(e[s],t,n);else if(fl(e)||ta(e))e.forEach(s=>{Ci(s,t,n)});else if(Xf(e)){for(const s in e)Ci(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Ci(e[s],t,n)}return e}/**
|
|
11
|
-
* @vue/runtime-core v3.5.35
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/const iS=[];function lE(e){iS.push(e)}function aE(){iS.pop()}function uhe(e,t){}const dhe={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"},cE={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 lu(e,t,n,s){try{return s?e(...s):e()}catch(o){xa(o,t,n)}}function Lo(e,t,n,s){if(kt(e)){const o=lu(e,t,n,s);return o&&A1(o)&&o.catch(i=>{xa(i,t,n)}),o}if(at(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Lo(e[i],t,n,s));return o}}function xa(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Lt;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){Ii(),lu(i,null,10,[e,a,c]),Ni();return}}uE(e,n,o,s,r)}function uE(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Es=[];let ti=-1;const sa=[];let ir=null,ql=0;const rS=Promise.resolve();let Yd=null;function ft(e){const t=Yd||rS;return e?t.then(this?e.bind(this):e):t}function dE(e){let t=ti+1,n=Es.length;for(;t<n;){const s=t+n>>>1,o=Es[s],i=Rc(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function O1(e){if(!(e.flags&1)){const t=Rc(e),n=Es[Es.length-1];!n||!(e.flags&2)&&t>=Rc(n)?Es.push(e):Es.splice(dE(t),0,e),e.flags|=1,lS()}}function lS(){Yd||(Yd=rS.then(aS))}function Xd(e){at(e)?sa.push(...e):ir&&e.id===-1?ir.splice(ql+1,0,e):e.flags&1||(sa.push(e),e.flags|=1),lS()}function Ny(e,t,n=ti+1){for(;n<Es.length;n++){const s=Es[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Es.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Zd(e){if(sa.length){const t=[...new Set(sa)].sort((n,s)=>Rc(n)-Rc(s));if(sa.length=0,ir){ir.push(...t);return}for(ir=t,ql=0;ql<ir.length;ql++){const n=ir[ql];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}ir=null,ql=0}}const Rc=e=>e.id==null?e.flags&2?-1:1/0:e.id;function aS(e){try{for(ti=0;ti<Es.length;ti++){const t=Es[ti];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),lu(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ti<Es.length;ti++){const t=Es[ti];t&&(t.flags&=-2)}ti=-1,Es.length=0,Zd(),Yd=null,(Es.length||sa.length)&&aS()}}let zl,Ku=[];function cS(e,t){var n,s;zl=e,zl?(zl.enabled=!0,Ku.forEach(({event:o,args:i})=>zl.emit(o,...i)),Ku=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{cS(i,t)}),setTimeout(()=>{zl||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ku=[])},3e3)):Ku=[]}let us=null,ah=null;function Dc(e){const t=us;return us=e,ah=e&&e.type.__scopeId||null,t}function fhe(e){ah=e}function hhe(){ah=null}const phe=e=>Ln;function Ln(e,t=us,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&nf(-1);const i=Dc(t);let r;try{r=e(...o)}finally{Dc(i),s._d&&nf(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Ot(e,t){if(us===null)return e;const n=du(us),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Lt]=t[o];i&&(kt(i)&&(i={mounted:i,updated:i}),i.deep&&Ci(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function si(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(Ii(),Lo(a,n,8,[e.el,l,e,t]),Ni())}}function kn(e,t){if(as){let n=as.provides;const s=as.parent&&as.parent.provides;s===n&&(n=as.provides=Object.create(s)),n[e]=t}}function Dt(e,t,n=!1){const s=ds();if(s||rl){let o=rl?rl._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&kt(t)?t.call(s&&s.proxy):t}}function mhe(){return!!(ds()||rl)}const fE=Symbol.for("v-scx"),hE=()=>Dt(fE);function pE(e,t){return au(e,null,t)}function ghe(e,t){return au(e,null,{flush:"post"})}function mE(e,t){return au(e,null,{flush:"sync"})}function Ve(e,t,n){return au(e,t,n)}function au(e,t,n=Lt){const{immediate:s,deep:o,flush:i,once:r}=n,l=nn({},n),a=t&&s||!t&&i!=="post";let c;if(ul){if(i==="sync"){const h=hE();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=Io,h.resume=Io,h.pause=Io,h}}const u=as;l.call=(h,p,g)=>Lo(h,u,p,g);let d=!1;i==="post"?l.scheduler=h=>{Un(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():O1(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=rE(e,t,l);return ul&&(c?c.push(f):a&&f()),f}function gE(e,t,n){const s=this.proxy,o=rn(e)?e.includes(".")?uS(s,e):()=>s[e]:e.bind(s,s);let i;kt(t)?i=t:(i=t.handler,n=t);const r=Ta(this),l=au(o,i.bind(s),n);return r(),l}function uS(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const nr=new WeakMap,dS=Symbol("_vte"),fS=e=>e.__isTeleport,Zr=e=>e&&(e.disabled||e.disabled===""),vE=e=>e&&(e.defer||e.defer===""),Ly=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Oy=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,og=(e,t)=>{const n=e&&e.to;return rn(n)?t?t(n):null:n},yE={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:g,createComment:S,parentNode:_}}=c,y=Zr(t.props);let{dynamicChildren:b}=t;const v=(E,k,A)=>{E.shapeFlag&16&&u(E.children,k,A,o,i,r,l,a)},w=(E=t)=>{const k=Zr(E.props),A=E.target=og(E.props,p),I=ig(A,E,g,h);A&&(r!=="svg"&&Ly(A)?r="svg":r!=="mathml"&&Oy(A)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(A),k||(v(E,A,I),ac(E,!1)))},N=E=>{const k=()=>{if(nr.get(E)===k){if(nr.delete(E),Zr(E.props)){const A=_(E.el)||n;v(E,A,E.anchor),ac(E,!0)}w(E)}};nr.set(E,k),Un(k,i)};if(e==null){const E=t.el=g(""),k=t.anchor=g("");if(h(E,n,s),h(k,n,s),vE(t.props)||i&&i.pendingBranch){N(t);return}y&&(v(t,n,k),ac(t,!0)),w()}else{t.el=e.el;const E=t.anchor=e.anchor,k=nr.get(e);if(k){k.flags|=8,nr.delete(e),N(t);return}t.targetStart=e.targetStart;const A=t.target=e.target,I=t.targetAnchor=e.targetAnchor,P=Zr(e.props),M=P?n:A,L=P?E:I;if(r==="svg"||Ly(A)?r="svg":(r==="mathml"||Oy(A))&&(r="mathml"),b?(f(e.dynamicChildren,b,M,o,i,r,l),q1(e,t,!0)):a||d(e,t,M,L,o,i,r,l,!1),y)P?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Gu(t,n,E,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=og(t.props,p);R&&Gu(t,R,null,c,0)}else P&&Gu(t,A,I,c,1);ac(t,y)}},remove(e,t,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,h=i||!Zr(f),p=nr.get(e);if(p&&(p.flags|=8,nr.delete(e)),d&&(o(c),o(u)),i&&o(a),!p&&r&16)for(let g=0;g<l.length;g++){const S=l[g];s(S,t,n,h,!!S.dynamicChildren)}},move:Gu,hydrate:kE};function Gu(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!nr.has(e)&&(!d||Zr(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],t,n,2);d&&s(l,t,n)}function kE(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(S,_){let y=_;for(;y;){if(y&&y.nodeType===8){if(y.data==="teleport start anchor")t.targetStart=y;else if(y.data==="teleport anchor"){t.targetAnchor=y,S._lpa=t.targetAnchor&&r(t.targetAnchor);break}}y=r(y)}}function h(S,_){_.anchor=d(r(S),_,l(S),n,s,o,i)}const p=t.target=og(t.props,a),g=Zr(t.props);if(p){const S=p._lpa||p.firstChild;t.shapeFlag&16&&(g?(h(e,t),f(p,S),t.targetAnchor||ig(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,S),t.targetAnchor||ig(p,t,u,c),d(S&&r(S),t,p,n,s,o,i))),ac(t,g)}else g&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const vhe=yE;function ac(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function ig(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[dS]=r,e&&(s(i,e,o),s(r,e,o)),r}const To=Symbol("_leaveCb"),Qa=Symbol("_enterCb");function hS(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Qt(()=>{e.isMounted=!0}),Ks(()=>{e.isUnmounting=!0}),e}const _o=[Function,Array],pS={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:_o,onEnter:_o,onAfterEnter:_o,onEnterCancelled:_o,onBeforeLeave:_o,onLeave:_o,onAfterLeave:_o,onLeaveCancelled:_o,onBeforeAppear:_o,onAppear:_o,onAfterAppear:_o,onAppearCancelled:_o},mS=e=>{const t=e.subTree;return t.component?mS(t.component):t},bE={name:"BaseTransition",props:pS,setup(e,{slots:t}){const n=ds(),s=hS();return()=>{const o=t.default&&P1(t.default(),!0),i=o&&o.length?gS(o):n.subTree?ie():void 0;if(!i)return;const r=Bt(e),{mode:l}=r;if(s.isLeaving)return Kp(i);const a=Py(i);if(!a)return Kp(i);let c=Bc(a,r,s,n,d=>c=d);a.type!==jn&&vr(a,c);let u=n.subTree&&Py(n.subTree);if(u&&u.type!==jn&&!Fo(u,a)&&mS(n).type!==jn){let d=Bc(u,r,s,n);if(vr(u,d),l==="out-in"&&a.type!==jn)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Kp(i);l==="in-out"&&a.type!==jn?d.delayLeave=(f,h,p)=>{const g=vS(s,u);g[String(u.key)]=u,f[To]=()=>{h(),f[To]=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 gS(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==jn){t=n;break}}return t}const _E=bE;function vS(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Bc(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:g,onBeforeAppear:S,onAppear:_,onAfterAppear:y,onAppearCancelled:b}=t,v=String(e.key),w=vS(n,e),N=(A,I)=>{A&&Lo(A,s,9,I)},E=(A,I)=>{const P=I[1];N(A,I),at(A)?A.every(M=>M.length<=1)&&P():A.length<=1&&P()},k={mode:r,persisted:l,beforeEnter(A){let I=a;if(!n.isMounted)if(i)I=S||a;else return;A[To]&&A[To](!0);const P=w[v];P&&Fo(e,P)&&P.el[To]&&P.el[To](),N(I,[A])},enter(A){if(w[v]===e)return;let I=c,P=u,M=d;if(!n.isMounted)if(i)I=_||c,P=y||u,M=b||d;else return;let L=!1;A[Qa]=B=>{L||(L=!0,B?N(M,[A]):N(P,[A]),k.delayedLeave&&k.delayedLeave(),A[Qa]=void 0)};const R=A[Qa].bind(null,!1);I?E(I,[A,R]):R()},leave(A,I){const P=String(e.key);if(A[Qa]&&A[Qa](!0),n.isUnmounting)return I();N(f,[A]);let M=!1;A[To]=R=>{M||(M=!0,I(),R?N(g,[A]):N(p,[A]),A[To]=void 0,w[P]===e&&delete w[P])};const L=A[To].bind(null,!1);w[P]=e,h?E(h,[A,L]):L()},clone(A){const I=Bc(A,t,n,s,o);return o&&o(I),I}};return k}function Kp(e){if(cu(e))return e=Oi(e),e.children=null,e}function Py(e){if(!cu(e))return fS(e.type)&&e.children?gS(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&&kt(n.default))return n.default()}}function vr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,vr(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 P1(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Pe?(r.patchFlag&128&&o++,s=s.concat(P1(r.children,t,l))):(t||r.type!==jn)&&s.push(l!=null?Oi(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Xe(e,t){return kt(e)?nn({name:e.name},t,{setup:e}):e}function yhe(){const e=ds();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function R1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function khe(e){const t=ds(),n=hl(null);if(t){const o=t.refs===Lt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Ry(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Jd=new WeakMap;function oa(e,t,n,s,o=!1){if(at(e)){e.forEach((g,S)=>oa(g,t&&(at(t)?t[S]:t),n,s,o));return}if(Ai(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&oa(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?du(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Lt?l.refs={}:l.refs,d=l.setupState,f=Bt(d),h=d===Lt?L2:g=>Ry(u,g)?!1:Kt(f,g),p=(g,S)=>!(S&&Ry(u,S));if(c!=null&&c!==a){if(Dy(t),rn(c))u[c]=null,h(c)&&(d[c]=null);else if(Bn(c)){const g=t;p(c,g.k)&&(c.value=null),g.k&&(u[g.k]=null)}}if(kt(a))lu(a,l,12,[r,u]);else{const g=rn(a),S=Bn(a);if(g||S){const _=()=>{if(e.f){const y=g?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(o)at(y)&&M1(y,i);else if(at(y))y.includes(i)||y.push(i);else if(g)u[a]=[i],h(a)&&(d[a]=u[a]);else{const b=[i];p(a,e.k)&&(a.value=b),e.k&&(u[e.k]=b)}}else g?(u[a]=r,h(a)&&(d[a]=r)):S&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const y=()=>{_(),Jd.delete(e)};y.id=-1,Jd.set(e,y),Un(y,n)}else Dy(e),_()}}}function Dy(e){const t=Jd.get(e);t&&(t.flags|=8,Jd.delete(e))}let By=!1;const Rl=()=>{By||(console.error("Hydration completed but contains mismatches."),By=!0)},wE=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",SE=e=>e.namespaceURI.includes("MathML"),Yu=e=>{if(e.nodeType===1){if(wE(e))return"svg";if(SE(e))return"mathml"}},Yl=e=>e.nodeType===8;function CE(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(b,v)=>{if(!v.hasChildNodes()){n(null,b,v),Zd(),v._vnode=b;return}d(v.firstChild,b,null,null,null),Zd(),v._vnode=b},d=(b,v,w,N,E,k=!1)=>{k=k||!!v.dynamicChildren;const A=Yl(b)&&b.data==="[",I=()=>g(b,v,w,N,E,A),{type:P,ref:M,shapeFlag:L,patchFlag:R}=v;let B=b.nodeType;v.el=b,R===-2&&(k=!1,v.dynamicChildren=null);let W=null;switch(P){case hr:B!==3?v.children===""?(a(v.el=o(""),r(b),b),W=b):W=I():(b.data!==v.children&&(Rl(),b.data=v.children),W=i(b));break;case jn:y(b)?(W=i(b),_(v.el=b.content.firstChild,b,w)):B!==8||A?W=I():W=i(b);break;case la:if(A&&(b=i(b),B=b.nodeType),B===1||B===3){W=b;const K=!v.children.length;for(let V=0;V<v.staticCount;V++)K&&(v.children+=W.nodeType===1?W.outerHTML:W.data),V===v.staticCount-1&&(v.anchor=W),W=i(W);return A?i(W):W}else I();break;case Pe:A?W=p(b,v,w,N,E,k):W=I();break;default:if(L&1)(B!==1||v.type.toLowerCase()!==b.tagName.toLowerCase())&&!y(b)?W=I():W=f(b,v,w,N,E,k);else if(L&6){v.slotScopeIds=E;const K=r(b);if(A?W=S(b):Yl(b)&&b.data==="teleport start"?W=S(b,b.data,"teleport end"):W=i(b),t(v,K,null,w,N,Yu(K),k),Ai(v)&&!v.type.__asyncResolved){let V;A?(V=gt(Pe),V.anchor=W?W.previousSibling:K.lastChild):V=b.nodeType===3?dt(""):gt("div"),V.el=b,v.component.subTree=V}}else L&64?B!==8?W=I():W=v.type.hydrate(b,v,w,N,E,k,e,h):L&128&&(W=v.type.hydrate(b,v,w,N,Yu(r(b)),E,k,e,d))}return M!=null&&oa(M,null,N,v),W},f=(b,v,w,N,E,k)=>{k=k||!!v.dynamicChildren;const{type:A,props:I,patchFlag:P,shapeFlag:M,dirs:L,transition:R}=v,B=A==="input"||A==="option";if(B||P!==-1){L&&si(v,null,w,"created");let W=!1;if(y(b)){W=RS(null,R)&&w&&w.vnode.props&&w.vnode.props.appear;const V=b.content.firstChild;if(W){const se=V.getAttribute("class");se&&(V.$cls=se),R.beforeEnter(V)}_(V,b,w),v.el=b=V}if(M&16&&!(I&&(I.innerHTML||I.textContent))){let V=h(b.firstChild,v,b,w,N,E,k);for(V&&!Xu(b,1)&&Rl();V;){const se=V;V=V.nextSibling,l(se)}}else if(M&8){let V=v.children;V[0]===`
|
|
15
|
-
`&&(b.tagName==="PRE"||b.tagName==="TEXTAREA")&&(V=V.slice(1));const{textContent:se}=b;se!==V&&se!==V.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(Xu(b,0)||Rl(),b.textContent=v.children)}if(I){if(B||!k||P&48){const V=b.tagName.includes("-");for(const se in I)(B&&(se.endsWith("value")||se==="indeterminate")||ru(se)&&!ol(se)||se[0]==="."||V&&!ol(se))&&s(b,se,null,I[se],void 0,w)}else if(I.onClick)s(b,"onClick",null,I.onClick,void 0,w);else if(P&4&&fr(I.style))for(const V in I.style)I.style[V]}let K;(K=I&&I.onVnodeBeforeMount)&&Bs(K,w,v),L&&si(v,null,w,"beforeMount"),((K=I&&I.onVnodeMounted)||L||W)&&HS(()=>{K&&Bs(K,w,v),W&&R.enter(b),L&&si(v,null,w,"mounted")},N)}return b.nextSibling},h=(b,v,w,N,E,k,A)=>{A=A||!!v.dynamicChildren;const I=v.children,P=I.length;let M=!1;for(let L=0;L<P;L++){const R=A?I[L]:I[L]=Fs(I[L]),B=R.type===hr;b?(B&&!A&&L+1<P&&Fs(I[L+1]).type===hr&&(a(o(b.data.slice(R.children.length)),w,i(b)),b.data=R.children),b=d(b,R,N,E,k,A)):B&&!R.children?a(R.el=o(""),w):(M||(M=!0,Xu(w,1)||Rl()),n(null,R,w,null,N,E,Yu(w),k))}return b},p=(b,v,w,N,E,k)=>{const{slotScopeIds:A}=v;A&&(E=E?E.concat(A):A);const I=r(b),P=h(i(b),v,I,w,N,E,k);return P&&Yl(P)&&P.data==="]"?i(v.anchor=P):(Rl(),a(v.anchor=c("]"),I,P),P)},g=(b,v,w,N,E,k)=>{if(Xu(b.parentElement,1)||Rl(),v.el=null,k){const P=S(b);for(;;){const M=i(b);if(M&&M!==P)l(M);else break}}const A=i(b),I=r(b);return l(b),n(null,v,I,A,w,N,Yu(I),E),w&&(w.vnode.el=v.el,dh(w,v.el)),A},S=(b,v="[",w="]")=>{let N=0;for(;b;)if(b=i(b),b&&Yl(b)&&(b.data===v&&N++,b.data===w)){if(N===0)return i(b);N--}return b},_=(b,v,w)=>{const N=v.parentNode;N&&N.replaceChild(b,v);let E=w;for(;E;)E.vnode.el===v&&(E.vnode.el=E.subTree.el=b),E=E.parent},y=b=>b.nodeType===1&&b.tagName==="TEMPLATE";return[u,d]}const Fy="data-allow-mismatch",xE={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Xu(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Fy);)e=e.parentElement;const n=e&&e.getAttribute(Fy);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(xE[t])}}const TE=th().requestIdleCallback||(e=>setTimeout(e,1)),ME=th().cancelIdleCallback||(e=>clearTimeout(e)),bhe=(e=1e4)=>t=>{const n=TE(t,{timeout:e});return()=>ME(n)};function AE(e){const{top:t,left:n,bottom:s,right:o}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||s>0&&s<i)&&(n>0&&n<r||o>0&&o<r)}const _he=e=>(t,n)=>{const s=new IntersectionObserver(o=>{for(const i of o)if(i.isIntersecting){s.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(AE(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},whe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},She=(e=[])=>(t,n)=>{rn(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function EE(e,t){if(Yl(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Yl(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const Ai=e=>!!e.type.__asyncLoader;function ii(e){kt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((S,_)=>{a(g,()=>S(f()),()=>_(g),d+1)});throw g}).then(g=>p!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return Xe({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,g,S){let _=!1;(g.bu||(g.bu=[])).push(()=>_=!0);const y=()=>{_||S()},b=i?()=>{const v=i(y,w=>EE(p,w));v&&(g.bum||(g.bum=[])).push(v)}:y;u?b():h().then(()=>!g.isUnmounted&&b())},get __asyncResolved(){return u},setup(){const p=as;if(R1(p),u)return()=>Zu(u,p);const g=b=>{c=null,xa(b,p,13,!s)};if(l&&p.suspense||ul)return h().then(b=>()=>Zu(b,p)).catch(b=>(g(b),()=>s?gt(s,{error:b}):null));const S=te(!1),_=te(),y=te(!!o);return o&&setTimeout(()=>{y.value=!1},o),r!=null&&setTimeout(()=>{if(!S.value&&!_.value){const b=new Error(`Async component timed out after ${r}ms.`);g(b),_.value=b}},r),h().then(()=>{S.value=!0,p.parent&&cu(p.parent.vnode)&&p.parent.update()}).catch(b=>{g(b),_.value=b}),()=>{if(S.value&&u)return Zu(u,p);if(_.value&&s)return gt(s,{error:_.value});if(n&&!y.value)return Zu(n,p)}}})}function Zu(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=gt(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const cu=e=>e.type.__isKeepAlive,$E={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=ds(),s=n.ctx;if(!s.renderer)return()=>{const y=t.default&&t.default();return y&&y.length===1?y[0]:y};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,f=d("div");s.activate=(y,b,v,w,N)=>{const E=y.component;c(y,b,v,0,l),a(E.vnode,y,b,v,E,l,w,y.slotScopeIds,N),Un(()=>{E.isDeactivated=!1,E.a&&na(E.a);const k=y.props&&y.props.onVnodeMounted;k&&Bs(k,E.parent,y)},l)},s.deactivate=y=>{const b=y.component;ef(b.m),ef(b.a),c(y,f,null,1,l),Un(()=>{b.da&&na(b.da);const v=y.props&&y.props.onVnodeUnmounted;v&&Bs(v,b.parent,y),b.isDeactivated=!0},l)};function h(y){Gp(y),u(y,n,l,!0)}function p(y){o.forEach((b,v)=>{const w=pg(Ai(b)?b.type.__asyncResolved||{}:b.type);w&&!y(w)&&g(v)})}function g(y){const b=o.get(y);b&&(!r||!Fo(b,r))?h(b):r&&Gp(r),o.delete(y),i.delete(y)}Ve(()=>[e.include,e.exclude],([y,b])=>{y&&p(v=>cc(y,v)),b&&p(v=>!cc(b,v))},{flush:"post",deep:!0});let S=null;const _=()=>{S!=null&&(tf(n.subTree.type)?Un(()=>{o.set(S,Ju(n.subTree))},n.subTree.suspense):o.set(S,Ju(n.subTree)))};return Qt(_),D1(_),Ks(()=>{o.forEach(y=>{const{subTree:b,suspense:v}=n,w=Ju(b);if(y.type===w.type&&y.key===w.key){Gp(w);const N=w.component.da;N&&Un(N,v);return}h(y)})}),()=>{if(S=null,!t.default)return r=null;const y=t.default(),b=y[0];if(y.length>1)return r=null,y;if(!yr(b)||!(b.shapeFlag&4)&&!(b.shapeFlag&128))return r=null,b;let v=Ju(b);if(v.type===jn)return r=null,v;const w=v.type,N=pg(Ai(v)?v.type.__asyncResolved||{}:w),{include:E,exclude:k,max:A}=e;if(E&&(!N||!cc(E,N))||k&&N&&cc(k,N))return v.shapeFlag&=-257,r=v,b;const I=v.key==null?w:v.key,P=o.get(I);return v.el&&(v=Oi(v),b.shapeFlag&128&&(b.ssContent=v)),S=I,P?(v.el=P.el,v.component=P.component,v.transition&&vr(v,v.transition),v.shapeFlag|=512,i.delete(I),i.add(I)):(i.add(I),A&&i.size>parseInt(A,10)&&g(i.values().next().value)),v.shapeFlag|=256,r=v,tf(b.type)?b:v}}},Che=$E;function cc(e,t){return at(e)?e.some(n=>cc(n,t)):rn(e)?e.split(",").includes(t):vA(e)?(e.lastIndex=0,e.test(t)):!1}function IE(e,t){yS(e,"a",t)}function NE(e,t){yS(e,"da",t)}function yS(e,t,n=as){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(ch(t,s,n),n){let o=n.parent;for(;o&&o.parent;)cu(o.parent.vnode)&&LE(s,t,n,o),o=o.parent}}function LE(e,t,n,s){const o=ch(t,e,s,!0);Ht(()=>{M1(s[t],o)},n)}function Gp(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Ju(e){return e.shapeFlag&128?e.ssContent:e}function ch(e,t,n=as,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Ii();const l=Ta(n),a=Lo(t,n,e,r);return l(),Ni(),a});return s?o.unshift(i):o.push(i),i}}const Di=e=>(t,n=as)=>{(!ul||e==="sp")&&ch(e,(...s)=>t(...s),n)},OE=Di("bm"),Qt=Di("m"),kS=Di("bu"),D1=Di("u"),Ks=Di("bum"),Ht=Di("um"),PE=Di("sp"),RE=Di("rtg"),DE=Di("rtc");function BE(e,t=as){ch("ec",e,t)}const B1="components",FE="directives";function HE(e,t){return F1(B1,e,!0,t)||e}const bS=Symbol.for("v-ndc");function _s(e){return rn(e)?F1(B1,e,!1)||e:e||bS}function xhe(e){return F1(FE,e)}function F1(e,t,n=!0,s=!1){const o=us||as;if(o){const i=o.type;if(e===B1){const l=pg(i,!1);if(l&&(l===t||l===Zn(t)||l===Qf(Zn(t))))return i}const r=Hy(o[e]||i[e],t)||Hy(o.appContext[e],t);return!r&&s?i:r}}function Hy(e,t){return e&&(e[t]||e[Zn(t)]||e[Qf(Zn(t))])}function Ye(e,t,n,s){let o;const i=n&&n[s],r=at(e);if(r||rn(e)){const l=r&&fr(e);let a=!1,c=!1;l&&(a=!io(e),c=Li(e),e=oh(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?va(jo(e[u])):jo(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(Gt(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function The(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(at(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function ia(e,t,n={},s,o){if(us.ce||us.parent&&Ai(us.parent)&&us.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),x(),je(Pe,null,[gt("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),x();const r=i&&H1(i(n)),l=n.key||r&&r.key,a=je(Pe,{key:(l&&!fo(l)?l:`_${t}`)+(!r&&s?"_fb":"")},r||(s?s():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function H1(e){return e.some(t=>yr(t)?!(t.type===jn||t.type===Pe&&!H1(t.children)):!0)?e:null}function Mhe(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:Cd(s)]=e[s];return n}const rg=e=>e?zS(e)?du(e):rg(e.parent):null,bc=nn(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=>rg(e.parent),$root:e=>rg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>W1(e),$forceUpdate:e=>e.f||(e.f=()=>{O1(e.update)}),$nextTick:e=>e.n||(e.n=ft.bind(e.proxy)),$watch:e=>gE.bind(e)}),Yp=(e,t)=>e!==Lt&&!e.__isScriptSetup&&Kt(e,t),lg={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(Yp(s,t))return r[t]=1,s[t];if(o!==Lt&&Kt(o,t))return r[t]=2,o[t];if(Kt(i,t))return r[t]=3,i[t];if(n!==Lt&&Kt(n,t))return r[t]=4,n[t];ag&&(r[t]=0)}}const c=bc[t];let u,d;if(c)return t==="$attrs"&&bs(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Lt&&Kt(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,Kt(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return Yp(o,t)?(o[t]=n,!0):s!==Lt&&Kt(s,t)?(s[t]=n,!0):Kt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Lt&&l[0]!=="$"&&Kt(e,l)||Yp(t,l)||Kt(i,l)||Kt(s,l)||Kt(bc,l)||Kt(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Kt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},WE=nn({},lg,{get(e,t){if(t!==Symbol.unscopables)return lg.get(e,t,e)},has(e,t){return t[0]!=="_"&&!wA(t)}});function Ahe(){return null}function Ehe(){return null}function $he(e){}function Ihe(e){}function Nhe(){return null}function Lhe(){}function Ohe(e,t){return null}function Phe(){return _S().slots}function uu(){return _S().attrs}function _S(e){const t=ds();return t.setupContext||(t.setupContext=GS(t))}function Fc(e){return at(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Rhe(e,t){const n=Fc(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?at(o)||kt(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function Dhe(e,t){return!e||!t?e||t:at(e)&&at(t)?e.concat(t):nn({},Fc(e),Fc(t))}function Bhe(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function Fhe(e){const t=ds(),n=ul;let s=e();Wc(),n&&aa(!1);const o=()=>{Ta(t),n&&aa(!0)},i=()=>{ds()!==t&&t.scope.off(),Wc(),n&&aa(!1)};return A1(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let ag=!0;function UE(e){const t=W1(e),n=e.proxy,s=e.ctx;ag=!1,t.beforeCreate&&Wy(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:g,deactivated:S,beforeDestroy:_,beforeUnmount:y,destroyed:b,unmounted:v,render:w,renderTracked:N,renderTriggered:E,errorCaptured:k,serverPrefetch:A,expose:I,inheritAttrs:P,components:M,directives:L,filters:R}=t;if(c&&jE(c,s,null),r)for(const K in r){const V=r[K];kt(V)&&(s[K]=V.bind(n))}if(o){const K=o.call(n,n);Gt(K)&&(e.data=so(K))}if(ag=!0,i)for(const K in i){const V=i[K],se=kt(V)?V.bind(n,n):kt(V.get)?V.get.bind(n,n):Io,Y=!kt(V)&&kt(V.set)?V.set.bind(n):Io,G=F({get:se,set:Y});Object.defineProperty(s,K,{enumerable:!0,configurable:!0,get:()=>G.value,set:ee=>G.value=ee})}if(l)for(const K in l)wS(l[K],s,n,K);if(a){const K=kt(a)?a.call(n):a;Reflect.ownKeys(K).forEach(V=>{kn(V,K[V])})}u&&Wy(u,e,"c");function W(K,V){at(V)?V.forEach(se=>K(se.bind(n))):V&&K(V.bind(n))}if(W(OE,d),W(Qt,f),W(kS,h),W(D1,p),W(IE,g),W(NE,S),W(BE,k),W(DE,N),W(RE,E),W(Ks,y),W(Ht,v),W(PE,A),at(I))if(I.length){const K=e.exposed||(e.exposed={});I.forEach(V=>{Object.defineProperty(K,V,{get:()=>n[V],set:se=>n[V]=se,enumerable:!0})})}else e.exposed||(e.exposed={});w&&e.render===Io&&(e.render=w),P!=null&&(e.inheritAttrs=P),M&&(e.components=M),L&&(e.directives=L),A&&R1(e)}function jE(e,t,n=Io){at(e)&&(e=cg(e));for(const s in e){const o=e[s];let i;Gt(o)?"default"in o?i=Dt(o.from||s,o.default,!0):i=Dt(o.from||s):i=Dt(o),Bn(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function Wy(e,t,n){Lo(at(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function wS(e,t,n,s){let o=s.includes(".")?uS(n,s):()=>n[s];if(rn(e)){const i=t[e];kt(i)&&Ve(o,i)}else if(kt(e))Ve(o,e.bind(n));else if(Gt(e))if(at(e))e.forEach(i=>wS(i,t,n,s));else{const i=kt(e.handler)?e.handler.bind(n):t[e.handler];kt(i)&&Ve(o,i,e)}}function W1(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>Qd(a,c,r,!0)),Qd(a,t,r)),Gt(t)&&i.set(t,a),a}function Qd(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&Qd(e,i,n,!0),o&&o.forEach(r=>Qd(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=qE[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const qE={data:Uy,props:jy,emits:jy,methods:uc,computed:uc,beforeCreate:As,created:As,beforeMount:As,mounted:As,beforeUpdate:As,updated:As,beforeDestroy:As,beforeUnmount:As,destroyed:As,unmounted:As,activated:As,deactivated:As,errorCaptured:As,serverPrefetch:As,components:uc,directives:uc,watch:VE,provide:Uy,inject:zE};function Uy(e,t){return t?e?function(){return nn(kt(e)?e.call(this,this):e,kt(t)?t.call(this,this):t)}:t:e}function zE(e,t){return uc(cg(e),cg(t))}function cg(e){if(at(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function As(e,t){return e?[...new Set([].concat(e,t))]:t}function uc(e,t){return e?nn(Object.create(null),e,t):t}function jy(e,t){return e?at(e)&&at(t)?[...new Set([...e,...t])]:nn(Object.create(null),Fc(e),Fc(t??{})):t}function VE(e,t){if(!e)return t;if(!t)return e;const n=nn(Object.create(null),e);for(const s in t)n[s]=As(e[s],t[s]);return n}function SS(){return{app:null,config:{isNativeTag:L2,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 KE=0;function GE(e,t){return function(s,o=null){kt(s)||(s=nn({},s)),o!=null&&!Gt(o)&&(o=null);const i=SS(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:KE++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:C4,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&kt(u.install)?(r.add(u),u.install(c,...d)):kt(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||gt(s,o);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,du(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Lo(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=rl;rl=c;try{return u()}finally{rl=d}}};return c}}let rl=null;function Hhe(e,t,n=Lt){const s=ds(),o=Zn(t),i=Hs(t),r=CS(e,o),l=eE((a,c)=>{let u,d=Lt,f;return mE(()=>{const h=e[o];ls(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(!ls(p,u)&&!(d!==Lt&&ls(h,d)))return;const g=s.vnode.props;g&&(t in g||o in g||i in g)&&(`onUpdate:${t}`in g||`onUpdate:${o}`in g||`onUpdate:${i}`in g)||(u=h,c()),s.emit(`update:${t}`,p),ls(h,p)&&ls(h,d)&&!ls(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Lt:l,done:!1}:{done:!0}}}},l}const CS=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Zn(t)}Modifiers`]||e[`${Hs(t)}Modifiers`];function YE(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Lt;let o=n;const i=t.startsWith("update:"),r=i&&CS(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>rn(u)?u.trim():u)),r.number&&(o=n.map(eh)));let l,a=s[l=Cd(t)]||s[l=Cd(Zn(t))];!a&&i&&(a=s[l=Cd(Hs(t))]),a&&Lo(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Lo(c,e,6,o)}}const XE=new WeakMap;function xS(e,t,n=!1){const s=n?XE:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!kt(e)){const a=c=>{const u=xS(c,t,!0);u&&(l=!0,nn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(Gt(e)&&s.set(e,null),null):(at(i)?i.forEach(a=>r[a]=null):nn(r,i),Gt(e)&&s.set(e,r),r)}function uh(e,t){return!e||!ru(t)?!1:(t=t.slice(2).replace(/Once$/,""),Kt(e,t[0].toLowerCase()+t.slice(1))||Kt(e,Hs(t))||Kt(e,t))}function xd(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:g}=e,S=Dc(e);let _,y;try{if(n.shapeFlag&4){const v=o||s,w=v;_=Fs(c.call(w,v,u,d,h,f,p)),y=l}else{const v=t;_=Fs(v.length>1?v(d,{attrs:l,slots:r,emit:a}):v(d,null)),y=t.props?l:JE(l)}}catch(v){_c.length=0,xa(v,e,1),_=gt(jn)}let b=_;if(y&&g!==!1){const v=Object.keys(y),{shapeFlag:w}=b;v.length&&w&7&&(i&&v.some(Yf)&&(y=QE(y,i)),b=Oi(b,y,!1,!0))}return n.dirs&&(b=Oi(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&vr(b,n.transition),_=b,Dc(S),_}function ZE(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(yr(o)){if(o.type!==jn||o.children==="v-if"){if(n)return;n=o}}else return}return n}const JE=e=>{let t;for(const n in e)(n==="class"||n==="style"||ru(n))&&((t||(t={}))[n]=e[n]);return t},QE=(e,t)=>{const n={};for(const s in e)(!Yf(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function e4(e,t,n){const{props:s,children:o,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?qy(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(TS(r,s,f)&&!uh(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?qy(s,r,c):!0:!!r;return!1}function qy(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(TS(t,e,i)&&!uh(n,i))return!0}return!1}function TS(e,t,n){const s=e[n],o=t[n];return n==="style"&&Gt(s)&&Gt(o)?!$i(s,o):s!==o}function dh({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const MS={},AS=()=>Object.create(MS),ES=e=>Object.getPrototypeOf(e)===MS;function t4(e,t,n,s=!1){const o={},i=AS();e.propsDefaults=Object.create(null),$S(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:XA(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function n4(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=Bt(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(uh(e.emitsOptions,f))continue;const h=t[f];if(a)if(Kt(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=Zn(f);o[p]=ug(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{$S(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!Kt(t,d)&&((u=Hs(d))===d||!Kt(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=ug(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!Kt(t,d))&&(delete i[d],c=!0)}c&&Si(e.attrs,"set","")}function $S(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(ol(a))continue;const c=t[a];let u;o&&Kt(o,u=Zn(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:uh(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=Bt(n),c=l||Lt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=ug(o,a,d,c[d],e,!Kt(c,d))}}return r}function ug(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=Kt(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&kt(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=Ta(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===Hs(n))&&(s=!0))}return s}const s4=new WeakMap;function IS(e,t,n=!1){const s=n?s4:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!kt(e)){const u=d=>{a=!0;const[f,h]=IS(d,t,!0);nn(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 Gt(e)&&s.set(e,ea),ea;if(at(i))for(let u=0;u<i.length;u++){const d=Zn(i[u]);zy(d)&&(r[d]=Lt)}else if(i)for(const u in i){const d=Zn(u);if(zy(d)){const f=i[u],h=r[d]=at(f)||kt(f)?{type:f}:nn({},f),p=h.type;let g=!1,S=!0;if(at(p))for(let _=0;_<p.length;++_){const y=p[_],b=kt(y)&&y.name;if(b==="Boolean"){g=!0;break}else b==="String"&&(S=!1)}else g=kt(p)&&p.name==="Boolean";h[0]=g,h[1]=S,(g||Kt(h,"default"))&&l.push(d)}}const c=[r,l];return Gt(e)&&s.set(e,c),c}function zy(e){return e[0]!=="$"&&!ol(e)}const U1=e=>e==="_"||e==="_ctx"||e==="$stable",j1=e=>at(e)?e.map(Fs):[Fs(e)],o4=(e,t,n)=>{if(t._n)return t;const s=Ln((...o)=>j1(t(...o)),n);return s._c=!1,s},NS=(e,t,n)=>{const s=e._ctx;for(const o in e){if(U1(o))continue;const i=e[o];if(kt(i))t[o]=o4(o,i,s);else if(i!=null){const r=j1(i);t[o]=()=>r}}},LS=(e,t)=>{const n=j1(t);e.slots.default=()=>n},OS=(e,t,n)=>{for(const s in t)(n||!U1(s))&&(e[s]=t[s])},i4=(e,t,n)=>{const s=e.slots=AS();if(e.vnode.shapeFlag&32){const o=t._;o?(OS(s,t,n),n&&P2(s,"_",o,!0)):NS(t,s)}else t&&LS(e,t)},r4=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Lt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:OS(o,t,n):(i=!t.$stable,NS(t,o)),r=t}else t&&(LS(e,t),r={default:1});if(i)for(const l in o)!U1(l)&&r[l]==null&&delete o[l]},Un=HS;function l4(e){return PS(e)}function a4(e){return PS(e,CE)}function PS(e,t){const n=th();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=Io,insertStaticContent:p}=e,g=(U,Z,fe,oe=null,he=null,H=null,X=void 0,ae=null,ke=!!Z.dynamicChildren)=>{if(U===Z)return;U&&!Fo(U,Z)&&(oe=_e(U),ee(U,he,H,!0),U=null),Z.patchFlag===-2&&(ke=!1,Z.dynamicChildren=null);const{type:Me,ref:Ie,shapeFlag:re}=Z;switch(Me){case hr:S(U,Z,fe,oe);break;case jn:_(U,Z,fe,oe);break;case la:U==null&&y(Z,fe,oe,X);break;case Pe:M(U,Z,fe,oe,he,H,X,ae,ke);break;default:re&1?w(U,Z,fe,oe,he,H,X,ae,ke):re&6?L(U,Z,fe,oe,he,H,X,ae,ke):(re&64||re&128)&&Me.process(U,Z,fe,oe,he,H,X,ae,ke,J)}Ie!=null&&he?oa(Ie,U&&U.ref,H,Z||U,!Z):Ie==null&&U&&U.ref!=null&&oa(U.ref,null,H,U,!0)},S=(U,Z,fe,oe)=>{if(U==null)s(Z.el=l(Z.children),fe,oe);else{const he=Z.el=U.el;Z.children!==U.children&&c(he,Z.children)}},_=(U,Z,fe,oe)=>{U==null?s(Z.el=a(Z.children||""),fe,oe):Z.el=U.el},y=(U,Z,fe,oe)=>{[U.el,U.anchor]=p(U.children,Z,fe,oe,U.el,U.anchor)},b=({el:U,anchor:Z},fe,oe)=>{let he;for(;U&&U!==Z;)he=f(U),s(U,fe,oe),U=he;s(Z,fe,oe)},v=({el:U,anchor:Z})=>{let fe;for(;U&&U!==Z;)fe=f(U),o(U),U=fe;o(Z)},w=(U,Z,fe,oe,he,H,X,ae,ke)=>{if(Z.type==="svg"?X="svg":Z.type==="math"&&(X="mathml"),U==null)N(Z,fe,oe,he,H,X,ae,ke);else{const Me=U.el&&U.el._isVueCE?U.el:null;try{Me&&Me._beginPatch(),A(U,Z,he,H,X,ae,ke)}finally{Me&&Me._endPatch()}}},N=(U,Z,fe,oe,he,H,X,ae)=>{let ke,Me;const{props:Ie,shapeFlag:re,transition:le,dirs:Ce}=U;if(ke=U.el=r(U.type,H,Ie&&Ie.is,Ie),re&8?u(ke,U.children):re&16&&k(U.children,ke,null,oe,he,Xp(U,H),X,ae),Ce&&si(U,null,oe,"created"),E(ke,U,U.scopeId,X,oe),Ie){for(const nt in Ie)nt!=="value"&&!ol(nt)&&i(ke,nt,null,Ie[nt],H,oe);"value"in Ie&&i(ke,"value",null,Ie.value,H),(Me=Ie.onVnodeBeforeMount)&&Bs(Me,oe,U)}Ce&&si(U,null,oe,"beforeMount");const We=RS(he,le);We&&le.beforeEnter(ke),s(ke,Z,fe),((Me=Ie&&Ie.onVnodeMounted)||We||Ce)&&Un(()=>{try{Me&&Bs(Me,oe,U),We&&le.enter(ke),Ce&&si(U,null,oe,"mounted")}finally{}},he)},E=(U,Z,fe,oe,he)=>{if(fe&&h(U,fe),oe)for(let H=0;H<oe.length;H++)h(U,oe[H]);if(he){let H=he.subTree;if(Z===H||tf(H.type)&&(H.ssContent===Z||H.ssFallback===Z)){const X=he.vnode;E(U,X,X.scopeId,X.slotScopeIds,he.parent)}}},k=(U,Z,fe,oe,he,H,X,ae,ke=0)=>{for(let Me=ke;Me<U.length;Me++){const Ie=U[Me]=ae?wi(U[Me]):Fs(U[Me]);g(null,Ie,Z,fe,oe,he,H,X,ae)}},A=(U,Z,fe,oe,he,H,X)=>{const ae=Z.el=U.el;let{patchFlag:ke,dynamicChildren:Me,dirs:Ie}=Z;ke|=U.patchFlag&16;const re=U.props||Lt,le=Z.props||Lt;let Ce;if(fe&&qr(fe,!1),(Ce=le.onVnodeBeforeUpdate)&&Bs(Ce,fe,Z,U),Ie&&si(Z,U,fe,"beforeUpdate"),fe&&qr(fe,!0),(re.innerHTML&&le.innerHTML==null||re.textContent&&le.textContent==null)&&u(ae,""),Me?I(U.dynamicChildren,Me,ae,fe,oe,Xp(Z,he),H):X||V(U,Z,ae,null,fe,oe,Xp(Z,he),H,!1),ke>0){if(ke&16)P(ae,re,le,fe,he);else if(ke&2&&re.class!==le.class&&i(ae,"class",null,le.class,he),ke&4&&i(ae,"style",re.style,le.style,he),ke&8){const We=Z.dynamicProps;for(let nt=0;nt<We.length;nt++){const lt=We[nt],bt=re[lt],St=le[lt];(St!==bt||lt==="value")&&i(ae,lt,bt,St,he,fe)}}ke&1&&U.children!==Z.children&&u(ae,Z.children)}else!X&&Me==null&&P(ae,re,le,fe,he);((Ce=le.onVnodeUpdated)||Ie)&&Un(()=>{Ce&&Bs(Ce,fe,Z,U),Ie&&si(Z,U,fe,"updated")},oe)},I=(U,Z,fe,oe,he,H,X)=>{for(let ae=0;ae<Z.length;ae++){const ke=U[ae],Me=Z[ae],Ie=ke.el&&(ke.type===Pe||!Fo(ke,Me)||ke.shapeFlag&198)?d(ke.el):fe;g(ke,Me,Ie,null,oe,he,H,X,!0)}},P=(U,Z,fe,oe,he)=>{if(Z!==fe){if(Z!==Lt)for(const H in Z)!ol(H)&&!(H in fe)&&i(U,H,Z[H],null,he,oe);for(const H in fe){if(ol(H))continue;const X=fe[H],ae=Z[H];X!==ae&&H!=="value"&&i(U,H,ae,X,he,oe)}"value"in fe&&i(U,"value",Z.value,fe.value,he)}},M=(U,Z,fe,oe,he,H,X,ae,ke)=>{const Me=Z.el=U?U.el:l(""),Ie=Z.anchor=U?U.anchor:l("");let{patchFlag:re,dynamicChildren:le,slotScopeIds:Ce}=Z;Ce&&(ae=ae?ae.concat(Ce):Ce),U==null?(s(Me,fe,oe),s(Ie,fe,oe),k(Z.children||[],fe,Ie,he,H,X,ae,ke)):re>0&&re&64&&le&&U.dynamicChildren&&U.dynamicChildren.length===le.length?(I(U.dynamicChildren,le,fe,he,H,X,ae),(Z.key!=null||he&&Z===he.subTree)&&q1(U,Z,!0)):V(U,Z,fe,Ie,he,H,X,ae,ke)},L=(U,Z,fe,oe,he,H,X,ae,ke)=>{Z.slotScopeIds=ae,U==null?Z.shapeFlag&512?he.ctx.activate(Z,fe,oe,X,ke):R(Z,fe,oe,he,H,X,ke):B(U,Z,ke)},R=(U,Z,fe,oe,he,H,X)=>{const ae=U.component=qS(U,oe,he);if(cu(U)&&(ae.ctx.renderer=J),VS(ae,!1,X),ae.asyncDep){if(he&&he.registerDep(ae,W,X),!U.el){const ke=ae.subTree=gt(jn);_(null,ke,Z,fe),U.placeholder=ke.el}}else W(ae,U,Z,fe,he,H,X)},B=(U,Z,fe)=>{const oe=Z.component=U.component;if(e4(U,Z,fe))if(oe.asyncDep&&!oe.asyncResolved){K(oe,Z,fe);return}else oe.next=Z,oe.update();else Z.el=U.el,oe.vnode=Z},W=(U,Z,fe,oe,he,H,X)=>{const ae=()=>{if(U.isMounted){let{next:re,bu:le,u:Ce,parent:We,vnode:nt}=U;{const It=DS(U);if(It){re&&(re.el=nt.el,K(U,re,X)),It.asyncDep.then(()=>{Un(()=>{U.isUnmounted||Me()},he)});return}}let lt=re,bt;qr(U,!1),re?(re.el=nt.el,K(U,re,X)):re=nt,le&&na(le),(bt=re.props&&re.props.onVnodeBeforeUpdate)&&Bs(bt,We,re,nt),qr(U,!0);const St=xd(U),ct=U.subTree;U.subTree=St,g(ct,St,d(ct.el),_e(ct),U,he,H),re.el=St.el,lt===null&&dh(U,St.el),Ce&&Un(Ce,he),(bt=re.props&&re.props.onVnodeUpdated)&&Un(()=>Bs(bt,We,re,nt),he)}else{let re;const{el:le,props:Ce}=Z,{bm:We,m:nt,parent:lt,root:bt,type:St}=U,ct=Ai(Z);if(qr(U,!1),We&&na(We),!ct&&(re=Ce&&Ce.onVnodeBeforeMount)&&Bs(re,lt,Z),qr(U,!0),le&&Se){const It=()=>{U.subTree=xd(U),Se(le,U.subTree,U,he,null)};ct&&St.__asyncHydrate?St.__asyncHydrate(le,U,It):It()}else{bt.ce&&bt.ce._hasShadowRoot()&&bt.ce._injectChildStyle(St,U.parent?U.parent.type:void 0);const It=U.subTree=xd(U);g(null,It,fe,oe,U,he,H),Z.el=It.el}if(nt&&Un(nt,he),!ct&&(re=Ce&&Ce.onVnodeMounted)){const It=Z;Un(()=>Bs(re,lt,It),he)}(Z.shapeFlag&256||lt&&Ai(lt.vnode)&<.vnode.shapeFlag&256)&&U.a&&Un(U.a,he),U.isMounted=!0,Z=fe=oe=null}};U.scope.on();const ke=U.effect=new zd(ae);U.scope.off();const Me=U.update=ke.run.bind(ke),Ie=U.job=ke.runIfDirty.bind(ke);Ie.i=U,Ie.id=U.uid,ke.scheduler=()=>O1(Ie),qr(U,!0),Me()},K=(U,Z,fe)=>{Z.component=U;const oe=U.vnode.props;U.vnode=Z,U.next=null,n4(U,Z.props,oe,fe),r4(U,Z.children,fe),Ii(),Ny(U),Ni()},V=(U,Z,fe,oe,he,H,X,ae,ke=!1)=>{const Me=U&&U.children,Ie=U?U.shapeFlag:0,re=Z.children,{patchFlag:le,shapeFlag:Ce}=Z;if(le>0){if(le&128){Y(Me,re,fe,oe,he,H,X,ae,ke);return}else if(le&256){se(Me,re,fe,oe,he,H,X,ae,ke);return}}Ce&8?(Ie&16&&ce(Me,he,H),re!==Me&&u(fe,re)):Ie&16?Ce&16?Y(Me,re,fe,oe,he,H,X,ae,ke):ce(Me,he,H,!0):(Ie&8&&u(fe,""),Ce&16&&k(re,fe,oe,he,H,X,ae,ke))},se=(U,Z,fe,oe,he,H,X,ae,ke)=>{U=U||ea,Z=Z||ea;const Me=U.length,Ie=Z.length,re=Math.min(Me,Ie);let le;for(le=0;le<re;le++){const Ce=Z[le]=ke?wi(Z[le]):Fs(Z[le]);g(U[le],Ce,fe,null,he,H,X,ae,ke)}Me>Ie?ce(U,he,H,!0,!1,re):k(Z,fe,oe,he,H,X,ae,ke,re)},Y=(U,Z,fe,oe,he,H,X,ae,ke)=>{let Me=0;const Ie=Z.length;let re=U.length-1,le=Ie-1;for(;Me<=re&&Me<=le;){const Ce=U[Me],We=Z[Me]=ke?wi(Z[Me]):Fs(Z[Me]);if(Fo(Ce,We))g(Ce,We,fe,null,he,H,X,ae,ke);else break;Me++}for(;Me<=re&&Me<=le;){const Ce=U[re],We=Z[le]=ke?wi(Z[le]):Fs(Z[le]);if(Fo(Ce,We))g(Ce,We,fe,null,he,H,X,ae,ke);else break;re--,le--}if(Me>re){if(Me<=le){const Ce=le+1,We=Ce<Ie?Z[Ce].el:oe;for(;Me<=le;)g(null,Z[Me]=ke?wi(Z[Me]):Fs(Z[Me]),fe,We,he,H,X,ae,ke),Me++}}else if(Me>le)for(;Me<=re;)ee(U[Me],he,H,!0),Me++;else{const Ce=Me,We=Me,nt=new Map;for(Me=We;Me<=le;Me++){const $t=Z[Me]=ke?wi(Z[Me]):Fs(Z[Me]);$t.key!=null&&nt.set($t.key,Me)}let lt,bt=0;const St=le-We+1;let ct=!1,It=0;const hn=new Array(St);for(Me=0;Me<St;Me++)hn[Me]=0;for(Me=Ce;Me<=re;Me++){const $t=U[Me];if(bt>=St){ee($t,he,H,!0);continue}let pn;if($t.key!=null)pn=nt.get($t.key);else for(lt=We;lt<=le;lt++)if(hn[lt-We]===0&&Fo($t,Z[lt])){pn=lt;break}pn===void 0?ee($t,he,H,!0):(hn[pn-We]=Me+1,pn>=It?It=pn:ct=!0,g($t,Z[pn],fe,null,he,H,X,ae,ke),bt++)}const vn=ct?c4(hn):ea;for(lt=vn.length-1,Me=St-1;Me>=0;Me--){const $t=We+Me,pn=Z[$t],un=Z[$t+1],et=$t+1<Ie?un.el||BS(un):oe;hn[Me]===0?g(null,pn,fe,et,he,H,X,ae,ke):ct&&(lt<0||Me!==vn[lt]?G(pn,fe,et,2):lt--)}}},G=(U,Z,fe,oe,he=null)=>{const{el:H,type:X,transition:ae,children:ke,shapeFlag:Me}=U;if(Me&6){G(U.component.subTree,Z,fe,oe);return}if(Me&128){U.suspense.move(Z,fe,oe);return}if(Me&64){X.move(U,Z,fe,J);return}if(X===Pe){s(H,Z,fe);for(let re=0;re<ke.length;re++)G(ke[re],Z,fe,oe);s(U.anchor,Z,fe);return}if(X===la){b(U,Z,fe);return}if(oe!==2&&Me&1&&ae)if(oe===0)ae.persisted&&!H[To]?s(H,Z,fe):(ae.beforeEnter(H),s(H,Z,fe),Un(()=>ae.enter(H),he));else{const{leave:re,delayLeave:le,afterLeave:Ce}=ae,We=()=>{U.ctx.isUnmounted?o(H):s(H,Z,fe)},nt=()=>{const lt=H._isLeaving||!!H[To];H._isLeaving&&H[To](!0),ae.persisted&&!lt?We():re(H,()=>{We(),Ce&&Ce()})};le?le(H,We,nt):nt()}else s(H,Z,fe)},ee=(U,Z,fe,oe=!1,he=!1)=>{const{type:H,props:X,ref:ae,children:ke,dynamicChildren:Me,shapeFlag:Ie,patchFlag:re,dirs:le,cacheIndex:Ce,memo:We}=U;if(re===-2&&(he=!1),ae!=null&&(Ii(),oa(ae,null,fe,U,!0),Ni()),Ce!=null&&(Z.renderCache[Ce]=void 0),Ie&256){Z.ctx.deactivate(U);return}const nt=Ie&1&&le,lt=!Ai(U);let bt;if(lt&&(bt=X&&X.onVnodeBeforeUnmount)&&Bs(bt,Z,U),Ie&6)Le(U.component,fe,oe);else{if(Ie&128){U.suspense.unmount(fe,oe);return}nt&&si(U,null,Z,"beforeUnmount"),Ie&64?U.type.remove(U,Z,fe,J,oe):Me&&!Me.hasOnce&&(H!==Pe||re>0&&re&64)?ce(Me,Z,fe,!1,!0):(H===Pe&&re&384||!he&&Ie&16)&&ce(ke,Z,fe),oe&&we(U)}const St=We!=null&&Ce==null;(lt&&(bt=X&&X.onVnodeUnmounted)||nt||St)&&Un(()=>{bt&&Bs(bt,Z,U),nt&&si(U,null,Z,"unmounted"),St&&(U.el=null)},fe)},we=U=>{const{type:Z,el:fe,anchor:oe,transition:he}=U;if(Z===Pe){de(fe,oe);return}if(Z===la){v(U);return}const H=()=>{o(fe),he&&!he.persisted&&he.afterLeave&&he.afterLeave()};if(U.shapeFlag&1&&he&&!he.persisted){const{leave:X,delayLeave:ae}=he,ke=()=>X(fe,H);ae?ae(U.el,H,ke):ke()}else H()},de=(U,Z)=>{let fe;for(;U!==Z;)fe=f(U),o(U),U=fe;o(Z)},Le=(U,Z,fe)=>{const{bum:oe,scope:he,job:H,subTree:X,um:ae,m:ke,a:Me}=U;ef(ke),ef(Me),oe&&na(oe),he.stop(),H&&(H.flags|=8,ee(X,U,Z,fe)),ae&&Un(ae,Z),Un(()=>{U.isUnmounted=!0},Z)},ce=(U,Z,fe,oe=!1,he=!1,H=0)=>{for(let X=H;X<U.length;X++)ee(U[X],Z,fe,oe,he)},_e=U=>{if(U.shapeFlag&6)return _e(U.component.subTree);if(U.shapeFlag&128)return U.suspense.next();const Z=f(U.anchor||U.el),fe=Z&&Z[dS];return fe?f(fe):Z};let me=!1;const $e=(U,Z,fe)=>{let oe;U==null?Z._vnode&&(ee(Z._vnode,null,null,!0),oe=Z._vnode.component):g(Z._vnode||null,U,Z,null,null,null,fe),Z._vnode=U,me||(me=!0,Ny(oe),Zd(),me=!1)},J={p:g,um:ee,m:G,r:we,mt:R,mc:k,pc:V,pbc:I,n:_e,o:e};let ye,Se;return t&&([ye,Se]=t(J)),{render:$e,hydrate:ye,createApp:GE($e,ye)}}function Xp({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 qr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function RS(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function q1(e,t,n=!1){const s=e.children,o=t.children;if(at(s)&&at(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=wi(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&q1(r,l)),l.type===hr&&(l.patchFlag===-1&&(l=o[i]=wi(l)),l.el=r.el),l.type===jn&&!l.el&&(l.el=r.el)}}function c4(e){const t=e.slice(),n=[0];let s,o,i,r,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function DS(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:DS(t)}function ef(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function BS(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?BS(t.subTree):null}const tf=e=>e.__isSuspense;let dg=0;const u4={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)d4(t,n,s,o,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}f4(e,t,n,s,o,r,l,a,c)}},hydrate:h4,normalize:p4},Whe=u4;function Hc(e,t){const n=e.props&&e.props[t];kt(n)&&n()}function d4(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=FS(e,o,s,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,s,f,i,r),f.deps>0?(Hc(e,"onPending"),Hc(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),ra(f,e.ssFallback)):f.resolve(!1,!0)}function f4(e,t,n,s,o,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:p,pendingBranch:g,isInFallback:S,isHydrating:_}=d;if(g)d.pendingBranch=f,Fo(g,f)?(a(g,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():S&&(_||(a(p,h,n,s,o,null,i,r,l),ra(d,h)))):(d.pendingId=dg++,_?(d.isHydrating=!1,d.activeBranch=g):c(g,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),S?(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,s,o,null,i,r,l),ra(d,h))):p&&Fo(p,f)?(a(p,f,n,s,o,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0&&d.resolve()));else if(p&&Fo(p,f))a(p,f,n,s,o,d,i,r,l),ra(d,f);else if(Hc(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=dg++,a(null,f,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:y,pendingId:b}=d;y>0?setTimeout(()=>{d.pendingId===b&&d.fallback(h)},y):y===0&&d.fallback(h)}}function FS(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:g,remove:S}}=c;let _;const y=m4(e);y&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);const b=e.props?qd(e.props.timeout):void 0,v=i,w={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:dg++,timeout:typeof b=="number"?b:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(N=!1,E=!1){const{vnode:k,activeBranch:A,pendingBranch:I,pendingId:P,effects:M,parentComponent:L,container:R,isInFallback:B}=w;let W=!1;if(w.isHydrating)w.isHydrating=!1;else if(!N){W=A&&I.transition&&I.transition.mode==="out-in";let se=!1;W&&(A.transition.afterLeave=()=>{P===w.pendingId&&(f(I,R,i===v&&!se?p(A):i,0),Xd(M),B&&k.ssFallback&&(k.ssFallback.el=null))}),A&&!w.isFallbackMountPending&&(g(A.el)===R&&(i=p(A),se=!0),h(A,L,w,!0),!W&&B&&k.ssFallback&&Un(()=>k.ssFallback.el=null,w)),W||f(I,R,i,0)}w.isFallbackMountPending=!1,ra(w,I),w.pendingBranch=null,w.isInFallback=!1;let K=w.parent,V=!1;for(;K;){if(K.pendingBranch){K.effects.push(...M),V=!0;break}K=K.parent}!V&&!W&&Xd(M),w.effects=[],y&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!E&&t.resolve()),Hc(k,"onResolve")},fallback(N){if(!w.pendingBranch)return;const{vnode:E,activeBranch:k,parentComponent:A,container:I,namespace:P}=w;Hc(E,"onFallback");const M=p(k),L=()=>{w.isFallbackMountPending=!1,w.isInFallback&&(d(null,N,I,M,A,null,P,l,a),ra(w,N))},R=N.transition&&N.transition.mode==="out-in";R&&(w.isFallbackMountPending=!0,k.transition.afterLeave=L),w.isInFallback=!0,h(k,A,null,!0),R||L()},move(N,E,k){w.activeBranch&&f(w.activeBranch,N,E,k),w.container=N},next(){return w.activeBranch&&p(w.activeBranch)},registerDep(N,E,k){const A=!!w.pendingBranch;A&&w.deps++;const I=N.vnode.el;N.asyncDep.catch(P=>{xa(P,N,0)}).then(P=>{if(N.isUnmounted||w.isUnmounted||w.pendingId!==N.suspenseId)return;Wc(),N.asyncResolved=!0;const{vnode:M}=N;fg(N,P,!1),I&&(M.el=I);const L=!I&&N.subTree.el;E(N,M,g(I||N.subTree.el),I?null:p(N.subTree),w,r,k),L&&(M.placeholder=null,S(L)),dh(N,M.el),A&&--w.deps===0&&w.resolve()})},unmount(N,E){w.isUnmounted=!0,w.activeBranch&&h(w.activeBranch,n,N,E),w.pendingBranch&&h(w.pendingBranch,n,N,E)}};return w}function h4(e,t,n,s,o,i,r,l,a){const c=t.suspense=FS(t,s,n,e.parentNode,document.createElement("div"),null,o,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function p4(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=Vy(s?n.default:n),e.ssFallback=s?Vy(n.fallback):gt(jn)}function Vy(e){let t;if(kt(e)){const n=cl&&e._c;n&&(e._d=!1,x()),e=e(),n&&(e._d=!0,t=ws,WS())}return at(e)&&(e=ZE(e)),e=Fs(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function HS(e,t){t&&t.pendingBranch?at(e)?t.effects.push(...e):t.effects.push(e):Xd(e)}function ra(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,s&&s.subTree===n&&(s.vnode.el=o,dh(s,o))}function m4(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),hr=Symbol.for("v-txt"),jn=Symbol.for("v-cmt"),la=Symbol.for("v-stc"),_c=[];let ws=null;function x(e=!1){_c.push(ws=e?null:[])}function WS(){_c.pop(),ws=_c[_c.length-1]||null}let cl=1;function nf(e,t=!1){cl+=e,e<0&&ws&&t&&(ws.hasOnce=!0)}function US(e){return e.dynamicChildren=cl>0?ws||ea:null,WS(),cl>0&&ws&&ws.push(e),e}function $(e,t,n,s,o,i){return US(m(e,t,n,s,o,i,!0))}function je(e,t,n,s,o){return US(gt(e,t,n,s,o,!0))}function yr(e){return e?e.__v_isVNode===!0:!1}function Fo(e,t){return e.type===t.type&&e.key===t.key}function Uhe(e){}const jS=({key:e})=>e??null,Td=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?rn(e)||Bn(e)||kt(e)?{i:us,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,s=0,o=null,i=e===Pe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&jS(t),ref:t&&Td(t),scopeId:ah,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:us};return l?(z1(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=rn(n)?8:16),cl>0&&!r&&ws&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&ws.push(a),a}const gt=g4;function g4(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===bS)&&(e=jn),yr(e)){const l=Oi(e,t,!0);return n&&z1(l,n),cl>0&&!i&&ws&&(l.shapeFlag&6?ws[ws.indexOf(e)]=l:ws.push(l)),l.patchFlag=-2,l}if(w4(e)&&(e=e.__vccOpts),t){t=v4(t);let{class:l,style:a}=t;l&&!rn(l)&&(t.class=Oe(l)),Gt(a)&&(lh(a)&&!at(a)&&(a=nn({},a)),t.style=Ft(a))}const r=rn(e)?1:tf(e)?128:fS(e)?64:Gt(e)?4:kt(e)?2:0;return m(e,t,n,s,o,r,i,!0)}function v4(e){return e?lh(e)||ES(e)?nn({},e):e:null}function Oi(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?tn(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&jS(c),ref:t&&t.ref?n&&i?at(i)?i.concat(Td(t)):[i,Td(t)]:Td(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!==Pe?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&&Oi(e.ssContent),ssFallback:e.ssFallback&&Oi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&vr(u,a.clone(u)),u}function dt(e=" ",t=0){return gt(hr,null,e,t)}function kr(e,t){const n=gt(la,null,e);return n.staticCount=t,n}function ie(e="",t=!1){return t?(x(),je(jn,null,e)):gt(jn,null,e)}function Fs(e){return e==null||typeof e=="boolean"?gt(jn):at(e)?gt(Pe,null,e.slice()):yr(e)?wi(e):gt(hr,null,String(e))}function wi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Oi(e)}function z1(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(at(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),z1(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!ES(t)?t._ctx=us:o===3&&us&&(us.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else kt(t)?(t={default:t,_ctx:us},n=32):(t=String(t),s&64?(n=16,t=[dt(t)]):n=8);e.children=t,e.shapeFlag|=n}function tn(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=Oe([t.class,s.class]));else if(o==="style")t.style=Ft([t.style,s.style]);else if(ru(o)){const i=t[o],r=s[o];r&&i!==r&&!(at(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Yf(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function Bs(e,t,n,s=null){Lo(e,t,7,[n,s])}const y4=SS();let k4=0;function qS(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||y4,i={uid:k4++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new F2(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:IS(s,o),emitsOptions:xS(s,o),emit:null,emitted:null,propsDefaults:Lt,inheritAttrs:s.inheritAttrs,ctx:Lt,data:Lt,props:Lt,attrs:Lt,slots:Lt,refs:Lt,setupState:Lt,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=YE.bind(null,i),e.ce&&e.ce(i),i}let as=null;const ds=()=>as||us;let sf,aa;{const e=th(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};sf=t("__VUE_INSTANCE_SETTERS__",n=>as=n),aa=t("__VUE_SSR_SETTERS__",n=>ul=n)}const Ta=e=>{const t=as;return sf(e),e.scope.on(),()=>{e.scope.off(),sf(t)}},Wc=()=>{as&&as.scope.off(),sf(null)};function zS(e){return e.vnode.shapeFlag&4}let ul=!1;function VS(e,t=!1,n=!1){t&&aa(t);const{props:s,children:o}=e.vnode,i=zS(e);t4(e,s,i,t),i4(e,o,n||t);const r=i?b4(e,t):void 0;return t&&aa(!1),r}function b4(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,lg);const{setup:s}=n;if(s){Ii();const o=e.setupContext=s.length>1?GS(e):null,i=Ta(e),r=lu(s,e,0,[e.props,o]),l=A1(r);if(Ni(),i(),(l||e.sp)&&!Ai(e)&&R1(e),l){if(r.then(Wc,Wc),t)return r.then(a=>{fg(e,a,t)}).catch(a=>{xa(a,e,0)});e.asyncDep=r}else fg(e,r,t)}else KS(e,t)}function fg(e,t,n){kt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Gt(t)&&(e.setupState=sS(t)),KS(e,n)}let of,hg;function jhe(e){of=e,hg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,WE))}}const qhe=()=>!of;function KS(e,t,n){const s=e.type;if(!e.render){if(!t&&of&&!s.render){const o=s.template||W1(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=nn(nn({isCustomElement:i,delimiters:l},r),a);s.render=of(o,c)}}e.render=s.render||Io,hg&&hg(e)}{const o=Ta(e);Ii();try{UE(e)}finally{Ni(),o()}}}const _4={get(e,t){return bs(e,"get",""),e[t]}};function GS(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,_4),slots:e.slots,emit:e.emit,expose:t}}function du(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(sS(cr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in bc)return bc[n](e)},has(t,n){return n in t||n in bc}})):e.proxy}function pg(e,t=!0){return kt(e)?e.displayName||e.name:e.name||t&&e.__name}function w4(e){return kt(e)&&"__vccOpts"in e}const F=(e,t)=>oE(e,t,ul);function Jt(e,t,n){try{nf(-1);const s=arguments.length;return s===2?Gt(t)&&!at(t)?yr(t)?gt(e,null,[t]):gt(e,t):gt(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&yr(n)&&(n=[n]),gt(e,t,n))}finally{nf(1)}}function zhe(){}function Vhe(e,t,n,s){const o=n[s];if(o&&S4(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function S4(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(ls(n[s],t[s]))return!1;return cl>0&&ws&&ws.push(e),!0}const C4="3.5.35",Khe=Io,Ghe=cE,Yhe=zl,Xhe=cS,x4={createComponentInstance:qS,setupComponent:VS,renderComponentRoot:xd,setCurrentRenderingInstance:Dc,isVNode:yr,normalizeVNode:Fs,getComponentPublicInstance:du,ensureValidVNode:H1,pushWarningContext:lE,popWarningContext:aE},Zhe=x4,Jhe=null,Qhe=null,epe=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let mg;const Ky=typeof window<"u"&&window.trustedTypes;if(Ky)try{mg=Ky.createPolicy("vue",{createHTML:e=>e})}catch{}const YS=mg?e=>mg.createHTML(e):e=>e,T4="http://www.w3.org/2000/svg",M4="http://www.w3.org/1998/Math/MathML",bi=typeof document<"u"?document:null,Gy=bi&&bi.createElement("template"),A4={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?bi.createElementNS(T4,e):t==="mathml"?bi.createElementNS(M4,e):n?bi.createElement(e,{is:n}):bi.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>bi.createTextNode(e),createComment:e=>bi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>bi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{Gy.innerHTML=YS(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Gy.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Xi="transition",ec="animation",ya=Symbol("_vtc"),XS={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},ZS=nn({},pS,XS),E4=e=>(e.displayName="Transition",e.props=ZS,e),Pi=E4((e,{slots:t})=>Jt(_E,JS(e),t)),zr=(e,t=[])=>{at(e)?e.forEach(n=>n(...t)):e&&e(...t)},Yy=e=>e?at(e)?e.some(t=>t.length>1):e.length>1:!1;function JS(e){const t={};for(const M in e)M in XS||(t[M]=e[M]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=$4(o),g=p&&p[0],S=p&&p[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:b,onLeave:v,onLeaveCancelled:w,onBeforeAppear:N=_,onAppear:E=y,onAppearCancelled:k=b}=t,A=(M,L,R,B)=>{M._enterCancelled=B,sr(M,L?u:l),sr(M,L?c:r),R&&R()},I=(M,L)=>{M._isLeaving=!1,sr(M,d),sr(M,h),sr(M,f),L&&L()},P=M=>(L,R)=>{const B=M?E:y,W=()=>A(L,M,R);zr(B,[L,W]),Xy(()=>{sr(L,M?a:i),ei(L,M?u:l),Yy(B)||Zy(L,s,g,W)})};return nn(t,{onBeforeEnter(M){zr(_,[M]),ei(M,i),ei(M,r)},onBeforeAppear(M){zr(N,[M]),ei(M,a),ei(M,c)},onEnter:P(!1),onAppear:P(!0),onLeave(M,L){M._isLeaving=!0;const R=()=>I(M,L);ei(M,d),M._enterCancelled?(ei(M,f),gg(M)):(gg(M),ei(M,f)),Xy(()=>{M._isLeaving&&(sr(M,d),ei(M,h),Yy(v)||Zy(M,s,S,R))}),zr(v,[M,R])},onEnterCancelled(M){A(M,!1,void 0,!0),zr(b,[M])},onAppearCancelled(M){A(M,!0,void 0,!0),zr(k,[M])},onLeaveCancelled(M){I(M),zr(w,[M])}})}function $4(e){if(e==null)return null;if(Gt(e))return[Zp(e.enter),Zp(e.leave)];{const t=Zp(e);return[t,t]}}function Zp(e){return qd(e)}function ei(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ya]||(e[ya]=new Set)).add(t)}function sr(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[ya];n&&(n.delete(t),n.size||(e[ya]=void 0))}function Xy(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let I4=0;function Zy(e,t,n,s){const o=e._endId=++I4,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=QS(e,t);if(!r)return s();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 QS(e,t){const n=window.getComputedStyle(e),s=p=>(n[p]||"").split(", "),o=s(`${Xi}Delay`),i=s(`${Xi}Duration`),r=Jy(o,i),l=s(`${ec}Delay`),a=s(`${ec}Duration`),c=Jy(l,a);let u=null,d=0,f=0;t===Xi?r>0&&(u=Xi,d=r,f=i.length):t===ec?c>0&&(u=ec,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Xi:ec:null,f=u?u===Xi?i.length:a.length:0);const h=u===Xi&&/\b(?:transform|all)(?:,|$)/.test(s(`${Xi}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function Jy(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Qy(n)+Qy(e[s])))}function Qy(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function gg(e){return(e?e.ownerDocument:document).body.offsetHeight}function N4(e,t,n){const s=e[ya];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const rf=Symbol("_vod"),eC=Symbol("_vsh"),Ho={name:"show",beforeMount(e,{value:t},{transition:n}){e[rf]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):tc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),tc(e,!0),s.enter(e)):s.leave(e,()=>{tc(e,!1)}):tc(e,t))},beforeUnmount(e,{value:t}){tc(e,t)}};function tc(e,t){e.style.display=t?e[rf]:"none",e[eC]=!t}function L4(){Ho.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const tC=Symbol("");function tpe(e){const t=ds();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>lf(i,o))},s=()=>{const o=e(t.proxy);t.ce?lf(t.ce,o):vg(t.subTree,o),n(o)};kS(()=>{Xd(s)}),Qt(()=>{Ve(s,Io,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),Ht(()=>o.disconnect())})}function vg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{vg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)lf(e.el,t);else if(e.type===Pe)e.children.forEach(n=>vg(n,t));else if(e.type===la){let{el:n,anchor:s}=e;for(;n&&(lf(n,t),n!==s);)n=n.nextSibling}}function lf(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=$A(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[tC]=s}}const O4=/(?:^|;)\s*display\s*:/;function P4(e,t,n){const s=e.style,o=rn(n);let i=!1;if(n&&!o){if(t)if(rn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&dc(s,l,"")}else for(const r in t)n[r]==null&&dc(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?D4(e,r,!rn(t)&&t?t[r]:void 0,l)||dc(s,r,l):dc(s,r,"")}}else if(o){if(t!==n){const r=s[tC];r&&(n+=";"+r),s.cssText=n,i=O4.test(n)}}else t&&e.removeAttribute("style");rf in e&&(e[rf]=i?s.display:"",e[eC]&&(s.display="none"))}const ek=/\s*!important$/;function dc(e,t,n){if(at(n))n.forEach(s=>dc(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=R4(e,t);ek.test(n)?e.setProperty(Hs(s),n.replace(ek,""),"important"):e[s]=n}}const tk=["Webkit","Moz","ms"],Jp={};function R4(e,t){const n=Jp[t];if(n)return n;let s=Zn(t);if(s!=="filter"&&s in e)return Jp[t]=s;s=Qf(s);for(let o=0;o<tk.length;o++){const i=tk[o]+s;if(i in e)return Jp[t]=i}return t}function D4(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&rn(s)&&n===s}const nk="http://www.w3.org/1999/xlink";function sk(e,t,n,s,o,i=AA(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(nk,t.slice(6,t.length)):e.setAttributeNS(nk,t,n):n==null||i&&!R2(n)?e.removeAttribute(t):e.setAttribute(t,i?"":fo(n)?String(n):n)}function ok(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?YS(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=R2(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function xi(e,t,n,s){e.addEventListener(t,n,s)}function B4(e,t,n,s){e.removeEventListener(t,n,s)}const ik=Symbol("_vei");function F4(e,t,n,s,o=null){const i=e[ik]||(e[ik]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=H4(t);if(s){const c=i[t]=j4(s,o);xi(e,l,c,a)}else r&&(B4(e,l,r,a),i[t]=void 0)}}const rk=/(?:Once|Passive|Capture)$/;function H4(e){let t;if(rk.test(e)){t={};let s;for(;s=e.match(rk);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Hs(e.slice(2)),t]}let Qp=0;const W4=Promise.resolve(),U4=()=>Qp||(W4.then(()=>Qp=0),Qp=Date.now());function j4(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(at(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&Lo(c,t,5,l)}}else Lo(o,t,5,[s])};return n.value=e,n.attached=U4(),n}const lk=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,q4=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?N4(e,s,r):t==="style"?P4(e,n,s):ru(t)?Yf(t)||F4(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):z4(e,t,s,r))?(ok(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&sk(e,t,s,r,i,t!=="value")):e._isVueCE&&(V4(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!rn(s)))?ok(e,Zn(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),sk(e,t,s,r))};function z4(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&lk(t)&&kt(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return lk(t)&&rn(n)?!1:t in e}function V4(e,t){const n=e._def.props;if(!n)return!1;const s=Zn(t);return Array.isArray(n)?n.some(o=>Zn(o)===s):Object.keys(n).some(o=>Zn(o)===s)}const ak={};function K4(e,t,n){let s=Xe(e,t);Xf(s)&&(s=nn({},s,t));class o extends V1{constructor(r){super(s,r,n)}}return o.def=s,o}const npe=((e,t)=>K4(e,t,c$)),G4=typeof HTMLElement<"u"?HTMLElement:class{};class V1 extends G4{constructor(t,n={},s=df){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&s!==df?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(nn({},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 V1){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,ft(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!at(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=qd(this._props[a])),(l||(l=Object.create(null)))[Zn(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)Kt(this,s)||Object.defineProperty(this,s,{get:()=>C(n[s])})}_resolveProps(t){const{props:n}=t,s=at(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(Zn))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(i){this._setProp(o,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):ak;const o=Zn(t);n&&this._numberProps&&this._numberProps[o]&&(s=qd(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===ak?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Hs(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Hs(t),n+""):n||this.removeAttribute(Hs(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),a$(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=gt(this._def,nn(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,Xf(r[0])?nn({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),Hs(i)!==i&&o(Hs(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function Y4(e){const t=ds(),n=t&&t.ce;return n||null}function spe(){const e=Y4();return e&&e.shadowRoot}function ope(e="$style"){{const t=ds();if(!t)return Lt;const n=t.type.__cssModules;if(!n)return Lt;const s=n[e];return s||Lt}}const nC=new WeakMap,sC=new WeakMap,af=Symbol("_moveCb"),ck=Symbol("_enterCb"),X4=e=>(delete e.props.mode,e),Z4=X4({name:"TransitionGroup",props:nn({},ZS,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ds(),s=hS();let o,i;return D1(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!t$(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(J4),o.forEach(Q4);const l=o.filter(e$);gg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;ei(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[af]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[af]=null,sr(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=Bt(e),l=JS(r);let a=r.tag||Pe;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),vr(u,Bc(u,l,s,n)),nC.set(u,oC(u.el)))}i=t.default?P1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&vr(u,Bc(u,l,s,n))}return gt(a,null,i)}}}),ipe=Z4;function J4(e){const t=e.el;t[af]&&t[af](),t[ck]&&t[ck]()}function Q4(e){sC.set(e,oC(e.el))}function e$(e){const t=nC.get(e),n=sC.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${s/a}px,${o/c}px)`,r.transitionDuration="0s",e}}function oC(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function t$(e,t,n){const s=e.cloneNode(),o=e[ya];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(s);const{hasTransform:r}=QS(s);return i.removeChild(s),r}const br=e=>{const t=e.props["onUpdate:modelValue"]||!1;return at(t)?n=>na(t,n):t};function n$(e){e.target.composing=!0}function uk(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const No=Symbol("_assign");function dk(e,t,n){return t&&(e=e.trim()),n&&(e=eh(e)),e}const xn={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[No]=br(o);const i=s||o.props&&o.props.type==="number";xi(e,t?"change":"input",r=>{r.target.composing||e[No](dk(e.value,n,i))}),(n||i)&&xi(e,"change",()=>{e.value=dk(e.value,n,i)}),t||(xi(e,"compositionstart",n$),xi(e,"compositionend",uk),xi(e,"change",uk))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[No]=br(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?eh(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},cf={deep:!0,created(e,t,n){e[No]=br(n),xi(e,"change",()=>{const s=e._modelValue,o=ka(e),i=e.checked,r=e[No];if(at(s)){const l=nh(s,o),a=l!==-1;if(i&&!a)r(s.concat(o));else if(!i&&a){const c=[...s];c.splice(l,1),r(c)}}else if(fl(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(rC(e,i))})},mounted:fk,beforeUpdate(e,t,n){e[No]=br(n),fk(e,t,n)}};function fk(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(at(t))o=nh(t,s.props.value)>-1;else if(fl(t))o=t.has(s.props.value);else{if(t===n)return;o=$i(t,rC(e,!0))}e.checked!==o&&(e.checked=o)}const iC={created(e,{value:t},n){e.checked=$i(t,n.props.value),e[No]=br(n),xi(e,"change",()=>{e[No](ka(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[No]=br(s),t!==n&&(e.checked=$i(t,s.props.value))}},uf={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=fl(t);xi(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?eh(ka(r)):ka(r));e[No](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,ft(()=>{e._assigning=!1})}),e[No]=br(s)},mounted(e,{value:t}){hk(e,t)},beforeUpdate(e,t,n){e[No]=br(n)},updated(e,{value:t}){e._assigning||hk(e,t)}};function hk(e,t){const n=e.multiple,s=at(t);if(!(n&&!s&&!fl(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=ka(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=nh(t,l)>-1}else r.selected=t.has(l);else if($i(ka(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ka(e){return"_value"in e?e._value:e.value}function rC(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const s$={created(e,t,n){Qu(e,t,n,null,"created")},mounted(e,t,n){Qu(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){Qu(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){Qu(e,t,n,s,"updated")}};function lC(e,t){switch(e){case"SELECT":return uf;case"TEXTAREA":return xn;default:switch(t){case"checkbox":return cf;case"radio":return iC;default:return xn}}}function Qu(e,t,n,s,o){const r=lC(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function o$(){xn.getSSRProps=({value:e})=>({value:e}),iC.getSSRProps=({value:e},t)=>{if(t.props&&$i(t.props.value,e))return{checked:!0}},cf.getSSRProps=({value:e},t)=>{if(at(e)){if(t.props&&nh(e,t.props.value)>-1)return{checked:!0}}else if(fl(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},s$.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=lC(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const i$=["ctrl","shift","alt","meta"],r$={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)=>i$.some(n=>e[`${n}Key`]&&!t.includes(n))},Ze=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const l=r$[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},l$={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Eo=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=Hs(o.key);if(t.some(r=>r===i||l$[r]===i))return e(o)}))},aC=nn({patchProp:q4},A4);let wc,pk=!1;function cC(){return wc||(wc=l4(aC))}function uC(){return wc=pk?wc:a4(aC),pk=!0,wc}const a$=((...e)=>{cC().render(...e)}),rpe=((...e)=>{uC().hydrate(...e)}),df=((...e)=>{const t=cC().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=fC(s);if(!o)return;const i=t._component;!kt(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,dC(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),c$=((...e)=>{const t=uC().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=fC(s);if(o)return n(o,!0,dC(o))},t});function dC(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function fC(e){return rn(e)?document.querySelector(e):e}let mk=!1;const lpe=()=>{mk||(mk=!0,o$(),L4())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function u$(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const ff=typeof window<"u",xr=(e,t=!1)=>t?Symbol.for(e):Symbol(e),d$=(e,t,n)=>f$({l:e,k:t,s:n}),f$=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),qn=e=>typeof e=="number"&&isFinite(e),hC=e=>G1(e)==="[object Date]",ba=e=>G1(e)==="[object RegExp]",fh=e=>Rt(e)&&Object.keys(e).length===0,zn=Object.assign,h$=Object.create,on=(e=null)=>h$(e);let gk;const tl=()=>gk||(gk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:on());function vk(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function p$(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const m$=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,g$=/^(?:href|src|action|formaction)$/i;function K1(e){return m$.test(e)}function v$(e){const t=/url\s*\(/gi;let n="",s=0,o;for(;(o=t.exec(e))!==null;){const i=o.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const 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(s,i),n+=K1(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function yk(e,t){if(g$.test(e)&&K1(t))return"about:blank";const n=e.toLowerCase()==="style"?v$(t):t;return p$(n)}function y$(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${yk(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${yk(s,o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,s,o)=>K1(o)?`${s}about:blank`:n),e}const k$=Object.prototype.hasOwnProperty;function $o(e,t){return k$.call(e,t)}const In=Array.isArray,bn=e=>typeof e=="function",it=e=>typeof e=="string",Ut=e=>typeof e=="boolean",jt=e=>e!==null&&typeof e=="object",b$=e=>jt(e)&&bn(e.then)&&bn(e.catch),pC=Object.prototype.toString,G1=e=>pC.call(e),Rt=e=>G1(e)==="[object Object]",_$=e=>e==null?"":In(e)||Rt(e)&&e.toString===pC?JSON.stringify(e,null,2):String(e);function Y1(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const ed=e=>!jt(e)||In(e);function Md(e,t){if(ed(e)||ed(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:o}=n.pop();Object.keys(s).forEach(i=>{i!=="__proto__"&&(jt(s[i])&&!jt(o[i])&&(o[i]=Array.isArray(s[i])?[]:on()),ed(o[i])||ed(s[i])?o[i]=s[i]:n.push({src:s[i],des:o[i]}))})}}/*!
|
|
25
|
-
* message-compiler v11.4.5
|
|
26
|
-
* (c) 2026 kazuya kawaguchi
|
|
27
|
-
* Released under the MIT License.
|
|
28
|
-
*/function w$(e,t,n){return{line:e,column:t,offset:n}}function yg(e,t,n){return{start:e,end:t}}const Zt={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},S$=17;function hh(e,t,n={}){const{domain:s,messages:o,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=s,l}function C$(e){throw e}const Jo=" ",x$="\r",vs=`
|
|
29
|
-
`,T$="\u2028",M$="\u2029";function A$(e){const t=e;let n=0,s=1,o=1,i=0;const r=E=>t[E]===x$&&t[E+1]===vs,l=E=>t[E]===vs,a=E=>t[E]===M$,c=E=>t[E]===T$,u=E=>r(E)||l(E)||a(E)||c(E),d=()=>n,f=()=>s,h=()=>o,p=()=>i,g=E=>r(E)||a(E)||c(E)?vs:t[E],S=()=>g(n),_=()=>g(n+i);function y(){return i=0,u(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function b(){return r(n+i)&&i++,i++,t[n+i]}function v(){n=0,s=1,o=1,i=0}function w(E=0){i=E}function N(){const E=n+i;for(;E!==n;)y();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:g,currentChar:S,currentPeek:_,next:y,peek:b,reset:v,resetPeek:w,skipToPeek:N}}const ki=void 0,E$=".",kk="'",$$="tokenizer";function I$(e,t={}){const n=t.location!==!1,s=A$(e),o=()=>s.index(),i=()=>w$(s.line(),s.column(),s.index()),r=i(),l=o(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(H,X,ae,...ke){const Me=c();if(X.column+=ae,X.offset+=ae,u){const Ie=n?yg(Me.startLoc,X):null,re=hh(H,Ie,{domain:$$,args:ke});u(re)}}function f(H,X,ae){H.endLoc=i(),H.currentType=X;const ke={type:X};return n&&(ke.loc=yg(H.startLoc,H.endLoc)),ae!=null&&(ke.value=ae),ke}const h=H=>f(H,13);function p(H,X){return H.currentChar()===X?(H.next(),X):(d(Zt.EXPECTED_TOKEN,i(),0,X),"")}function g(H){let X="";for(;H.currentPeek()===Jo||H.currentPeek()===vs;)X+=H.currentPeek(),H.peek();return X}function S(H){const X=g(H);return H.skipToPeek(),X}function _(H){if(H===ki)return!1;const X=H.charCodeAt(0);return X>=97&&X<=122||X>=65&&X<=90||X===95}function y(H){if(H===ki)return!1;const X=H.charCodeAt(0);return X>=48&&X<=57}function b(H,X){const{currentType:ae}=X;if(ae!==2)return!1;g(H);const ke=_(H.currentPeek());return H.resetPeek(),ke}function v(H,X){const{currentType:ae}=X;if(ae!==2)return!1;g(H);const ke=H.currentPeek()==="-"?H.peek():H.currentPeek(),Me=y(ke);return H.resetPeek(),Me}function w(H,X){const{currentType:ae}=X;if(ae!==2)return!1;g(H);const ke=H.currentPeek()===kk;return H.resetPeek(),ke}function N(H,X){const{currentType:ae}=X;if(ae!==7)return!1;g(H);const ke=H.currentPeek()===".";return H.resetPeek(),ke}function E(H,X){const{currentType:ae}=X;if(ae!==8)return!1;g(H);const ke=_(H.currentPeek());return H.resetPeek(),ke}function k(H,X){const{currentType:ae}=X;if(!(ae===7||ae===11))return!1;g(H);const ke=H.currentPeek()===":";return H.resetPeek(),ke}function A(H,X){const{currentType:ae}=X;if(ae!==9)return!1;const ke=()=>{const Ie=H.currentPeek();return Ie==="{"?_(H.peek()):Ie==="@"||Ie==="|"||Ie===":"||Ie==="."||Ie===Jo||!Ie?!1:Ie===vs?(H.peek(),ke()):P(H,!1)},Me=ke();return H.resetPeek(),Me}function I(H){g(H);const X=H.currentPeek()==="|";return H.resetPeek(),X}function P(H,X=!0){const ae=(Me=!1,Ie="")=>{const re=H.currentPeek();return re==="{"||re==="@"||!re?Me:re==="|"?!(Ie===Jo||Ie===vs):re===Jo?(H.peek(),ae(!0,Jo)):re===vs?(H.peek(),ae(!0,vs)):!0},ke=ae();return X&&H.resetPeek(),ke}function M(H,X){const ae=H.currentChar();return ae===ki?ki:X(ae)?(H.next(),ae):null}function L(H){const X=H.charCodeAt(0);return X>=97&&X<=122||X>=65&&X<=90||X>=48&&X<=57||X===95||X===36}function R(H){return M(H,L)}function B(H){const X=H.charCodeAt(0);return X>=97&&X<=122||X>=65&&X<=90||X>=48&&X<=57||X===95||X===36||X===45}function W(H){return M(H,B)}function K(H){const X=H.charCodeAt(0);return X>=48&&X<=57}function V(H){return M(H,K)}function se(H){const X=H.charCodeAt(0);return X>=48&&X<=57||X>=65&&X<=70||X>=97&&X<=102}function Y(H){return M(H,se)}function G(H){let X="",ae="";for(;X=V(H);)ae+=X;return ae}function ee(H){let X="";for(;;){const ae=H.currentChar();if(ae==="\\"){const ke=H.peek();ke==="{"||ke==="}"||ke==="@"||ke==="|"||ke==="\\"?(X+=ae+ke,H.next(),H.next()):(H.resetPeek(),X+=ae,H.next())}else{if(ae==="{"||ae==="}"||ae==="@"||ae==="|"||!ae)break;if(ae===Jo||ae===vs)if(P(H))X+=ae,H.next();else{if(I(H))break;X+=ae,H.next()}else X+=ae,H.next()}}return X}function we(H){S(H);let X="",ae="";for(;X=W(H);)ae+=X;const ke=H.currentChar();if(ke&&ke!=="}"&&ke!==ki&&ke!==Jo&&ke!==vs&&ke!==" "){const Me=J(H);return d(Zt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,ae+Me),ae+Me}return H.currentChar()===ki&&d(Zt.UNTERMINATED_CLOSING_BRACE,i(),0),ae}function de(H){S(H);let X="";return H.currentChar()==="-"?(H.next(),X+=`-${G(H)}`):X+=G(H),H.currentChar()===ki&&d(Zt.UNTERMINATED_CLOSING_BRACE,i(),0),X}function Le(H){return H!==kk&&H!==vs}function ce(H){S(H),p(H,"'");let X="",ae="";for(;X=M(H,Le);)X==="\\"?ae+=_e(H):ae+=X;const ke=H.currentChar();return ke===vs||ke===ki?(d(Zt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ke===vs&&(H.next(),p(H,"'")),ae):(p(H,"'"),ae)}function _e(H){const X=H.currentChar();switch(X){case"\\":case"'":return H.next(),`\\${X}`;case"u":return me(H,X,4);case"U":return me(H,X,6);default:return d(Zt.UNKNOWN_ESCAPE_SEQUENCE,i(),0,X),""}}function me(H,X,ae){p(H,X);let ke="";for(let Me=0;Me<ae;Me++){const Ie=Y(H);if(!Ie){d(Zt.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${X}${ke}${H.currentChar()}`);break}ke+=Ie}return`\\${X}${ke}`}function $e(H){return H!=="{"&&H!=="}"&&H!==Jo&&H!==vs}function J(H){S(H);let X="",ae="";for(;X=M(H,$e);)ae+=X;return ae}function ye(H){let X="",ae="";for(;X=R(H);)ae+=X;return ae}function Se(H){const X=ae=>{const ke=H.currentChar();return ke==="{"||ke==="@"||ke==="|"||ke==="("||ke===")"||!ke||ke===Jo?ae:(ae+=ke,H.next(),X(ae))};return X("")}function U(H){S(H);const X=p(H,"|");return S(H),X}function Z(H,X){let ae=null;switch(H.currentChar()){case"{":return X.braceNest>=1&&d(Zt.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),H.next(),ae=f(X,2,"{"),S(H),X.braceNest++,ae;case"}":return X.braceNest>0&&X.currentType===2&&d(Zt.EMPTY_PLACEHOLDER,i(),0),H.next(),ae=f(X,3,"}"),X.braceNest--,X.braceNest>0&&S(H),X.inLinked&&X.braceNest===0&&(X.inLinked=!1),ae;case"@":return X.braceNest>0&&d(Zt.UNTERMINATED_CLOSING_BRACE,i(),0),ae=fe(H,X)||h(X),X.braceNest=0,ae;default:{let Me=!0,Ie=!0,re=!0;if(I(H))return X.braceNest>0&&d(Zt.UNTERMINATED_CLOSING_BRACE,i(),0),ae=f(X,1,U(H)),X.braceNest=0,X.inLinked=!1,ae;if(X.braceNest>0&&(X.currentType===4||X.currentType===5||X.currentType===6))return d(Zt.UNTERMINATED_CLOSING_BRACE,i(),0),X.braceNest=0,oe(H,X);if(Me=b(H,X))return ae=f(X,4,we(H)),S(H),ae;if(Ie=v(H,X))return ae=f(X,5,de(H)),S(H),ae;if(re=w(H,X))return ae=f(X,6,ce(H)),S(H),ae;if(!Me&&!Ie&&!re)return ae=f(X,12,J(H)),d(Zt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,ae.value),S(H),ae;break}}return ae}function fe(H,X){const{currentType:ae}=X;let ke=null;const Me=H.currentChar();switch((ae===7||ae===8||ae===11||ae===9)&&(Me===vs||Me===Jo)&&d(Zt.INVALID_LINKED_FORMAT,i(),0),Me){case"@":return H.next(),ke=f(X,7,"@"),X.inLinked=!0,ke;case".":return S(H),H.next(),f(X,8,".");case":":return S(H),H.next(),f(X,9,":");default:return I(H)?(ke=f(X,1,U(H)),X.braceNest=0,X.inLinked=!1,ke):N(H,X)||k(H,X)?(S(H),fe(H,X)):E(H,X)?(S(H),f(X,11,ye(H))):A(H,X)?(S(H),Me==="{"?Z(H,X)||ke:f(X,10,Se(H))):(ae===7&&d(Zt.INVALID_LINKED_FORMAT,i(),0),X.braceNest=0,X.inLinked=!1,oe(H,X))}}function oe(H,X){let ae={type:13};if(X.braceNest>0)return Z(H,X)||h(X);if(X.inLinked)return fe(H,X)||h(X);switch(H.currentChar()){case"{":return Z(H,X)||h(X);case"}":return d(Zt.UNBALANCED_CLOSING_BRACE,i(),0),H.next(),f(X,3,"}");case"@":return fe(H,X)||h(X);default:{if(I(H))return ae=f(X,1,U(H)),X.braceNest=0,X.inLinked=!1,ae;if(P(H))return f(X,0,ee(H));break}}return ae}function he(){const{currentType:H,offset:X,startLoc:ae,endLoc:ke}=a;return a.lastType=H,a.lastOffset=X,a.lastStartLoc=ae,a.lastEndLoc=ke,a.offset=o(),a.startLoc=i(),s.currentChar()===ki?f(a,13):oe(s,a)}return{nextToken:he,currentOffset:o,currentPosition:i,context:c}}const N$="parser",L$=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,O$=/\\([\\@{}|])/g;function P$(e,t){return t}function R$(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function D$(e={}){const t=e.location!==!1,{onError:n}=e;function s(_,y,b,v,...w){const N=_.currentPosition();if(N.offset+=v,N.column+=v,n){const E=t?yg(b,N):null,k=hh(y,E,{domain:N$,args:w});n(k)}}function o(_,y,b){const v={type:_};return t&&(v.start=y,v.end=y,v.loc={start:b,end:b}),v}function i(_,y,b,v){t&&(_.end=y,_.loc&&(_.loc.end=b))}function r(_,y){const b=_.context(),v=o(3,b.offset,b.startLoc);return v.value=y.replace(O$,P$),i(v,_.currentOffset(),_.currentPosition()),v}function l(_,y){const b=_.context(),{lastOffset:v,lastStartLoc:w}=b,N=o(5,v,w);return N.index=parseInt(y,10),_.nextToken(),i(N,_.currentOffset(),_.currentPosition()),N}function a(_,y){const b=_.context(),{lastOffset:v,lastStartLoc:w}=b,N=o(4,v,w);return N.key=y,_.nextToken(),i(N,_.currentOffset(),_.currentPosition()),N}function c(_,y){const b=_.context(),{lastOffset:v,lastStartLoc:w}=b,N=o(9,v,w);return N.value=y.replace(L$,R$),_.nextToken(),i(N,_.currentOffset(),_.currentPosition()),N}function u(_){const y=_.nextToken(),b=_.context(),{lastOffset:v,lastStartLoc:w}=b,N=o(8,v,w);return y.type!==11?(s(_,Zt.UNEXPECTED_EMPTY_LINKED_MODIFIER,b.lastStartLoc,0),N.value="",i(N,v,w),{nextConsumeToken:y,node:N}):(y.value==null&&s(_,Zt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Qo(y)),N.value=y.value||"",i(N,_.currentOffset(),_.currentPosition()),{node:N})}function d(_,y){const b=_.context(),v=o(7,b.offset,b.startLoc);return v.value=y,i(v,_.currentOffset(),_.currentPosition()),v}function f(_){const y=_.context(),b=o(6,y.offset,y.startLoc);let v=_.nextToken();if(v.type===8){const w=u(_);b.modifier=w.node,v=w.nextConsumeToken||_.nextToken()}switch(v.type!==9&&s(_,Zt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Qo(v)),v=_.nextToken(),v.type===2&&(v=_.nextToken()),v.type){case 10:v.value==null&&s(_,Zt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Qo(v)),b.key=d(_,v.value||"");break;case 4:v.value==null&&s(_,Zt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Qo(v)),b.key=a(_,v.value||"");break;case 5:v.value==null&&s(_,Zt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Qo(v)),b.key=l(_,v.value||"");break;case 6:v.value==null&&s(_,Zt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Qo(v)),b.key=c(_,v.value||"");break;default:{s(_,Zt.UNEXPECTED_EMPTY_LINKED_KEY,y.lastStartLoc,0);const w=_.context(),N=o(7,w.offset,w.startLoc);return N.value="",i(N,w.offset,w.startLoc),b.key=N,i(b,w.offset,w.startLoc),{nextConsumeToken:v,node:b}}}return i(b,_.currentOffset(),_.currentPosition()),{node:b}}function h(_){const y=_.context(),b=y.currentType===1?_.currentOffset():y.offset,v=y.currentType===1?y.endLoc:y.startLoc,w=o(2,b,v);w.items=[];let N=null;do{const A=N||_.nextToken();switch(N=null,A.type){case 0:A.value==null&&s(_,Zt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Qo(A)),w.items.push(r(_,A.value||""));break;case 5:A.value==null&&s(_,Zt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Qo(A)),w.items.push(l(_,A.value||""));break;case 4:A.value==null&&s(_,Zt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Qo(A)),w.items.push(a(_,A.value||""));break;case 6:A.value==null&&s(_,Zt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Qo(A)),w.items.push(c(_,A.value||""));break;case 7:{const I=f(_);w.items.push(I.node),N=I.nextConsumeToken||null;break}}}while(y.currentType!==13&&y.currentType!==1);const E=y.currentType===1?y.lastOffset:_.currentOffset(),k=y.currentType===1?y.lastEndLoc:_.currentPosition();return i(w,E,k),w}function p(_,y,b,v){const w=_.context();let N=v.items.length===0;const E=o(1,y,b);E.cases=[],E.cases.push(v);do{const k=h(_);N||(N=k.items.length===0),E.cases.push(k)}while(w.currentType!==13);return N&&s(_,Zt.MUST_HAVE_MESSAGES_IN_PLURAL,b,0),i(E,_.currentOffset(),_.currentPosition()),E}function g(_){const y=_.context(),{offset:b,startLoc:v}=y,w=h(_);return y.currentType===13?w:p(_,b,v,w)}function S(_){const y=I$(_,zn({},e)),b=y.context(),v=o(0,b.offset,b.startLoc);return t&&v.loc&&(v.loc.source=_),v.body=g(y),e.onCacheKey&&(v.cacheKey=e.onCacheKey(_)),b.currentType!==13&&s(y,Zt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,_[b.offset]||""),i(v,y.currentOffset(),y.currentPosition()),v}return{parse:S}}function Qo(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 B$(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function bk(e,t){for(let n=0;n<e.length;n++)X1(e[n],t)}function X1(e,t){switch(e.type){case 1:bk(e.cases,t),t.helper("plural");break;case 2:bk(e.items,t);break;case 6:{X1(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 F$(e,t={}){const n=B$(e);n.helper("normalize"),e.body&&X1(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function H$(e){const t=e.body;return t.type===2?_k(t):t.cases.forEach(n=>_k(n)),e}function _k(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=Y1(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}function Vl(e){switch(e.t=e.type,e.type){case 0:{const t=e;Vl(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)Vl(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)Vl(n[s]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;Vl(t.key),t.k=t.key,delete t.key,t.modifier&&(Vl(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 W$(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(g,S){r.code+=g}function c(g,S=!0){const _=S?s:"";a(o?_+" ".repeat(g):_)}function u(g=!0){const S=++r.indentLevel;g&&c(S)}function d(g=!0){const S=--r.indentLevel;g&&c(S)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function U$(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),_a(e,t.key),t.modifier?(e.push(", "),_a(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function j$(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(_a(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function q$(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(_a(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function z$(e,t){t.body?_a(e,t.body):e.push("null")}function _a(e,t){const{helper:n}=e;switch(t.type){case 0:z$(e,t);break;case 1:q$(e,t);break;case 2:j$(e,t);break;case 6:U$(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 V$=(e,t={})=>{const n=it(t.mode)?t.mode:"normal",s=it(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
-
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=W$(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${Y1(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),_a(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 K$(e,t={}){const n=zn({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=D$(n).parse(e);return s?(i&&H$(l),o&&Vl(l),{ast:l,code:""}):(F$(l,n),V$(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function G$(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(tl().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(tl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function ri(e){return jt(e)&&Z1(e)===0&&($o(e,"b")||$o(e,"body"))}const mC=["b","body"];function Y$(e){return Tr(e,mC)}const gC=["c","cases"];function X$(e){return Tr(e,gC,[])}const vC=["s","static"];function Z$(e){return Tr(e,vC)}const yC=["i","items"];function J$(e){return Tr(e,yC,[])}const kC=["t","type"];function Z1(e){return Tr(e,kC)}const bC=["v","value"];function td(e,t){const n=Tr(e,bC);if(n!=null)return n;throw Uc(t)}const _C=["m","modifier"];function Q$(e){return Tr(e,_C)}const wC=["k","key"];function eI(e){const t=Tr(e,wC);if(t)return t;throw Uc(6)}function Tr(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if($o(e,o)&&e[o]!=null)return e[o]}return n}const SC=[...mC,...gC,...vC,...yC,...wC,..._C,...bC,...kC];function Uc(e){return new Error(`unhandled node type: ${e}`)}function em(e){return n=>tI(n,e)}function tI(e,t){const n=Y$(t);if(n==null)throw Uc(0);if(Z1(n)===1){const i=X$(n);return e.plural(i.reduce((r,l)=>[...r,wk(e,l)],[]))}else return wk(e,n)}function wk(e,t){const n=Z$(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=J$(t).reduce((o,i)=>[...o,kg(e,i)],[]);return e.normalize(s)}}function kg(e,t){const n=Z1(t);switch(n){case 3:return td(t,n);case 9:return td(t,n);case 4:{const s=t;if($o(s,"k")&&s.k)return e.interpolate(e.named(s.k));if($o(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Uc(n)}case 5:{const s=t;if($o(s,"i")&&qn(s.i))return e.interpolate(e.list(s.i));if($o(s,"index")&&qn(s.index))return e.interpolate(e.list(s.index));throw Uc(n)}case 6:{const s=t,o=Q$(s),i=eI(s);return e.linked(kg(e,i),o?kg(e,o):void 0,e.type)}case 7:return td(t,n);case 8:return td(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const nI=e=>e;let nd=on();function sI(e,t={}){let n=!1;const s=t.onError||C$;return t.onError=o=>{n=!0,s(o)},{...K$(e,t),detectError:n}}function oI(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&it(e)){Ut(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||nI)(e),o=nd[s];if(o)return o;const{ast:i,detectError:r}=sI(e,{...t,location:!1,jit:!0}),l=em(i);return r?l:nd[s]=l}else{const n=e.cacheKey;if(n){const s=nd[n];return s||(nd[n]=em(e))}else return em(e)}}let jc=null;function iI(e){jc=e}function rI(e,t,n){jc&&jc.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const lI=aI("function:translate");function aI(e){return t=>jc&&jc.emit(e,t)}const Ti={INVALID_ARGUMENT:S$,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},cI=24;function Mi(e){return hh(e,null,void 0)}function J1(e,t){return t.locale!=null?Sk(t.locale):Sk(e.locale)}let tm;function Sk(e){if(it(e))return e;if(bn(e)){if(e.resolvedOnce&&tm!=null)return tm;if(e.constructor.name==="Function"){const t=e();if(b$(t))throw Mi(Ti.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return tm=t}else throw Mi(Ti.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Mi(Ti.NOT_SUPPORT_LOCALE_TYPE)}function uI(e,t,n){return[...new Set([n,...In(t)?t:jt(t)?Object.keys(t):it(t)?[t]:[n]])]}function bg(e,t,n){const s=it(n)?n:qc,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;In(r);)r=Ck(i,r,t);const l=In(t)||!Rt(t)?t:t.default?t.default:null;r=it(l)?[l]:l,In(r)&&Ck(i,r,!1),o.__localeChainCache.set(s,i)}return i}function Ck(e,t,n){let s=!0;for(let o=0;o<t.length&&Ut(s);o++){const i=t[o];it(i)&&(s=dI(e,t[o],n))}return s}function dI(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=fI(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function fI(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(In(n)||Rt(n))&&n[o]&&(s=n[o])}return s}const Mr=[];Mr[0]={w:[0],i:[3,0],"[":[4],o:[7]};Mr[1]={w:[1],".":[2],"[":[4],o:[7]};Mr[2]={w:[2],i:[3,0],0:[3,0]};Mr[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Mr[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Mr[5]={"'":[4,0],o:8,l:[5,0]};Mr[6]={'"':[4,0],o:8,l:[6,0]};const hI=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function pI(e){return hI.test(e)}function mI(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 gI(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 vI(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:pI(t)?mI(t):"*"+t}function yI(e){const t=[];let n=-1,s=0,o=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](),o++},f[3]=()=>{if(o>0)o--,s=4,f[0]();else{if(o=0,r===void 0||(r=vI(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(s===5&&p==="'"||s===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=gI(i),d=Mr[s],c=d[a]||d.l||8,c===8||(s=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(s===7)return t}}const xk=new Map;function kI(e,t){return jt(e)?e[t]:null}function bI(e,t){if(!jt(e))return null;let n=xk.get(t);if(n||(n=yI(t),n&&xk.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(SC.includes(r)&&ri(o)||!jt(o)||!$o(o,r))return null;const l=o[r];if(l===void 0||bn(o))return null;o=l,i++}return o}const _I="11.4.5",ph=-1,qc="en-US",hf="",Tk=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function wI(){return{upper:(e,t)=>t==="text"&&it(e)?e.toUpperCase():t==="vnode"&&jt(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&it(e)?e.toLowerCase():t==="vnode"&&jt(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&it(e)?Tk(e):t==="vnode"&&jt(e)&&"__v_isVNode"in e?Tk(e.children):e}}let CC;function SI(e){CC=e}let xC;function CI(e){xC=e}let TC;function xI(e){TC=e}let MC=null;const TI=e=>{MC=e},MI=()=>MC;let AC=null;const Mk=e=>{AC=e},AI=()=>AC;let Ak=0;function EI(e={}){const t=bn(e.onWarn)?e.onWarn:u$,n=it(e.version)?e.version:_I,s=it(e.locale)||bn(e.locale)?e.locale:qc,o=bn(s)?qc:s,i=In(e.fallbackLocale)||Rt(e.fallbackLocale)||it(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Rt(e.messages)?e.messages:nm(o),l=Rt(e.datetimeFormats)?e.datetimeFormats:nm(o),a=Rt(e.numberFormats)?e.numberFormats:nm(o),c=zn(on(),e.modifiers,wI()),u=e.pluralRules||on(),d=bn(e.missing)?e.missing:null,f=Ut(e.missingWarn)||ba(e.missingWarn)?e.missingWarn:!0,h=Ut(e.fallbackWarn)||ba(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,g=!!e.unresolving,S=bn(e.postTranslation)?e.postTranslation:null,_=Rt(e.processor)?e.processor:null,y=Ut(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter,v=bn(e.messageCompiler)?e.messageCompiler:CC,w=bn(e.messageResolver)?e.messageResolver:xC||kI,N=bn(e.localeFallbacker)?e.localeFallbacker:TC||uI,E=jt(e.fallbackContext)?e.fallbackContext:void 0,k=e,A=jt(k.__datetimeFormatters)?k.__datetimeFormatters:new Map,I=jt(k.__numberFormatters)?k.__numberFormatters:new Map,P=jt(k.__meta)?k.__meta:{};Ak++;const M={version:n,cid:Ak,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:g,postTranslation:S,processor:_,warnHtmlMessage:y,escapeParameter:b,messageCompiler:v,messageResolver:w,localeFallbacker:N,fallbackContext:E,onWarn:t,__meta:P};return M.datetimeFormats=l,M.numberFormats=a,M.__datetimeFormatters=A,M.__numberFormatters=I,__INTLIFY_PROD_DEVTOOLS__&&rI(M,n,P),M}const nm=e=>({[e]:on()});function Q1(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return it(l)?l:t}else return t}function nc(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function $I(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function II(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if($I(e,t[s]))return!0;return!1}function Ek(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!it(t[0])&&!hC(t[0])&&!qn(t[0]))return hf;const[a,c,u,d]=_g(...t),f=Ut(u.missingWarn)?u.missingWarn:e.missingWarn;Ut(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=J1(e,u),g=r(e,o,p);if(!it(a)||a===""){const N=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?N.formatToParts(c):N.format(c)}let S={},_,y=null;const b="datetime format";for(let N=0;N<g.length&&(_=g[N],S=n[_]||{},y=S[a],!Rt(y));N++)Q1(e,a,_,f,b);if(!Rt(y)||!it(_))return s?ph:a;let v=`${_}__${a}`;fh(d)||(v=`${v}__${JSON.stringify(d)}`);let w=l.get(v);return w||(w=new Intl.DateTimeFormat(_,zn({},y,d)),l.set(v,w)),h?w.formatToParts(c):w.format(c)}const EC=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function _g(...e){const[t,n,s,o]=e,i=on();let r=on(),l;if(it(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Mi(Ti.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 Mi(Ti.INVALID_ISO_DATE_ARGUMENT)}}else if(hC(t)){if(isNaN(t.getTime()))throw Mi(Ti.INVALID_DATE_ARGUMENT);l=t}else if(qn(t))l=t;else throw Mi(Ti.INVALID_ARGUMENT);return it(n)?i.key=n:Rt(n)&&Object.keys(n).forEach(a=>{EC.includes(a)?r[a]=n[a]:i[a]=n[a]}),it(s)?i.locale=s:Rt(s)&&(r=s),Rt(o)&&(r=o),[i.key||"",l,i,r]}function $k(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function Ik(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!qn(t[0]))return hf;const[a,c,u,d]=wg(...t),f=Ut(u.missingWarn)?u.missingWarn:e.missingWarn;Ut(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=J1(e,u),g=r(e,o,p);if(!it(a)||a===""){const N=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?N.formatToParts(c):N.format(c)}let S={},_,y=null;const b="number format";for(let N=0;N<g.length&&(_=g[N],S=n[_]||{},y=S[a],!Rt(y));N++)Q1(e,a,_,f,b);if(!Rt(y)||!it(_))return s?ph:a;let v=`${_}__${a}`;fh(d)||(v=`${v}__${JSON.stringify(d)}`);let w=l.get(v);return w||(w=new Intl.NumberFormat(_,zn({},y,d)),l.set(v,w)),h?w.formatToParts(c):w.format(c)}const $C=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function wg(...e){const[t,n,s,o]=e,i=on();let r=on();if(!qn(t))throw Mi(Ti.INVALID_ARGUMENT);const l=t;return it(n)?i.key=n:Rt(n)&&Object.keys(n).forEach(a=>{$C.includes(a)?r[a]=n[a]:i[a]=n[a]}),it(s)?i.locale=s:Rt(s)&&(r=s),Rt(o)&&(r=o),[i.key||"",l,i,r]}function Nk(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const NI=e=>e,LI=e=>"",OI="text",PI=e=>e.length===0?"":Y1(e),RI=_$;function sm(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function DI(e){const t=qn(e.pluralIndex)?e.pluralIndex:-1;return qn(e.named?.count)?e.named.count:qn(e.named?.n)?e.named.n:t}function BI(e={}){const t=e.locale,n=DI(e),s=it(t)&&bn(e.pluralRules?.[t])?e.pluralRules[t]:sm,o=s===sm?void 0:sm,i=_=>_[s(n,_.length,o)],r=e.list||[],l=_=>r[_],a=e.named||on();qn(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=_=>a[_];function u(_,y){const b=bn(e.messages)?e.messages(_,!!y):jt(e.messages)?e.messages[_]:!1;return b||(e.parent?e.parent.message(_):LI)}const d=_=>e.modifiers?e.modifiers[_]:NI,f=bn(e.processor?.normalize)?e.processor.normalize:PI,h=bn(e.processor?.interpolate)?e.processor.interpolate:RI,p=it(e.processor?.type)?e.processor.type:OI,S={list:l,named:c,plural:i,linked:(_,...y)=>{const[b,v]=y;let w="text",N="";y.length===1?jt(b)?(N=b.modifier||N,w=b.type||w):it(b)&&(N=b||N):y.length===2&&(it(b)&&(N=b||N),it(v)&&(w=v||w));const E=u(_,!0)(S),k=E===""||E===void 0?_:E,A=w==="vnode"&&In(k)&&N?k[0]:k;return N?d(N)(A,w):A},message:u,type:p,interpolate:h,normalize:f,values:zn(on(),r,a)};return S}const Lk=()=>"",Mo=e=>bn(e);function Ok(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Sg(...t),u=Ut(c.missingWarn)?c.missingWarn:e.missingWarn,d=Ut(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=Ut(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=it(c.default)||Ut(c.default)?Ut(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,g=n||p!=null&&(it(p)||bn(p)),S=J1(e,c);f&&FI(c);let[_,y,b]=h?[a,S,l[S]||on()]:IC(e,a,S,r,d,u),v=_,w=a;if(!h&&!(it(v)||ri(v)||Mo(v))&&g&&(v=p,w=v),!h&&(!(it(v)||ri(v)||Mo(v))||!it(y)))return o?ph:a;let N=!1;const E=()=>{N=!0},k=Mo(v)?v:NC(e,a,y,v,w,E);if(N)return v;const A=UI(e,y,b,c),I=BI(A),P=HI(e,k,I);let M=s?s(P,a):P;if(f&&it(M)&&(M=y$(M)),__INTLIFY_PROD_DEVTOOLS__){const L={timestamp:Date.now(),key:it(a)?a:Mo(v)?v.key:"",locale:y||(Mo(v)?v.locale:""),format:it(v)?v:Mo(v)?v.source:"",message:M};L.meta=zn({},e.__meta,MI()||{}),lI(L)}return M}function FI(e){In(e.list)?e.list=e.list.map(t=>it(t)?vk(t):t):jt(e.named)&&Object.keys(e.named).forEach(t=>{it(e.named[t])&&(e.named[t]=vk(e.named[t]))})}function IC(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=on(),f,h=null;const p="translate";for(let g=0;g<u.length&&(f=u[g],d=r[f]||on(),(h=a(d,t))===null&&(h=d[t]),!(it(h)||ri(h)||Mo(h)));g++)if(!II(f,u)){const S=Q1(e,t,f,i,p);S!==t&&(h=S)}return[h,f,d]}function NC(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(Mo(s)){const c=s;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>s);return c.locale=n,c.key=t,c}const a=r(s,WI(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function HI(e,t,n){return t(n)}function Sg(...e){const[t,n,s]=e,o=on();if(!it(t)&&!qn(t)&&!Mo(t)&&!ri(t))throw Mi(Ti.INVALID_ARGUMENT);const i=qn(t)?String(t):(Mo(t),t);return qn(n)?o.plural=n:it(n)?o.default=n:Rt(n)&&!fh(n)?o.named=n:In(n)&&(o.list=n),qn(s)?o.plural=s:it(s)?o.default=s:Rt(s)&&zn(o,s),[i,o]}function WI(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>d$(t,n,r)}}function UI(e,t,n,s){const{modifiers:o,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:o,pluralRules:i,messages:(h,p)=>{let g=r(n,h);if(g==null&&(u||p)){const[S,,_]=IC(u||e,h,t,l,a,c);g=S??r(_,h)}if(it(g)||ri(g)){let S=!1;const y=NC(e,h,t,g,h,()=>{S=!0});return S?Lk:y}else return Mo(g)?g:Lk}};return e.processor&&(f.processor=e.processor),s.list&&(f.list=s.list),s.named&&(f.named=s.named),qn(s.plural)&&(f.pluralIndex=s.plural),f}G$();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const jI="11.4.5";function qI(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(tl().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(tl().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(tl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(tl().__INTLIFY_PROD_DEVTOOLS__=!1)}const $s={UNEXPECTED_RETURN_TYPE:cI,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 Ws(e,...t){return hh(e,null,void 0)}const Cg=xr("__translateVNode"),xg=xr("__datetimeParts"),Tg=xr("__numberParts"),LC=xr("__setPluralRules"),OC=xr("__injectWithOption"),Xl=xr("__dispose");function zc(e){if(!jt(e)||ri(e))return e;for(const t in e)if($o(e,t))if(!t.includes("."))jt(e[t])&&zc(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=on()),!jt(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(ri(o)?SC.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!ri(o)){const r=o[n[s]];jt(r)&&zc(r)}}return e}function ev(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=Rt(n)?n:In(s)?on():{[e]:on()};if(In(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||on(),Md(c,r[a])):Md(c,r)}else it(l)&&Md(JSON.parse(l),r)}),o==null&&i)for(const l in r)$o(r,l)&&zc(r[l]);return r}function PC(e){return e.type}function RC(e,t,n){let s=jt(t.messages)?t.messages:on();"__i18nGlobal"in n&&(s=ev(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[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 Pk(e){return gt(hr,null,e,0)}function Vc(){return ds()}const Rk="__INTLIFY_META__",Dk=()=>[],zI=()=>!1;let Bk=0;function Fk(e){return((t,n,s,o)=>e(n,s,Vc()||void 0,o))}const VI=()=>{const e=Vc();let t=null;return e&&(t=PC(e)[Rk])?{[Rk]:t}:null};function pf(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=ff?te:hl;let r=Ut(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:it(e.locale)?e.locale:qc),a=i(t&&r?t.fallbackLocale.value:it(e.fallbackLocale)||In(e.fallbackLocale)||Rt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(ev(l.value,e)),u=i(Rt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Rt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:Ut(e.missingWarn)||ba(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:Ut(e.fallbackWarn)||ba(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:Ut(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,S=bn(e.missing)?e.missing:null,_=bn(e.missing)?Fk(e.missing):null,y=bn(e.postTranslation)?e.postTranslation:null,b=t?t.warnHtmlMessage:Ut(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter;const w=t?t.modifiers:Rt(e.modifiers)?e.modifiers:{};let N=e.pluralRules||t&&t.pluralRules,E;E=(()=>{s&&Mk(null);const re={version:jI,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:w,pluralRules:N,missing:_===null?void 0:_,missingWarn:f,fallbackWarn:h,fallbackFormat:g,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:b,escapeParameter:v,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};re.datetimeFormats=u.value,re.numberFormats=d.value,re.__datetimeFormatters=Rt(E)?E.__datetimeFormatters:void 0,re.__numberFormatters=Rt(E)?E.__numberFormatters:void 0;const le=EI(re);return s&&Mk(le),le})(),nc(E,l.value,a.value);function A(){return[l.value,a.value,c.value,u.value,d.value]}const I=F({get:()=>l.value,set:re=>{E.locale=re,l.value=re}}),P=F({get:()=>a.value,set:re=>{E.fallbackLocale=re,a.value=re,nc(E,l.value,re)}}),M=F(()=>c.value),L=F(()=>u.value),R=F(()=>d.value);function B(){return bn(y)?y:null}function W(re){y=re,E.postTranslation=re}function K(){return S}function V(re){re!==null&&(_=Fk(re)),S=re,E.missing=_}const se=(re,le,Ce,We,nt,lt)=>{A();let bt;try{__INTLIFY_PROD_DEVTOOLS__,s||(E.fallbackContext=t?AI():void 0),bt=re(E)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(E.fallbackContext=void 0)}if(Ce!=="translate exists"&&qn(bt)&&bt===ph||Ce==="translate exists"&&!bt){const[St,ct]=le();return t&&p?We(t):nt(St)}else{if(lt(bt))return bt;throw Ws($s.UNEXPECTED_RETURN_TYPE)}};function Y(...re){return se(le=>Reflect.apply(Ok,null,[le,...re]),()=>Sg(...re),"translate",le=>Reflect.apply(le.t,le,[...re]),le=>le,le=>it(le))}function G(...re){const[le,Ce,We]=re;if(We&&!jt(We))throw Ws($s.INVALID_ARGUMENT);return Y(le,Ce,zn({resolvedMessage:!0},We||{}))}function ee(...re){return se(le=>Reflect.apply(Ek,null,[le,...re]),()=>_g(...re),"datetime format",le=>Reflect.apply(le.d,le,[...re]),()=>hf,le=>it(le)||In(le))}function we(...re){return se(le=>Reflect.apply(Ik,null,[le,...re]),()=>wg(...re),"number format",le=>Reflect.apply(le.n,le,[...re]),()=>hf,le=>it(le)||In(le))}function de(re){return re.map(le=>it(le)||qn(le)||Ut(le)?Pk(String(le)):le)}const ce={normalize:de,interpolate:re=>re,type:"vnode"};function _e(...re){return se(le=>{let Ce;const We=le;try{We.processor=ce,Ce=Reflect.apply(Ok,null,[We,...re])}finally{We.processor=null}return Ce},()=>Sg(...re),"translate",le=>le[Cg](...re),le=>[Pk(le)],le=>In(le))}function me(...re){return se(le=>Reflect.apply(Ik,null,[le,...re]),()=>wg(...re),"number format",le=>le[Tg](...re),Dk,le=>it(le)||In(le))}function $e(...re){return se(le=>Reflect.apply(Ek,null,[le,...re]),()=>_g(...re),"datetime format",le=>le[xg](...re),Dk,le=>it(le)||In(le))}function J(re){N=re,E.pluralRules=N}function ye(re,le){return se(()=>{if(!re)return!1;const Ce=it(le)?le:l.value,We=it(le)?[Ce]:bg(E,a.value,Ce);for(let nt=0;nt<We.length;nt++){const lt=Z(We[nt]);let bt=E.messageResolver(lt,re);if(bt===null&&(bt=lt[re]),ri(bt)||Mo(bt)||it(bt))return!0}return!1},()=>[re],"translate exists",Ce=>Reflect.apply(Ce.te,Ce,[re,le]),zI,Ce=>Ut(Ce))}function Se(re){let le=null;const Ce=bg(E,a.value,l.value);for(let We=0;We<Ce.length;We++){const nt=c.value[Ce[We]]||{},lt=E.messageResolver(nt,re);if(lt!=null){le=lt;break}}return le}function U(re){const le=Se(re);return le??(t?t.tm(re)||{}:{})}function Z(re){return c.value[re]||{}}function fe(re,le){if(o){const Ce={[re]:le};for(const We in Ce)$o(Ce,We)&&zc(Ce[We]);le=Ce[re]}c.value[re]=le,E.messages=c.value}function oe(re,le){c.value[re]=c.value[re]||{};const Ce={[re]:le};if(o)for(const We in Ce)$o(Ce,We)&&zc(Ce[We]);le=Ce[re],Md(le,c.value[re]),E.messages=c.value}function he(re){return u.value[re]||{}}function H(re,le){u.value[re]=le,E.datetimeFormats=u.value,$k(E,re,le)}function X(re,le){u.value[re]=zn(u.value[re]||{},le),E.datetimeFormats=u.value,$k(E,re,le)}function ae(re){return d.value[re]||{}}function ke(re,le){d.value[re]=le,E.numberFormats=d.value,Nk(E,re,le)}function Me(re,le){d.value[re]=zn(d.value[re]||{},le),E.numberFormats=d.value,Nk(E,re,le)}Bk++,t&&ff&&(Ve(t.locale,re=>{r&&(l.value=re,E.locale=re,nc(E,l.value,a.value))}),Ve(t.fallbackLocale,re=>{r&&(a.value=re,E.fallbackLocale=re,nc(E,l.value,a.value))}));const Ie={id:Bk,locale:I,fallbackLocale:P,get inheritLocale(){return r},set inheritLocale(re){r=re,re&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,nc(E,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:M,get modifiers(){return w},get pluralRules(){return N||{}},get isGlobal(){return s},get missingWarn(){return f},set missingWarn(re){f=re,E.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(re){h=re,E.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(re){p=re},get fallbackFormat(){return g},set fallbackFormat(re){g=re,E.fallbackFormat=g},get warnHtmlMessage(){return b},set warnHtmlMessage(re){b=re,E.warnHtmlMessage=re},get escapeParameter(){return v},set escapeParameter(re){v=re,E.escapeParameter=re},t:Y,getLocaleMessage:Z,setLocaleMessage:fe,mergeLocaleMessage:oe,getPostTranslationHandler:B,setPostTranslationHandler:W,getMissingHandler:K,setMissingHandler:V,[LC]:J};return Ie.datetimeFormats=L,Ie.numberFormats=R,Ie.rt=G,Ie.te=ye,Ie.tm=U,Ie.d=ee,Ie.n=we,Ie.getDateTimeFormat=he,Ie.setDateTimeFormat=H,Ie.mergeDateTimeFormat=X,Ie.getNumberFormat=ae,Ie.setNumberFormat=ke,Ie.mergeNumberFormat=Me,Ie[OC]=n,Ie[Cg]=_e,Ie[xg]=$e,Ie[Tg]=me,Ie}function KI(e){const t=it(e.locale)?e.locale:qc,n=it(e.fallbackLocale)||In(e.fallbackLocale)||Rt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=bn(e.missing)?e.missing:void 0,o=Ut(e.silentTranslationWarn)||ba(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Ut(e.silentFallbackWarn)||ba(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Ut(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Rt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=bn(e.postTranslation)?e.postTranslation:void 0,d=it(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=Ut(e.sync)?e.sync:!0;let p=e.messages;if(Rt(e.sharedMessages)){const w=e.sharedMessages;p=Object.keys(w).reduce((E,k)=>{const A=E[k]||(E[k]={});return zn(A,w[k]),E},p||{})}const{__i18n:g,__root:S,__injectWithOption:_}=e,y=e.datetimeFormats,b=e.numberFormats,v=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:v,datetimeFormats:y,numberFormats:b,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:g,__root:S,__injectWithOption:_}}function Mg(e={}){const t=pf(KI(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return Ut(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=Ut(o)?!o:o},get silentFallbackWarn(){return Ut(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=Ut(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function GI(e,t,n){return{beforeCreate(){const s=Vc();if(!s)throw Ws($s.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=Hk(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Mg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Hk(e,o);else{this.$i18n=Mg({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&RC(t,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(s,this.$i18n)},mounted(){},unmounted(){const s=Vc();if(!s)throw Ws($s.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function Hk(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[LC](t.pluralizationRules||e.pluralizationRules);const n=ev(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const tv={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function YI({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Pe?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},on())}function DC(){return Pe}const XI=Xe({name:"i18n-t",props:zn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>qn(e)||!isNaN(e)}},tv),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||_t({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=on();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=it(e.plural)?+e.plural:e.plural);const u=YI(t,a);return o[Cg](e.keypath,u,c)},r=zn(on(),s),l=it(e.tag)||jt(e.tag)?e.tag:DC();return jt(l)?Jt(l,r,{default:i}):Jt(l,r,i())}}}),Wk=XI;function ZI(e){return In(e)&&!it(e[0])}function BC(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=on();e.locale&&(c.locale=e.locale),it(e.format)?c.key=e.format:jt(e.format)&&(it(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?zn(on(),h,{[p]:e.format[p]}):h,on()));const d=s(e.value,c,u);let f=[c.key];return In(d)?f=d.map((h,p)=>{const g=o[h.type],S=g?g({[h.type]:h.value,index:p,parts:d}):[h.value];return ZI(S)&&(S[0].key=`${h.type}-${p}`),S}):it(d)&&(f=[d]),f},l=zn(on(),i),a=it(e.tag)||jt(e.tag)?e.tag:DC();return jt(a)?Jt(a,l,{default:r}):Jt(a,l,r())}}const JI=Xe({name:"i18n-n",props:zn({value:{type:Number,required:!0},format:{type:[String,Object]}},tv),setup(e,t){const n=e.i18n||_t({useScope:e.scope,__useComponent:!0});return BC(e,t,$C,(...s)=>n[Tg](...s))}}),Uk=JI;function QI(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function e6(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Ws($s.UNEXPECTED_ERROR);const c=QI(e,l.$),u=jk(a);return[Reflect.apply(c.t,c,[...qk(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);ff&&(r.__i18nWatcher=Ve(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{ff&&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=jk(l);r.textContent=Reflect.apply(a.t,a,[...qk(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function jk(e){if(it(e))return{path:e};if(Rt(e)){if(!("path"in e))throw Ws($s.REQUIRED_VALUE,"path");return e}else throw Ws($s.INVALID_VALUE)}function qk(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return it(n)&&(r.locale=n),qn(o)&&(r.plural=o),qn(i)&&(r.plural=i),[t,l,r]}function t6(e,t,...n){const s=Rt(n[0])?n[0]:{};(Ut(s.globalInstall)?s.globalInstall:!0)&&([Wk.name,"I18nT"].forEach(i=>e.component(i,Wk)),[Uk.name,"I18nN"].forEach(i=>e.component(i,Uk)),[Kk.name,"I18nD"].forEach(i=>e.component(i,Kk))),e.directive("t",e6(t))}const n6=xr("global-vue-i18n");function s6(e={}){const t=__VUE_I18N_LEGACY_API__&&Ut(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Ut(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=o6(e,t),r=xr("");function l(d){return s.get(d)||null}function a(d,f){s.set(d,f)}function c(d){s.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),Rt(f[0])){const g=f[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let h=null;!t&&n&&(h=d6(d,u.global)),__VUE_I18N_FULL_INSTALL__&&t6(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(GI(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function _t(e={}){const t=Vc();if(t==null)throw Ws($s.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ws($s.NOT_INSTALLED);const n=i6(t),s=l6(n),o=PC(t),i=r6(e,o);if(i==="global")return RC(s,e,o),s;if(i==="parent"){let a=zk(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw Ws($s.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=zn({},e),u=zk(n,t);c.__root=u||s;const d=pf(c);return a.__composerExtend&&(d[Xl]=a.__composerExtend(d)),E1()&&$1(()=>{const h=d[Xl];h&&(h(),delete d[Xl])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=zn({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=pf(a),r.__composerExtend&&(l[Xl]=r.__composerExtend(l)),c6(r,t,l),r.__setInstance(t,l)}return l}function o6(e,t){const n=IA(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Mg(e)):n.run(()=>pf(e));if(s==null)throw Ws($s.UNEXPECTED_ERROR);return[n,s]}function i6(e){const t=Dt(e.isCE?n6:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ws(e.isCE?$s.NOT_INSTALLED_WITH_PROVIDE:$s.UNEXPECTED_ERROR);return t}function r6(e,t){return fh(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function l6(e){return e.mode==="composition"?e.global:e.global.__composer}function zk(e,t,n=!1){let s=null;const o=t.root;let i=a6(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(s=l.__composer,n&&s&&!s[OC]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function a6(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function c6(e,t,n){Qt(()=>{},t),Ht(()=>{const s=n;e.__deleteInstance(t);const o=s[Xl];o&&(o(),delete s[Xl])},t)}const u6=["locale","fallbackLocale","availableLocales"],Vk=["t","rt","d","n","tm","te"];function d6(e,t){const n=Object.create(null);return u6.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Ws($s.UNEXPECTED_ERROR);const r=Bn(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,Vk.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Ws($s.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,Vk.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const f6=Xe({name:"i18n-d",props:zn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},tv),setup(e,t){const n=e.i18n||_t({useScope:e.scope,__useComponent:!0});return BC(e,t,EC,(...s)=>n[xg](...s))}}),Kk=f6;qI();SI(oI);CI(bI);xI(bg);if(__INTLIFY_PROD_DEVTOOLS__){const e=tl();e.__INTLIFY__=!0,iI(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Et={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",theme:"kimi-web.theme",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",betaToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-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"};function Gk(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function An(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function Pn(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Kc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function nv(e){const t=An(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function sv(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function ov(){const e=An(Et.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[s,o]of Object.entries(t))o===!0&&(n[s]=!0);return n}catch{return{}}}function iv(e){const n={...ov()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];Pn(Et.unread,JSON.stringify(n))}function h6(){const e=nv(Et.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function p6(e){sv(Et.collapsedWorkspaces,Array.from(e))}function m6(){const e=nv(Et.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function FC(e){sv(Et.workspaceOrder,Array.from(e))}const Yk=Et.clientId,g6="kimi-code-web",v6="web";function y6(){return{serverHttpUrl:b6(),clientId:C6(),clientName:g6,clientVersion:x6(),clientUiMode:v6}}function k6(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function b6(e){const t=k6(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function _6(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function w6(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return _6(e)}function mf(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function S6(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 C6(){const e=An(Yk);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return Pn(Yk,t),t}function x6(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function Ss(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 T6(e)}function T6(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 M6(e,t){if(e.length===0)return null;const n=new Set(e),s=t.filter(i=>n.has(i)),o=e.filter(i=>!t.includes(i));return o.length===0&&s.length===t.length?null:[...o,...s]}function A6(e,t){const n=new Map(t.map((s,o)=>[s,o]));return e.toSorted((s,o)=>(n.get(s.id)??-1)-(n.get(o.id)??-1))}function E6(e,t,n,s="before"){const o=e.indexOf(t),i=e.indexOf(n);if(o===-1||i===-1||o===i)return e;const r=[...e];r.splice(o,1);const l=o<i?i-1:i,a=s==="before"?l:l+1;return r.splice(a,0,t),r}const $6={class:"row"},I6={class:"lead","aria-hidden":"true"},N6={key:0,class:"run-ico",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none"},L6={key:1,class:"unread-dot"},O6={class:"archive-label"},P6={class:"left"},R6=["onKeydown"],D6={class:"ts"},B6=["title"],F6={class:"tag-text"},H6=["title"],W6={class:"tag-text"},U6=["title"],j6={class:"tag-text"},q6=["title"],z6=Xe({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=_t(),o=e,i=n,r=te(!1),l=te(null),a=te(null);function c(I){const P=I.target;a.value?.contains(P)||l.value?.contains(P)||d()}function u(I){I.stopPropagation(),r.value?d():(r.value=!0,setTimeout(()=>document.addEventListener("mousedown",c),0))}function d(){r.value=!1,document.removeEventListener("mousedown",c)}Ht(()=>document.removeEventListener("mousedown",c));const f=te(!1),h=te(""),p=te(null);async function g(){d(),f.value=!0,h.value=o.session.title,await ft();try{p.value?.focus(),p.value?.select()}catch{}}function S(){const I=h.value.trim();I&&i("rename",o.session.id,I),f.value=!1}function _(){f.value=!1}const y=te(!1),b=te(!1);async function v(){const I=await Ss(o.session.id);y.value=I,b.value=!I,setTimeout(()=>{y.value=!1,b.value=!1,d()},1500)}function w(){d(),i("fork",o.session.id)}const N=te(!1);function E(){d(),N.value=!0}function k(){i("archive",o.session.id),N.value=!1}function A(){N.value=!1}return t({closeMenu:d,cancelArchive:A}),(I,P)=>(x(),$("div",{class:Oe(["se",{on:e.active}]),onClick:P[5]||(P[5]=M=>i("select",e.session.id))},[m("div",$6,[m("span",I6,[e.session.busy?(x(),$("svg",N6,[...P[6]||(P[6]=[m("circle",{class:"run-track",cx:"8",cy:"8",r:"6","stroke-width":"2"},null,-1),m("path",{class:"run-arc",d:"M8 2 A6 6 0 1 1 2 8","stroke-width":"2","stroke-linecap":"round"},null,-1)])])):e.unread?(x(),$("span",L6)):ie("",!0)]),N.value?(x(),$("div",{key:0,class:"archive-confirm",onClick:P[0]||(P[0]=Ze(()=>{},["stop"]))},[m("span",O6,O(C(s)("sidebar.archiveConfirm")),1),m("button",{class:"btn-confirm",onClick:Ze(k,["stop"])},O(C(s)("sidebar.confirm")),1),m("button",{class:"btn-cancel",onClick:Ze(A,["stop"])},O(C(s)("sidebar.cancel")),1)])):(x(),$(Pe,{key:1},[m("div",P6,[f.value?Ot((x(),$("input",{key:0,ref_key:"renameInputRef",ref:p,"onUpdate:modelValue":P[1]||(P[1]=M=>h.value=M),class:"rename-input",onClick:P[2]||(P[2]=Ze(()=>{},["stop"])),onKeydown:[Eo(Ze(S,["stop"]),["enter"]),Eo(Ze(_,["stop"]),["esc"])],onBlur:S},null,40,R6)),[[xn,h.value]]):(x(),$("span",{key:1,class:"t",onDblclick:Ze(g,["stop"])},O(e.session.title),33))]),m("span",D6,O(e.session.time),1),!f.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(x(),$("span",{key:0,class:"tag tag-ask",title:C(s)("workspace.awaitingAnswerTitle")},[m("span",F6,O(C(s)("workspace.awaitingAnswer")),1)],8,B6)):ie("",!0),!f.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(x(),$("span",{key:1,class:"tag tag-approve",title:C(s)("workspace.awaitingPermissionTitle")},[m("span",W6,O(C(s)("workspace.awaitingPermission")),1)],8,H6)):ie("",!0),!f.value&&e.session.status==="aborted"?(x(),$("span",{key:2,class:"tag tag-aborted",title:C(s)("workspace.abortedTitle")},[m("span",j6,O(C(s)("workspace.aborted")),1)],8,U6)):ie("",!0),f.value?ie("",!0):(x(),$("button",{key:3,ref_key:"kebabRef",ref:l,class:Oe(["kebab",{open:r.value}]),title:C(s)("sidebar.options"),onClick:P[3]||(P[3]=Ze(M=>u(M),["stop"]))},[...P[7]||(P[7]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"8",cy:"3",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,q6))],64))]),r.value?(x(),$("div",{key:0,ref_key:"menuRef",ref:a,class:"menu",onClick:P[4]||(P[4]=Ze(()=>{},["stop"]))},[m("button",{class:Oe(["menu-item copy-id",{failed:b.value}]),onClick:Ze(v,["stop"])},O(b.value?C(s)("sidebar.copyFailed"):y.value?C(s)("sidebar.copied"):C(s)("sidebar.copySessionId")),3),P[8]||(P[8]=m("div",{class:"menu-divider"},null,-1)),m("button",{class:"menu-item",onClick:Ze(g,["stop"])},O(C(s)("sidebar.rename")),1),m("button",{class:"menu-item",onClick:Ze(w,["stop"])},O(C(s)("sidebar.fork")),1),m("button",{class:"menu-item archive",onClick:Ze(E,["stop"])},O(C(s)("sidebar.archive")),1)],512)):ie("",!0)],2))}}),vt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},HC=vt(z6,[["__scopeId","data-v-8222aa18"]]),V6={class:"gh-top"},K6={class:"gh-folder",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},G6={key:0,class:"gh-name"},Y6=["title","aria-label","aria-expanded"],X6=["title","aria-label"],Z6=["title"],J6={class:"group-sessions"},Q6=["disabled"],e5={key:1,class:"group-empty"},t5=Xe({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},selectedIds:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","loadMore","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=F({get:()=>s.renameValue,set:a=>o("updateRenameValue",a)});function r(a){s.renameInputRef.value=a instanceof HTMLInputElement?a:null}function l(a){a.dataTransfer&&(a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(a,c)=>(x(),$("div",{class:Oe(["group",{dragging:e.dragging}])},[m("div",{class:Oe(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,sel:e.selectedIds.has(e.group.workspace.id)}]),draggable:"true",onClick:c[7]||(c[7]=Ze(u=>o("groupClick",e.group.workspace.id,u),["stop"])),onContextmenu:c[8]||(c[8]=u=>o("groupContextmenu",e.group.workspace,u)),onDragstart:l,onDragend:c[9]||(c[9]=u=>o("wsDragend"))},[m("div",V6,[(x(),$("svg",K6,[e.isCollapsed(e.group.workspace.id)?(x(),$(Pe,{key:0},[c[15]||(c[15]=m("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),c[16]||(c[16]=m("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(x(),$(Pe,{key:1},[c[17]||(c[17]=m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),c[18]||(c[18]=m("path",{d:"M1 5.5h12"},null,-1))],64))])),e.renamingId!==e.group.workspace.id?(x(),$("span",G6,O(e.group.workspace.name),1)):Ot((x(),$("input",{key:1,ref:r,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u),class:"gh-rename",type:"text",onKeydown:[c[1]||(c[1]=Eo(u=>o("confirmRename"),["enter"])),c[2]||(c[2]=Eo(u=>o("cancelRename"),["esc"]))],onBlur:c[3]||(c[3]=u=>o("cancelRename")),onClick:c[4]||(c[4]=Ze(()=>{},["stop"]))},null,544)),[[xn,i.value]]),m("button",{type:"button",class:Oe(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),title:C(n)("sidebar.options"),"aria-label":C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:c[5]||(c[5]=Ze(u=>o("toggleWsMenu",e.group.workspace,u),["stop"]))},[...c[19]||(c[19]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"8",cy:"3",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,Y6),m("button",{type:"button",class:"gh-add",title:C(n)("workspace.newInGroup"),"aria-label":C(n)("workspace.newInGroup"),onClick:c[6]||(c[6]=Ze(u=>o("createInWorkspace",e.group.workspace.id),["stop"]))},[...c[20]||(c[20]=[m("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M8 3v10M3 8h10"})],-1)])],8,X6)]),m("div",{class:"gh-path",title:e.group.workspace.root},O(e.group.workspace.shortPath||e.group.workspace.root),9,Z6)],34),Ot(m("div",J6,[(x(!0),$(Pe,null,Ye(e.group.sessions,u=>(x(),je(HC,{key:u.id,session:u,active:u.id===e.activeId,"approval-count":e.pendingBySession[u.id]?.approvals??0,"question-count":e.pendingBySession[u.id]?.questions??0,unread:e.unreadBySession[u.id]??!1,onSelect:c[10]||(c[10]=d=>o("selectSession",d)),onRename:c[11]||(c[11]=(d,f)=>o("renameSession",d,f)),onArchive:c[12]||(c[12]=d=>o("archiveSession",d)),onFork:c[13]||(c[13]=d=>o("forkSession",d))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(x(),$("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:c[14]||(c[14]=Ze(u=>o("loadMore",e.group.workspace.id),["stop"]))},O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,e.group.workspace.sessionCount-e.group.sessions.length)})),9,Q6)):ie("",!0),e.group.sessions.length===0?(x(),$("div",e5,O(C(n)("sidebar.noSessions")),1)):ie("",!0)],512),[[Ho,!e.isCollapsed(e.group.workspace.id)]])],2))}}),n5=vt(t5,[["__scopeId","data-v-4c114e7c"]]),s5={class:"side"},o5={class:"ch"},i5={class:"ch-brand"},r5={class:"ch-name"},l5={key:0,class:"ch-endpoint"},a5=["title","aria-label"],c5=["title","aria-label"],u5={class:"search"},d5=["placeholder","aria-label","onKeydown"],f5=["title","aria-label"],h5={class:"btn-wrap"},p5={key:0,class:"sessions"},m5={key:1,class:"empty"},g5={key:1,class:"sessions"},v5={key:0,class:"empty"},y5=["onDragover","onDrop"],k5=Xe({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","selectWorkspaces","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","reorderWorkspaces","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=_t(),s=!1,o="",i=e,r=t,l=te(""),a=F(()=>l.value.trim()),c=F(()=>a.value.length>0),u=F(()=>{const le=a.value.toLowerCase();return le?i.sessions.filter(Ce=>{const We=(Ce.title??"").toLowerCase(),nt=(Ce.lastPrompt??"").toLowerCase();return We.includes(le)||nt.includes(le)}):[]});function d(){l.value=""}function f(le){d(),A(le)}Ve(c,le=>{le&&r("loadAllSessions")});const h=te(new Set(h6()));function p(le){return h.value.has(le)}function g(le){const Ce=new Set(h.value);Ce.has(le)?Ce.delete(le):Ce.add(le),h.value=Ce,p6(Ce)}const S=te(null),_=te(null);function y(le){S.value=le}function b(){S.value=null,_.value=null}function v(le){const Ce=le.currentTarget.getBoundingClientRect();return le.clientY<Ce.top+Ce.height/2?"before":"after"}function w(le,Ce){S.value===null||S.value===Ce||(le.preventDefault(),le.dataTransfer&&(le.dataTransfer.dropEffect="move"),_.value={id:Ce,position:v(le)})}function N(le){const Ce=S.value,We=_.value?.id===le?_.value.position:"before";if(_.value=null,S.value=null,!Ce||Ce===le)return;const nt=E6(i.groups.map(lt=>lt.workspace.id),Ce,le,We);r("reorderWorkspaces",nt)}const E=te(new Set);function k(le,Ce){if(Ce.shiftKey){Ce.stopPropagation();const We=new Set(E.value);We.has(le)?We.delete(le):We.add(le),E.value=We,r("selectWorkspaces",Array.from(We));return}E.value=new Set,r("selectWorkspaces",[]),g(le)}function A(le){E.value=new Set,r("selectWorkspaces",[]),r("select",le)}const I=te(null),P=te(""),M=te(null);function L(){return M}function R(le,Ce){I.value=le,P.value=Ce,ft().then(()=>M.value?.focus())}function B(){const le=I.value,Ce=P.value.trim();le&&Ce&&r("renameWorkspace",le,Ce),I.value=null}function W(){I.value=null}function K(le){P.value=le}const V=te(!1),se=te(null),Y=te({}),G=te(null);function ee(le){G.value&&!G.value.contains(le.target)&&de()}function we(le,Ce){if(Ce.shiftKey){Ce.stopPropagation();const We=new Set(E.value);We.has(le.id)?We.delete(le.id):We.add(le.id),E.value=We,r("selectWorkspaces",Array.from(We));return}Ce.preventDefault(),Ce.stopPropagation(),se.value=le,Y.value={top:`${Ce.clientY}px`,left:`${Ce.clientX}px`},V.value=!0,document.addEventListener("mousedown",ee,!0)}function de(){V.value=!1,document.removeEventListener("mousedown",ee,!0),se.value=null,J()}function Le(){se.value&&Ss(se.value.root),de()}function ce(){se.value&&R(se.value.id,se.value.name),de()}function _e(){const le=se.value;le&&ye(le.id)&&(r("deleteWorkspace",le.id),de())}const me=te(null);let $e;function J(){clearTimeout($e),me.value=null}function ye(le){return me.value===le?(J(),!0):(clearTimeout($e),me.value=le,$e=setTimeout(()=>{me.value=null},2500),!1)}const Se=te(null),U=te(null),Z=te({}),fe=te(null);function oe(le){const Ce=le.target;Ce.closest(".gh-more")||Ce.closest(".ws-menu")||H()}async function he(le,Ce){if(Se.value===le.id){H();return}const We=Ce.currentTarget;U.value=le,Se.value=le.id,document.addEventListener("mousedown",oe),document.addEventListener("scroll",H,!0),window.addEventListener("resize",H),await ft();const nt=fe.value,lt=We.getBoundingClientRect(),bt=4,St=8,ct=nt?.offsetHeight??0,It=nt?.offsetWidth??0;let hn=lt.bottom+bt;hn+ct>window.innerHeight-St&&(hn=Math.max(St,lt.top-ct-bt));let vn=lt.right-It;vn<St&&(vn=St),Z.value={top:`${Math.round(hn)}px`,left:`${Math.round(vn)}px`}}function H(){Se.value=null,U.value=null,J(),document.removeEventListener("mousedown",oe),document.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H)}function X(le){Ss(le.root),H()}function ae(le){R(le.id,le.name),H()}function ke(le){ye(le.id)&&(r("deleteWorkspace",le.id),H())}Ks(()=>{document.removeEventListener("mousedown",ee,!0),document.removeEventListener("mousedown",oe),document.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H),clearTimeout($e)});const Me=te(null);let Ie;function re(){const le=Me.value;le&&(le.classList.remove("blink-now"),le.getBoundingClientRect(),le.classList.add("blink-now"),clearTimeout(Ie),Ie=setTimeout(()=>le.classList.remove("blink-now"),300))}return(le,Ce)=>(x(),$("aside",s5,[m("div",{class:"col",style:Ft({width:e.colWidth+"px"})},[m("div",o5,[m("div",i5,[(x(),$("svg",{ref_key:"logoRef",ref:Me,class:Oe(["ch-logo",{"is-dev":C(s)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:re},[...Ce[19]||(Ce[19]=[kr('<defs data-v-bdcf1ef0><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-bdcf1ef0><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-bdcf1ef0></rect><g class="ch-eyes" fill="#000" data-v-bdcf1ef0><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-bdcf1ef0></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-bdcf1ef0></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-bdcf1ef0></rect>',2)])],2)),m("span",r5,[Ce[20]||(Ce[20]=dt("Kimi Code",-1)),C(s)?(x(),$("span",l5," · "+O(C(o)),1)):ie("",!0)])]),m("button",{type:"button",class:"collapse-btn",title:C(n)("sidebar.collapseSidebar"),"aria-label":C(n)("sidebar.collapseSidebar"),onClick:Ce[0]||(Ce[0]=Ze(We=>r("collapse"),["stop"]))},[...Ce[21]||(Ce[21]=[kr('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-bdcf1ef0><path d="M11 6h9" data-v-bdcf1ef0></path><path d="M11 12h9" data-v-bdcf1ef0></path><path d="M11 18h9" data-v-bdcf1ef0></path><path d="M7 9l-3 3 3 3" data-v-bdcf1ef0></path></svg>',1)])],8,a5),m("button",{type:"button",class:"settings-btn",title:C(n)("settings.title"),"aria-label":C(n)("settings.title"),onClick:Ce[1]||(Ce[1]=Ze(We=>r("openSettings"),["stop"]))},[...Ce[22]||(Ce[22]=[m("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("circle",{cx:"12",cy:"12",r:"3"}),m("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l-.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09A1.65 1.65 0 0 0 15 4.6a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09A1.65 1.65 0 0 0 19.4 15z"})],-1)])],8,c5)]),m("div",u5,[Ce[24]||(Ce[24]=m("svg",{class:"search-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("circle",{cx:"7",cy:"7",r:"5"}),m("path",{d:"M11 11l3 3"})],-1)),Ot(m("input",{"onUpdate:modelValue":Ce[2]||(Ce[2]=We=>l.value=We),class:"search-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),onKeydown:Eo(Ze(d,["stop"]),["esc"])},null,40,d5),[[xn,l.value]]),c.value?(x(),$("button",{key:0,type:"button",class:"search-clear",title:C(n)("sidebar.searchClear"),"aria-label":C(n)("sidebar.searchClear"),onClick:Ze(d,["stop"])},[...Ce[23]||(Ce[23]=[m("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,f5)):ie("",!0)]),m("div",h5,[m("button",{class:"btn-new-chat",onClick:Ce[3]||(Ce[3]=Ze(We=>r("create"),["stop"]))},[Ce[25]||(Ce[25]=m("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),m("span",null,O(C(n)("sidebar.newChat")),1)]),ie("",!0)]),c.value?(x(),$("div",p5,[u.value.length>0?(x(!0),$(Pe,{key:0},Ye(u.value,We=>(x(),je(HC,{key:We.id,session:We,active:We.id===e.activeId,"approval-count":e.pendingBySession[We.id]?.approvals??0,"question-count":e.pendingBySession[We.id]?.questions??0,unread:e.unreadBySession[We.id]??!1,onSelect:Ce[5]||(Ce[5]=nt=>f(nt)),onRename:Ce[6]||(Ce[6]=(nt,lt)=>r("rename",nt,lt)),onArchive:Ce[7]||(Ce[7]=nt=>r("archive",nt)),onFork:Ce[8]||(Ce[8]=nt=>r("fork",nt))},null,8,["session","active","approval-count","question-count","unread"]))),128)):(x(),$("div",m5,O(C(n)("sidebar.searchNoResults")),1))])):(x(),$("div",g5,[e.groups.length===0?(x(),$("div",v5,O(C(n)("workspace.noWorkspace")),1)):(x(!0),$(Pe,{key:1},Ye(e.groups,We=>(x(),$("div",{key:We.workspace.id,class:Oe(["ws-drop-target",{"drop-before":_.value?.id===We.workspace.id&&_.value.position==="before","drop-after":_.value?.id===We.workspace.id&&_.value.position==="after"}]),onDragover:nt=>w(nt,We.workspace.id),onDrop:nt=>N(We.workspace.id)},[gt(n5,{group:We,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"selected-ids":E.value,"renaming-id":I.value,"rename-value":P.value,"rename-input-ref":L(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":Se.value,dragging:S.value===We.workspace.id,"is-collapsed":p,onGroupClick:k,onGroupContextmenu:we,onToggleWsMenu:he,onCreateInWorkspace:Ce[9]||(Ce[9]=nt=>r("createInWorkspace",nt)),onSelectSession:A,onRenameSession:Ce[10]||(Ce[10]=(nt,lt)=>r("rename",nt,lt)),onArchiveSession:Ce[11]||(Ce[11]=nt=>r("archive",nt)),onForkSession:Ce[12]||(Ce[12]=nt=>r("fork",nt)),onLoadMore:Ce[13]||(Ce[13]=nt=>r("loadMoreSessions",nt)),onConfirmRename:B,onCancelRename:W,onUpdateRenameValue:K,onWsDragstart:y,onWsDragend:b},null,8,["group","active-workspace-id","active-id","selected-ids","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,y5))),128))]))],4),V.value?(x(),$("div",{key:0,ref_key:"ghMenuRef",ref:G,class:"gh-menu",style:Ft(Y.value),onClick:Ce[14]||(Ce[14]=Ze(()=>{},["stop"]))},[m("button",{type:"button",class:"ghm-item",onClick:Le},O(C(n)("sidebar.copyPath")),1),m("button",{type:"button",class:"ghm-item",onClick:ce},O(C(n)("sidebar.rename")),1),m("button",{type:"button",class:"ghm-item del",onClick:_e},O(se.value&&me.value===se.value.id?C(n)("sidebar.confirm"):C(n)("sidebar.removeWorkspace")),1)],4)):ie("",!0),Se.value!==null&&U.value?(x(),$("div",{key:1,ref_key:"wsMenuRef",ref:fe,class:"ws-menu",style:Ft(Z.value),onClick:Ce[18]||(Ce[18]=Ze(()=>{},["stop"]))},[m("button",{class:"ws-menu-item",onClick:Ce[15]||(Ce[15]=Ze(We=>X(U.value),["stop"]))},O(C(n)("sidebar.copyPath")),1),Ce[27]||(Ce[27]=m("div",{class:"ws-menu-divider"},null,-1)),m("button",{class:"ws-menu-item",onClick:Ce[16]||(Ce[16]=Ze(We=>ae(U.value),["stop"]))},O(C(n)("sidebar.rename")),1),Ce[28]||(Ce[28]=m("div",{class:"ws-menu-divider"},null,-1)),m("button",{class:"ws-menu-item del",onClick:Ce[17]||(Ce[17]=Ze(We=>ke(U.value),["stop"]))},O(me.value===U.value.id?C(n)("sidebar.confirm"):C(n)("sidebar.removeWorkspace")),1)],4)):ie("",!0)]))}}),b5=vt(k5,[["__scopeId","data-v-bdcf1ef0"]]);function _5(e){try{const t=An(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function w5(e,t){try{Pn(e,String(t))}catch{}}function S5(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(_){return Number.isFinite(_)?Math.min(nS(o),Math.max(s,Math.round(_))):n}const l=te(r(_5(t)??n)),a=te(!1);function c(_){const y=r(_);l.value=y,w5(t,y)}let u=0,d=0,f=null,h=-1;function p(_){if(!a.value)return;const y=_.clientX-u;c(d+(i?-y:y))}function g(){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",g),f.removeEventListener("pointercancel",g)}f=null,h=-1}}function S(_){_.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",g),f.addEventListener("pointercancel",g)}return Ks(g),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:S}}const C5=["aria-label"],x5=Xe({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),{width:i,dragging:r,onPointerDown:l}=S5({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ve(i,a=>s("update:width",a)),Ve(r,a=>s("update:dragging",a)),(a,c)=>(x(),$("div",{class:Oe(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[m("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,C5))}}),Xk=vt(x5,[["__scopeId","data-v-0d454900"]]),T5={preview:"Preview"},M5={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",comingSoon:"Coming soon…"},A5={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive session?",confirm:"Confirm",cancel:"Cancel",options:"Options",rename:"Rename",copyPath:"Copy path",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:"Show more ({count})",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchClear:"Clear search",searchNoResults:"No matching sessions"},E5={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},$5={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",confirm:"Confirm",cancel:"Cancel",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…"},I5={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",modelTooltip:"Click to switch model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionTooltip:"Click to cycle permission mode",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",modesTooltip:"Mode: Plan / Goal / Swarm",goalLabel:"Goal",swarmLabel:"Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},N5={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",steerNow:"Steer now ⌃S",steerTitle:"Inject into the running turn without waiting (Ctrl+S / ⌘S)",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"},L5={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"},O5={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",confirm:"Confirm",cancel:"Cancel",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},P5={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"},R5={title:"New session",close:"Close (Esc)",cwdLabel:"Working directory",cwdPlaceholder:"Absolute path of the working directory, e.g. /Users/you/project",recentLabel:"Recent directories",titleFieldLabel:"Title",titleFieldPlaceholder:"Optional, named automatically if left blank",create:"Create",cancel:"Cancel",footerHint:"Enter to create · Esc to close"},D5={title:"Sessions",close:"Close",searchPlaceholder:"Search sessions by title…",noWorkspace:"No workspace",emptyNone:"No sessions yet",emptyNoMatch:"No matching sessions",footerHint:"↑↓ to navigate · Enter to switch · Esc to close",justNow:"just now"},B5={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"},F5={title:"Question",step:"Q{current}/{total}",prev:"‹ Prev",next:"Next ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},H5={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",dockQueue:"Queue",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",todoTag:"todos",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",collapse:"Collapse",expand:"Expand"},W5={panelTitle:"Thinking",close:"Close"},U5={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"},j5={},q5={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"}},z5={searching:"Searching…",noMatch:"No matches"},V5={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",contentType:"Content type",details:"Server details",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",status:"HTTP status",timeout:"Timeout"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},K5={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},sessions:{desc:"Browse & switch sessions"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},G5={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Plan",task:"Task"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"}},Y5={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},X5={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},Z5={label:"Theme",modern:"Explore",kimi:"Native",colorSchemeLabel:"Appearance",light:"Light",dark:"Dark",system:"System"},J5={preview:"预览"},Q5={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",comingSoon:"敬请期待"},eN={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"归档会话?",confirm:"确认",cancel:"取消",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID ⧉",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"展开更多 ({count})",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchClear:"清除搜索",searchNoResults:"没有匹配的会话"},tN={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},nN={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"确定撤销?",confirm:"确定",cancel:"取消",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…"},sN={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",modelTooltip:"点击切换模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionTooltip:"点击循环切换审批模式",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",modesTooltip:"模式:计划 / 目标 / Swarm",goalLabel:"目标",swarmLabel:"Swarm",modeOff:"未启用",goalPlaceholder:"让 Agent 完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},oN={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",steerNow:"立即插入 ⌃S",steerTitle:"不等当前回合结束,把消息直接插进正在运行的任务(Ctrl+S / ⌘S)",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking"},iN={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 后重试"},rN={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",confirm:"确认",cancel:"取消",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},lN={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},aN={title:"新建会话",close:"关闭 (Esc)",cwdLabel:"工作目录",cwdPlaceholder:"工作目录绝对路径,如 /Users/you/project",recentLabel:"最近目录",titleFieldLabel:"标题",titleFieldPlaceholder:"可选,留空则自动命名",create:"新建",cancel:"取消",footerHint:"Enter 新建 · Esc 关闭"},cN={title:"会话",close:"关闭",searchPlaceholder:"按标题搜索会话…",noWorkspace:"无工作区",emptyNone:"暂无会话",emptyNoMatch:"没有匹配的会话",footerHint:"↑↓ 切换 · Enter 进入 · Esc 关闭",justNow:"刚刚"},uN={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},dN={title:"提问",step:"Q{current}/{total}",prev:"‹ 上一",next:"下一 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},fN={tag:"tasks",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",dockQueue:"队列",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",todoTag:"待办",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",collapse:"折叠",expand:"展开"},hN={panelTitle:"思考过程",close:"关闭"},pN={title:"改动",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},mN={},gN={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:"无法读取这个文件"}},vN={searching:"搜索中…",noMatch:"无匹配"},yN={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",contentType:"响应类型",details:"服务端详情",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",status:"HTTP 状态",timeout:"超时设置"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},kN={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},sessions:{desc:"浏览/切换会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},bN={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"计划",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"}},_N={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},wN={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},SN={label:"主题",modern:"探索",kimi:"原生",colorSchemeLabel:"外观",light:"浅色",dark:"深色",system:"跟随系统"},CN={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",themeLabel:"Theme",modernDesc:"Bubbles, conversational, softer.",kimiDesc:"Native look: calm, flat.",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},xN={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",themeLabel:"主题",modernDesc:"气泡、对话感、更柔和。",kimiDesc:"原生风格:安静、扁平。",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},TN={title:"Settings",tabs:{general:"General",agent:"Agent",advanced:"Advanced",experimental:"Experimental"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",permission:{manual:"Manual",auto:"Auto",yolo:"YOLO"},defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Telemetry",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",beta:"Experimental",betaToc:"Proportional conversation outline",betaTocHint:" Larger bubbles, viewport indicator, and hover tooltip"},MN={title:"设置",tabs:{general:"通用",agent:"Agent",advanced:"高级",experimental:"实验性"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",permission:{manual:"手动",auto:"自动",yolo:"全自动"},defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"遥测",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",beta:"实验性",betaToc:"对话目录增强",betaTocHint:"更大的气泡、视口指示器和悬停提示"},AN={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",confirmArchive:"Confirm archive?"},EN={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"detached",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",confirmArchive:"确认归档?"},$N={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"},IN={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},NN={en:{common:T5,app:M5,sidebar:A5,workspace:E5,conversation:$5,status:I5,composer:N5,login:L5,providers:O5,model:P5,newSession:R5,sessions:D5,approval:B5,question:F5,tasks:H5,thinking:W5,diff:U5,fileTree:j5,filePreview:q5,mention:z5,warnings:V5,commands:K5,tools:G5,layout:Y5,mobile:X5,theme:Z5,onboarding:CN,settings:TN,header:AN,sideChat:$N},zh:{common:J5,app:Q5,sidebar:eN,workspace:tN,conversation:nN,status:sN,composer:oN,login:iN,providers:rN,model:lN,newSession:aN,sessions:cN,approval:uN,question:dN,tasks:fN,thinking:hN,diff:pN,fileTree:mN,filePreview:gN,mention:vN,warnings:yN,commands:kN,tools:bN,layout:_N,mobile:wN,theme:SN,onboarding:xN,settings:MN,header:EN,sideChat:IN}},WC=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function LN(){const e=An(Et.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Nn=s6({legacy:!1,locale:LN(),fallbackLocale:"en",messages:NN});function UC(e){Nn.global.locale.value=e,Pn(Et.locale,e)}const ca=Nn.global.t,ON={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"},PN={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 pl(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return PN[t]??t}function gf(e){const t=ON[pl(e)];return t?ca(t):e}const RN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="2.5" y="1.5" width="9" height="13" rx="1"/><line x1="5" y1="5" x2="9" y2="5"/><line x1="5" y1="7.5" x2="11" y2="7.5"/><line x1="5" y1="10" x2="10" y2="10"/></svg>',DN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="1.5" y="2.5" width="13" height="11" rx="1.5"/><polyline points="4,6 6.5,8 4,10"/><line x1="8" y1="10" x2="12" y2="10"/></svg>',Zk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M10.5 2.5l3 3-8 8H2.5v-3l8-8z"/><line x1="8.5" y1="4.5" x2="11.5" y2="7.5"/></svg>',BN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M3 12V4.5L8 2l5 2.5V12H3z"/><line x1="6" y1="7" x2="10" y2="7"/><line x1="8" y1="5" x2="8" y2="9"/></svg>',Jk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="6.5" cy="6.5" r="4"/><line x1="9.5" y1="9.5" x2="13.5" y2="13.5"/></svg>',FN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M5 2.5C3.5 2.5 3.5 5 3.5 6.5S2.5 8 2.5 8s1 0 1 1.5S3.5 13.5 5 13.5"/><path d="M11 2.5c1.5 0 1.5 2.5 1.5 4S13.5 8 13.5 8s-1 0-1 1.5.5 4-1.5 4"/><line x1="8" y1="6" x2="8" y2="10"/><line x1="6.3" y1="6.8" x2="9.7" y2="9.2"/><line x1="9.7" y1="6.8" x2="6.3" y2="9.2"/></svg>',HN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',WN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="6"/><path d="M8 2c-2 2-3 3.6-3 6s1 4 3 6"/><path d="M8 2c2 2 3 3.6 3 6s-1 4-3 6"/><line x1="2" y1="8" x2="14" y2="8"/></svg>',Qk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><polyline points="2,4.5 3.5,6 5.5,3"/><polyline points="2,11 3.5,12.5 5.5,9.5"/><line x1="8" y1="4.5" x2="14" y2="4.5"/><line x1="8" y1="11" x2="14" y2="11"/></svg>',UN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M8.5 1L3 9h4l-1.5 6 5.5-8h-4l1.5-6z"/></svg>',jN="";function qN(e){switch(pl(e)){case"read":return RN;case"bash":return DN;case"edit":return Zk;case"multi_edit":return Zk;case"write":return BN;case"grep":return Jk;case"search":return Jk;case"glob":return FN;case"ls":return HN;case"web_fetch":return WN;case"todo":return Qk;case"task":return Qk;default:return(e??"").trim().toLowerCase().includes("skill")?UN:jN}}const jC=80;function zN(e,t=jC){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function VN(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function KN(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 Vt(e){return typeof e=="string"&&e.length>0?e:void 0}function Vr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function GN(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 om(e){return Vt(e.path)??Vt(e.file_path)??Vt(e.filePath)??Vt(e.filename)}const YN=64;function Ag(e,t,n=!1){const s=(o,i=jC)=>n?o.trim():zN(o,i);try{const o=KN(t);if(!n&&VN(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(pl(e)){case"read":{const r=om(o);if(!r)return i();const l=Vr(o.offset)??Vr(o.line_start)??Vr(o.start_line),a=Vr(o.limit)??Vr(o.length),c=Vr(o.line_end)??Vr(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=om(o);return r?s(`${r} ${ca("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=om(o);return r?s(r):i()}case"bash":{const r=Vt(o.command)??Vt(o.cmd)??Vt(o.script);return r?s(r,YN):i()}case"grep":case"search":{const r=Vt(o.pattern)??Vt(o.query)??Vt(o.regex),l=Vt(o.path)??Vt(o.glob)??Vt(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=Vt(o.pattern)??Vt(o.glob)??Vt(o.query),l=Vt(o.path)??Vt(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):Vt(o.path)?s(Vt(o.path)):i()}case"ls":{const r=Vt(o.path)??Vt(o.dir)??Vt(o.directory)??Vt(o.cwd);return r?s(r):i()}case"web_fetch":{const r=Vt(o.url)??Vt(o.uri);return r?s(GN(r)):i()}case"todo":case"task":{const r=Vt(o.description)??Vt(o.title)??Vt(o.prompt)??Vt(o.name)??Vt(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(ca("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function XN(e){try{switch(pl(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return ca("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return ca("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?ca("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const ZN=1e6,eb=5e3;function tb(e){if(e==="")return[];const t=e.split(`
|
|
39
|
-
`);return t.at(-1)===""&&t.pop(),t}function JN(e,t){const n=tb(e),s=tb(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>eb||i>eb||(o+1)*(i+1)>ZN)return null;const r=Array.from({length:o+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=o;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===s[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=o,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===s[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:s[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 QN(e){let t=0,n=0;for(const s of e)s.type==="add"?t++:s.type==="del"&&n++;return{added:t,removed:n}}function qC(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 zC(e){const t=pl(e.name);if(t!=="edit"&&t!=="write")return null;const n=qC(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const s=typeof n.old_string=="string"?n.old_string:void 0,o=typeof n.new_string=="string"?n.new_string:void 0;return s===void 0||o===void 0?null:JN(s,o)}return null}function e8(e){const t=qC(e);return t&&typeof t.path=="string"?t.path:void 0}function t8(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const n8=["title"],s8=["title"],o8=["src","alt"],i8=["src"],r8=["src"],l8={class:"car",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},a8=["points"],c8=["innerHTML"],u8={class:"a"},d8=["title"],f8={class:"rt"},h8=["title"],p8={key:1,class:"chip"},m8={key:2,class:"spin",role:"status","aria-label":"running"},g8={key:4,class:"tm"},v8={key:0,class:"bb"},y8={key:0,class:"bb-summary"},k8={key:1,class:"bb-empty"},b8=!1,_8=Xe({__name:"ToolCall",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,s=t,o=F(()=>n.tool.status==="running"&&/^bash$/i.test(n.tool.name)),i=F(()=>!!n.tool.output&&n.tool.output.length>0),r=F(()=>i.value||o.value),l=te(n.tool.defaultExpanded===!0&&r.value),a=F(()=>{const M=pl(n.tool.name);return M==="edit"||M==="write"});function c(){if(a.value&&n.toolDiffPanel){s("openToolDiff",n.tool.id);return}r.value&&(l.value=!l.value)}Ve(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status,n.tool.name],()=>{n.tool.defaultExpanded===!0&&r.value&&(l.value=!0)});const u=()=>n.tool.status==="error"?"✕":"✓",d=()=>gf(n.tool.name),f=()=>qN(n.tool.name),h=()=>Ag(n.tool.name,n.tool.arg),p=()=>Ag(n.tool.name,n.tool.arg,!0),g=()=>{const M=y.value;if(M&&n.tool.status!=="error"){const{added:L,removed:R}=QN(M);if(L||R)return`+${L} −${R}`}return XN({name:n.tool.name,arg:n.tool.arg,output:n.tool.output,timing:n.tool.timing,status:n.tool.status})},S=()=>n.tool.status==="error",_=F(()=>n.tool.status==="ok"?n.tool.media:void 0),y=F(()=>zC(n.tool)),b=F(()=>n.tool.name==="ExitPlanMode"),v=F(()=>b.value?n.tool.planPath:void 0),w=F(()=>{const M=v.value;return M?M.split(/[\\/]+/).pop()||M:""});function N(){v.value&&s("openFile",{path:v.value})}const E=F(()=>b8);function k(M){return M.split(/[\\/]+/).pop()||M}function A(M){return M<1024?`${M} B`:M<1024*1024?`${(M/1024).toFixed(1)} KB`:`${(M/1024/1024).toFixed(1)} MB`}const I=F(()=>{const M=_.value;if(!M)return"";const L=[M.path?k(M.path):gf(n.tool.name)];return M.mimeType&&L.push(M.mimeType),M.bytes!==void 0&&L.push(A(M.bytes)),M.dimensions&&L.push(M.dimensions),L.join(" · ")});function P(){const M=_.value;M?.kind==="image"&&s("openMedia",M)}return(M,L)=>_.value?(x(),$("div",{key:0,class:Oe(["media-tool",{mob:e.mobile}])},[m("div",{class:"media-title",title:_.value.path||I.value},O(I.value),9,n8),_.value.kind==="image"?(x(),$("button",{key:0,type:"button",class:"media-image-button",title:_.value.path||I.value,onClick:P},[m("img",{class:"media-image",src:_.value.url,alt:_.value.path?k(_.value.path):I.value,loading:"lazy"},null,8,o8)],8,s8)):_.value.kind==="video"?(x(),$("video",{key:1,class:"media-video",src:_.value.url,controls:"",preload:"metadata"},null,8,i8)):(x(),$("audio",{key:2,class:"media-audio",src:_.value.url,controls:""},null,8,r8))],2)):(x(),$("div",{key:1,class:Oe(["box",{open:l.value,err:S(),mob:e.mobile,stacked:e.stackPosition!=="single","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[m("div",{class:"bh",onClick:c},[(x(),$("svg",l8,[m("polyline",{points:l.value?"4,6 8,10 12,6":"6,4 10,8 6,12"},null,8,a8)])),f()?(x(),$("span",{key:0,class:"gl",innerHTML:f(),"aria-hidden":"true"},null,8,c8)):ie("",!0),m("span",u8,O(d()),1),l.value?ie("",!0):(x(),$("span",{key:1,class:"p",title:h()},O(h()),9,d8)),m("span",f8,[E.value?(x(),$("button",{key:0,class:"plan-link",type:"button",title:v.value,onClick:Ze(N,["stop"])},"📄 "+O(w.value),9,h8)):ie("",!0),g()?(x(),$("span",p8,O(g()),1)):ie("",!0),e.tool.status==="running"?(x(),$("span",m8)):(x(),$("span",{key:3,class:Oe(e.tool.status==="ok"?"ok":"er")},O(u()),3)),e.tool.timing&&e.tool.name!=="bash"?(x(),$("span",g8,O(e.tool.timing),1)):ie("",!0)])]),l.value?(x(),$("div",v8,[p()?(x(),$("div",y8,O(p()),1)):ie("",!0),i.value?ie("",!0):(x(),$("div",k8,"Waiting for output…")),(x(!0),$(Pe,null,Ye(e.tool.output??[],(R,B)=>(x(),$("div",{key:B},O(R),1))),128))])):ie("",!0)],2))}}),sd=vt(_8,[["__scopeId","data-v-4b9fd75b"]]);var w8=Object.create,rv=Object.defineProperty,S8=Object.getOwnPropertyDescriptor,VC=Object.getOwnPropertyNames,C8=Object.getPrototypeOf,x8=Object.prototype.hasOwnProperty,KC=(e,t)=>function(){return t||(0,e[VC(e)[0]])((t={exports:{}}).exports,t),t.exports},GC=e=>{let t={};for(var n in e)rv(t,n,{get:e[n],enumerable:!0});return t},T8=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=VC(t),i=0,r=o.length,l;i<r;i++)l=o[i],!x8.call(e,l)&&l!==n&&rv(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=S8(t,l))||s.enumerable});return e},YC=(e,t,n)=>(n=e!=null?w8(C8(e)):{},T8(rv(n,"default",{value:e,enumerable:!0}),e));function M8(e,t,n,s){const o=Number(e[t].meta.id+1).toString();let i="";return typeof s.docId=="string"&&(i=`-${s.docId}-`),i+o}function A8(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function E8(e,t,n,s,o){const i=o.rules.footnote_anchor_name(e,t,n,s,o),r=o.rules.footnote_caption(e,t,n,s,o);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function $8(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
40
|
-
`:`<hr class="footnotes-sep">
|
|
41
|
-
`)+`<section class="footnotes">
|
|
42
|
-
<ol class="footnotes-list">
|
|
43
|
-
`}function I8(){return`</ol>
|
|
44
|
-
</section>
|
|
45
|
-
`}function N8(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function L8(){return`</li>
|
|
46
|
-
`}function O8(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function P8(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=E8,e.renderer.rules.footnote_block_open=$8,e.renderer.rules.footnote_block_close=I8,e.renderer.rules.footnote_open=N8,e.renderer.rules.footnote_close=L8,e.renderer.rules.footnote_anchor=O8,e.renderer.rules.footnote_caption=A8,e.renderer.rules.footnote_anchor_name=M8;function s(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 g=new l.Token("footnote_reference_open","",1);g.meta={label:p},g.level=l.level++,l.tokens.push(g);const S=l.bMarks[a],_=l.tShift[a],y=l.sCount[a],b=l.parentType,v=h,w=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let N=w;for(;h<f;){const k=l.src.charCodeAt(h);if(n(k))k===9?N+=4-N%4:N++;else break;h++}l.tShift[a]=h-v,l.sCount[a]=N-w,l.bMarks[a]=v,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=b,l.blkIndent-=4,l.tShift[a]=_,l.sCount[a]=y,l.bMarks[a]=S;const E=new l.Token("footnote_reference_close","",-1);return E.level=--l.level,l.tokens.push(E),!0}function o(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,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 g=l.push("footnote_ref","",0);g.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 g=l.push("footnote_ref","",0);g.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,g=h.length;p<g;p++){const S=new l.Token("footnote_open","",1);if(S.meta={id:p,label:h[p].label},l.tokens.push(S),h[p].tokens){a=[];const b=new l.Token("paragraph_open","p",1);b.block=!0,a.push(b);const v=new l.Token("inline","",0);v.children=h[p].tokens,v.content=h[p].content,a.push(v);const w=new l.Token("paragraph_close","p",-1);w.block=!0,a.push(w)}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 y=h[p].count>0?h[p].count:1;for(let b=0;b<y;b++){const v=new l.Token("footnote_anchor","",0);v.meta={id:p,subId:b,label:h[p].label},l.tokens.push(v)}_&&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",s,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",o),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function R8(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==43)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){let i;const r=[],l=o.length;for(let a=0;a<l;a++){const c=o[a];if(c.marker!==43||c.end===-1)continue;const u=o[c.end];i=s.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=s.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",s.tokens[u.token-1].type==="text"&&s.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<s.tokens.length&&s.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=s.tokens[c],s.tokens[c]=s.tokens[a],s.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(s){const o=s.tokens_meta,i=(s.tokens_meta||[]).length;n(s,s.delimiters);for(let r=0;r<i;r++)o[r]&&o[r].delimiters&&n(s,o[r].delimiters)})}function D8(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==61)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){const i=[],r=o.length;for(let l=0;l<r;l++){const a=o[l];if(a.marker!==61||a.end===-1)continue;const c=o[a.end],u=s.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=s.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",s.tokens[c.token-1].type==="text"&&s.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<s.tokens.length&&s.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=s.tokens[a];s.tokens[a]=s.tokens[l],s.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(s){let o;const i=s.tokens_meta,r=(s.tokens_meta||[]).length;for(n(s,s.delimiters),o=0;o<r;o++)i[o]&&i[o].delimiters&&n(s,i[o].delimiters)})}const B8=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function F8(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==126||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(B8,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function H8(e){e.inline.ruler.after("emphasis","sub",F8)}const W8=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function U8(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==94||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(W8,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function j8(e){e.inline.ruler.after("emphasis","sup",U8)}var q8=KC({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(g,S){S=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},S),g.core.ruler.after("inline","github-task-lists",function(_){for(var y=_.tokens,b=0,v=2;v<y.length;v++)o(y,v)&&(i(y[v],b,S,_.Token),b+=1,n(y[v-2],"class",S.liClass),n(y[s(y,v-2)],"class",S.ulClass))})};function n(g,S,_){var y=g.attrIndex(S),b=[S,_];y<0?g.attrPush(b):g.attrs[y]=b}function s(g,S){for(var _=g[S].level-1,y=S-1;y>=0;y--)if(g[y].level===_)return y;return-1}function o(g,S){return d(g[S])&&f(g[S-1])&&h(g[S-2])&&p(g[S])}function i(g,S,_,y){var b=_.idPrefix+S;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(b,y)),g.children.push(a(y)),g.children.unshift(r(g,b,_,y)),_.divWrap&&(g.children.unshift(c(_,y)),g.children.push(u(y)))}function r(g,S,_,y){var b=new y("checkbox_input","input",0);return b.attrs=[["type","checkbox"],["id",S]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&b.attrs.push(["checked","true"]),_.disabled===!0&&b.attrs.push(["disabled","true"]),b}function l(g,S){var _=new S("label_open","label",1);return _.attrs=[["for",g]],_}function a(g){return new g("label_close","label",-1)}function c(g,S){var _=new S("checkbox_open","div",0);return _.attrs=[["class",g.divClass]],_}function u(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function p(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})}),z8=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))),V8=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),im;const K8=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]]),G8=(im=String.fromCodePoint)!==null&&im!==void 0?im: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 Y8(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=K8.get(e))!==null&&t!==void 0?t:e}var ns;(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"})(ns||(ns={}));const X8=32;var ur;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ur||(ur={}));function Eg(e){return e>=ns.ZERO&&e<=ns.NINE}function Z8(e){return e>=ns.UPPER_A&&e<=ns.UPPER_F||e>=ns.LOWER_A&&e<=ns.LOWER_F}function J8(e){return e>=ns.UPPER_A&&e<=ns.UPPER_Z||e>=ns.LOWER_A&&e<=ns.LOWER_Z||Eg(e)}function Q8(e){return e===ns.EQUALS||J8(e)}var ts;(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"})(ts||(ts={}));var lr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(lr||(lr={}));var eL=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ts.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=lr.Strict}startEntity(e){this.decodeMode=e,this.state=ts.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ts.EntityStart:return e.charCodeAt(t)===ns.NUM?(this.state=ts.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ts.NamedEntity,this.stateNamedEntity(e,t));case ts.NumericStart:return this.stateNumericStart(e,t);case ts.NumericDecimal:return this.stateNumericDecimal(e,t);case ts.NumericHex:return this.stateNumericHex(e,t);case ts.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|X8)===ns.LOWER_X?(this.state=ts.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ts.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,s){if(t!==n){const o=n-t;this.result=this.result*Math.pow(s,o)+parseInt(e.substr(t,o),s),this.consumed+=o}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Eg(s)||Z8(s))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Eg(s))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ns.SEMI)this.consumed+=1;else if(this.decodeMode===lr.Strict)return 0;return this.emitCodePoint(Y8(this.result),this.consumed),this.errors&&(e!==ns.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let s=n[this.treeIndex],o=(s&ur.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=tL(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===lr.Attribute&&(o===0||Q8(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&ur.VALUE_LENGTH)>>14,o!==0){if(i===ns.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==lr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&ur.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~ur.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case ts.NamedEntity:return this.result!==0&&(this.decodeMode!==lr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ts.NumericDecimal:return this.emitNumericEntity(0,2);case ts.NumericHex:return this.emitNumericEntity(0,3);case ts.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ts.EntityStart:return 0}}};function XC(e){let t="";const n=new eL(e,s=>t+=G8(s));return function(o,i){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(i);const c=n.write(o,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+o.slice(r);return t="",a}}function tL(e,t,n,s){const o=(t&ur.BRANCH_LENGTH)>>7,i=t&ur.JUMP_TABLE;if(o===0)return i!==0&&s===i?n:-1;if(i){const a=s-i;return a<0||a>=o?-1:e[n+a]-1}let r=n,l=r+o-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<s)r=a+1;else if(c>s)l=a-1;else return e[a+o]}return-1}const nL=XC(z8);XC(V8);function lv(e,t=lr.Legacy){return nL(e,t)}var sL=YC(q8());const nb={};function oL(e){let t=nb[e];if(t)return t;t=nb[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);t.push(s)}for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}function mh(e,t){typeof t!="string"&&(t=mh.defaultChars);const n=oL(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(s){let o="";for(let i=0,r=s.length;i<r;i+=3){const l=parseInt(s.slice(i+1,i+3),16);if(l<128){o+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(s.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?o+="��":o+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?o+="���":o+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16),u=parseInt(s.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}o+="�"}return o})}mh.defaultChars=";/?:@&=+$,#";mh.componentChars="";var $g=mh;const sb={};function iL(e){let t=sb[e];if(t)return t;t=sb[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);/^[0-9a-z]$/i.test(s)?t.push(s):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function gh(e,t,n){typeof t!="string"&&(n=t,t=gh.defaultChars),typeof n>"u"&&(n=!0);const s=iL(t);let o="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){o+=e.slice(i,i+3),i+=2;continue}if(l<128){o+=s[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){o+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[i])}return o}gh.defaultChars=";/?:@&=+$,-_.!~*'()#";gh.componentChars="-_.!~*'()";var ZC=gh;function av(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 vf(){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 rL=/^([a-z0-9.+-]+:)/i,lL=/:[0-9]*$/,aL=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,cL=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
47
|
-
`," "]),uL=["'"].concat(cL),ob=["%","/","?",";","#"].concat(uL),ib=["/","?","#"],dL=255,rb=/^[+a-z0-9A-Z_-]{0,63}$/,fL=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,lb={javascript:!0,"javascript:":!0},ab={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function hL(e,t){if(e&&e instanceof vf)return e;const n=new vf;return n.parse(e,t),n}vf.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=aL.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=rL.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=i.substr(0,2)==="//",o&&!(r&&lb[r])&&(i=i.substr(2),this.slashes=!0)),!lb[r]&&(o||r&&!ab[r])){let c=-1;for(let p=0;p<ib.length;p++)s=i.indexOf(ib[p]),s!==-1&&(c===-1||s<c)&&(c=s);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let p=0;p<ob.length;p++)s=i.indexOf(ob[p]),s!==-1&&(c===-1||s<c)&&(c=s);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 g=0,S=p.length;g<S;g++){const _=p[g];if(_&&!_.match(rb)){let y="";for(let b=0,v=_.length;b<v;b++)_.charCodeAt(b)>127?y+="x":y+=_[b];if(!y.match(rb)){const b=p.slice(0,g),v=p.slice(g+1),w=_.match(fL);w&&(b.push(w[1]),v.unshift(w[2])),v.length&&(i=v.join(".")+i),this.hostname=b.join(".");break}}}}this.hostname.length>dL&&(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),ab[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};vf.prototype.parseHost=function(e){let t=lL.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 cv=hL,JC=GC({decode:()=>$g,encode:()=>ZC,format:()=>av,parse:()=>cv}),QC=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ex=/[\0-\x1F\x7F-\x9F]/,pL=/[\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]/,tx=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,mL=/[\$\+<->\^`\|~\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]/,nx=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,gL=GC({Any:()=>QC,Cc:()=>ex,Cf:()=>pL,P:()=>tx,S:()=>mL,Z:()=>nx}),vL=Object.defineProperty,sx=e=>{let t={};for(var n in e)vL(t,n,{get:e[n],enumerable:!0});return t},yL=sx({arrayReplaceAt:()=>xL,assign:()=>SL,countLines:()=>$n,escapeHtml:()=>OL,escapeRE:()=>RL,fromCodePoint:()=>Yc,has:()=>wL,isMdAsciiPunct:()=>bf,isPunctChar:()=>kf,isPunctCode:()=>Ig,isSpace:()=>CL,isString:()=>bL,isValidEntityCode:()=>yh,isWhiteSpace:()=>Gc,lib:()=>DL,mdurl:()=>JC,normalizeReference:()=>vh,ucmicro:()=>yf,unescapeAll:()=>Xc,unescapeMd:()=>EL});const yf=gL;function kL(e){return Object.prototype.toString.call(e)}function bL(e){return kL(e)==="[object String]"}const _L=Object.prototype.hasOwnProperty;function wL(e,t){return _L.call(e,t)}function SL(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(s=>{e[s]=n[s]})}}),e}function CL(e){return e===9||e===32}function Gc(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function kf(e){return yf.P.test(e)||yf.S.test(e)}const cb=new Map;function Ig(e){if(bf(e))return!0;const t=cb.get(e);if(t!==void 0)return t;const n=kf(String.fromCharCode(e));return cb.set(e,n),n}function bf(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 vh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function xL(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function yh(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Yc(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const ox=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,TL=new RegExp(`${ox.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),ML=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function AL(e,t){if(t.charCodeAt(0)===35&&ML.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return yh(s)?Yc(s):e}const n=lv(e);return n!==e?n:e}function EL(e){return e.includes("\\")?e.replace(ox,"$1"):e}function Xc(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(TL,(t,n,s)=>n||AL(t,s))}const $L=/[&<>"]/,IL=/[&<>"]/g,NL={"&":"&","<":"<",">":">",'"':"""};function LL(e){return NL[e]}function OL(e){return $L.test(e)?e.replace(IL,LL):e}const PL=/[.?*+^$[\]\\(){}|-]/g;function RL(e){return e.replace(PL,"\\$&")}const DL={mdurl:JC,ucmicro:yf};function $n(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
48
|
-
`,n+1))!==-1;)t++;return t}const BL=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,FL=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,HL=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,uv=["references","footnotes","abbreviations","abbr","abbrs"],dv=Symbol.for("markdown-it-ts.global-state"),fv=Object.prototype.hasOwnProperty;function ub(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Wo(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function pr(e){if(Array.isArray(e))return e.map(t=>pr(t));if(Wo(e)){const t={};for(const n of Object.keys(e))t[n]=pr(e[n]);return t}return e}function _f(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Wo(e)?Object.keys(e):[]}function Ng(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(!Ng(e[n],t[n]))return!1;return!0}if(Wo(e)||Wo(t)){if(!Wo(e)||!Wo(t))return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of n)if(!fv.call(t,o)||!Ng(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function ix(e,t){if(Array.isArray(e))return e[Number(t)];if(Wo(e))return e[t]}function WL(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=pr(t[n]);return e}if(Wo(e)&&Wo(t)){for(const n of Object.keys(e))fv.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=pr(t[n]);return e}return pr(t)}function UL(e,t,n){const s=n.ownedKeys??[],o=e[t];if(Wo(o)||Array.isArray(o)){const i=new Set(_f(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=pr(ix(n.value,r)):delete o[r];!n.existed&&_f(o).length===0&&delete e[t];return}n.existed?e[t]=pr(n.value):delete e[t]}function hv(e){const t=e[dv];return ub(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&ub(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function jL(e,t){Object.defineProperty(e,dv,{value:t,enumerable:!1,configurable:!0,writable:!0})}function ys(e){return e?BL.test(e)?"footnote-definition":FL.test(e)?"abbreviation-definition":HL.test(e)?"reference-definition":null:null}function fu(e){return hv(e)?.reason??null}function ua(e,t,n){if(fu(e)&&Ri(e),!t)return n();pv(e,t);try{const s=n();return mv(e),s}catch(s){throw Ri(e),s}}function pv(e,t){try{Ri(e);const n={};for(const s of uv)n[s]=fv.call(e,s)?{existed:!0,value:pr(e[s])}:{existed:!1};jL(e,{reason:t,snapshot:n})}catch{}}function mv(e){const t=hv(e);if(t)for(const n of uv){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!Wo(o)&&!Array.isArray(o))continue;const i=new Set(_f(s.existed?s.value:void 0));s.ownedKeys=_f(o).filter(r=>i.has(r)?!Ng(o[r],ix(s.value,r)):!0)}}function Ri(e){const t=hv(e);if(t){for(const n of uv){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){UL(e,n,s);continue}s.existed?e[n]=WL(e[n],s.value):delete e[n]}delete e[dv]}}const Lg=Symbol.for("markdown-it-ts.diagnostics");function kh(e,t){if(e)try{const n=e[Lg];if(n&&typeof n=="object")return n;if(!t)return;const s={};return Object.defineProperty(e,Lg,{value:s,enumerable:!1,configurable:!0,writable:!0}),s}catch{return}}function _i(e){return kh(e,!1)}function qL(e){if(e)try{delete e[Lg]}catch{}}function to(e){qL(e)}function rs(e,t){const n=kh(e,!0);n&&(n.strategy=t)}function rm(e,t){const n=kh(e,!0);n&&(n.chunk=t)}function rx(e,t){const n=kh(e,!0);n&&(n.unbounded=t)}function zL(e){const t={};e=e||{},t.src_Any=QC.source,t.src_Cc=ex.source,t.src_Z=nx.source,t.src_P=tx.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 Og(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function bh(e){return Object.prototype.toString.call(e)}function VL(e){return bh(e)==="[object String]"}function KL(e){return bh(e)==="[object Object]"}function GL(e){return bh(e)==="[object RegExp]"}function db(e){return bh(e)==="[object Function]"}function YL(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const lx={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function XL(e){return Object.keys(e||{}).reduce(function(t,n){return t||lx.hasOwnProperty(n)},!1)}const ZL={"http:":{validate:function(e,t,n){const s=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(s)?s.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const s=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(s)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const s=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(s)?s.match(n.re.mailto)[0].length:0}}},JL="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]",QL="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function eO(e){e.__index__=-1,e.__text_cache__=""}function tO(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function fb(){return function(e,t){t.normalize(e)}}function wf(e){const t=e.re=zL(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(JL),n.push(t.src_xn),t.src_tlds=n.join("|");function s(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const o=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,KL(a)){GL(a.validate)?c.validate=tO(a.validate):db(a.validate)?c.validate=a.validate:i(l,a),db(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=fb();return}if(VL(a)){o.push(l);return}i(l,a)}),o.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:fb()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(YL).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"),eO(e)}function nO(e,t){const n=e.__index__,s=e.__last_index__,o=e.__text_cache__.slice(n,s);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=s+t,this.raw=o,this.text=o,this.url=o}function Pg(e,t){const n=new nO(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function ho(e,t){if(!(this instanceof ho))return new ho(e,t);t||XL(e)&&(t=e,e={}),this.__opts__=Og({},lx,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Og({},ZL,e),this.__compiled__={},this.__tlds__=QL,this.__tlds_replaced__=!1,this.re={},wf(this)}ho.prototype.add=function(t,n){return this.__schemas__[t]=n,wf(this),this};ho.prototype.set=function(t){return this.__opts__=Og(this.__opts__,t),this};ho.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,s,o,i,r,l,a,c,u;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(t))!==null;)if(i=this.testSchemaAt(t,n[2],a.lastIndex),i){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(s=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(r=s.index+s[1].length,(this.__index__<0||r<this.__index__)&&(this.__schema__="",this.__index__=r,this.__last_index__=s.index+s[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(o=t.match(this.re.email_fuzzy))!==null&&(r=o.index+o[1].length,l=o.index+o[0].length,(this.__index__<0||r<this.__index__||r===this.__index__&&l>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=l))),this.__index__>=0};ho.prototype.pretest=function(t){return this.re.pretest.test(t)};ho.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};ho.prototype.match=function(t){const n=[];let s=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Pg(this,s)),s=this.__last_index__);let o=s?t.slice(s):t;for(;this.test(o);)n.push(Pg(this,s)),o=o.slice(this.__last_index__),s+=this.__last_index__;return n.length?n:null};ho.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const s=this.testSchemaAt(t,n[2],n[0].length);return s?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s,Pg(this,0)):null};ho.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(s,o,i){return s!==i[o-1]}).reverse(),wf(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,wf(this),this)};ho.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ho.prototype.onCompile=function(){};var ax=ho,sO=KC({"../../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"},g=35,S=Math.floor,_=String.fromCharCode;function y(B){throw new RangeError(p[B])}function b(B,W){const K=[];let V=B.length;for(;V--;)K[V]=W(B[V]);return K}function v(B,W){const K=B.split("@");let V="";K.length>1&&(V=K[0]+"@",B=K[1]),B=B.replace(h,".");const se=b(B.split("."),W).join(".");return V+se}function w(B){const W=[];let K=0;const V=B.length;for(;K<V;){const se=B.charCodeAt(K++);if(se>=55296&&se<=56319&&K<V){const Y=B.charCodeAt(K++);(Y&64512)==56320?W.push(((se&1023)<<10)+(Y&1023)+65536):(W.push(se),K--)}else W.push(se)}return W}const N=B=>String.fromCodePoint(...B),E=function(B){return B>=48&&B<58?26+(B-48):B>=65&&B<91?B-65:B>=97&&B<123?B-97:36},k=function(B,W){return B+22+75*(B<26)-((W!=0)<<5)},A=function(B,W,K){let V=0;for(B=K?S(B/700):B>>1,B+=S(B/W);B>g*26>>1;V+=36)B=S(B/g);return S(V+(g+1)*B/(B+38))},I=function(B){const W=[],K=B.length;let V=0,se=128,Y=72,G=B.lastIndexOf("-");G<0&&(G=0);for(let ee=0;ee<G;++ee)B.charCodeAt(ee)>=128&&y("not-basic"),W.push(B.charCodeAt(ee));for(let ee=G>0?G+1:0;ee<K;){const we=V;for(let Le=1,ce=36;;ce+=36){ee>=K&&y("invalid-input");const _e=E(B.charCodeAt(ee++));_e>=36&&y("invalid-input"),_e>S((2147483647-V)/Le)&&y("overflow"),V+=_e*Le;const me=ce<=Y?1:ce>=Y+26?26:ce-Y;if(_e<me)break;const $e=36-me;Le>S(2147483647/$e)&&y("overflow"),Le*=$e}const de=W.length+1;Y=A(V-we,de,we==0),S(V/de)>2147483647-se&&y("overflow"),se+=S(V/de),V%=de,W.splice(V++,0,se)}return String.fromCodePoint(...W)},P=function(B){const W=[];B=w(B);const K=B.length;let V=128,se=0,Y=72;for(const we of B)we<128&&W.push(_(we));const G=W.length;let ee=G;for(G&&W.push("-");ee<K;){let we=2147483647;for(const Le of B)Le>=V&&Le<we&&(we=Le);const de=ee+1;we-V>S((2147483647-se)/de)&&y("overflow"),se+=(we-V)*de,V=we;for(const Le of B)if(Le<V&&++se>2147483647&&y("overflow"),Le===V){let ce=se;for(let _e=36;;_e+=36){const me=_e<=Y?1:_e>=Y+26?26:_e-Y;if(ce<me)break;const $e=ce-me,J=36-me;W.push(_(k(me+$e%J,0))),ce=S($e/J)}W.push(_(k(ce,0))),Y=A(se,de,ee===G),se=0,++ee}++se,++V}return W.join("")},R={version:"2.3.1",ucs2:{decode:w,encode:N},decode:I,encode:P,toASCII:function(B){return v(B,function(W){return f.test(W)?"xn--"+P(W):W})},toUnicode:function(B){return v(B,function(W){return d.test(W)?I(W.slice(4).toLowerCase()):W})}};t.exports=R})}),cx=YC(sO()),cs=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,s=t.length;n<s;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}};function gv(e,t,n){let s,o=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(s=e.charCodeAt(o),s===10||s===60)return i;if(s===62)return i.pos=o+1,i.str=Xc(e.slice(t+1,o)),i.ok=!0,i;if(s===92&&o+1<n){o+=2;continue}o++}return i}let r=0;for(;o<n&&(s=e.charCodeAt(o),!(s===32||s<32||s===127));){if(s===92&&o+1<n){if(e.charCodeAt(o+1)===32)break;o+=2;continue}if(s===40&&(r++,r>32))return i;if(s===41){if(r===0)break;r--}o++}return t===o||r!==0||(i.str=Xc(e.slice(t,o)),i.pos=o,i.ok=!0),i}var ux=gv;const Ad=-2;function oO(e,t,n){let s=t+1;for(;s<n;){const o=e.charCodeAt(s);if(o===93)return s;if(o===92){s+=2;continue}if(o===96||o===60||o===33&&s+1<n&&e.charCodeAt(s+1)===91||o===91)return Ad;s++}return-1}function vv(e,t,n){let s=1,o=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.__mdtsLinkLabelNoCloseFrom;if(typeof u=="number"&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.__mdtsLinkLabelNoCloseFrom=t+1,-1;const f=oO(l,t,a);if(f!==Ad)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(s--,s===0)){o=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)s++;else if(n)return e.pos=c,-1}}let h=-1;return o&&(h=e.pos),e.pos=c,h}var Sf=vv;function yv(e,t,n,s){let o,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)r.str=s.str,r.marker=s.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(o=e.charCodeAt(i),o===r.marker)return r.pos=i+1,r.str+=Xc(e.slice(t,i)),r.ok=!0,r;if(o===40&&r.marker===41)return r;o===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Xc(e.slice(t,i)),r}var dx=yv;function _h(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 kv(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function iO(e,t,n){const s=_h(e,t),o=[t,n];s<0?kv(e,o):e.attrs[s]=o}function rO(e,t){const n=_h(e,t);return n>=0?e.attrs[n][1]:null}function lO(e,t,n){const s=_h(e,t);s<0?kv(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var aO=sx({attrGet:()=>rO,attrIndex:()=>_h,attrJoin:()=>lO,attrPush:()=>kv,attrSet:()=>iO,parseLinkDestination:()=>gv,parseLinkLabel:()=>vv,parseLinkTitle:()=>yv});function cO(e){return e.includes("\r")||e.includes("\0")}function fx(e){return typeof e=="string"?e:e.toString()}function uO(e){if(e.inlineMode){const t=new cs("inline","",0);t.content=fx(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 dO=/^([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])?)*)$/,fO=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function hO(e,t){let n=e.pos;const s=e.src;if(s.charCodeAt(n)!==60)return!1;const o=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=s.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=s.slice(o+1,n);if(fO.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(dO.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 pO=hO;function mO(e,t){const n=e.src;let s=e.pos;if(n.charCodeAt(s)!==96)return!1;const o=s;s++;const i=e.posMax;for(;s<i&&n.charCodeAt(s)===96;)s++;const r=n.slice(o,s),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=o)return t||(e.pending+=r),e.pos+=l,!0;let a=s,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let f=n.slice(s,c);f.includes(`
|
|
49
|
-
`)&&(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 gO=mO;function hb(e){const t={},n=e.length;if(!n)return;let s=0,o=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[s].marker!==l.marker||o!==l.token-1)&&(s=r),o=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=s-i[s]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let 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,o=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function vO(e){const t=e.tokens_meta,n=e.tokens_meta.length;hb(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&hb(t[s].delimiters)}var yO=vO;function kO(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==95&&s!==42)return!1;const o=e.scanDelims(e.pos,s===42);if(!o||o.length===0)return!1;for(let i=0;i<o.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function pb(e,t){const n=t.length;for(let s=n-1;s>=0;s--){const o=t[s];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const i=t[o.end],r=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===o.marker&&t[s-1].token===o.token-1&&t[o.end+1].token===i.token+1,l=String.fromCharCode(o.marker),a=e.tokens[o.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[s-1].token].content="",e.tokens[t[o.end+1].token].content="",s--)}}function bO(e){const t=e.tokens_meta,n=e.tokens_meta.length;pb(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&pb(e,t[s].delimiters)}const mb={tokenize:kO,postProcess:bO};function hx(e){return lv(e)}function bv(e){return e>=48&&e<=57}function _O(e){const t=e|32;return bv(e)||t>=97&&t<=102}function px(e){const t=e|32;return t>=97&&t<=122}function wO(e){return px(e)||bv(e)}function SO(e,t,n){let s=t+2;if(s>=n)return null;let o=!1,i=7,r=s;for((e.charCodeAt(s)|32)===120&&(o=!0,i=6,s++,r=s);s<n&&s-r<i;){const l=e.charCodeAt(s);if(!(o?_O(l):bv(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function CO(e,t,n){let s=t+1;if(s>=n||!px(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&wO(e.charCodeAt(s));)s++;if(s-t-1<2||s>=n||e.charCodeAt(s)!==59)return null;const o=e.slice(t,s+1);return hx(o)!==o?o:null}function xO(e,t){const n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=s)return!1;if(e.src.charCodeAt(n+1)===35){const o=SO(e.src,n,s);if(o){if(!t){const i=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=yh(i)?Yc(i):Yc(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=CO(e.src,n,s);if(o){const i=hx(o);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var TO=xO;const mx=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Rg=new Array(128),gx=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Rg[e]=`\\${t}`,gx[e]=mx[e]?t:Rg[e]}function gb(e,t,n){e.pending&&e.pushPending();const s=new cs("text_special","",0);s.level=e.level,s.content=t,s.markup=n,s.info="escape",e.pendingLevel=e.level,e.tokens.push(s),e.tokens_meta.push(null)}function MO(e,t){let n=e.pos;const s=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=s))return!1;let i=o.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<s&&(i=o.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(gb(e,gx[i],Rg[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return gb(e,i<256&&mx[i]?r:l,l),e.pos=n+1,!0}var AO=MO;function EO(e){let t,n,s=0;const o=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=o[t];r&&(r.nesting&&r.nesting<0&&s--,r.level=s,r.nesting&&r.nesting>0&&s++,r.type==="text"&&t+1<i&&o[t+1]?.type==="text"?o[t+1].content=r.content+o[t+1].content:(t!==n&&(o[n]=r),n++))}t!==n&&(o.length=n)}var $O=EO;const vx=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,yx="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",IO=new RegExp(`^(?:${vx}|${yx}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),NO=new RegExp(`^(?:${vx}|${yx})`);function kx(e){return e===32||e===9||e===10||e===12||e===13}function LO(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||kx(t)}function OO(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(!kx(n))return!1}return!1}function PO(e){const t=e|32;return t>=97&&t<=122}function RO(e,t){if(!e.md.options.html)return!1;const n=e.posMax,s=e.pos,o=e.src;if(o.charCodeAt(s)!==60||s+2>=n)return!1;const i=o.charCodeAt(s+1);if(i!==33&&i!==63&&i!==47&&!PO(i))return!1;const r=o.slice(s).match(IO);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,LO(l)&&e.linkLevel++,OO(l)&&e.linkLevel--}return e.pos+=l.length,!0}var DO=RO;function BO(e,t){let n,s,o,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=Sf(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=ux(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=dx(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=Sf(e,i),i>=0?o=e.src.slice(c,i++):i=p+1):i=p+1,o||(o=e.src.slice(h,p)),r=e.env.references[vh(o)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){s=e.src.slice(h,p);const g=[];e.md.inline.parse(s,e.md,e.env,g);const S=e.push("image","img",0);S.attrs=[["src",u],["alt",""]],S.children=g,S.content=s,a&&S.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var FO=BO;function HO(e,t){let n,s,o,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=Sf(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(o=ux(e.src,p,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?p=o.pos:r="",a=p;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(o=dx(e.src,p,e.posMax),p<d&&a!==p&&o.ok)for(l=o.str,p=o.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=Sf(e,p),p>=0?s=e.src.slice(a,p++):p=h+1):p=h+1,s||(s=e.src.slice(f,h)),i=e.env.references[vh(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=h;const g=e.push("link_open","a",1),S=[["href",r]];g.attrs=S,l&&S.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 WO=HO;function bx(e){const t=e|32;return t>=97&&t<=122}function UO(e){return e>=48&&e<=57}function jO(e){return bx(e)||UO(e)||e===43||e===45||e===46}function qO(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&jO(e.charCodeAt(t));)t--;return t++,t>=e.length||!bx(e.charCodeAt(t))?null:e.slice(t)}function zO(e,t,n){let s=t;for(;s<n;){const o=e.charCodeAt(s);if(o<=32||o===127||o===60)break;s++}return e.slice(t,s)}function VO(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,s=e.posMax;if(n+3>s||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=qO(e.pending);if(!o)return!1;const i=zO(e.src,n-o.length,s),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-o.length,!0}function KO(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const s=e.pending.length-1,o=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let i=s-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<o;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var GO=KO;function YO(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==126)return!1;const o=e.scanDelims(e.pos,!0);if(!o)return!1;let i=o.length;const r=String.fromCharCode(s);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:s,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function vb(e,t){let n;const s=[],o=t.length;for(let i=0;i<o;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&s.push(l.token-1)}for(;s.length;){const i=s.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function XO(e){const t=e.delimiters;vb(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&vb(e,n[s].delimiters)}const yb={tokenize:YO,postProcess:XO};function kb(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 ZO(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||kb(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!kb(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var JO=ZO;function _v(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function QO(e){if(e.length===0)return 0;const t=e.slice().sort((s,o)=>s-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function eP(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 _x(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,s={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:_v(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function da(e,t,n,s,o,i){const r=_x(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=eP(t,n));a.calls++,a.inclusiveMs+=s,s>a.maxMs&&(a.maxMs=s),a.samples.push(s),i?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=_v()}function tP(e){const t=_x(e);if(!t)return null;const n=Object.keys(t.records);for(let s=0;s<n.length;s++){const o=t.records[n[s]];o.medianMs=QO(o.samples)}return t.completedAt=_v(),t}var bb=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const s=this.rules.findIndex(o=>o.name===e);s>=0&&this.rules.splice(s,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const s=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(s<0)return;const o=this.rules[s];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(s<0)throw new Error(`Parser rule not found: ${e}`);this.rules[s].fn=t,n?.alt!==void 0&&(this.rules[s].alt=n.alt),this.invalidateCache()}before(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const s of this.rules)if(s.enabled&&s.alt)for(const o of s.alt)e.add(o);const t=new Map,n=new Map;for(const s of e){const o=[],i=[];for(const r of this.rules)r.enabled&&(s!==""&&!r.alt?.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(s,o),n.set(s,i)}this.cache=t,this.namedCache=n}},wx=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;maxNesting;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s,this.tokens_meta=new Array(s.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.maxNesting=t.options.maxNesting}pushPending(){const e=new cs("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 cs(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const s=new cs(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(o),s}scanDelims(e,t){const{src:n,posMax:s}=this,o=n.charCodeAt(e);let i=e;for(;i<s&&n.charCodeAt(i)===o;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<s?n.charCodeAt(i):32,c=Gc(l),u=Gc(a),d=Ig(l),f=Ig(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}}};wx.prototype.Token=cs;function nP(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 Sx(e){for(let t=0;t<e.length;t++)if(nP(e.charCodeAt(t)))return!1;return!0}var sP=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new bb,this.ruler2=new bb,this.ruler.push("text",JO),this.ruler.push("linkify",VO),this.ruler.push("newline",GO),this.ruler.push("escape",AO),this.ruler.push("backticks",gO),this.ruler.push("strikethrough",yb.tokenize),this.ruler.push("emphasis",mb.tokenize),this.ruler.push("link",WO),this.ruler.push("image",FO),this.ruler.push("autolink",pO),this.ruler.push("html_inline",DO),this.ruler.push("entity",TO),this.ruler2.push("balance_pairs",yO),this.ruler2.push("strikethrough",yb.postProcess),this.ruler2.push("emphasis",mb.postProcess),this.ruler2.push("fragments_join",$O),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),s=n.length,o=e.cache,i=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<s;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(da(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<s;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,s=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=o[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(da(e.env,"inline",o[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,s){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&Sx(e)){const a=new cs("text","",0);a.content=e,s.push(a);return}const o=new wx(e,t,n,s);this.tokenize(o);const i=this.getRules2(),r=i.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](o,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(o,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();da(o.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,s){this.parseSource(e,t,n,s)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function oP(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let s=0,o=t.length;s<o;s++){const i=t[s];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&Sx(i.content)){const r=new cs("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const iP=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,rP=/[0-9a-z]/i;function lP(e){return/^<a[>\s]/i.test(e)}function aP(e){return/^<\/a\s*>/i.test(e)}function cP(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const s=t.raw[n-1],o=t.raw[n];if(!iP.test(s)||!rP.test(o))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function uP(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const s=t[n];if(s.type!=="inline"||!e.md.linkify.pretest(s.content))continue;let o=s.children;o||(o=[],s.children=o);let i=0;for(let r=o.length-1;r>=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(lP(l.content)&&i>0&&i--,aP(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=>cP(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&&o[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],g=e.md.normalizeLink(p.url);if(!e.md.validateLink(g))continue;let S=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(S)?S=e.md.normalizeLinkText(`mailto:${S}`).replace(/^mailto:/,""):S=e.md.normalizeLinkText(S):S=e.md.normalizeLinkText(`http://${S}`).replace(/^http:\/\//,"");const _=p.index;if(_>f){const w=new cs("text","",0);w.content=a.slice(f,_),w.level=d,u.push(w)}const y=new cs("link_open","a",1);y.attrs=[["href",g]],y.level=d++,y.markup="linkify",y.info="auto",u.push(y);const b=new cs("text","",0);b.content=S,b.level=d,u.push(b);const v=new cs("link_close","a",-1);v.level=--d,v.markup="linkify",v.info="auto",u.push(v),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new cs("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}o.splice(r,1,...u)}}}}const dP=/\r\n?|\n/g,fP=/\0/g;function hP(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),s=t.includes("\0");if(!n&&!s)return;let o=t;n&&(o=o.replace(dP,`
|
|
50
|
-
`)),s&&(o=o.replace(fP,"�")),e.src=o}const Cx=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,pP=/\((?:c|tm|r)\)/i,mP=/\((c|tm|r)\)/gi,gP={c:"©",r:"®",tm:"™"};function vP(e,t){return gP[t.toLowerCase()]}function yP(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&(s.content=s.content.replace(mP,vP)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function kP(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&Cx.test(s.content)&&(s.content=s.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function bP(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");pP.test(s)&&yP(n.children||[]),Cx.test(s)&&kP(n.children||[])}}var _P=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(s=>s.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(s=>s.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const wP=/['"]/,_b=/['"]/g,wb="’";function od(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function SP(e,t){let n;const s=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=s.length-1;n>=0&&!(s[n].level<=l);n--);if(s.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){_b.lastIndex=c;const d=_b.exec(a);if(!d)break;let f=!0,h=!0;c=d.index+1;const p=d[0]==="'";let g=32;if(d.index-1>=0)g=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){g=e[n].content.charCodeAt(e[n].content.length-1);break}let S=32;if(c<u)S=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){S=e[n].content.charCodeAt(0);break}const _=bf(g)||kf(String.fromCharCode(g)),y=bf(S)||kf(String.fromCharCode(S)),b=Gc(g),v=Gc(S);if(v?f=!1:y&&(b||_||(f=!1)),b?h=!1:_&&(v||y||(h=!1)),S===34&&d[0]==='"'&&g>=48&&g<=57&&(h=f=!1),f&&h&&(f=_,h=y),!f&&!h){p&&(r.content=od(r.content,d.index,wb));continue}if(h)for(n=s.length-1;n>=0;n--){let w=s[n];if(s[n].level<l)break;if(w.single===p&&s[n].level===l){w=s[n];let N,E;p?(N=o[2]||"‘",E=o[3]||"’"):(N=o[0]||"“",E=o[1]||"”"),r.content=od(r.content,d.index,E),e[w.token].content=od(e[w.token].content,w.pos,N),c+=E.length-1,w.token===i&&(c+=N.length-1),a=r.content,u=a.length,s.length=n;continue e}}f?s.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=od(r.content,d.index,wb))}}}function CP(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!wP.test(s)||!n.children||SP(n.children,e)}}function xP(e){const t=e.tokens||[],n=t.length;for(let s=0;s<n;s++){const o=t[s];if(o.type!=="inline"||!Array.isArray(o.children))continue;const i=o.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const TP=/^(?:vbscript|javascript|file|data):/,MP=/^data:image\/(?:gif|png|jpeg|webp);/,xx=["http:","https:","mailto:"];function Tx(e){const t=e.trim().toLowerCase();return TP.test(t)?MP.test(t):!0}function Mx(e){const t=cv(e,!0);if(t.hostname&&(!t.protocol||xx.includes(t.protocol)))try{t.hostname=cx.default.toASCII(t.hostname)}catch{}return ZC(av(t))}function Ax(e){const t=cv(e,!0);if(t.hostname&&(!t.protocol||xx.includes(t.protocol)))try{t.hostname=cx.default.toUnicode(t.hostname)}catch{}return $g(av(t),`${$g.defaultChars}%`)}function AP(e){switch(e){case 9:case 32:return!0}return!1}function EP(e,t,n,s){const o=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const f=e.lineMax;if(a[t]-e.blkIndent>=4||o.charCodeAt(u)!==62)return!1;if(s)return!0;const h=[],p=[],g=[],S=[],_=e.md.block.ruler.getRulesForState(e,"blockquote"),y=e.parentType;e.parentType="blockquote";let b=!1,v;for(v=t;v<n;v++){const A=a[v]<e.blkIndent;if(u=i[v]+l[v],d=r[v],u>=d)break;if(o.charCodeAt(u++)===62&&!A){let P=a[v]+1,M,L;o.charCodeAt(u)===32?(u++,P++,L=!1,M=!0):o.charCodeAt(u)===9?(M=!0,(c[v]+P)%4===3?(u++,P++,L=!1):L=!0):M=!1;let R=P;for(h.push(i[v]),i[v]=u;u<d;){const B=o.charCodeAt(u);if(AP(B))B===9?R+=4-(R+c[v]+(L?1:0))%4:R++;else break;u++}b=u>=d,p.push(c[v]),c[v]=a[v]+1+(M?1:0),g.push(a[v]),a[v]=R-P,S.push(l[v]),l[v]=u-i[v];continue}if(b)break;let I=!1;for(let P=0,M=_.length;P<M;P++)if(_[P](e,v,n,!0)){I=!0;break}if(I){e.lineMax=v,e.blkIndent!==0&&(h.push(i[v]),p.push(c[v]),S.push(l[v]),g.push(a[v]),a[v]-=e.blkIndent);break}h.push(i[v]),p.push(c[v]),S.push(l[v]),g.push(a[v]),a[v]=-1}const w=e.blkIndent;e.blkIndent=0;const N=e.push("blockquote_open","blockquote",1);N.markup=">";const E=[t,0];N.map=E,e.md.block.tokenize(e,t,v);const k=e.push("blockquote_close","blockquote",-1);k.markup=">",e.lineMax=f,e.parentType=y,E[1]=e.line;for(let A=0;A<S.length;A++)i[A+t]=h[A],l[A+t]=S[A],a[A+t]=g[A],c[A+t]=p[A];return e.blkIndent=w,!0}function $P(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,o=s;for(;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}e.line=o;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,o,4+e.blkIndent,!1)}
|
|
51
|
-
`,i.map=[t,e.line],!0}function IP(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>i)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const c=e.src.slice(l,o),u=e.src.slice(o,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(s)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],o<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(o)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(o=e.skipChars(o,r),!(o-l<a)&&(o=e.skipSpaces(o),!(o<i)))){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 Sb=["","h1","h2","h3","h4","h5","h6"],Cb=["","#","##","###","####","#####","######"];function xb(e){switch(e){case 9:case 32:return!0}return!1}function NP(e,t,n,s){const o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=o.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=o.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=o.charCodeAt(++a);if(d>6||a<c&&!xb(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&xb(o.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",Sb[d],1);h.markup=Cb[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=o.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const g=e.push("heading_close",Sb[d],-1);return g.markup=Cb[d],!0}function LP(e){switch(e){case 9:case 32:return!0}return!1}function OP(e,t,n,s){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<o;){const c=e.src.charCodeAt(i++);if(c!==r&&!LP(c))return!1;c===r&&l++}if(l<3)return!1;if(s)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const Dl=[[/^<(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(`${NO.source}\\s*$`),/^$/,!1]];function PP(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,i),l=0;for(;l<Dl.length&&!Dl[l][0].test(r);l++);if(l===Dl.length)return!1;if(s)return Dl[l][2];let a=t+1;if(!Dl[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(o=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(o,i),Dl[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 RP(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function Ex(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function $x(e,t,n){if(t>=n)return!1;const s=e.charCodeAt(t);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:RP(e,t,n)}const Tb=["","h1","h2"];function DP(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=Ex(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 v=i[p]+r[p],w=l[p];if(v>=w)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=o.charCodeAt(v),h===45||h===61)){let E=v+1,k=E;for(;E<w&&o.charCodeAt(E)===h;)E++;for(k=E;E<w;){const A=o.charCodeAt(E);if(A!==9&&A!==32)break;E++}if(E>=w){f=h===61?1:2;break}if(k-v>1)continue}if(a[p]<0||u&&!$x(o,v,w))continue;let N=!1;for(let E=0,k=s.length;E<k;E++)if(s[E](e,p,n,!0)){N=!0;break}if(N)break}if(!f)return!1;let g;if(p===t+1){const v=i[t]+r[t];let w=l[t];for(;w>v;){const N=o.charCodeAt(w-1);if(N!==9&&N!==32)break;w--}g=o.slice(v,w)}else g=e.getLines(t,p,c,!1).trim();e.line=p+1;const S=h===61?"=":"-",_=e.push("heading_open",Tb[f],1);_.markup=S,_.map=[t,e.line];const y=e.push("inline","",0);y.content=g,y.map=[t,e.line-1],y.children=[];const b=e.push("heading_close",Tb[f],-1);return b.markup=S,e.parentType=d,!0}function Ix(e){switch(e){case 9:case 32:return!0}return!1}function Mb(e,t){const n=e.eMarks,s=e.bMarks,o=e.tShift,i=e.src,r=n[t];let l=s[t]+o[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!Ix(i.charCodeAt(l))?-1:l}function Ab(e,t){const n=e.bMarks,s=e.tShift,o=e.eMarks,i=e.src,r=n[t]+s[t],l=o[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!Ix(c))?-1:a}function BP(e,t,n){const s=e.bMarks,o=e.tShift,i=e.src,r=s[t]+o[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const FP=["0","1","2","3","4","5","6","7","8","9"];function HP(e,t){const n=e.level+2,s=e.tokens;for(let o=t+2,i=s.length-2;o<i;o++){const r=s[o];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,s[o+2].hidden=!0,o+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++o<i;)l+=s[o].nesting}}}}function WP(e,t,n,s){let o,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;s&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,g=e.tShift,S=e.eMarks,_=e.sCount,y=e.bsCount,b=p[l]+g[l];if(b>=S[l])return!1;const v=h.charCodeAt(b);if(v>=48&&v<=57){if(f=Ab(e,l),f<0||(u=!0,r=b,d=BP(e,l,f),c&&d!==1))return!1}else if(v===42||v===45||v===43){if(f=Mb(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=S[l])return!1;if(s)return!0;const w=h.charCodeAt(f-1),N=String.fromCharCode(w);if(u){const M=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(M.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const E=[l,0];e.tokens[e.tokens.length-1].map=E,e.tokens[e.tokens.length-1].markup=N;let k=!1;const A=e.tokens.length-1,I=e.md.block.ruler.getRulesForState(e,"list"),P=e.parentType;for(e.parentType="list";l<n;){i=f,o=S[l];const M=_[l]+f-(p[l]+g[l]);let L=M;for(;i<o;){const de=h.charCodeAt(i);if(de===9)L+=4-(L+y[l])%4;else if(de===32)L++;else break;i++}const R=i;let B;R>=o?B=1:B=L-M,B>4&&(B=1);const W=M+B,K=e.push("list_item_open","li",1);K.markup=N;const V=[l,0];K.map=V,u&&(K.info=f-r-1===1?FP[h.charCodeAt(r)-48]:h.slice(r,f-1));const se=e.tight,Y=e.tShift[l],G=e.sCount[l],ee=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=W,e.tight=!0,e.tShift[l]=R-p[l],e.sCount[l]=L,R>=o&&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=ee,e.tShift[l]=Y,e.sCount[l]=G,e.tight=se,e.push("list_item_close","li",-1).markup=N,l=e.line,V[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let we=!1;for(let de=0,Le=I.length;de<Le;de++)if(I[de](e,l,n,!0)){we=!0;break}if(we)break;if(u){if(f=Ab(e,l),f<0)break;r=p[l]+g[l]}else if(f=Mb(e,l),f<0)break;if(w!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=N:e.push("bullet_list_close","ul",-1).markup=N,E[1]=l,e.line=l,e.parentType=P,a&&HP(e,A),!0}function Eb(e){return e===9||e===32}function UP(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=Ex(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(o==="list"&&c[f]>=u){const b=r[f]+l[f],v=a[f];if(b<v){const w=i.charCodeAt(b);if(w===42||w===45||w===43){if(b+1>=v||Eb(i.charCodeAt(b+1)))break}else if(w>=48&&w<=57&&b+1<v){let N=b+1;for(;;){if(N>=v){N=-1;break}const E=i.charCodeAt(N++);if(E>=48&&E<=57){if(N-b>=10){N=-1;break}continue}if((E===41||E===46)&&(N>=v||Eb(i.charCodeAt(N))))break;N=-1;break}if(N>=0)break}}}const S=r[f]+l[f],_=a[f];if(d&&!$x(i,S,_))continue;let y=!1;for(let b=0,v=s.length;b<v;b++)if(s[b](e,f,n,!0)){y=!0;break}if(y)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 g=e.push("inline","",0);return g.content=h,g.map=[t,e.line],g.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function id(e){switch(e){case 9:case 32:return!0}return!1}function jP(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(b){const v=e.lineMax;if(b>=v||e.isEmpty(b))return null;let w=!1;if(e.sCount[b]-e.blkIndent>3&&(w=!0),e.sCount[b]<0&&(w=!0),!w){const k=e.parentType;e.parentType="reference";let A=!1;for(let I=0,P=l.length;I<P;I++)if(l[I](e,b,v,!0)){A=!0;break}if(e.parentType=k,A)return null}const N=e.bMarks[b]+e.tShift[b],E=e.eMarks[b];return e.src.slice(N,E+1)}let c=e.src.slice(o,i+1);i=c.length;let u=-1;for(o=1;o<i;o++){const b=c.charCodeAt(o);if(b===91)return!1;if(b===93){u=o;break}else if(b===10){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}else if(b===92&&(o++,o<i&&c.charCodeAt(o)===10)){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const b=c.charCodeAt(o);if(b===10){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}else if(!id(b))break}const d=e.md.helpers.parseLinkDestination(c,o,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;o=d.pos;const h=o,p=r,g=o;for(;o<i;o++){const b=c.charCodeAt(o);if(b===10){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}else if(!id(b))break}let S=e.md.helpers.parseLinkTitle(c,o,i);for(;S.can_continue;){const b=a(r);if(b===null)break;c+=b,o=i,i=c.length,r++,S=e.md.helpers.parseLinkTitle(c,o,i,S)}let _;for(o<i&&g!==o&&S.ok?(_=S.str,o=S.pos):(_="",o=h,r=p);o<i&&id(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&_)for(_="",o=h,r=p;o<i&&id(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const y=vh(c.slice(1,u));return y?(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[y]>"u"&&(e.env.references[y]={title:_,href:f}),e.line=r),!0):!1}function lm(e){switch(e){case 9:case 32:return!0}return!1}const qP=65536;function am(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function zP(e,t){for(let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];n<s;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function $b(e){const t=[],n=e.length;let s=0,o=e.charCodeAt(s),i=!1,r=0,l="";for(;s<n;)o===124&&(i?(l+=e.substring(r,s-1),r=s):(t.push(l+e.substring(r,s)),l="",r=s+1)),i=o===92,s++,o=e.charCodeAt(s);return t.push(l+e.substring(r)),t}function VP(e,t,n,s){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let i=e.bMarks[o]+e.tShift[o];if(i>=e.eMarks[o])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[o])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!lm(l)||r===45&&lm(l)||!zP(e,t))return!1;for(;i<e.eMarks[o];){const v=e.src.charCodeAt(i);if(v!==124&&v!==45&&v!==58&&!lm(v))return!1;i++}let a=am(e,t+1),c=a.split("|");const u=[];for(let v=0;v<c.length;v++){const w=c[v].trim();if(!w){if(v===0||v===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(w))return!1;w.charCodeAt(w.length-1)===58?u.push(w.charCodeAt(0)===58?"center":"right"):w.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=am(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=$b(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(s)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),g=[t,0];p.map=g;const S=e.push("thead_open","thead",1);S.map=[t,t+1];const _=e.push("tr_open","tr",1);_.map=[t,t+1];for(let v=0;v<c.length;v++){const w=e.push("th_open","th",1);u[v]&&(w.attrs=[["style",`text-align:${u[v]}`]]);const N=e.push("inline","",0);N.content=c[v].trim(),N.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y,b=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let v=!1;for(let N=0,E=h.length;N<E;N++)if(h[N](e,o,n,!0)){v=!0;break}if(v||(a=am(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=$b(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),b+=d-c.length,b>qP))break;if(o===t+2){const N=e.push("tbody_open","tbody",1);N.map=y=[t+2,0]}const w=e.push("tr_open","tr",1);w.map=[o,o+1];for(let N=0;N<d;N++){const E=e.push("td_open","td",1);u[N]&&(E.attrs=[["style",`text-align:${u[N]}`]]);const k=e.push("inline","",0);k.content=c[N]?c[N].trim():"",k.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return y&&(e.push("tbody_close","tbody",-1),y[1]=o),e.push("table_close","table",-1),g[1]=o,e.parentType=f,e.line=o,!0}var KP=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}after(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:s,fn:o})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=o(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return da(i?.env,"block",s,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const s=this._rules.findIndex(o=>o.name===e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[s].fn=t,n?.alt&&(this._rules[s].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this._rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const s of this._rules)if(s.enabled)for(const o of s.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const s of e){const o=[],i=[];for(const r of this._rules)r.enabled&&(s!==""&&!r.alt.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t[s]=o,n[s]=i}this.cache=t,this.namedCache=n}};function Ib(e){switch(e){case 9:case 32:return!0}return!1}var Nx=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s;const o=this.src;let i=0,r=0,l=0,a=!1;for(let c=0,u=o.length;c<u;c++){const d=o.charCodeAt(c);if(!a)if(Ib(d)){i++,d===9?r+=4-r%4:r++;continue}else a=!0;(d===10||c===u-1)&&(d!==10&&c++,this.bMarks.push(l),this.eMarks.push(c),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),a=!1,i=0,r=0,l=c+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const o=new cs(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new cs(e,t,n);return s.block=!0,n<0&&this.level--,s.level=this.level,n>0&&this.level++,this.tokens.push(s),s}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,s=this.eMarks;for(let o=this.lineMax;e<o&&!(t[e]+n[e]<s[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const s=t.charCodeAt(e);if(s!==9&&s!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const s=n.charCodeAt(--e);if(s!==9&&s!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let s=n.length;e<s&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const s=this.src;for(;e>n;)if(t!==s.charCodeAt(--e))return e+1;return e}getLines(e,t,n,s){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=s?this.eMarks[u]+1:this.eMarks[u];let p=0;const g=this.src,S=this.bsCount,_=this.tShift;for(;f<h&&p<n;){const y=g.charCodeAt(f);if(y===9||y===32)y===9?p+=4-(p+S[u])%4:p++;else if(f-d<_[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const o=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let f=0;const h=r[d];let p=h,g;for(d+1<t||s?g=l[d]+1:g=l[d];p<g&&f<n;){const S=i.charCodeAt(p);if(Ib(S))S===9?f+=4-(f+a[d])%4:f++;else if(p-h<c[d])f++;else break;p++}f>n?o[u]=new Array(f-n+1).join(" ")+i.slice(p,g):o[u]=i.slice(p,g)}return o.join("")}};Nx.prototype.Token=cs;const rd=[["table",VP,["paragraph","reference"]],["code",$P],["fence",IP,["paragraph","reference","blockquote","list"]],["blockquote",EP,["paragraph","reference","blockquote","list"]],["hr",OP,["paragraph","reference","blockquote","list"]],["list",WP,["paragraph","reference","blockquote"]],["reference",jP],["html_block",PP,["paragraph","reference","blockquote"]],["heading",NP,["paragraph","reference","blockquote"]],["lheading",DP],["paragraph",UP]];var GP=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new KP;for(let e=0;e<rd.length;e++)this.ruler.push(rd[e][0],rd[e][1],{alt:(rd[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const s=this.getRules(),o=s.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let g=0;g<o;g++)if(p=s[g](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 g=0;g<o;g++){const S=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[g].fn(e,u,n,!1);const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(da(e.env,"block",f[g].name,_-S,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,s){if(!e||e.length===0)return;const o=new Nx(e,t,n,s);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},Lx=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}};Lx.prototype.Token=cs;const Nb=[["normalize",hP],["block",uO],["inline",oP],["linkify",uP],["replacements",bP],["smartquotes",CP],["text_join",xP]],YP={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},XP={parseLinkLabel:vv,parseLinkDestination:gv,parseLinkTitle:yv};function ZP(){return{...YP}}function JP(){return{...XP}}var QP=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new GP,this.inline=new sP,this.ruler=new _P;for(let e=0;e<Nb.length;e++){const[t,n]=Nb[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:ZP(),helpers:JP(),normalizeLink:Mx,normalizeLinkText:Ax,validateLink:Tx,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new ax),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 Lx(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let s=0;s<n.length;s++)n[s](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();da(e.env,"core",t[n].name,o-s,!0,!1)}tP(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&cO(e))return this.parse(fx(e),t,n);const s=this.createState(e,t,n);return this.process(s),this.lastState=s,s}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const eR={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function Cf(e,t,n={},s){to(n);const o={...eR,...s||{}},i=ys(t);if(o.fallbackOnGlobalState!==!1&&i)return rm(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),ua(n,i,()=>e.core.parse(t,n,e).tokens);let r=Ed(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=oR(r,o.maxChunks)),$d(t,r))return rm(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),ua(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return rm(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),ua(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&&nR(f,l),sR(a,f),l+=u.lineCount}return a})}function Ed(e,t,n=!0){const s=[];let o=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(s.push({start:r,end:f,lineCount:l}),r=f,o=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
|
|
52
|
-
`,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const g=iR(e,f,h);if(t.fenceAware){let y=f;for(;y<h;){const v=e.charCodeAt(y);if(v===32||v===9)y++;else break}const b=e[y];if(b==="`"||b==="~"){let v=y;for(;v<h&&e[v]===b;)v++;const w=v-y;w>=3&&(u?u.marker===b&&w>=u.length&&(u=null):u={marker:b,length:w})}}const S=p-f;o+=S,i+=1,l+=1,g?(a=0,c=0):(a+=1,c+=S);const _=g;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(_)d(p);else{const y=Math.max(10,Math.floor(t.maxChunkLines*.5)),b=Math.max(t.maxChunkChars,8e3);(a>=y||c>=b)&&d(p)}f=p}return n&&d(e.length),s}function $d(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!tR(e,t[o].end))return!0;return!1}function tR(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let s=n+1;s<t-1;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function nR(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function sR(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function oR(e,t){if(e.length<=t)return e;const n=[];let s=0;for(let o=0;o<t;o++){const i=t-o,r=e.length-s,l=Math.ceil(r/i),a=e.slice(s,s+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),s+=l}return n}function iR(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}const Ox=4e6,Px=8e4,rR=1e4,lR=200,aR=1e4,cR=200;function Rx(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function uR(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function Zi(e){return e.length===0?0:$n(e)+(e.charCodeAt(e.length-1)===10?0:1)}function dR(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function fR(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
|
|
53
|
-
`,s);o===-1&&(o=e.length);let i=s;for(;i<o;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<o&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}s=o===e.length?e.length:o+1}return n!==null}function hR(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 dR(e,n+1,e.length-1)?!fR(e,t):!1}function pR(e,t,n,s={}){const o=s.mode??"full",i=s.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(s.maxChunkChars!==void 0||s.maxChunkLines!==void 0||s.autoTune===!1){const r=s.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??aR:e.options.fullChunkSizeChars??rR),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??cR:e.options.fullChunkSizeLines??lR);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var hu=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=Zi(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=Ed(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if($d(this.pending,s,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const o=this.commitRanges(s,e);return this.pending=this.pending.slice(o),this.updateEnvDiagnostics(e,t,Zi(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!hR(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Zi(this.pending)),null;const n=Ed(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,Zi(this.pending)),null;const s=$d(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Zi(this.pending)}]:n;return this.commitRanges(s,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const s=this.resolveWindow();return this.updateEnvDiagnostics(e,s,0),this.tokens}const t=this.resolveWindow(),n=Ed(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=$d(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Zi(this.pending)}]:n;this.commitRanges(s,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:Zi(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+Zi(this.pending);return pR(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(fu(e)&&Ri(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=ys(t);n&&(pv(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let s=0;s<e.length;s++){const o=e[s],i=this.pending.slice(o.start,o.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&uR(r,a),this.options.retainTokens!==!1&&Rx(this.tokens,r),this.committedChars+=i.length,this.committedLines+=o.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:o.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=o.end}return this.markedGlobalStateReason&&mv(t),n}catch(s){throw this.markedGlobalStateReason&&(Ri(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){rx(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 mR(e,t,n={},s={}){to(n);const o=new hu(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function gR(e,t,n={},s={}){to(n);const o=new hu(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function vR(e,t,n,s={},o={}){to(s);const i=new hu(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}async function yR(e,t,n,s={},o={}){to(s);const i=new hu(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}function Dx(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??Ox,o=e.options.autoUnboundedThresholdLines??Px;return t>=s||n>=o}function Bx(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??Ox))return"yes";const s=e.options.autoUnboundedThresholdLines??Px;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function Sc(e,t,n={},s={}){to(n);const o=ys(t);if(fu(n)&&Ri(n),s.fallbackOnGlobalState!==!1&&o)return rx(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:$n(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),ua(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new hu(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){Rx(i,l)}});if(o&&pv(n,o),r.feed(t),r.flushForce(n),o&&(mv(n),s.fallbackOnGlobalState===!1)){const l=_i(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const fa=(e,t,n)=>e<t?t:e>n?n:e;function Fx(e){return e.experimental?{...e,...e.experimental}:e}const Lb=[{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"}],Ob=[{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 Hx(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function kR(e,t=Math.max(0,e/40|0),n={}){const s=Fx(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<Lb.length;l++){const a=Lb[l];if(e<=a.max){if(a.strategy!=="adaptive")return Hx(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:fa(Math.ceil(e/i),8e3,64e3),maxChunkLines:fa(Math.ceil(t/i),150,700),maxChunks:fa(Math.ceil(e/64e3),i,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.fullChunkSizeChars??1e4,maxChunkLines:s.fullChunkSizeLines??200,fenceAware:o,maxChunks:s.fullChunkMaxChunks}}function Pb(e,t=Math.max(0,e/40|0),n={}){const s=Fx(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<Ob.length;l++){const a=Ob[l];if(e<=a.max){if(a.strategy!=="adaptive")return Hx(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:fa(Math.ceil(e/i),8e3,64e3),maxChunkLines:fa(Math.ceil(t/i),150,700),maxChunks:fa(Math.ceil(e/64e3),i,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.streamChunkSizeChars??1e4,maxChunkLines:s.streamChunkSizeLines??200,maxChunks:s.streamChunkMaxChunks,fenceAware:o}}var bR={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"]}}},_R={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},wR={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};const SR=/[&<>"]/,Rb=/[&<>"]/g,CR=/&/g,xR=/[<>"]/g,TR={"&":"&","<":"<",">":">",'"':"""};function cm(e){return TR[e]||e}function gn(e){if(e.length===0)return"";if(e.length<32)return SR.test(e)?e.replace(Rb,cm):e;const t=e.includes("&"),n=e.includes("<"),s=e.includes(">"),o=e.includes('"');return!t&&!n&&!s&&!o?e:t&&!n&&!s&&!o?e.replace(CR,"&"):t?e.replace(Rb,cm):e.replace(xR,cm)}const MR=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),AR=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function Wx(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(MR,(t,n,s)=>{if(n)return n;if(AR.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return yh(i)?Yc(i):"�"}const o=lv(t);return o!==t?o:t})}function wh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Id(e,t){if(wh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const Db=e=>wh(e)?e:Promise.resolve(e);function Cc(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 gn(e)}}function _r(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Cc(t[0])}="${gn(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${Cc(o[0])}="${gn(o[1])}"`}return n}function Ux(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const s=e.charCodeAt(t);if(s===32||s===9||s===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const s=e.charCodeAt(n);if(s!==32&&s!==9&&s!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function xc(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
|
|
54
|
-
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${gn(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
|
|
55
|
-
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${s}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${_r(r)}>${t}</code></pre>
|
|
56
|
-
`}return`<pre><code${_r(e.attrs)}>${t}</code></pre>
|
|
57
|
-
`}function xf(e){return!e.attrs||e.attrs.length===0?`<code>${gn(e.content)}</code>`:`<code${_r(e.attrs)}>${gn(e.content)}</code>`}function Dg(e){const t=gn(e.content);return e.attrs?`<pre${_r(e.attrs)}><code>${t}</code></pre>
|
|
58
|
-
`:`<pre><code>${t}</code></pre>
|
|
59
|
-
`}function ER(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="${gn(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${gn(n[0][1])}">`}return null}function Bb(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Cc(t[0][0])}="${gn(t[0][1])}">`:t.length===2?`<a ${Cc(t[0][0])}="${gn(t[0][1])}" ${Cc(t[1][0])}="${gn(t[1][1])}">`:`<a${_r(t)}>`}function $R(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 Fb(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 Tf(e,t){if(e.hidden)return"";const n=e.attrs,s=e.nesting,o=e.tag;if(!n||n.length===0)return s===0?t?`<${o} />`:`<${o}>`:s===-1?`</${o}>`:`<${o}>`;let i=(s===-1?"</":"<")+o+_r(n);return s===0&&t&&(i+=" /"),`${i}>`}const IR={langPrefix:"language-",xhtmlOut:!1,breaks:!1},ld=Object.prototype.hasOwnProperty,cn={code_inline(e,t){return xf(e[t])},code_block(e,t){return Dg(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?Wx(i.info).trim():"",{langName:l,langAttrs:a}=Ux(r),c=n.highlight,u=gn(i.content);if(!c)return xc(i,u,r,l,n);const d=c(i.content,l,a);return wh(d)?d.then(f=>xc(i,f||u,r,l,n)):xc(i,d||u,r,l,n)},image(e,t,n,s,o){const i=e[t],r=o.renderInlineAsText(i.children||[],n,s),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],Tf(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
60
|
-
`:`<br>
|
|
61
|
-
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
62
|
-
`:`<br>
|
|
63
|
-
`:`
|
|
64
|
-
`},text(e,t){return gn(e[t].content)},text_special(e,t){return gn(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Hb(e,t,n){const s=e.info?Wx(e.info).trim():"",{langName:o,langAttrs:i}=Ux(s),r=t.highlight,l=gn(e.content);if(!r)return xc(e,l,s,o,t);const a=r(e.content,o,i);if(wh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return xc(e,a||l,s,o,t)}function ad(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===cn.text)return l.content.length===0?"":gn(l.content);break;case"text_special":if(o.text_special===cn.text_special)return l.content.length===0?"":gn(l.content);break;case"softbreak":if(o.softbreak===cn.softbreak)return r;break;case"hardbreak":if(o.hardbreak===cn.hardbreak)return i;break;case"html_inline":if(o.html_inline===cn.html_inline)return l.content;break;case"code_inline":if(o.code_inline===cn.code_inline)return xf(l);break}const a=o[l.type];if(!a)return Tf(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:Id(c,l.type)}var NR=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 s=this.mergeOptions(t),o=n??{},i=this.rules,r=s.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",g=!1,S="";for(let _=0;_<e.length;_++){const y=e[_],b=y.type,v=_>0&&e[_-1].hidden?`
|
|
65
|
-
`:"";if(b==="list_item_open"&&(!y.attrs||y.attrs.length===0)&&_+3<e.length){const E=e[_+1],k=e[_+2],A=e[_+3];if(E.type==="paragraph_open"&&E.hidden&&k.type==="inline"&&A.type==="paragraph_close"&&A.hidden){S+=`${v}<li>${this.renderInlineTokens(k.children||[],s,o)}`,_+=3;continue}}if(_+2<e.length){const E=e[_+1],k=e[_+2];if(E.type==="inline"&&k.nesting===-1&&k.tag===y.tag&&!k.hidden){const A=ER(y,v);if(A!==null){S+=`${A+this.renderInlineTokens(E.children||[],s,o)}</${y.tag}>
|
|
66
|
-
`,_+=2;continue}}}if(b==="inline"){const E=y.children||[];if(E.length===1){g||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=s.xhtmlOut?`<br />
|
|
67
|
-
`:`<br>
|
|
68
|
-
`,p=s.breaks?h:`
|
|
69
|
-
`,g=!0);const k=E[0];switch(k.type){case"text":if(l===cn.text){S+=gn(k.content);continue}break;case"text_special":if(a===cn.text_special){S+=gn(k.content);continue}break;case"softbreak":if(c===cn.softbreak){S+=p;continue}break;case"hardbreak":if(u===cn.hardbreak){S+=h;continue}break;case"html_inline":if(d===cn.html_inline){S+=k.content;continue}break;case"code_inline":if(f===cn.code_inline){S+=xf(k);continue}break}}S+=this.renderInlineTokens(E,s,o);continue}const w=i[b];if(!w){const E=y.attrs;if(!y.hidden){if(!E||E.length===0)switch(b){case"hr":S+=r?`<hr />
|
|
70
|
-
`:`<hr>
|
|
71
|
-
`;continue;case"heading_open":S+=`<${y.tag}>`;continue;case"heading_close":S+=`</${y.tag}>
|
|
72
|
-
`;continue;case"paragraph_open":S+=`${v}<p>`;continue;case"paragraph_close":S+=`</p>
|
|
73
|
-
`;continue;case"list_item_open":{const k=e[_+1];S+=v+(k&&(k.type==="inline"||k.hidden||k.nesting===-1&&k.tag==="li")?"<li>":`<li>
|
|
74
|
-
`);continue}case"list_item_close":S+=`</li>
|
|
75
|
-
`;continue;case"bullet_list_open":S+=`${v}<ul>
|
|
76
|
-
`;continue;case"bullet_list_close":S+=`</ul>
|
|
77
|
-
`;continue;case"blockquote_open":S+=v+(e[_+1]&&e[_+1].nesting===-1&&e[_+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
78
|
-
`);continue;case"blockquote_close":S+=`</blockquote>
|
|
79
|
-
`;continue;case"ordered_list_open":S+=`${v}<ol>
|
|
80
|
-
`;continue;case"ordered_list_close":S+=`</ol>
|
|
81
|
-
`;continue;case"table_open":S+=`${v}<table>
|
|
82
|
-
`;continue;case"table_close":S+=`</table>
|
|
83
|
-
`;continue;case"thead_open":S+=`${v}<thead>
|
|
84
|
-
`;continue;case"thead_close":S+=`</thead>
|
|
85
|
-
`;continue;case"tbody_open":S+=`${v}<tbody>
|
|
86
|
-
`;continue;case"tbody_close":S+=`</tbody>
|
|
87
|
-
`;continue;case"tr_open":S+=`${v}<tr>
|
|
88
|
-
`;continue;case"tr_close":S+=`</tr>
|
|
89
|
-
`;continue;case"td_open":S+=`${v}<td>`;continue;case"td_close":S+=`</td>
|
|
90
|
-
`;continue;case"th_open":S+=`${v}<th>`;continue;case"th_close":S+=`</th>
|
|
91
|
-
`;continue}else if(E.length===1){const k=E[0];if(b==="ordered_list_open"&&k[0]==="start"){S+=`${v}<ol start="${gn(k[1])}">
|
|
92
|
-
`;continue}if(b==="td_open"&&k[0]==="style"){S+=`${v}<td style="${gn(k[1])}">`;continue}if(b==="th_open"&&k[0]==="style"){S+=`${v}<th style="${gn(k[1])}">`;continue}}}S+=this.renderToken(e,_,s);continue}if(b==="code_block"&&w===cn.code_block){S+=Dg(y);continue}if(b==="fence"&&w===cn.fence){S+=Hb(y,s);continue}if(b==="html_block"&&w===cn.html_block){S+=y.content;continue}const N=w(e,_,s,o,this);typeof N=="string"?S+=N:S+=Id(N,y.type)}return S}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const s=this.mergeOptions(t),o=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],s,o);continue}const c=i[a.type];c?r+=await Db(c(e,l,s,o,this)):r+=this.renderToken(e,l,s)}return r}renderInline(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokens(e,s,o)}async renderInlineAsync(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokensAsync(e,s,o)}renderInlineAsText(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineAsTextInternal(e,s,o)}renderAttrs(e){return _r(e.attrs)}renderToken(e,t,n){const s=e[t];if(s.hidden)return"";const o=s.block,i=s.nesting,r=s.tag,l=s.attrs;let a=!1;if(o&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=o&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
93
|
-
`:"",u=a?`>
|
|
94
|
-
`:">";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+_r(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const s=()=>(n||(n={...t}),n);if(ld.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),ld.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(ld.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(ld.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...IR,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===cn.code_block)return Dg(t);if(i==="html_block"&&o.html_block===cn.html_block)return t.content;const r=this.mergeOptions(n),l=s??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[i];if(!a)return t.block?this.renderToken(e,0,r):Tf(t,r.xhtmlOut===!0);if(i==="fence"&&a===cn.fence)return Hb(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Id(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const s=this.rules,o=s.text,i=s.text_special,r=s.softbreak,l=s.hardbreak,a=s.html_inline,c=s.code_inline,u=s.link_open,d=s.link_close,f=s.em_open,h=s.em_close,p=s.strong_open,g=s.strong_close,S=t.xhtmlOut===!0,_=S?`<br />
|
|
95
|
-
`:`<br>
|
|
96
|
-
`,y=t.breaks?_:`
|
|
97
|
-
`;if(e.length===1)return ad(e,t,n,this,s,_,y);let b="";for(let v=0;v<e.length;v++){const w=e[v];if(w.type==="link_open"&&!u&&!d&&v+2<e.length){const k=e[v+1];if(e[v+2].type==="link_close"&&$R(k)){const A=`${Bb(w)+ad([k],t,n,this,s,_,y)}</a>`;if(r===cn.softbreak&&v+3<e.length&&e[v+3].type==="softbreak"){b+=A+y,v+=3;continue}b+=A,v+=2;continue}}if(w.type==="link_open"&&!u&&!d&&v+1<e.length&&e[v+1].type==="link_close"){b+=`${Bb(w)}</a>`,v+=1;continue}if(w.type==="em_open"&&!f&&!h&&v+2<e.length){const k=e[v+1];if(e[v+2].type==="em_close"&&Fb(k)){b+=`<em>${ad([k],t,n,this,s,_,y)}</em>`,v+=2;continue}}if(w.type==="strong_open"&&!p&&!g&&v+2<e.length){const k=e[v+1];if(e[v+2].type==="strong_close"&&Fb(k)){b+=`<strong>${ad([k],t,n,this,s,_,y)}</strong>`,v+=2;continue}}switch(w.type){case"text":if(o===cn.text){const k=w.content.length===0?"":gn(w.content);if(a===cn.html_inline&&v+1<e.length&&e[v+1].type==="html_inline"){for(b+=k+e[++v].content;v+1<e.length&&e[v+1].type==="html_inline";)b+=e[++v].content;continue}b+=k;continue}break;case"text_special":if(i===cn.text_special){w.content.length!==0&&(b+=gn(w.content));continue}break;case"softbreak":if(r===cn.softbreak){b+=y;continue}break;case"hardbreak":if(l===cn.hardbreak){b+=_;continue}break;case"html_inline":if(a===cn.html_inline){for(b+=w.content;v+1<e.length&&e[v+1].type==="html_inline";)b+=e[++v].content;continue}break;case"code_inline":if(c===cn.code_inline){b+=xf(w);continue}break}const N=s[w.type];if(!N){b+=w.block?this.renderToken(e,v,t):Tf(w,S);continue}const E=N(e,v,t,n,this);typeof E=="string"?b+=E:b+=Id(E,w.type)}return b}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const s=this.rules;let o="";for(let i=0;i<e.length;i++){const r=s[e[i].type];r?o+=await Db(r(e,i,t,n,this)):o+=this.renderToken(e,i,t)}return o}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let s="";for(let o=0;o<e.length;o++){const i=e[o];switch(i.type){case"text":case"text_special":s+=i.content;break;case"image":s+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":s+=i.content;break;case"softbreak":case"hardbreak":s+=`
|
|
98
|
-
`;break}}return s}},LR=NR;const OR=[];function Wb(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var PR=class{core;cache=null;stats=Wb();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=Wb(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(to(s??o?.env),!o||s&&s!==o.env){const M=s??{},L=!!n.__explicitStreamChunkFallbackSetting,R=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,B=!!n.options?.streamChunkedFallback,W=!L&&R,K=B||W,V=n.options?.streamChunkAdaptive!==!1,se=n.options?.streamChunkTargetChunks??8,Y=n.options?.streamChunkSizeChars,G=n.options?.streamChunkSizeLines,ee=n.options?.streamChunkMaxChunks,we=!!n.__explicitStreamChunkConfig,de=n.options?.autoTuneChunks!==!1,Le=n.options?.streamChunkFenceAware??!0,ce=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,_e=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let me,$e=e.length>=ce;if(!$e&&_e!==void 0&&(me=$n(e),$e=me>=_e),$e){const ye=this.parseFullDocument(e,M,n,me,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",rs(M,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!_i(M)?.unbounded}),ye.tokens}else if(K){const ye=(H,X,ae)=>H<X?X:H>ae?ae:H;me===void 0&&(me=$n(e));const Se=de&&!we?Pb(e.length,me,n.options):null,U=Se?.maxChunkChars??(V?ye(Math.ceil(e.length/se),8e3,64e3):Y??1e4),Z=Se?.maxChunkLines??(V?ye(Math.ceil(me/se),150,700):G??200),fe=Se?.maxChunks??(V?ye(Math.ceil(e.length/64e3),se,32):ee),oe=e.length>0&&e.charCodeAt(e.length-1)===10,he=W&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Se?.strategy!=="plain";if((B||he)&&(e.length>=U*2||me>=Z*2)&&oe){const H=Cf(n,e,M,{maxChunkChars:U,maxChunkLines:Z,fenceAware:Se?.fenceAware??Le,maxChunks:fe});return this.cache={src:e,tokens:H,env:M,lineCount:me,lastSegment:void 0,globalStateReason:ys(e)},this.updateCacheLineCount(this.cache,me),this.recordChunkedParseResult(M,B?"explicit-initial-large-doc":"default-initial-large-doc"),H}}const J=this.parseFullDocument(e,M,n,me);return me=J.lineCount,this.cache={src:e,tokens:J.tokens,env:M,lineCount:me,lastSegment:void 0,globalStateReason:ys(e)},this.updateCacheLineCount(this.cache,me),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",rs(M,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!_i(M)?.unbounded}),J.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",rs(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;let i=o.globalStateReason;i===void 0&&(i=ys(o.src),o.globalStateReason=i);const r=ys(e),l=i||r;if(l){const M=s??o.env;Ri(M);const L=this.parseFullDocument(e,M,n),R=L.tokens,B=L.lineCount;return this.cache={src:e,tokens:R,env:M,lineCount:B,lastSegment:void 0,globalStateReason:r},this.updateCacheLineCount(this.cache,B),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",rs(M,{area:"stream",path:"stream-full",reason:`global-state:${l}`,unbounded:!!_i(M)?.unbounded}),R}const a=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length<a&&e.length<a*1.5&&!e.startsWith(o.src)){const M=s??o.env,L=this.parseFullDocument(e,M,n),R=L.tokens,B=L.lineCount;return this.cache={src:e,tokens:R,env:M,lineCount:B,lastSegment:void 0,globalStateReason:ys(e)},this.updateCacheLineCount(this.cache,B),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",rs(M,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!_i(M)?.unbounded}),R}const c=this.getAppendedSegment(o.src,e);if(c&&!this.shouldPreferTailReparseForAppend(o)){let V=function(Le){const ce=Le.length;let _e=0;for(;_e<=ce;){let me=Le.indexOf(`
|
|
99
|
-
`,_e);me===-1&&(me=ce);const $e=me<ce;let J=_e,ye=0;for(;J<me;){const Se=Le.charCodeAt(J);if(Se===32){if(ye++,J++,ye>=4)return!0;continue}if(Se===9){if(ye+=4-ye%4,J++,ye>=4)return!0;continue}break}if(J<me){const Se=Le.charCodeAt(J);switch(Se){case 35:{let U=J;for(;U<me&&Le.charCodeAt(U)===35;)U++;const Z=U-J;if(Z>0&&Z<=6){if(U<me){const fe=Le.charCodeAt(U);if(fe===32||fe===9||fe===13)return!0}else if(U===me&&$e)return!0}break}case 62:{const U=J+1;if(U<me){const Z=Le.charCodeAt(U);if(Z===32||Z===9||Z===13)return!0}else if(U===me&&$e)return!0;break}case 45:case 42:case 43:{const U=J+1;if(U<me){const Z=Le.charCodeAt(U);if(Z===32||Z===9||Z===13)return!0}else if(U===me&&$e)return!0;break}case 96:case 126:{let U=J;for(;U<me&&Le.charCodeAt(U)===Se;)U++;if(U-J>=3)return!0;break}default:if(Se>=48&&Se<=57){let U=J+1;for(;U<me;){const Z=Le.charCodeAt(U);if(Z<48||Z>57)break;U++}if(U<me&&Le.charCodeAt(U)===46){const Z=U+1;if(Z<me){const fe=Le.charCodeAt(Z);if(fe===32||fe===9||fe===13)return!0}else if(Z===me&&$e)return!0}}break}}if(me===ce)break;_e=me+1}return!1};const M=o.lineCount??$n(o.src);let L=3;c.length>5e3?L=8:c.length>1e3?L=6:c.length>200&&(L=4),L=Math.min(L,M);let R=null;const B=n.options?.streamContextParseStrategy??"chars",W=n.options?.streamContextParseMinChars??200,K=n.options?.streamContextParseMinLines??2;let se=null;const Y=()=>(se===null&&(se=$n(c)),se),G=this.canDirectlyParseAppend(o),ee=G&&this.shouldUseUnboundedAppend(e,o,c);let we=!1;if(!G)switch(B){case"lines":we=Y()>=K;break;case"constructs":if(c.length>=W){we=!0;break}if(V(c)){we=!0;break}we=Y()>=K;break;case"chars":default:we=c.length>=W}if(L>0&&we){const Le=this.getTailLines(o.src,L)+c;try{const ce=this.core.parse(Le,o.env,n).tokens,_e=ce.findIndex(me=>me.map&&typeof me.map[1]=="number"&&me.map[1]>L);if(_e!==-1){const me=ce.slice(_e),$e=M-L;$e!==0&&this.shiftTokenLines(me,$e),R={tokens:me}}}catch{R=null}}else R=null;if(!R){const Le=M;if(ee)R={tokens:Sc(n,c,o.env,{mode:"stream"})},Le>0&&this.shiftTokenLines(R.tokens,Le);else{const ce=this.core.parse(c,o.env,n);Le>0&&this.shiftTokenLines(ce.tokens,Le),R=ce}}if(o.tokens.length>0&&R.tokens.length>0){const Le=o.tokens[o.tokens.length-1],ce=R.tokens[0];try{Le.type==="inline"&&ce.type==="inline"&&(ce.children&&ce.children.length>0&&(Le.children||(Le.children=[]),this.appendTokens(Le.children,ce.children)),Le.content=(Le.content||"")+(ce.content||""),R.tokens.shift())}catch{}}const de=o.tokens.length;if(R.tokens.length>0){let me=function(Se,U){if(!Se&&!U)return!0;if(!Se||!U||Se.length!==U.length)return!1;for(let Z=0;Z<Se.length;Z++)if(Se[Z][0]!==U[Z][0]||Se[Z][1]!==U[Z][1])return!1;return!0},$e=function(Se,U){if(!Se&&!U)return!0;if(!Se||!U||Se.length!==U.length)return!1;for(let Z=0;Z<Se.length;Z++)if(!J(Se[Z],U[Z]))return!1;return!0},J=function(Se,U){if(!Se||!U||Se.type!==U.type)return!1;const Z=Se.map,fe=U.map;return!!Z!=!!fe||Z&&fe&&(Z[0]!==fe[0]||Z[1]!==fe[1])||Se.tag!==U.tag||Se.nesting!==U.nesting||Se.markup!==U.markup||Se.info!==U.info||Se.block!==U.block||Se.hidden!==U.hidden||!me(Se.attrs,U.attrs)||!$e(Se.children,U.children)?!1:(Se.type==="inline",(Se.content||"")===(U.content||""))};const Le=o.tokens,ce=R.tokens,_e=Math.min(Le.length,ce.length);let ye=0;for(let Se=_e;Se>0;Se--){let U=!0;for(let Z=0;Z<Se;Z++){const fe=Le[Le.length-Se+Z],oe=ce[Z];if(!J(fe,oe)){U=!1;break}}if(U){ye=Se;break}}ye>0&&ce.splice(0,ye),ce.length>0&&this.appendTokens(o.tokens,ce)}if(o.src=e,o.globalStateReason=ys(e),o.lineCount=M+(se??$n(c)),o.tokens.length>de){const Le=this.getLastSegment(o.tokens.slice(de),e);Le?o.lastSegment={tokenStart:de+Le.tokenStart,tokenEnd:de+Le.tokenEnd,lineStart:Le.lineStart,lineEnd:Le.lineEnd,srcOffset:Le.srcOffset}:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ee&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",rs(o.env,{area:"stream",path:ee?"stream-unbounded-append":"stream-append",reason:ee?"large-delta":"safe-append",unbounded:ee}),o.tokens}const u=s??o.env,d=this.tryTailSegmentReparse(e,o,u,n);if(d)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",rs(u,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),d;const f=!!n.__explicitStreamChunkFallbackSetting,h=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,p=!!n.options?.streamChunkedFallback,g=!f&&!c&&h,S=p||g,_=n.options?.streamChunkAdaptive!==!1,y=n.options?.streamChunkTargetChunks??8,b=n.options?.streamChunkSizeChars,v=n.options?.streamChunkSizeLines,w=n.options?.streamChunkMaxChunks,N=!!n.__explicitStreamChunkConfig,E=n.options?.autoTuneChunks!==!1,k=n.options?.streamChunkFenceAware??!0;let A=c&&o.lineCount!==void 0?o.lineCount+$n(c):void 0;if(S){A===void 0&&(A=$n(e));const M=(se,Y,G)=>se<Y?Y:se>G?G:se,L=E&&!N?Pb(e.length,A,n.options):null,R=L?.maxChunkChars??(_?M(Math.ceil(e.length/y),8e3,64e3):b??1e4),B=L?.maxChunkLines??(_?M(Math.ceil(A/y),150,700):v??200),W=L?.maxChunks??(_?M(Math.ceil(e.length/64e3),y,32):w),K=e.length>0&&e.charCodeAt(e.length-1)===10,V=g&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&L?.strategy!=="plain";if((p||V)&&(e.length>=R*2||A>=B*2)&&K){const se=Cf(n,e,u,{maxChunkChars:R,maxChunkLines:B,fenceAware:L?.fenceAware??k,maxChunks:W});return this.cache={src:e,tokens:se,env:u,lineCount:A,lastSegment:void 0,globalStateReason:ys(e)},this.updateCacheLineCount(this.cache,A),this.recordChunkedParseResult(u,p?"explicit-fallback-large-doc":"default-fallback-large-doc"),se}}const I=this.parseFullDocument(e,u,n,A),P=I.tokens;return A=I.lineCount,this.cache={src:e,tokens:P,env:u,lineCount:A,lastSegment:void 0,globalStateReason:ys(e)},this.updateCacheLineCount(this.cache,A),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",rs(u,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!_i(u)?.unbounded}),P}recordChunkedParseResult(e,t){const n=_i(e)?.chunk,s=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,s){this.stats.fullParses+=1,this.stats.lastMode="full",rs(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!_i(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",rs(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=ys(e);fu(t)&&Ri(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?Bx(n,e.length,s):"no";if(r==="yes"){const a=Sc(n,e,t);return rs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?$n(e):0)}}let l=s;if(r==="need-lines"&&(l=$n(e),Dx(n,e.length,l))){const a=Sc(n,e,t);return rs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?$n(e):0),{tokens:ua(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:$n(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t){if(!t.startsWith(e)||!e.endsWith(`
|
|
100
|
-
`))return null;const n=t.slice(e.length);if(!n)return null;const s=n.length;if(n.charCodeAt(s-1)!==10)return null;let o=0,i=-1;for(let l=0;l<s&&!(n.charCodeAt(l)===10&&(i===-1&&(i=l),o++,o>=2));l++);if(o<2)return null;const r=(i===-1?n:n.slice(0,i)).trim();if(r.length===0)return null;if(/^[-=]+$/.test(r)){const l=e.slice(0,-1),a=l.lastIndexOf(`
|
|
101
|
-
`);if(l.slice(a+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(n)?null:n}tryTailSegmentReparse(e,t,n,s){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const i=t.src.slice(0,o.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,s,o,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,s),u=this.getLastSegment(c.tokens,l);return o.lineStart>0&&this.shiftTokenLines(c.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=ys(e),t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=$n(e),u?t.lastSegment={tokenStart:o.tokenStart+u.tokenStart,tokenEnd:o.tokenStart+u.tokenEnd,lineStart:o.lineStart+u.lineStart,lineEnd:o.lineStart+u.lineEnd,srcOffset:o.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let s=e.length-1;s>=0;s--)if(e.charCodeAt(s)===10&&(n--,n===0))return e.slice(s+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,s=e.slice(n),o=s.length;let i=null,r=0;for(;r<=o;){let l=s.indexOf(`
|
|
102
|
-
`,r);l===-1&&(l=o);let a=r;for(;a<l;){const c=s.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=s.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&s.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===o)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??OR}getStats(){return{...this.stats}}appendTokens(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}updateCacheLineCount(e,t){e.lineCount=t??$n(e.src),e.lastSegment=void 0}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t){if(e.length===0)return null;let n=Number.POSITIVE_INFINITY,s=-1,o=0;for(let i=e.length-1;i>=0;i--){const r=e[i];if(r.map&&(r.map[0]<n&&(n=r.map[0]),r.map[1]>s&&(s=r.map[1])),r.nesting<0){o+=-r.nesting;continue}if(r.nesting>0){if(o-=r.nesting,r.level===0&&o<=0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}continue}if(r.level===0&&o===0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}}return null}getLineStartOffset(e,t){if(t<=0)return 0;let n=t,s=-1;for(;n>0;){if(s=e.indexOf(`
|
|
103
|
-
`,s+1),s===-1)return e.length;n--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,s,o,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,s,o,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,s,o,i,r);default:return null}}tryListTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const f=t.lineCount??$n(t.src);f>0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),p=this.getListParagraphMode(u,0,u.length,0);return(h==="loose"||p==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=ys(e),t.lineCount=$n(e),r.map&&(r.map[1]=this.getDocLineCount(e)),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:this.getDocLineCount(e),srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(o.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),h=this.getTableBodySection(t.tokens,o.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 g=o.lineEnd-2;g!==0&&this.shiftTokenLines(p,g);const S=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex;t.tokens.splice(S,0,...p),t.src=e,t.env=n,t.globalStateReason=ys(e),t.lineCount=$n(e);const _=this.getDocLineCount(e);if(r.map&&(r.map[1]=_),h.tbodyOpenIndex>=0){const y=t.tokens[h.tbodyOpenIndex];y?.map&&(y.map[1]=_)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:_,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
104
|
-
`);if(t<0)return null;const n=e.indexOf(`
|
|
105
|
-
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,s){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===s){o=l;break}}if(o<0)return null;let i=-1,r=-1;for(let l=t+1;l<o;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===s+1){i=l;break}}if(i>=0){for(let l=o-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===s+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,s){if(e.length<2)return!1;const o=e[0],i=e[e.length-1];if(o.type!==t||i.type!==n||o.level!==0||i.level!==0||s!==void 0&&o.markup!==s)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,s){let o=!1,i=!1;const r=s+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?o=!0:i=!0,o&&i))return"loose"}return i?"loose":o?"tight":"none"}setListParagraphVisibility(e,t,n,s,o){const i=s+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=o)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const s=e.charCodeAt(n);if(s===32||s===9){n--;continue}return s===10}return!0}getDocLineCount(e){const t=$n(e);return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;const n=[...e];for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}};const Ub={default:_R,zero:wR,commonmark:bR};function RR(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function DR(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 jb(e){return e.experimental?{...e,...e.experimental}:e}function Co(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 qb(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(Co(t,o)||Co(e,o))return!0}return!1}function zb(e,t,n){return Co(t,n)||Co(e,n)}function Vb(e,t){const n=_i(e)?.chunk;if(n?.fallback){rs(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}rs(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function BR(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},s="default",o;!t&&typeof e!="string"?(o=e,s="default"):typeof e=="string"&&(s=e,o=t);const i=Ub[s];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${s}", check name`);if(i?.options&&(n={...n,...i.options}),o&&(n={...n,...o}),n=jb(n),typeof n.quotes=="string"){const w=n.quotes;w.length>=4?n.quotes=[w[0],w[1],w[2],w[3]]:n.quotes=["“","”","‘","’"]}let r=qb(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=qb(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=zb(i?.options,o,"fullChunkedFallback"),c=zb(i?.options,o,"streamChunkedFallback"),u=!1,d=null;const f=new QP;let h=null;const p=()=>(h||(h=new LR(n)),h);let g=null;const S=()=>(g||(g=new PR(f)),g);let _=null;const y=()=>(_||(_=new ax),_),b=w=>!u&&!!d&&!DR(w,d),v={core:f,block:f.block,inline:f.inline,get linkify(){const w=y();return Object.defineProperty(this,"linkify",{value:w,writable:!0,configurable:!0}),w},get renderer(){const w=p();return Object.defineProperty(this,"renderer",{value:w,writable:!0,configurable:!0}),w},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return b(this)},set(w){const N=jb(w);return this.options={...this.options,...N},(Co(w,"fullChunkSizeChars")||Co(w,"fullChunkSizeLines")||Co(w,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(Co(w,"streamChunkSizeChars")||Co(w,"streamChunkSizeLines")||Co(w,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),Co(w,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),Co(w,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),h&&h.set(N),typeof N.stream=="boolean"&&(this.stream.enabled=N.stream,g&&(g.reset(),g.resetStats())),this},configure(w){const N=typeof w=="string"?Ub[w]:w;if(!N)throw new Error("Wrong `markdown-it` preset, can't be empty");if(N.options&&this.set(N.options),N.components){const E=N.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(w,N){const E=Array.isArray(w)?w:[w],k=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],A=new Set;for(const I of k){if(!I)continue;const P=I.enable(E,!0);for(let M=0;M<P.length;M++)A.add(P[M])}if(!N){const I=E.filter(P=>!A.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(w,N){const E=Array.isArray(w)?w:[w],k=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],A=new Set;for(const I of k){if(!I)continue;const P=I.disable(E,!0);for(let M=0;M<P.length;M++)A.add(P[M])}if(!N){const I=E.filter(P=>!A.has(P));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(w,...N){const E=typeof w=="function"?w:w&&typeof w.default=="function"?w.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const k=[this,...N],A=w;return u=!0,E.apply(A,k),this},render(w,N={}){const E=this.parse(w,N);return p().render(E,this.options,N)},async renderAsync(w,N={}){const E=this.parse(w,N);return p().renderAsync(E,this.options,N)},renderIterable(w,N={}){const E=this.parseIterable(w,N);return p().render(E,this.options,N)},async renderAsyncIterable(w,N={}){const E=await this.parseAsyncIterable(w,N);return p().renderAsync(E,this.options,N)},renderInline(w,N={}){const E=this.parseInline(w,N);return p().render(E,this.options,N)},validateLink:Tx,normalizeLink:Mx,normalizeLinkText:Ax,utils:yL,helpers:{...aO},parse(w,N={}){if(typeof w!="string")throw new TypeError("Input data should be a String");to(N);let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&b(this)){const A=Bx(this,w.length);if(A==="yes"){const I=Sc(this,w,N);return rs(N,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),I}A==="need-lines"&&(E=$n(w))}if(!this.stream.enabled){const A=w.length,I=E??$n(w),P=this.options.autoTuneChunks!==!1,M=r,L=!a&&b(this),R=!!this.options.fullChunkedFallback,B=L&&A>=2e5,W=P&&!M?kR(A,I,this.options):null;if((R||B)&&(R?A>=(this.options.fullChunkThresholdChars??2e4)||I>=(this.options.fullChunkThresholdLines??400):B)){if(W&&W.strategy!=="plain"){const K=Cf(this,w,N,{maxChunkChars:W.maxChunkChars,maxChunkLines:W.maxChunkLines,fenceAware:W.fenceAware,maxChunks:W.maxChunks});return Vb(N,R?"explicit-full-chunk":"default-large-string"),K}if(R){const K=(ce,_e,me)=>ce<_e?_e:ce>me?me:ce,V=this.options.fullChunkAdaptive!==!1,se=this.options.fullChunkTargetChunks??8,Y=K(Math.ceil(A/se),8e3,64e3),G=K(Math.ceil(I/se),150,700),ee=V?Y:this.options.fullChunkSizeChars??1e4,we=V?G:this.options.fullChunkSizeLines??200,de=V?K(Math.ceil(A/64e3),se,32):this.options.fullChunkMaxChunks,Le=Cf(this,w,N,{maxChunkChars:ee,maxChunkLines:we,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:de});return Vb(N,"explicit-full-chunk"),Le}}if(E!==void 0&&b(this)&&Dx(this,A,I)){const K=Sc(this,w,N);return rs(N,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),K}}const k=ys(w);return rs(N,{area:"parse",path:"plain",reason:"default-plain"}),ua(N,k,()=>f.parse(w,N,this).tokens)},parseIterable(w,N={}){return to(N),mR(this,w,N)},parseAsyncIterable(w,N={}){return to(N),gR(this,w,N)},parseIterableToSink(w,N,E={}){return to(E),vR(this,w,N,E)},parseAsyncIterableToSink(w,N,E={}){return to(E),yR(this,w,N,E)},parseInline(w,N={}){if(typeof w!="string")throw new TypeError("Input data should be a String");to(N),fu(N)&&Ri(N);const E=f.createState(w,N,this);return E.inlineMode=!0,f.process(E),E.tokens}};if(v.stream={enabled:!!n.stream,parse(w,N){return v.stream.enabled?S().parse(w,N,v):v.parse(w,N??{})},reset(){S().reset()},peek(){return g?g.peek():[]},stats(){return g?g.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){g&&g.resetStats()}},i?.components){const w=i.components;w.core?.rules&&v.core.ruler.enableOnly(w.core.rules),w.block?.rules&&v.block.ruler.enableOnly(w.block.rules),w.inline?.rules&&v.inline.ruler.enableOnly(w.inline.rules),w.inline2?.rules&&v.inline.ruler2.enableOnly(w.inline2.rules)}return d=RR(v),v}var FR=BR;function HR(e,t,n){function s(f){return f.trim().split(" ",2)[0]===t}function o(f,h,p,g,S){return f[h].nesting===1&&f[h].attrJoin("class",t),S.renderToken(f,h,p,g,S)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||s,u=n.render||o;function d(f,h,p,g){let S,_=!1,y=f.bMarks[h]+f.tShift[h],b=f.eMarks[h];if(l!==f.src.charCodeAt(y))return!1;for(S=y+1;S<=b&&r[(S-y)%a]===f.src[S];S++);const v=Math.floor((S-y)/a);if(v<i)return!1;S-=(S-y)%a;const w=f.src.slice(y,S),N=f.src.slice(S,b);if(!c(N,w))return!1;if(g)return!0;let E=h;for(;E++,!(E>=p||(y=f.bMarks[E]+f.tShift[E],b=f.eMarks[E],y<b&&f.sCount[E]<f.blkIndent));)if(l===f.src.charCodeAt(y)&&!(f.sCount[E]-f.blkIndent>=4)){for(S=y+1;S<=b&&r[(S-y)%a]===f.src[S];S++);if(!(Math.floor((S-y)/a)<v)&&(S-=(S-y)%a,S=f.skipSpaces(S),!(S<b))){_=!0;break}}const k=f.parentType,A=f.lineMax;f.parentType="container",f.lineMax=E;const I=f.push("container_"+t+"_open","div",1);I.markup=w,I.block=!0,I.info=N,I.map=[h,E],f.md.block.tokenize(f,h+1,E);const P=f.push("container_"+t+"_close","div",-1);return P.markup=f.src.slice(y,S),P.block=!0,f.parentType=k,f.lineMax=A,f.line=E+(_?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 WR(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const s=[];let o="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){o+=c,a+1<n.length&&(o+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,o+=c;continue}if(!i&&c==='"'){r=!r,o+=c;continue}if(!i&&!r&&c===","){s.push(o.trim()),o="";continue}o+=c}o.trim()&&s.push(o.trim());const l={};for(const a of s){if(!a)continue;let c=!1,u=!1,d=-1;for(let S=0;S<a.length;S++){const _=a[S];if(_==="\\"){S++;continue}if(!u&&_==="'"){c=!c;continue}if(!c&&_==='"'){u=!u;continue}if(!c&&!u&&_===":"){d=S;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 g;if(!h)g="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{g=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{g=h}else/^-?\d+(?:\.\d+)?$/.test(h)?g=Number(h):h==="true"||h==="false"?g=h==="true":h==="null"?g=null:g=h;l[p]=g}return l}function UR(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(HR,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
106
|
-
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,s,o)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let f,h;const p=d.indexOf("{"),g=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,g?.startsWith("{")){let w=0,N=-1;for(let E=0;E<g.length;E++)if(g[E]==="{"?w++:g[E]==="}"&&w--,w===0){N=E+1;break}N>0&&(h=g.slice(0,N))}h||(f=d||void 0)}if(o)return!0;const S=!!i.env.__markstreamFinal;let _=n+1,y=!1;for(;_<=s;){const w=i.bMarks[_]+i.tShift[_],N=i.eMarks[_];if(i.src.slice(w,N).trim()===":::"){y=!0;break}_++}y||(_=s);const b=i.push("vmr_container_open","div",1);if(b.attrSet("class",`vmr-container vmr-container-${u}`),b.meta={...b.meta??{},unclosed:!y&&!S},f&&b.attrSet("data-args",f),h)try{const w=JSON.parse(h);for(const[N,E]of Object.entries(w)){const k=E!=null&&typeof E=="object";b.attrSet(`data-${N}`,k?JSON.stringify(E):String(E))}}catch{const w=WR(h);if(w)for(const[N,E]of Object.entries(w)){const k=E!=null&&typeof E=="object";b.attrSet(`data-${N}`,k?JSON.stringify(E):String(E))}else b.attrSet("data-attrs",h)}const v=[];for(let w=n+1;w<_;w++){const N=i.bMarks[w]+i.tShift[w],E=i.eMarks[w];v.push(i.src.slice(N,E))}if(v.some(w=>w.trim().length>0)){let w=v.join(`
|
|
107
|
-
`);w.endsWith(`
|
|
108
|
-
`)||(w+=`
|
|
109
|
-
`),w.endsWith(`
|
|
110
|
-
|
|
111
|
-
`)||(w+=`
|
|
112
|
-
`);const N=i.tokens[i.tokens.length-1];N&&(N.raw=w);const E=[];i.md.block.parse(w,i.md,i.env,E),i.tokens.push(...E)}return y&&i.push("vmr_container_close","div",-1),i.line=y?_+1:_,!0},{alt:["paragraph","reference","blockquote","list"]})}const jx=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],jR=["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"],qx=["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"],qR=["svg","g","path"],zR=["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"],VR=["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"],KR=["action","data","href","src","srcset","poster","xlink:href","formaction"],GR=["script"],YR=["pre","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title"],ml=new Set(jx),XR=new Set(qx),Zc=new Set([...jx,...jR,...qx,...qR]),zx=new Set([...Zc,...zR]),ZR=new Set(VR),JR=new Set(KR),pu=new Set(GR),Vx=new Set(YR);function Kx(e){let t="";for(const n of e){const s=n.charCodeAt(0);s<=31||s>=127&&s<=159||/\s/u.test(n)||(t+=n)}return t}const QR={amp:"&",bsol:"\\",colon:":",newline:`
|
|
113
|
-
`,sol:"/",tab:" "};function Gx(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,s,o)=>{const i=n??s;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return QR[String(o??"").toLowerCase()]??t})}const cd=new Set(["http","https","mailto","tel"]),sc=new Set(["http","https"]);function Yx(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function e7(e,t){return t==="href"||t==="xlink:href"?cd:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?sc:cd}function ha(e,t={}){const n=Kx(Gx(e)).toLowerCase(),s=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return s==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=Yx(n);return i?!e7(s,o).has(i):!1}function t7(e){const t=Gx(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=Yx(Kx(t).toLowerCase());return n==="http"||n==="https"}function n7(e,t={}){const n=String(e??"").trim();return n?ha(n,t)?"":n:""}function Kb(e){return n7(e,{tagName:"img",attrName:"src"})}function ro(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Tn(e){let t=!1,n=!1;for(let s=0;s<e.length;s++){const o=e[s];if(o==="\\"){s++;continue}if(!n&&o==="'"){t=!t;continue}if(!t&&o==='"'){n=!n;continue}if(!t&&!n&&o===">")return s}return-1}function Sh(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=s[2]||s[3]||s[4]||"";t.push([o,i])}return t}const s7=/^[a-z][a-z0-9_-]*$/;function Gb(e){return s7.test(String(e??"").trim().toLowerCase())}function Oo(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return Gb(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const s=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const o=t.slice(s,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":Gb(o)?o:""}function Ma(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=Oo(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function o7(...e){const t=new Set,n=[];for(const s of e)for(const o of Ma(s))t.has(o)||(t.add(o),n.push(o));return n}function i7(e){const t=Ma(e);return{key:t.join(","),tags:t}}function Xx(e){return Oo(e)}function r7(e,t){const n=String(e??""),s=Oo(t);if(!s)return!1;const o=ro(s),i=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function Zx(e,t){const n=Oo(t);return!!n&&!Zc.has(n)&&!r7(e,n)}function l7(e,t){const n=String(e??""),s=Oo(t);if(!s)return n;const o=ro(s),i=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const Jx=ml,a7=Zc,Qx=new Set(XR);Qx.delete("details");const c7=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,u7=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Bg=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,d7=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Mf(e){return(e.match(Bg)?.[1]??"").toLowerCase()}function wv(e){return/^\s*<\s*\//.test(e)}function Sv(e,t){return Jx.has(t)||/\/\s*>\s*$/.test(e)}function f7(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(!o||o.type!=="html_inline")continue;const i=String(o.content??""),r=Mf(i);if(r===t){if(wv(i)){if(n===0)return s;n--;continue}Sv(i,r)||n++}}return-1}function h7(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=Mf(o);if(i===t){if(wv(o)){n>0&&n--;continue}Sv(o,i)||n++}}return n}function Yb(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${ro(t)}(?=[\s>/])[^>]*>`,"gi");s.lastIndex=Math.max(0,n);let o=0,i;for(;(i=s.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:i.index,end:i.index+r.length};o--;continue}a||o++}return null}function p7(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${ro(t)}(?=[\s>/])[^>]*>`,"gi");let s=0,o;for(;(o=n.exec(e))!==null;){const i=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(i);if(r){s>0&&s--;continue}l||s++}return s}function Af(e){const t=e;return String(t.raw??t.content??t.markup??"")}function m7(e){const t=e;return t.meta||(t.meta={}),t.meta}function um(e,t,n){const s=m7(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function g7(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${ro(h)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!s.length))for(const p of s)p.raw+=h,p.inner+=h},l=()=>{!s.length||!o||(r(`
|
|
114
|
-
`),o=!1)},a=h=>{r(h)},c=h=>{for(let g=0;g<s.length;g++)s[g].raw+=h,g<s.length-1&&(s[g].inner+=h);const p=s.pop();um(p.token,p.raw,p.inner)},u=h=>{const p=s[s.length-1]?.tag;if(!p)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${ro(p)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!u(h),f=(h,p,g)=>{const S=g??(h.type==="html_inline"?Mf(p):"");if(!(S&&t.has(S))){r(p);return}const _=wv(p),y=!_&&Sv(p,S);if(_){if(!s.length||s[s.length-1].tag!==S){r(p);return}c(p);return}if(r(p),y){um(h,p,"");return}s.push({tag:S,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)?o=!1:l(),!s.length&&!i(p)){o=!1;continue}let g=0,S=!0;for(const _ of h.children){const y=Af(_),b=_.type==="html_inline"?Mf(y):"",v=b&&t.has(b);let w=y;if(S&&p&&y&&(s.length||v)){const N=p.indexOf(y,g);if(N!==-1)a(p.slice(g,N)),w=p.slice(N,N+y.length),g=N+y.length;else{if(s.length&&!v)continue;S=!1}}f(_,w,b)}S&&p&&g<p.length&&s.length&&a(p.slice(g)),o=s.length>0;continue}if(s.length&&typeof h.content=="string"){const p=Af(h),g=h.type==="html_block"?u(p):null;if(g){c(`${o?`
|
|
115
|
-
`:""}${g}`),o=s.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of s)um(h.token,h.raw,h.inner)}function v7(e){return/^\s*<\s*[!?]/.test(e)}function y7(e){const t=new Set(a7);if(e&&Array.isArray(e))for(const n of e){const s=String(n??"").trim();if(!s)continue;const o=s.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function Xb(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function k7(e,t){let n=null;for(const i of e.matchAll(c7)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Xb(l,t)&&Tn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(u7)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Xb(l,t)&&Tn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const s=/<\/\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const o=/<\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function b7(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function _7(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(b7(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(Bg);if(!h){i("<",c),u=d+1;continue}const p=Tn(f);if(p===-1){i("<",c),u=d+1;continue}const g=f.slice(0,p+1),S=(h[1]??"").toLowerCase();t.has(S)?n.push({type:"html_inline",tag:"",content:g,raw:g}):i(g,c),u=d+g.length}}function l(a,c){if(!a)return;const u=k7(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),s={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},o=s.buffer}for(const a of e){if(s){s.buffer+=Af(a),o=s.buffer;const c=Tn(s.buffer);if(c===-1)continue;const u=s.buffer.slice(0,c+1),d=s.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),s=null,o=null,d&&l(d);continue}if(a.type==="html_inline"){const c=Af(a),u=(c.match(Bg)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Tn(c)===-1){s={tag:u,buffer:c,closing:/^<\s*\//.test(c)},o=s.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:o??void 0}}const w7=["a","span","strong","em","b","i","u"];function S7(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=Oo(f);h&&n.add(h)}const s=f=>{const h=f,p=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const b of g){const v=Oo(String(b??""));v&&p.add(v)}const S=y7(Array.from(p)),_=new Set(w7);for(const b of p)_.add(b);return{autoCloseInlineTagSet:_,commonHtmlTags:S,customTagSet:p,shouldMergeHtmlBlockTag:b=>p.has(b)||!S.has(b)||Qx.has(b)}},o=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 g=p.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const S={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},S,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[S]},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:g}=s(f);for(const S of h){const _=S;if(_.type!=="inline"||!Array.isArray(_.children))continue;const y=String(_.content??""),b=_.children.length?_.children:y.includes("<")?[{type:"text",content:y,raw:y}]:null;if(b)try{const v=_7(b,p);if(_.children=v.children,v.pendingBuffer){const w=y.lastIndexOf(v.pendingBuffer);if(w!==-1){const N=y.slice(0,w);_.content=N,typeof _.raw=="string"&&(_.raw=N)}}}catch(v){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",v)}}g7(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:g,shouldMergeHtmlBlockTag:S}=s(f),_=[];for(let y=0;y<h.length;y++){const b=h[y];if(_.length>0){const[w,N]=_[_.length-1];if(y!==N){if(b.type==="paragraph_open"||b.type==="paragraph_close"){h.splice(y,1),y--;continue}const E=String(b.content??b.raw??"");if(E){const k=h[N],A=`${String(k.content||"")}
|
|
116
|
-
${E}`,I=Tn(A),P=I===-1?null:Yb(A,w,I+1);if(P){const M=A.slice(0,P.end),L=A.slice(P.end);k.content=M,k.loading=!1,h.splice(y,1),_.pop();const R=d(k,L)?[]:c(L,u(h,y,"paragraph"));R.length&&h.splice(y,0,...R),y--;continue}k.content=A,k.loading!==!1&&(k.loading=!0)}h.splice(y,1),y--;continue}}const v=o(b);if(v){if(v7(v))continue;const w=(v.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),N=/^\s*<\s*\//.test(v);if(!w||!S(w))continue;if(i(b,v),!N)w&&!new RegExp(`^\\s*<\\s*${w}\\b[^>]*\\/\\s*>`,"i").test(v)&&p7(v,w)>0&&_.push([w,y]);else if(_.length>0&&w&&_[_.length-1][0]===w){const[,E]=_[_.length-1],k=h[E];k.content=`${String(k.content||"")}
|
|
117
|
-
${v}`,k.loading=!1,_.pop(),h.splice(y,1),y--}continue}else if(_.length>0){if(b.type==="paragraph_open"||b.type==="paragraph_close"){h.splice(y,1),y--;continue}const w=b.content||"",N=new RegExp(`<\\s*\\/\\s*${_[_.length-1][0]}\\s*>`,"i").test(w);if(w){const[,E]=_[_.length-1],k=h[E];k.content=`${k.content||""}
|
|
118
|
-
${w}`,k.loading!==!1&&(k.loading=!N)}N&&_.pop(),h.splice(y,1),y--}else continue}if(g.size>0){const y=new Map,b=new Map,v=E=>{let k=y.get(E);return k||(k=new RegExp(`<\\s*${E}\\b`,"i"),y.set(E,k)),k},w=E=>{let k=b.get(E);return k||(k=new RegExp(`<\\s*\\/\\s*${E}\\s*>`,"i"),b.set(E,k)),k},N=[];for(let E=0;E<h.length;E++){const k=h[E],A=String(k.content??"");if(N.length>0){const P=N[N.length-1],M=h[P.index],L=k.type==="html_block"?w(P.tag).exec(A):null;if(L){const W=L.index+L[0].length,K=A.slice(0,W),V=A.slice(W);M.content=`${String(M.content??"")}
|
|
119
|
-
${K}`,Array.isArray(M.children)&&M.children.push({type:"html_inline",content:`</${P.tag}>`,raw:`</${P.tag}>`}),N.pop();const se=d(M,V)?[]:c(V,u(h,E,"paragraph"));se.length?h.splice(E,1,...se):(h.splice(E,1),E--);continue}if(k.type!=="inline")continue;const R=Array.isArray(k.children)?k.children:[],B=f7(R,P.tag);if(B!==-1){const W=R.slice(0,B+1),K=R.slice(B+1),V=W.map(se=>String(se?.content??se?.raw??"")).join("");if(M.content=`${String(M.content??"")}
|
|
120
|
-
${V}`,Array.isArray(M.children)&&M.children.push(...W),K.length){const se=K.map(Y=>String(Y.content??Y.raw??"")).join("");if(se.trim()){const Y=se.replace(/^\s+/,"");if(d(M,se))h.splice(E,1),E--;else if(Y.startsWith("<"))h.splice(E,1,{type:"html_block",content:Y});else{const G=c(se,u(h,E,"paragraph"));h.splice(E,1,...G)}}else h.splice(E,1),E--}else h.splice(E,1),E--;N.pop();continue}M.content=`${String(M.content??"")}
|
|
121
|
-
${A}`,Array.isArray(M.children)&&M.children.push(...R),h.splice(E,1),E--;continue}if(k.type!=="inline")continue;const I=Array.isArray(k.children)?k.children:[];for(const P of g)if((I.length?h7(I,P):v(P).test(A)&&!w(P).test(A)?1:0)>0){N.push({tag:P,index:E});break}}}{let y=0;for(let b=0;b<h.length;b++){const v=h[b];if(v.type==="paragraph_open"){y++;continue}v.type==="paragraph_close"&&(y>0?y--:(h.splice(b,1),b--))}}for(let y=0;y<h.length;y++){const b=h[y];if(b.type==="html_block"){const k=(b.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(k.startsWith("!")||k.startsWith("?")){b.loading=!1;continue}if(g.has(k)){const B=String(b.content??""),W=Tn(B),K=W===-1?null:Yb(B,k,W+1);b.loading=K?!1:b.loading!==void 0?b.loading:!0;const V=K?.start??-1,se=K?K.end-K.start:0;if(V!==-1){const Y=B.slice(0,V+se);let G="";W!==-1&&W<V&&(G=B.slice(W+1,V)),b.children=[{type:k,content:G,raw:Y,attrs:[],tag:k,loading:!1}],b.content=Y,b.raw=Y;const ee=c(B.slice(V+se)||"","text");ee.length&&h.splice(y+1,0,...ee)}else b.children=[{type:k,content:"",raw:B,attrs:[],tag:k,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(k))continue;b.type="inline";const A=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let I;for(;(I=A.exec(b.content||""))!==null;)I[1],I[2]||I[3]||I[4];const P=String(b.content??""),M=new RegExp(`<\\/\\s*${k}\\s*>`,"i").exec(P),L=M?M.index:-1,R=M?M[0].length:0;if(L!==-1){const B=P.slice(0,L+R),W=(P.slice(L+R)||"").replace(/^\s+/,"");b.children=[{type:"html_block",content:B,tag:k,loading:!1}],b.content=B,b.raw=B,W&&h.splice(y+1,0,W.startsWith("<")?{type:"html_block",content:W}:{type:"text",content:W,raw:W})}else b.children=[{type:"html_block",content:b.content,tag:k,loading:!0}];continue}if(!b||b.type!=="inline")continue;if(b.children.length===2&&b.children[0].type==="html_inline"){const k=(b.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),A=b.children[1],I=String(A?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(A?.type==="html_inline"&&I===k)continue;p.has(k)?(b.children[0].loading=!0,b.children[0].tag=k,b.children.push({type:"html_inline",tag:k,loading:!0,content:`</${k}>`})):b.children=[{type:"html_block",loading:!0,tag:k,content:String(b.children[0]?.content??"")+String(b.children[1]?.content??"")}];continue}else if(b.children.length===3&&b.children[0].type==="html_inline"&&b.children[2].type==="html_inline"){const k=(b.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(k))continue;b.children=[{type:"html_block",loading:!1,tag:k,content:b.children.map(A=>A.content).join("")}];continue}if(!b.content?.startsWith("<")||b.children?.length!==1)continue;const v=String(b.content),w=b,N=w.children[0];if(N?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(v)&&(w.children.length=0);continue}const E=String(N.content??v).match(d7)?.[1]?.toLowerCase()??"";if(E){if(/\/\s*>\s*$/.test(v)||Jx.has(E)){w.children=[{type:"html_inline",content:v}];continue}w.children.length=0}}})}function C7(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 x7(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const s=n.tokens??[];for(let o=0;o<s.length;o++){const i=s[o];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!C7(l[0]??"")){const a=l[0]??"",c=i.level??0;s.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),o+=2}}})}const eT=/\.([a-z0-9]{1,15})$/i,T7=/[_()[\]{}<>]/u,M7=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,A7=/[?#@]/u,E7=/[\\/]/u,$7=/^[\p{L}\p{N}./\\-]+$/u,I7=/^[A-Za-z0-9-]{1,63}$/u,N7=/^xn--[a-z0-9-]{2,59}$/i,L7=/^(?:[A-Z]{1,6}|\d{1,8})$/u,O7=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,P7=/文件名\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,R7=/文件名\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,D7=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,B7=new Set(["ai","md","py","rs","sh","zip"]),tT=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),F7=new Set([...tT,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),H7=new Set(["com","dev","io","page","site"]),W7=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),U7=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 Jc(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 Jc(n)?n:void 0}function Zb(e,t){if(!Jc(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 Jb(e){const t=mu(e);return Jc(t)?t:void 0}function j7(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Qb(e,t){if(!Jc(t))return;const n=String(e??"").trim().split(/\s+/u).map(j7).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>Ef(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>Ef(o,{marketTicker:!0}))&&(s.marketTicker=!0),Jc(s)?s:void 0}function Ar(e,t=!1){let n;return{options(s){return t||s==null?Zb(e,n):Zb(e,dm(Jb(s),Qb(s,n)))},remember(s){const o=Jb(s);n=t?dm(n,o):dm(o,Qb(s,n))},reset(){n=void 0}}}function e_(e){return I7.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function q7(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return e_(n)||N7.test(n)?t.every(e_):!1}function nT(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function z7(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function V7(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function sT(e,t,n){const s=z7(t);return nT(e)&&V7(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function mu(e){const t=String(e??"");return{explicitFilename:P7.test(t),filename:R7.test(t),marketTicker:D7.test(t)}}function K7(e){return q7(e.split(/[\\/]/)[0]??"")}function G7(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function Y7(e){if(T7.test(e)||!$7.test(e))return!0;if(E7.test(e))return!K7(e);const t=e.replace(eT,"");return nT(t)?!0:t.split(".").filter(Boolean).some(G7)}function X7(e,t,n){if(!(n?F7:tT).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?O7:L7).test(s)}function Ef(e,t={}){if(!e||M7.test(e)||A7.test(e))return!1;const n=e.match(eT);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return X7(e,s,t.marketTicker===!0)?!0:U7.has(s)?!B7.has(s)||t.filename?!0:Y7(e):!!(t.explicitFilename&&H7.has(s)||t.filename&&W7.has(s))}const t_=["!"];function Ds(e){return{type:"text",content:e,raw:e}}function Kr(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 Gr(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 Ji(e,t,n){let s="";if(t.includes('"')){const o=t.split('"');t=o[0].trim(),s=o[1].trim()}return{type:"link",loading:n,href:t,title:s,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function Z7(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(Ds(t))}}function n_(e,t){let n=-1;for(const s of t){const o=e.indexOf(s);o!==-1&&(n===-1||o<n)&&(n=o)}return n}function J7(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function Q7(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(s=>s?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function eD(e,t,n){let s="";for(let o=t+1;o<n;o++){const i=e[o];if(i?.type!=="text"||typeof i.content!="string")return null;s+=i.content}return s||null}function tD(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=nD(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function nD(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=mu(t);for(let s=0;s<=e.length-1;s++){s<0&&(s=0);const o=e[s];if(!o)break;if(o.type==="link_open"&&(o.markup==="linkify"||o.markup==="autolink")){let i=-1;for(let r=s+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=eD(e,s,i),l=J7(o);if(o.markup==="linkify"&&r&&!sT(r,l,t)&&Ef(r,n)){e.splice(s,i-s+1,Ds(r));continue}const a=n_(l,t_);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=n_(u.content,t_);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 y=e[_];y?.type==="text"&&typeof y.content=="string"&&(p+=y.content)}u.content=h,u.raw=h;const g=i-(c+1);g>0&&(e.splice(c+1,g),i=c+1);let S=l;if(a!==-1)S=l.slice(0,a);else if(p){const _=encodeURI(p);if(_&&l.endsWith(_))S=l.slice(0,l.length-_.length);else{const y=f?encodeURI(f):"",b=y?l.indexOf(y):-1;b!==-1&&(S=l.slice(0,b))}}S!==l&&Q7(o,S),p&&e.splice(i+1,0,Ds(p));break}}}if(o?.type==="em_open"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("*")){const i=e[s-1].content?.replace(/(\*+)$/,"")||"";e[s-1].content=i,o.type="strong_open",o.tag="strong",o.markup="**";for(let r=s+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(o?.type==="text"&&o.content?.endsWith("(")&&e[s+1]?.type==="link_open"){const i=o.content.match(/\[([^\]]+)\]/);if(i){let r=o.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(Ds(r));const c=i[1],u=l[1].length;Kr(a,u);let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(Ji(c,d,!e[s+4]?.content?.startsWith(")"))),Gr(a,u),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)\**/,"");f&&a.push(Ds(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(Ds(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(h+=e[s+4]?.content||"",e[s+4].content=""),Kr(a,f),a.push(Ji(c,h,!e[s+4]?.content?.startsWith(")"))),Gr(a,f),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)/,"");p&&a.push(Ds(p)),e.splice(s,5,...a)}else e.splice(s,4,...a);s===0?s=a.length-1:s-=a.length+1;continue}let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(Ji(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(Ds(f)),e.splice(s,5,...a)}else e.splice(s,4,...a)}s-=a.length+1;continue}}else if(o.type==="link_open"&&o.markup==="linkify"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("(")){if(e[s-2]?.type==="link_close"){const i=[],r=e[s-3].content||"";let l=o.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[s+3]?.type==="text"){const a=(e[s+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[s+3]?.content?.slice(0,a)||"",e[s+3].content=""),i.push(Ji(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(Ds(u)),e.splice(s-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(s-4,7,...i);continue}else if(e[s-1].content==="]("&&e[s-3]?.type==="text"&&e[s-3].content?.endsWith(")"))if(e[s-2]?.type==="strong_open"){const[i,r]=e[s-3].content?.split("[**")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else if(e[s-2]?.type==="em_open"){const[i,r]=e[s-3].content?.split("[*")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else{const[i,r]=e[s-3].content?.split("[")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}}if(o.type==="link_close"&&o.nesting===-1&&e[s-2]?.type==="link_open"&&e[s+1]?.type==="text"&&e[s-1]?.type==="text"){const i=e[s-1].content||"",r=e[s-2].attrs||[],l=r.find(p=>p[0]==="href")?.[1]||"",a=r.find(p=>p[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[s-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;Kr(f,p)}if(o.markup!=="linkify"&&e[s+1].type==="text"&&e[s+1]?.content?.startsWith("](")){c+=1;for(let p=s+1;p<e.length;p++){const g=d?d[1].length:e[s-3].markup.length,S=e[p];if(g===1&&S.type==="em_close")break;if(g===2&&S.type==="strong_close")break;if(g===3&&(S.type==="em_close"||S.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;Gr(f,p)}e.splice(s-u,c,...f),s-=f.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].markup?.includes("*")&&e[s-4]?.type==="text"&&e[s-4].content?.endsWith("[")){const i=e[s-1].markup.length,r=[],l=e[s-4].content.slice(0,e[s-4].content.length-i);l&&r.push(Ds(l)),Kr(r,i);const a=e[s-2].content||"";let c=o.content.slice(2),u=!0;if(e[s+1]?.type==="text"){const d=(e[s+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[s+1]?.content?.slice(0,d)||"",e[s+1].content="")}if(r.push(Ji(a,c,u)),Gr(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(Ds(d)),e.splice(s-4,8,...r)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...r):e.splice(s-4,7,...r);s-=r.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].type==="strong_close"&&e[s-4]?.type==="text"&&e[s-4]?.content?.includes("**[")){const i=[],r=e[s-4].content.split("**[")[0];r&&i.push(Ds(r)),Kr(i,2);const l=e[s-2].content||"";let a=o.content.slice(2),c=!0;if(e[s+1]?.type==="text"){const u=(e[s+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[s+1]?.content?.slice(0,u)||"",e[s+1].content="")}if(i.push(Ji(l,a,c)),Gr(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(Ds(u)),e.splice(s-4,8,...i)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...i):e.splice(s-4,7,...i);s-=i.length+1;continue}else if(o.type==="strong_close"&&e[s+1]?.type==="text"&&e[s+1].content?.includes("](")&&e[s-1].type==="text"&&/\[.*$/.test(e[s-1].content||"")){const i=[],[r,l]=e[s-1].content?.split("[")||["",""];r&&i.push(Ds(r)),Kr(i,2);let[a,c]=e[s+1].content.split("](");a=l+a;let u=4;if(e[s+2]?.type==="link_open"){const f=e[s+2].attrs?.find(h=>h[0]==="href")?.[1];e[s+5]?.type==="text"&&e[s+5].content==="."?(c=(f||c)+e[s+5].content,e[s+5].content=""):c=f||c,u+=3}let d=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,"")),e[s+2]?.type==="text"){const f=(e[s+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[s+2]?.content?.slice(0,f)||"",e[s+2].content="")}i.push(Ji(a,c,d)),Gr(i,2),e.splice(s-2,u,...i)}if(o.type==="text"&&/\*+\[[^\]]*$/.test(o.content||"")&&e[s+1]?.type==="strong_open"&&e[s+2]?.type==="text"&&e[s+2].content==="]("&&e[s+3]?.type==="link_open"&&e[s+5]?.type==="link_close"&&e[s+6]?.type==="text"&&e[s+6].content===")"&&e[s+7]?.type==="strong_close"){const i=(o.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[s+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[s+4]?.type==="text"&&(l=e[s+4].content||"");const a=[];Kr(a,2),a.push(Ji(r,l,!1)),Gr(a,2),e.splice(s,9,...a),s-=a.length-1;continue}}}for(let s=0;s<e.length-1;s++){const o=e[s],i=e[s+1];if(o?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(o.href??"");if(String(o.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;Z7(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function sD(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=oD(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function oD(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 iD(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=rD(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function rD(e){let t=0;const n=new Set,s=new Set;let o=0;for(let u=0;u<e.length;u++){const d=e[u],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 g=e[p];let S=u+1;for(;S<e.length&&e[S].type==="text"&&e[S].content==="";)S++;const _=e[S];h==="__"&&(g?.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"){o++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const g=e[p];let S=u+1;for(;S<e.length&&e[S].type==="text"&&e[S].content==="";)S++;const _=e[S];h==="_"&&(g?.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,s.add(o))}else f==="em_close"&&(s.has(o)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),o--,o<0&&(o=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,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=lD(l),l}function lD(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const s=e[n],o=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const f=u.slice(0,d),h=u.slice(d+2);t.push(s),t.push(o),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(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=aD(e,n+6);if(u){t.push(s),t.push(o),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(s)}return t}function aD(e,t){for(let n=t;n<e.length;n++){const s=e[n];if(s?.type==="strong_open")return null;if(s?.type!=="text")continue;const o=String(s.content??""),i=o.indexOf("**");if(i!==-1)return{index:n,beforeClose:o.slice(0,i),afterClose:o.slice(i+2)}}return null}function cD(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=mD(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(s)&&(n.tokens=s)}catch(s){console.error("[applyFixTableTokens] failed to fix table tokens",s)}})}function s_(){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 o_(){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 i_(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 oT(e,t){if(!e.startsWith("|")||e.includes(`
|
|
122
|
-
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(s=>s.trim().length>0)?n:null}function fm(e){return oT(e)!==null}function iT(e){return/^:?-+:?$/.test(e.trim())}function uD(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(iT)}function dD(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function fD(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(iT)&&dD(n)}function hD(e){return e==="|"||e==="|:"}function pD(e){const t=oT(e);return t!==null&&t.every(n=>!n.includes(":"))}function mD(e,t=!1,n=""){const s=[...e];if(e.length<3)return s;const o=e.length-2,i=e[o];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
123
|
-
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
124
|
-
`),d=!t&&!r.includes(`
|
|
125
|
-
`)&&/\r?\n$/.test(n)&&fm(r);if(!t&&(r.includes(`
|
|
126
|
-
`)&&u.length===0&&fm(a)&&fD(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>i_(p)),h=[...s_(),...f,...o_()];s.splice(o-1,3,...h)}else if(r.includes(`
|
|
127
|
-
`)&&u.length===0&&fm(a)&&uD(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>i_(p)),h=[...s_(),...f,...o_()];s.splice(o-1,3,...h)}else r.includes(`
|
|
128
|
-
`)&&u.length===0&&pD(a)&&hD(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function gD(e,t,n,s){const o=e.length;if(n==="$$"&&s==="$$"){let c=t;for(;c<o-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=s;let l=0,a=t;for(;a<o;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var vD=gD;const yD=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],$f=yD.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),kD=/\\[a-z]+/i,rT="(?:\\\\|\\u0008)",bD=new RegExp(String.raw`${rT}(?:${$f})\s*\{[^}]+\}`,"i"),_D=new RegExp(String.raw`(?:${rT})?(?:${$f})\s*\{`,"i"),wD=/\\(?:text|frac|left|right|times)/,SD=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,CD=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,xD=/[A-Z]+\s*\([^)]+\)/i,TD=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,MD=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,AD=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,ED={"\b":"\\b","\v":"\\v","\f":"\\f"};function $D(e){let t="";for(const n of e)t+=ED[n]??n;return t}function Zl(e){if(!e)return!1;const t=$D(e),n=t.trim();if(AD.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=kD.test(t),o=bD.test(t),i=_D.test(t),r=wD.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=SD.test(t)&&!CD.test(t),c=xD.test(t),u=TD.test(n),d=MD.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return s||o||i||r||l||a||c||u||d||f||h}const lT="__markstreamMathPluginApplied",Fg=80,aT=2e4,r_=aT+4096;function cT(e){return!!e[lT]}function ID(e){e[lT]=!0}const uT=["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"],ND=["cdot","mathbf{","partial","mu_{"],dT=uT.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),fT="[ \r\b\f\v]",LD=new RegExp(`([^\\\\])(${ND.map(e=>e).join("|")})+`,"g"),OD=/span\{([^}]+)\}/,PD=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,RD=/(^|[^\\])\\\r?\n/g,DD=/(^|[^\\])\\$/g,BD=new RegExp(`(${fT})|(${dT})\\b`,"g"),l_=new Map,a_=new Map;function FD(e){if(!e)return BD;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=l_.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${fT})|(${o})\\b`,"g");return l_.set(n,i),i}function HD(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=a_.get(s);if(o)return o;const i=e?[$f,dT].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),$f].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return a_.set(s,r),r}const c_={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function u_(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function d_(e){const t=/(^|[^\\])(__|\*\*)/g;let n,s=null;for(;(n=t.exec(e))!==null;)s={marker:n[2],index:n.index+(n[1]?.length??0)};return s}function Qi(e,t){const n=t?.commands??uT,s=t?.escapeExclamation??!0,o=t?.commands==null,i=FD(o?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&c_[u]!==void 0)return`\\${c_[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});s&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=HD(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(OD,"span\\{$1\\}").replace(PD,"\\operatorname{span}\\{$1\\}"),l=l.replace(RD,`$1\\\\
|
|
129
|
-
`),l=l.replace(DD,"$1\\\\"),l=l.replace(LD,"$1\\$2"),l}function f_(e){const t=e.trim();return!(!Zl(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 hT(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const s=n;let o=1;for(;s+o<e.length&&e[s+o]==="`";)o++;let i=s+o,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===o){r=i;break}i+=l}if(r!==-1){t.push([s,r+o]),n=r+o;continue}n=s+o}return t}function If(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function WD(e,t=!1){const n=[];let s=0;for(;s<e.length-1;){if(e[s]==="!"&&e[s+1]==="["){const o=s;let i=s+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([o,l]),s=l;continue}if(t){n.push([o,e.length]),s=e.length;continue}}}s++}return n}function gu(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function Hg(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(gu(e,s)){n=s+1;continue}return s}return-1}function hm(e,t){let n=t;for(;n<e.length;){const s=Hg(e,n);if(s===-1)return-1;if(s>0&&e[s-1]==="$"||s+1<e.length&&e[s+1]==="$"){n=s+1;continue}return s}return-1}function fc(e,t,n=0){let s=Math.max(0,n);for(;s<e.length;){const o=e.indexOf(t,s);if(o===-1)return-1;if(!gu(e,o))return o;s=o+Math.max(1,t.length)}return-1}function h_(e,t,n=0,s=e.length,o=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,s));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=If(o,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}gu(e,a)||i++,r=a+Math.max(1,t.length)}return i}function Cv(e,t,n){const s=eu(String(e??""));if(!s.endsWith(t))return-1;const o=s.length-t.length;if(o<=0||!eu(s.slice(0,o)).trim()||gu(s,o))return-1;const i=hT(s);if(If(i,o))return-1;const r=h_(s,t,0,o,i);if(t==="$$"){if(r%2===1)return-1}else if(r>h_(s,n,0,o,i))return-1;return o}function Qc(e){return e===" "||e===" "}function eu(e){let t=e.length;for(;t>0&&Qc(e[t-1]);)t--;return e.slice(0,t)}function p_(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
130
|
-
`&&t++;return t}function m_(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function UD(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(o===t){n++;continue}if(!Qc(o))return!1}return n>=3}function jD(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let s=0;for(;t[n]==="-";)s++,n++;return s<3?!1:(t[n]===":"&&n++,n===t.length)}function qD(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(jD)}function zD(e){let t=0;if(!m_(e[t]))return!1;for(;m_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Qc(e[t+1])}function pT(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&&Qc(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Qc(t[1])||zD(t)||UD(t)||qD(t))}function g_(e,t){return e?t?`${e}
|
|
131
|
-
${t}`:e:t}function Wg(e){const t=String(e??"").trim();return t?Zl(t):!1}function v_(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function mT(e){if(e.length<=r_)return{source:e,lineOffset:0};let t=e.length-r_;const n=e.indexOf(`
|
|
132
|
-
`,t);return n===-1?{source:"",lineOffset:p_(e)}:(t=n+1,{source:e.slice(t),lineOffset:p_(e.slice(0,t))})}function gT(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=mT(t);if(!n)return!1;const s=n.split(/\r?\n/),o=Math.max(0,s.length-Fg-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=o;r<s.length;r++){const l=eu(s[r]);if(l&&!pT(l)){for(const[a,c]of i)if(Cv(l,a,c)!==-1)return!0}}return!1}function VD(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:s}=mT(t);if(!n)return null;const o=n.split(/\r?\n/),i=Math.max(0,o.length-Fg-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<o.length-1;l++){const a=eu(o[l]);for(const[c,u]of r){const d=Cv(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<o.length;p++){if(p-l>Fg){h=!0;break}const g=o[p],S=fc(g,u);if(S!==-1){const _=g_(f,g.slice(0,S));if(!Wg(_)){h=!0;break}const y=g.slice(S+u.length),b=y.trim()?`suffix:${v_(y)}`:"nosuffix";return["closed",c,s+l,d,s+p,S,v_(_),b].join(":")}if(pT(g)){h=!0;break}if(f=g_(f,g),f.length>aT){h=!0;break}}if(!h&&Wg(f))return["pending",c,s+l,d].join(":")}}return null}function pm(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function KD(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const s=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(s)?!1:s===""||/^[)\s,.!?;:]/.test(s)}function mm(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function GD(e,t){ID(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)},s=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(y,b)=>{let v=b;for(;v<y.length&&(y[v]===" "||y[v]===" ");)v++;if(v===b||!(y[v]===`
|
|
133
|
-
`||y[v]==="\r"&&y[v+1]===`
|
|
134
|
-
`))return b;const w=y.slice(b,v),N=a.push("text","",0);return N.content=w,v};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let y=a.pos+1;for(;a.src[y]==="$";)y++;const b=y-a.pos,v=a.src[y];if(b>=3&&(!v||/\s/.test(v))){const w=a.push("text","",0);return w.content=a.src.slice(a.pos,y),a.pos=y,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let g=p,S=p;const _=p;for(const[y,b]of f){const v=a.src,w=hT(v),N=WD(v,u);let E=!1;y==="$$"&&g!==_&&(g=_);let k=-1,A=-1,I=0;const P=M=>{if((M==="undefined"||M==null)&&(M=""),M==="\\"){a.pos=a.pos+M.length,g=a.pos;return}if(M==="\\)"||M==="\\("){const B=a.push("text_special","",0);B.content=M==="\\)"?")":"(",B.markup=M,a.pos=a.pos+M.length,g=a.pos;return}if(!M)return;if(y==="$$"&&M.includes("$")){let B=0;for(;B<M.length;){const W=Hg(M,B);if(W===-1){const ce=M.slice(B);if(ce){const _e=a.push("text","",0);_e.content=ce,a.pos=a.pos+ce.length,g=a.pos}break}if(W>0&&M[W-1]==="$"||W+1<M.length&&M[W+1]==="$"){const ce=M.slice(B,W+1);if(ce){const _e=a.push("text","",0);_e.content=ce,a.pos=a.pos+ce.length,g=a.pos}B=W+1;continue}const K=M.slice(B,W);if(K){const ce=a.push("text","",0);ce.content=K,a.pos=a.pos+K.length,g=a.pos}const V=hm(M,W+1);if(V===-1){const ce=M.slice(W),_e=a.push("text","",0);_e.content=ce,a.pos=a.pos+ce.length,g=a.pos;break}const se=M.slice(W+1,V),Y=se.includes("`"),G=!se||!se.trim(),ee=M[V+1],we=pm(se,ee),de=mm(se);if(!Y&&!G&&!we&&!de){const ce=a.push("math_inline","math",0);ce.content=Qi(se,t),ce.markup="$",ce.raw=`$${se}$`,ce.loading=!1,a.pos=a.pos+(V-W+1),g=a.pos,B=V+1;continue}const Le=a.push("text","",0);Le.content="$",a.pos=a.pos+1,g=a.pos,B=W+1}return}const L=M.indexOf("![");if(L!==-1){if(L>0){const K=M.slice(0,L),V=a.push("text","",0);V.content=K,a.pos=a.pos+K.length,g=a.pos}const B=M.slice(L).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(B){const[,K,V]=B,se=V.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),Y=se?se[1]:V,G=se&&se[2]?se[2]:null,ee=a.push("image","img",0);ee.attrs=[["src",Y],["alt",K]],G&&ee.attrs.push(["title",G]),ee.content=K,ee.children=[{type:"text",content:K,tag:""}],a.pos=a.pos+B[0].length,g=a.pos;const we=M.slice(L+B[0].length);we&&P(we);return}const W=a.push("text","",0);W.content=M,a.pos=a.pos+M.length,g=a.pos;return}const R=a.push("text","",0);R.content=M,a.pos=a.pos+M.length,g=a.pos};for(;!(g>=v.length);){const M=v.indexOf(y,g);if(M===-1)break;if(gu(v,M)){g=M+Math.max(1,y.length);continue}const L=If(w,M);if(L){g=L[1];continue}const R=If(N,M);if(R){g=R[1];continue}if(M===k&&g===A){if(I++,I>2){g=M+Math.max(1,y.length);continue}}else I=0,k=M,A=g;if(y==="("&&M>0){let we=M-1;for(;we>=0&&v[we]===" ";)we--;if(we>=0&&v[we]==="]"){g=M+y.length;continue}}if(y==="$"&&M>0&&v[M-1]==="$"){g=M+1;continue}if(y==="$"&&M<v.length-1&&v[M+1]==="$"){g=M+2;continue}const B=y==="$"?hm(v,M+y.length):vD(v,M+y.length,y,b);if(B===-1){const we=v.slice(M+y.length);if(we.includes(y)){g=v.indexOf(y,M+y.length);continue}if(B===-1){const de=y==="$"&&KD(we);if(u&&!c&&!de&&Zl(we)&&!we.includes("`")){if(g=M+y.length,E=!0,!l){a.pending="";const Le=S?v.slice(S,g):v.slice(0,g),ce=u_(Le)%2===1;if(S)P(v.slice(S,g));else{let _e=v.slice(0,g);_e.endsWith(y)&&(_e=_e.slice(0,_e.length-y.length)),P(_e)}if(ce){const _e=d_(Le)?.marker??"**",me=a.push("strong_open","",0);me.markup=_e;const $e=a.push("math_inline","math",0);$e.content=Qi(we,t),$e.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",$e.raw=`${y}${we}${b}`,$e.loading=!0,me.content=we,a.push("strong_close","",0)}else{const _e=a.push("math_inline","math",0);_e.content=Qi(we,t),_e.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",_e.raw=`${y}${we}${b}`,_e.loading=!0}a.pos=v.length}g=v.length,S=g}break}}const W=v.slice(M+y.length,B),K=W.includes("`"),V=!W||!W.trim(),se=y==="$",Y=v[B+b.length],G=se&&pm(W,Y),ee=se&&mm(W);if(c?K||V||G||ee:K||V||G||ee||!se&&!Zl(W)){g=B+b.length;const we=v.slice(a.pos,g);a.pending||(P(we),S=g);continue}if(E=!0,!l){const we=v.slice(a.pos-(a.pending??"").length,M);let de=v.slice(0,g)?v.slice(S,M):we;const Le=u_(de)%2===1;M!==a.pos&&Le&&(de=a.pending+v.slice(a.pos,M));const ce=Le?d_(de):null,_e=ce?.marker??"**";if(a.pending!==de)if(a.pending="",Le)if(ce){const me=de.slice(ce.index+_e.length);P(de.slice(0,ce.index));const $e=a.push("strong_open","",0);$e.markup=_e;const J=a.push("text","",0);J.content=me,a.push("strong_close","",0)}else P(de);else P(de);if(Le){const me=a.push("strong_open","",0);me.markup=_e;const $e=a.push("math_inline","math",0);$e.content=Qi(W,t),$e.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",$e.raw=`${y}${W}${b}`,$e.loading=!1;const J=v.slice(B+b.length).startsWith(_e);return J&&a.push("strong_close","",0),a.pos=d(v,B+b.length),g=a.pos,S=g,J||a.push("strong_close","",0),!0}else{const me=a.push("math_inline","math",0);me.content=Qi(W,t),me.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",me.raw=`${y}${W}${b}`,me.loading=!1}}return g=d(v,B+b.length),S=g,a.pos=g,!0}if(E){if(l)a.pos=g;else{if(y==="$$"&&g<v.length&&v.slice(g).includes("$")){let M=g;for(;!(M>=v.length);){const L=Hg(v,M);if(L===-1)break;if(L+1<v.length&&v[L+1]==="$"){M=L+2;continue}if(L>0&&v[L-1]==="$"){M=L+1;continue}const R=hm(v,L+1);if(R===-1)break;const B=v.slice(L+1,R),W=B.includes("`"),K=!B||!B.trim(),V=v[R+1],se=pm(B,V),Y=mm(B);if(!W&&!K&&!se&&!Y){const G=v.slice(g,L);G&&P(G);const ee=a.push("math_inline","math",0);ee.content=Qi(B,t),ee.markup="$",ee.raw=`$${B}$`,ee.loading=!1,g=R+1,M=R+1}else P("$"),M=L+1}M<v.length&&P(v.slice(M))}else g<v.length&&P(v.slice(g));a.pos=v.length}return!0}}return!1},o=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let g=u.src.slice(p,u.eMarks[l]).trim(),S=!1,_="",y="",b=!1,v="",w=!1;for(const[G,ee]of h)if(g.startsWith(G))if(G.includes("["))if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1<a){S=!0,_=G,y=ee;break}continue}}else if(g.replace("\\","")==="["){if(l+1<a){S=!0,_=G,y=ee;break}continue}else{const we=u.tokens[u.tokens.length-1];if(we&&we.type==="list_item_open"&&we.mark==="-"&&g.slice(G.length,g.indexOf("]")).trim()==="x")continue;if(g.replace("\\","").startsWith("[")&&!g.includes("](")){const de=g.indexOf("]");if(g.slice(de).trim()!=="]")continue;const Le=g.slice(G.length,de);if(G==="["?f_(Le):Zl(Le)){S=!0,_=G,y=ee;break}continue}}else{S=!0,_=G,y=ee;break}else if((G==="$$"||G==="\\[")&&g.endsWith(G)&&l+1<a){const we=Cv(g,G,ee);if(we===-1)continue;v=eu(g.slice(0,we)),w=!0;const de=u.bMarks[l+1]+u.tShift[l+1];g=u.src.slice(de,u.eMarks[l+1]).trim(),b=!0,S=!0,_=G,y=ee;break}if(!S)return!1;if(c&&!w)return!0;const N=g.indexOf(_),E=N+_.length,k=!f&&_==="["?g.indexOf("\\]",E):-1,A=k>=0?"\\]":y,I=k>=0?k:fc(g,y,E);if(!b&&I>_.length){const G=g.slice(N+_.length,I),ee=u.push("math_block","math",0);ee.content=Qi(G),ee.markup=_==="$$"?"$$":_==="["?"[]":"\\[\\]",ee.map=[l,l+1],ee.raw=`${_}${G}${A}`,ee.block=!0,ee.loading=!1,u.line=l+1;const we=g.slice(I+A.length);return we.trim()&&n(u,we,l),!0}let P=l,M="",L=!1,R="",B=l;const W=b?g:g===_?"":g.slice(_.length),K=!f&&_==="\\["?"]":"",V=fc(W,y);if(V!==-1){const G=V;M=W.slice(0,G),R=W.slice(G+y.length),B=b?l+1:l,L=!0,P=B}else for(W&&!b&&(M=W),P=l+1;P<a;P++){const G=u.bMarks[P]+u.tShift[P],ee=u.eMarks[P],we=u.src.slice(G,ee),de=we.trim();if(!f&&_==="["&&de==="\\]"){y="\\]",L=!0;break}if(K&&we.trim()===K){y=K,L=!0;break}if(de===y){L=!0;break}else if(!f&&_==="["&&we.includes("\\]")){L=!0;const Le=we.indexOf("\\]");y="\\]";const ce=we.slice(0,Le);ce&&(M+=(M?`
|
|
135
|
-
`:"")+ce),R=we.slice(Le+y.length),B=P;break}else if(fc(we,y)!==-1){L=!0;const Le=fc(we,y),ce=we.slice(0,Le);ce&&(M+=(M?`
|
|
136
|
-
`:"")+ce),R=we.slice(Le+y.length),B=P;break}M+=(M?`
|
|
137
|
-
`:"")+we}if((!d||f)&&!L)return!1;const se=/^\s*!\[/.test(M);if(!(w?!se&&Wg(M):_==="$$"?!se:_==="["?f_(M):Zl(M)))return!1;if(c)return!0;v&&n(u,v,l);const Y=u.push("math_block","math",0);return Y.content=Qi(M),Y.markup=_==="$$"?"$$":_==="["?"[]":"\\[\\]",Y.raw=`${_}${M}${M.startsWith(`
|
|
138
|
-
`)?`
|
|
139
|
-
`:""}${y}`,Y.map=[l,P+1],Y.block=!0,Y.loading=!L,u.line=P+1,R.trim()&&n(u,R,B),!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:o(r,l,a,c)};e.inline.ruler.before("escape","math",s),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function YD(e){const t=e.renderer.rules.image||function(n,s,o,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,s,o):""};e.renderer.rules.image=(n,s,o,i,r)=>{const l=n;return l[s].attrSet?.("loading","lazy"),t(l,s,o,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,s)=>{const o=n[s],i=String(o.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(o.content??""))}</code></pre>`})}function XD(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},s=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=new FR({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return(e.enableMath??!0)&&GD(o,{...e.mathOptions??{}}),(e.enableContainers??!0)&&UR(o),e.enableFixIndentedCodeBlock!==!1&&x7(o),tD(o),iD(o),sD(o),cD(o),YD(o),S7(o,{customHtmlTags:e.customHtmlTags}),o}function ll(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=>ll(n))),t}function ZD(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function JD(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,s=n===""||n==="true";return{type:"checkbox_input",checked:s,raw:s?"[x]":"[ ]"}}function QD(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function ud(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];o+=String(e[i].content??l.text??""),r.push(e[i]),i++}return s.push(...Mn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const y_=/\r?\n[ \t]*`+\s*$/,vT=["diff ","index ","--- ","+++ ","@@ "],eB=/\r?\n/;function tB(e){const t=String(e??"");return t?vT.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function k_(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function nB(e,t){const n=[],s=[],o=[],i=[],r=e.split(eB),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!vT.some(g=>p.startsWith(g)))if(p.startsWith("-")){const g=p.slice(1);o.push(!a&&g.startsWith(" ")?` ${g}`:g)}else if(p.startsWith("+")){const g=p.slice(1);i.push(!a&&g.startsWith(" ")?` ${g}`:g)}else{k_(n,s,o,i);const g=a&&p.startsWith(" ")?p.slice(1):p;n.push(g),s.push(g)}},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&&tB(p)||c(p)}(t||o.length>0||i.length>0)&&k_(n,s,o,i);const d=n.join(`
|
|
140
|
-
`),f=s.join(`
|
|
141
|
-
`);return{original:t&&l&&d?`${d}
|
|
142
|
-
`:d,updated:t&&l&&f?`${f}
|
|
143
|
-
`:f}}function xv(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},s=typeof n.closed=="boolean"?n.closed:void 0,o=s===!0||s!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(y_.test(a)&&(a=a.replace(y_,"")),r){const{original:c,updated:u}=nB(a,o===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t}}function sB(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function oB(){return{type:"hardbreak",raw:`\\
|
|
144
|
-
`}}function iB(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...Mn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let gm=null;const vm=new WeakMap;function b_(){return gm||(gm={customTagSet:null,allowedTagSet:Th()}),gm}function yT(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function kT(e){return/^<\s*\//.test(e)}function bT(e,t){return/\/\s*>\s*$/.test(t)||ml.has(e)}function rB(e){if(!e||e.length===0)return b_();const t=vm.get(e);if(t)return t;const n=e.map(Oo).filter(Boolean);if(!n.length){const o=b_();return vm.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:Th({customHtmlTags:e})};return vm.set(e,s),s}function _T(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function lB(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function Nf(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function aB(e,t,n){const s=e.slice();return Nf(s,"href")||s.push(["href",t]),n!=null&&!Nf(s,"title")&&s.push(["title",n]),s}function Ug(e){return e.map(_T).join("")}function Nd(e){const t=[],n=s=>{const o=String(s??"");if(!o)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${o}`,i.raw=`${i.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const s of e)if(s){if(s.type==="reference"||s.type==="footnote_reference"){n(String(s.raw??""));continue}if("children"in s&&Array.isArray(s.children)){t.push({...s,children:Nd(s.children)});continue}t.push(s)}return t}function cB(e,t,n){let s=0;for(let o=t;o<e.length;o++){const i=e[o];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=yT(r),a=kT(r),c=bT(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function ym(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?cB(e,t+1,n):-1;return l!==-1?(o=e.slice(t+1,l),s.push(...o,e[l]),i=l+1,r=!0):(o=e.slice(t+1),o.length&&s.push(...o),i=e.length),{closed:r,html:Ug(s),innerTokens:o,nextIndex:i}}function uB(e,t,n,s,o,i,r){const l=String(e.content??""),a=yT(l),{customTagSet:c,allowedTagSet:u}=rB(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!ym(t,n,a).closed){const w=_T(e);return[{type:"text",content:w,raw:w},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=kT(l),f=bT(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const w=ym(t,n,a),N=Sh(l),E=w.innerTokens,k=String(Nf(N,"href")??""),A=Nf(N,"title"),I=A==null?null:String(A),P=aB(N,k,I),M=Nd(E.length?s(E,o,i,r):[]),L=E.length?Ug(E):k||"";return!M.length&&L&&M.push({type:"text",content:L,raw:L}),[{type:"link",href:k,title:I,text:L,attrs:P,children:M,loading:!w.closed,raw:w.html||l},w.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=ym(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Nd(h.innerTokens.length?s(h.innerTokens,o,i,r):[]),raw:h.html},h.nextIndex];const p=Nd(h.innerTokens.length?s(h.innerTokens,o,i,r):[]);let g=h.html||l,S=!h.closed,_=!1;if(!h.closed){const w=`</${a}>`;g.toLowerCase().includes(w.toLowerCase())||(g+=w),_=!0,S=!0}const y=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let v;for(;(v=b.exec(l))!==null;){const w=v[1],N=v[2]||v[3]||v[4]||"";y.push([w,N])}if(c?.has(a)){const w=lB(e);return[{type:a,tag:a,attrs:y,content:w?w.inner:h.innerTokens.length?Ug(h.innerTokens):"",children:h.innerTokens.length?s(h.innerTokens,o,i,r):[],raw:w?.raw??g,loading:e.loading||S,autoClosed:_},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:y,content:g,children:p,raw:g,loading:S,autoClosed:_},h.nextIndex]}function wT(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=>wT(t)).join(""):String(e.content??"")}function dB(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>wT(t)).join("")}function __(e,t=!1){let n=e.attrs??[],s=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,s=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=dB(s??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):s?.content!=null&&String(s.content).length>0?l=String(s.content):Array.isArray(s?.children)&&s.children[0]?.content?l=String(s.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:o,alt:l,title:c,raw:u,loading:t}}function fB(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function hB(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...Mn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function pB(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const s=n?.[0];s&&t.push([String(s),String(n?.[1]??"")])}return t}function Lf(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function mB(e,t,n){const s=e.slice();return Lf(s,"href")||s.push(["href",t]),n!=null&&!Lf(s,"title")&&s.push(["title",n]),s}function dd(e,t,n){const s=e[t],o=pB(s.attrs),i=String(Lf(o,"href")??""),r=Lf(o,"title"),l=r==null?null:String(r),a=mB(o,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let f=u;const h=u[u.length-1];if(n?.__insideStrong&&h?.type==="text"&&String(h.content??"").endsWith("**")&&!u.some(S=>S.type==="strong_open")){const S=String(h.content??""),_=String(h.raw??S),y=ll(h);y.content=S.slice(0,-2),y.raw=_.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=y}const p=Mn(f,void 0,void 0,n),g=p.map(S=>{const _=S;return"content"in S?String(_.content??""):String(_.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:g,children:p,raw:`[${g}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function w_(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 gB(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function S_(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...Mn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const vB=/\\([\\()[\]`$|*_\-!])/g;function yB(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(vB,"$1")===t))return n}function oc(e,t,n,s){const o=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...s,__insideStrong:!0};return o.push(...Mn(l,yB(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function kB(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)o+=String(e[i].content??""),r.push(e[i]),i++;s.push(...Mn(r,void 0,void 0,n));const l=String(e[t].content??""),a=o||l;return{node:{type:"subscript",children:s.length>0?s:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function bB(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...Mn(r,void 0,void 0,n)),{node:{type:"superscript",children:s.length>0?s:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function _B(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const wB=/[^~]*~{2,}[^~]+/,SB=/\*\*/,CB=/[[_*^~]/,xB=/\\([\\()[\]`$|*_\-!])/g,Tv=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),TB=/\s/u,MB=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,AB=/\p{P}/u,EB=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,$B=/:\/\//;function IB(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 ST(e,t=0){if(!e)return-1;let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&Tv.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function wr(e){return!!e&&TB.test(e)}function Sr(e){return!!e&&(MB.test(e)||AB.test(e))}function NB(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||wr(s)?!1:!(Sr(s)&&n&&!wr(n)&&!Sr(n))}function LB(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||wr(n)?!1:!(Sr(n)&&s&&!wr(s)&&!Sr(s))}function OB(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?ST(e,s):t.indexOf("*",s);if(i===-1)break;if(LB(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function PB(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||wr(s)?!1:!(Sr(s)&&n&&!wr(n)&&!Sr(n))}function RB(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||wr(n)?!1:!(Sr(n)&&s&&!wr(s)&&!Sr(s))}function DB(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(RB(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function BB(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let s=0;for(;n+s<e.length&&e[n+s]==="\\";)s++;const o=e[n+s];if(t+="\\".repeat(Math.floor(s/2)),s%2===1){if(o&&Tv.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function FB(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&Tv.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function HB(e,t,n){const s=FB(e,t);if(s===-1||e[s]!==n)return!1;let o=0;for(let i=s-1;i>=0&&e[i]==="\\";i--)o++;return o%2===1}const WB=/[\p{L}\p{N}]/u,UB=/^[\p{L}\p{N}]+$/u;function jg(e){return e?WB.test(e):!1}function CT(e){return e?UB.test(e):!1}function Tc(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const s=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return{len:n-t,prev:s,next:o,intraword:jg(s)&&jg(o)}}function jB(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=Tc(e,n),o=n+s.len;s.len>=2&&s.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n<t.length-1;n++){const s=t[n],o=t[n+1];if(!CT(e.slice(s.end,o.start)))return o.end}return-1}function qB(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function zB(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=Tc(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function VB(e){return e?EB.test(e)||$B.test(e):!1}function KB(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Mn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=mu(t),r={filename:o?.filename||i.filename,explicitFilename:o?.explicitFilename||i.explicitFilename,marketTicker:o?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(s={...s,__linkifyDemotionContext:r});const l=s,a=[];let c=null,u=0;const d=s?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function p(){c=null}function g(J,ye){const Se=e.length===1?t:String(ye.content??""),U=[],Z=jB(J);if(Z!==-1){w(J.slice(0,Z),J.slice(0,Z));const oe=J.slice(Z);return oe&&(I({type:"text",content:oe,raw:oe}),u--),u++,!0}if(wB.test(J)){const oe=J.indexOf("~~");oe!==-1&&U.push({type:"strikethrough",index:oe})}if(SB.test(J)){const oe=J.indexOf("**");oe!==-1&&U.push({type:"strong",index:oe})}if(/[^*]*\*[^*]+/.test(J)){const oe=Se?ST(Se,0):J.indexOf("*");if(Se&&oe===-1)return!1;oe!==-1&&U.push({type:"emphasis",index:oe})}U.sort((oe,he)=>oe.index!==he.index?oe.index-he.index:oe.type===he.type?0:oe.type==="strong"?-1:he.type==="strong"?1:0);const fe=U[0];if(!fe)return!1;if(fe.type==="strikethrough"){const oe=fe.index,he=oe>-1?J.slice(0,oe):"";if(he&&w(he,he),oe===-1)return u++,!0;const H=J.indexOf("~~",oe+2),X=H===-1?J.slice(oe+2):J.slice(oe+2,H),ae=H===-1?"":J.slice(H+2),{node:ke}=S_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:X,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return p(),v(ke),ae&&(I({type:"text",content:ae,raw:ae}),u--),u++,!0}if(fe.type==="strong"){const oe=fe.index,he=oe>-1?J.slice(0,oe):"";if(he&&w(he,he),oe===-1)return u++,!0;if(t&&oe===0){let Ie=!1,re=0;for(;re<J.length&&J[re]==="*";)re++;if(t.startsWith("\\*")&&(Ie=!0),Ie){let le=0,Ce=0;for(;Ce<t.length&&le<re;)if(t[Ce]==="\\"&&Ce+1<t.length&&t[Ce+1]==="*")le+=1,Ce+=2;else{if(t[Ce]==="*")break;Ce++}if(le>=2)return w(J,J),u++,!0}}if(t&&(J.match(/\*/g)||[]).length>IB(t))return w(J.slice(he.length),J.slice(he.length)),u++,!0;const H=Tc(J,oe);if(H.len>=3){const Ie=zB(J,oe+H.len);if(Ie!==-1){const re=J.slice(oe+H.len,Ie);if(qB(re)){const{node:le}=oc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:re,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);p(),v(le);const Ce=J.slice(Ie+3);return Ce&&(I({type:"text",content:Ce,raw:Ce}),u--),u++,!0}}}if(!PB(J,oe)){const Ie=J.slice(oe,oe+H.len);w(Ie,Ie);const re=J.slice(oe+H.len);return re&&(I({type:"text",content:re,raw:re}),u--),u++,!0}const X=DB(J,oe+2);let ae="",ke="";if(X.index!==-1){ae=J.slice(oe+2,X.index),ke=J.slice(X.index+2);const Ie=X.index,re=Tc(J,Ie);if(H.intraword&&re.intraword&&!CT(ae)||!ae&&H.len>=4&&H.intraword)return w(J.slice(he.length),J.slice(he.length)),u++,!0}else{if(d||X.sawInvalidClose||H.intraword)return w(J.slice(he.length),J.slice(he.length)),u++,!0;ae=J.slice(oe+2),ke=""}if(!ae&&/^\*+$/.test(ke))return w(J,J),u++,!0;const{node:Me}=oc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:ae,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return p(),v(Me),ke&&(I({type:"text",content:ke,raw:ke}),u--),u++,!0}if(fe.type==="emphasis"){let oe=fe.index;oe===-1&&(oe=0);const he=J.slice(0,oe);if(he&&w(he,he),!NB(J,oe)){w(J[oe],J[oe]);const Ie=J.slice(oe+1);return Ie&&(I({type:"text",content:Ie,raw:Ie}),u--),u++,!0}const H=Tc(J,oe),X=OB(Se,J,oe+1),ae=X.index,ke=e[u+1];if(s?.final&&ke?.type==="em_open"&&ae!==-1&&J.slice(oe+1,ae).trim()!==J.slice(oe+1,ae)||ae===-1&&(X.sawInvalidClose||s?.final||H.intraword||!jg(J[oe+1])))return w(J.slice(oe),J.slice(oe)),u++,!0;const{node:Me}=ud([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ae>-1?J.slice(oe+1,ae):J.slice(oe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(p(),v(Me),ae!==-1&&ae<J.length-1){const Ie=J.slice(ae+1);Ie&&(I({type:"text",content:Ie,raw:Ie}),u--)}return u++,!0}return!1}function S(J,ye){if(!J.includes("`"))return!1;const U=(ke=>{for(let Me=0;Me<ke.length;Me++){if(ke[Me]!=="`")continue;let Ie=0;for(let re=Me-1;re>=0&&ke[re]==="\\";re--)Ie++;if(Ie%2===0)return Me}return-1})(J);if(U===-1)return!1;let Z=1;for(let ke=U+1;ke<J.length&&J[ke]==="`";ke++)Z++;const fe="`".repeat(Z),oe=U+Z,he=J.indexOf(fe,oe);if(he===-1){if(Z===1){const Me=J.slice(0,U),Ie=J.slice(U+1);return Me&&(g(Me,ye)?u--:w(Me,Me)),y({type:"inline_code",code:Ie,raw:String(Ie)}),u++,!0}let ke=J;for(let Me=u+1;Me<e.length;Me++)ke+=String((e[Me].content??"")+(e[Me].markup??""));return u=e.length-1,w(ke,ke),u++,!0}p();const H=J.slice(0,U),X=J.slice(U+Z,he),ae=J.slice(he+Z);return H&&(g(H,ye)?u--:w(H,H)),y({type:"inline_code",code:X,raw:String(X??"")}),ae&&(I({type:"text",content:ae,raw:ae}),u--),u++,!0}function _(J){const ye=l?.__markdownIt;if(!ye||e.length<=1||!e.some(fe=>fe?.type==="math_inline")||!CB.test(J))return null;const Se=ye.parseInline(J,{__markstreamFinal:!!s?.final});if(!Array.isArray(Se)||Se.length===0)return null;const U=(Se.find(fe=>fe?.type==="inline")?.children??[]).filter(fe=>!(fe?.type==="text"&&String(fe.content??"")===""));if(!U.length||!U.some(fe=>fe?.type!=="text")||U.length===1&&U[0]?.type==="text"&&String(U[0].content??"")===J)return null;const Z=Mn(U,J,n,s);return Z.length?Z:null}function y(J){p(),a.push(J)}function b(J){p();const ye=ll(J);a.push(ye)}function v(J){y(J)}function w(J,ye){c?(c.content+=J,c.raw+=ye??J):(c={type:"text",content:String(J??""),raw:String(ye??J??"")},a.push(c))}function N(J,ye){if(!J)return;const Se=Mn([{...ye,type:"text",content:J,raw:J}],J,n,s);if(Se.length===1&&Se[0]?.type==="text"){const U=Se[0];w(String(U.content??""),String(U.raw??U.content??""));return}for(const U of Se)v(U)}function E(J,ye){return String(J.markup??"").startsWith(ye)}function k(J){return J.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 A(J,ye){let Se=J;const U=String(ye.content??"");return Se.endsWith("\\")&&!E(ye,"\\\\")&&!U.endsWith("\\\\")&&(Se=Se.slice(0,-1)),Se.endsWith("(")&&!E(ye,"\\(")&&!U.endsWith("\\(")&&(Se=Se.slice(0,-1)),/\*+$/.test(Se)&&!E(ye,"\\*")&&!U.endsWith("\\*")&&(Se=Se.replace(/\*+$/,"")),Se}for(;u<e.length;){const J=e[u];I(J)}function I(J){switch(J.type){case"text":M(J);break;case"softbreak":c?(c.content+=`
|
|
145
|
-
`,c.raw+=`
|
|
146
|
-
`):(c={type:"text",content:`
|
|
147
|
-
`,raw:`
|
|
148
|
-
`},a.push(c)),u++;break;case"code_inline":v(fB(J)),u++;break;case"html_inline":{const[ye,Se]=uB(J,e,u,Mn,t,n,s);v(ye),u=Se;break}case"link_open":L(J);break;case"image":we(J)||(p(),v(__(J)),u++);break;case"strong_open":{p();const{node:ye,nextIndex:Se}=oc(e,u,J.content,s);v(ye),u=Se;break}case"em_open":{p();const{node:ye,nextIndex:Se}=ud(e,u,s);v(ye),u=Se;break}case"s_open":{p();const{node:ye,nextIndex:Se}=S_(e,u,s);v(ye),u=Se;break}case"mark_open":{p();const{node:ye,nextIndex:Se}=iB(e,u,s);v(ye),u=Se;break}case"ins_open":{p();const{node:ye,nextIndex:Se}=hB(e,u,s);v(ye),u=Se;break}case"sub_open":{p();const{node:ye,nextIndex:Se}=kB(e,u,s);v(ye),u=Se;break}case"sup_open":{p();const{node:ye,nextIndex:Se}=bB(e,u,s);v(ye),u=Se;break}case"sub":p(),v({type:"subscript",children:[{type:"text",content:String(J.content??""),raw:String(J.content??"")}],raw:`~${String(J.content??"")}~`}),u++;break;case"sup":p(),v({type:"superscript",children:[{type:"text",content:String(J.content??""),raw:String(J.content??"")}],raw:`^${String(J.content??"")}^`}),u++;break;case"emoji":{p();const ye=e[u-1];ye?.type==="text"&&/\|:-+/.test(String(ye.content??""))?w("",""):v(QD(J)),u++;break}case"checkbox":p(),v(ZD(J)),u++;break;case"checkbox_input":p(),v(JD(J)),u++;break;case"footnote_ref":p(),v(sB(J)),u++;break;case"footnote_anchor":{p();const ye=J.meta??{};y({type:"footnote_anchor",id:String(ye.label??J.content??""),raw:String(J.content??"")}),u++;break}case"hardbreak":p(),v(oB()),u++;break;case"fence":p(),v(xv(e[u])),u++;break;case"math_inline":p(),!J.content&&J.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(v(w_({...J,content:e[u+1].content})),u+=2):v(w_(J)),u++;break;case"reference":B(J);break;case"text_special":w(String(J.content??""),String(J.content??"")),u++;break;default:{const ye=J;if(J.type==="link"&&ye.href!=null&&s?.validateLink&&!s.validateLink(String(ye.href))){p();const Se=String(ye.text??"");w(Se,Se),u++}else de(J)||K(J)||se(J)||W(J)||b(J),u++;break}}}function P(J,ye,Se,U){const Z=_B({...ye,content:J});if(c){c.content+=A(Z.content,ye),c.raw+=Z.raw;return}const fe=Se?.tag==="br"&&e[u-2]?.content==="[";U||(Z.content=A(Z.content,ye)),c=Z,c.center=fe,a.push(c)}function M(J){const ye=String(J.content??""),Se=e.length===1&&ye.includes("\\")&&typeof t=="string"?String(t):"";let U=Se?BB(Se):ye.replace(xB,"$1");if(J.content==="<"||U==="1"&&e[u-1]?.tag==="br"){u++;return}const Z=U.indexOf("$");Z!==-1&&Z===U.lastIndexOf("$")&&U.endsWith("$")&&(U=U.slice(0,-1)),U.endsWith("undefined")&&!t?.endsWith("undefined")&&(U=U.slice(0,-9));let fe=a.length,oe="";for(let ae=a.length-1;ae>=0;ae--){const ke=a[ae];if(ke.type!=="text")break;fe=ae,oe=String(ke.content??"")+oe}fe<a.length&&(U.startsWith(oe)?(c=null,a.length=fe):c=a[a.length-1]);const he=e[u+1];if((U==="`"||U==="|"||U==="$")&&!E(J,`\\${U}`)||/^\*+$/.test(U)&&!E(J,"\\*")){u++;return}if(!he&&/[^\]]\s*\(\s*$/.test(U)&&(U=U.replace(/\(\s*$/,"")),!U){u++;return}if(ee(U)||Le(U))return;if(!(U.includes("*")||U.includes("_")||U.includes("~")||U.includes("`")||U.includes("[")||U.includes("!")||U.includes("$")||U.includes("|")||U.includes("("))){P(U,J,e[u-1],he),u++;return}if($e(U))return;const H=e[u-1];if(U==="["&&!he?.markup?.includes("*")&&!E(J,"\\[")||U==="]"&&!H?.markup?.includes("*")&&!E(J,"\\]")){u++;return}if(S(ye,J)||me(U)||(e[u+1]?.type!=="link_open"||k(U))&&_e(U,J))return;const X=_(ye);if(X){p();for(const ae of X)v(ae);u++;return}g(U,J)||(P(U,J,H,he),u++)}function L(J){if(R(J))return;if(ce()){const{node:he,nextIndex:H}=dd(e,u,s),X=String(he.text||he.href||"");w(X,X),u=H;return}p();const{node:ye,nextIndex:Se}=dd(e,u,s);u=Se;const U=ye.text||ye.href||"";if(J.markup==="linkify"&&!sT(U,ye.href,t)&&Ef(U,l?.__linkifyDemotionContext)){w(U,U);return}const Z=ye.children.length===1&&ye.children[0]?.type==="text";if(ye.loading&&t&&ye.text===ye.href&&Z){const he=KB(t,ye.href);he&&(ye.text=he,ye.children=[{type:"text",content:he,raw:he}],ye.raw=`[${he}](${ye.href}${ye.title?` "${ye.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(ye.href)){w(ye.text,ye.text);return}const fe=J.attrs?.find(([he])=>he==="href")?.[1],oe=String(fe??"");if(t&&oe){const he=t.indexOf("](");if(he!==-1){const H=t.indexOf(")",he+2);H===-1?ye.loading=!0:ye.loading&&t.slice(he+2,H).includes(oe)&&(ye.loading=!1)}}W(ye)||y(ye)}function R(J){if(J.markup!=="linkify")return!1;const{node:ye,nextIndex:Se}=dd(e,u,s);return V(ye,Se)?(u=Se,!0):!1}function B(J){p(),v(gB(J)),u++}function W(J){if(J.type!=="link")return!1;const ye=a[a.length-1];if(!ye||ye.type!=="text")return!1;const Se=String(ye.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!Se)return!1;const U=J,Z=String(U.href??""),fe=String(U.text??""),oe=String(Se[2]??""),he=Z.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!Z||!(fe===Z||fe===he||VB(fe)))return!1;const H=String(Se[1]??"");return H?(ye.content=H,ye.raw=H):a.pop(),y({...J,text:oe,children:[{type:"text",content:oe,raw:oe}],raw:`[${oe}](${Z}${U.title?` "${U.title}"`:""})`}),!0}function K(J){if(J.type!=="link")return!1;const ye=J,Se=String(ye.href??"");return Se?V({href:Se,title:ye.title==null||ye.title===""?null:String(ye.title),loading:!!ye.loading},u+1):!1}function V(J,ye){const Se=a[a.length-1];if(Se?.type!=="image"||Se.src||!Se.loading||!String(Se.raw??"").endsWith("]("))return!1;const U=e[ye],Z=String(U?.content??"");if(U?.type!=="text"||!Z.startsWith(")"))return!1;a.pop(),c=null;const fe=String(Se.alt??"");y({type:"image",src:J.href,alt:fe,title:J.title,raw:``,loading:!!J.loading});const oe=Z.slice(1),he=ll(U);return he.content=oe,he.raw=oe,h()[ye]=he,!0}function se(J){if(J.type!=="link")return!1;const ye=a[a.length-1],Se=e[u-1];if(!ye||ye.type!=="text"||Se?.type!=="text")return!1;const U=String(ye.content??""),Z=String(Se.content??"");if(!U.endsWith("!")||!Z.endsWith("!")||E(Se,"\\!"))return!1;const fe=U.slice(0,-1);fe?(ye.content=fe,ye.raw=fe,c=ye):(a.pop(),c=null);const oe=J,he=String(oe.text??oe.children?.map(ae=>String(ae?.content??ae?.raw??"")).join("")??""),H=String(oe.href??""),X=oe.title==null||oe.title===""?null:String(oe.title);return y({type:"image",src:H,alt:he,title:X,raw:``,loading:!!oe.loading}),!0}function Y(J,ye="",Se=null){const U=String(J.alt??J.raw??"");return{type:"link",href:ye,title:Se,text:U,children:[J],raw:`[${U}](${ye}${Se?` "${Se}"`:""})`,loading:!0}}function G(J){const ye=J.startsWith(";return{type:"image",src:"",alt:U===-1?Se.replace(/\]$/,""):Se.slice(0,U),title:null,raw:ye,loading:!0}}function ee(J){const ye=J.indexOf("[![");if(ye===-1||typeof t=="string"&&e.length===1&&HB(t,ye,"["))return!1;const Se=J.slice(0,ye);return Se&&w(Se,Se),y(Y(G(J.slice(ye+1)))),u++,!0}function we(J){if(s?.final)return!1;const ye=e[u-1];if(ye?.type!=="text"||!String(ye.content??"").endsWith("[")||E(ye,"\\["))return!1;const Se=a[a.length-1];if(Se?.type==="text"&&Se.content.endsWith("[")){const U=Se.content.slice(0,-1);U?(Se.content=U,Se.raw=U,c=Se):(a.pop(),c=null)}return y(Y(__(J))),u++,!0}function de(J){if(J.type!=="link")return!1;const ye=J,Se=String(ye.raw??""),U=String(ye.text??"");if(!Se.startsWith("[![")&&!U.startsWith("!["))return!1;const Z=ye.title==null||ye.title===""?null:String(ye.title);return y(Y({type:"image",src:String(ye.href??""),alt:U.replace(/^!\[/,"").replace(/\]$/,""),title:Z,raw:Se.startsWith("[)return!1;const ye=e[u-2];if(ye?.type==="text"&&String(ye.content??"").endsWith("[")&&E(ye,"\\["))return!1;const Se=a[a.length-1];if(Se?.type!=="image"&&Se?.type!=="link")return!1;const U=Se,Z=Se?.type==="link"&&Array.isArray(U.children)&&U.children.length===1&&U.children[0]?.type==="image"?a.pop():null,fe=Z?Z.children[0]:a.pop();if(!fe||fe.type!=="image")return!1;const oe=e[u+1];let he=String(Z?.href??""),H=Z?.title==null?null:String(Z.title),X=!0;if(oe?.type==="link_open"){const{node:ke,nextIndex:Me}=dd(e,u+1,s);he=ke.href,H=ke.title,X=!0,u=Me}else{if(he=J.slice(2),he.includes('"')){const ke=he.split('"');he=String(ke[0]??"").trim(),H=ke[1]==null?null:String(ke[1]).trim()}u++}const ae=Y(fe,he,H);return ae.loading=X,y(ae),!0}function ce(){const J=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&J?.type==="text"&&String(J.content??"").endsWith("[")&&E(J,"\\[")}function _e(J,ye){const Se=J.indexOf("[");if(Se===-1)return!1;let U=J.slice(0,Se);const Z=J.indexOf("](",Se);if(Z!==-1){const fe=e[u+2];let oe=J.slice(Se+1,Z);if(oe.includes("[")){const Ie=oe.indexOf("[");U+=J.slice(0,Se+Ie+1);const re=Se+Ie+1;oe=J.slice(re+1,Z)}const he=e[u+1];if(J.endsWith("](")&&he?.type==="link_open"&&fe){const Ie=e[u+4];let re=4,le=!0;if(Ie?.type==="text"){const We=String(Ie.content??"");if(We.startsWith(")")){le=!1;const nt=We.slice(1);if(nt){const lt=ll(Ie);lt.content=nt,lt.raw=nt,h()[u+4]=lt}else re++}else We==="."&&re++}N(U,ye);const Ce=String(fe.content??"");return s?.validateLink&&!s.validateLink(Ce)?w(oe,oe):y({type:"link",href:Ce,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:le}),u+=re,!0}const H=J.indexOf(")",Z),X=H!==-1?J.slice(Z+2,H):"",ae=H===-1;let ke=U.match(/\*+$/);if(ke&&(U=U.replace(/\*+$/,"")),N(U,ye),ke||(ke=oe.match(/^\*+/)),!d&&ke){const Ie=ke[0].length;oe=oe.replace(/^\*+/,"").replace(/\*+$/,"");const re=[];if(Ie===1?re.push({type:"em_open",tag:"em",nesting:1}):Ie===2?re.push({type:"strong_open",tag:"strong",nesting:1}):Ie===3&&(re.push({type:"strong_open",tag:"strong",nesting:1}),re.push({type:"em_open",tag:"em",nesting:1})),re.push({type:"link",href:X,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:ae}),Ie===1){re.push({type:"em_close",tag:"em",nesting:-1});const{node:le}=ud(re,0,s);v(le)}else if(Ie===2){re.push({type:"strong_close",tag:"strong",nesting:-1});const{node:le}=oc(re,0,void 0,s);v(le)}else if(Ie===3){re.push({type:"em_close",tag:"em",nesting:-1}),re.push({type:"strong_close",tag:"strong",nesting:-1});const{node:le}=oc(re,0,void 0,s);v(le)}else{const{node:le}=ud(re,0,s);v(le)}}else s?.validateLink&&!s.validateLink(X)?w(oe,oe):y({type:"link",href:X,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:ae});const Me=H!==-1?J.slice(H+1):"";return Me&&(I({type:"text",content:Me,raw:Me}),u--),u++,!0}return!1}function me(J){const ye=J.indexOf("![");if(ye===-1)return!1;const Se=J.slice(0,ye);return Se&&!c?c={type:"text",content:Se,raw:Se}:Se&&c&&(c.content+=Se),c&&(a.push(c),c=null),y(G(J.slice(ye))),u++,!0}function $e(J){if(!(J?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ye=J.slice(1).match(/[^\s\]]/);if(ye===null)return u++,!0;if(ye&&/x/i.test(ye[0])){const Se=ye[0]==="x"||ye[0]==="X";return y({type:"checkbox_input",checked:Se,raw:Se?"[x]":"[ ]"}),u++,!0}return!1}return a}function GB(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){o.content=r;break}s.pop();continue}break}}function YB(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){s.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?o.content=r:s.pop())}break}}function XB(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Aa(e,t,n){const s=e[t],o=[],i=Ar(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=XB(c)?ll(c):c,d=e[a-1];u!==c&&(YB(u),GB(u));const f=String(u.content??"");l.push({type:"paragraph",children:Mn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=Ea(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]=Aa(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=Av(e,a,i.options(),Mv);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}o.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:s.type==="ordered_list_open",start:(()=>{if(s.attrs&&s.attrs.length){const l=s.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:o,raw:o.map(l=>l.raw).join(`
|
|
149
|
-
`)},r+1]}function ZB(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=Ar(s,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:Mn(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]=Aa(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=Ea(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Ch(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:o,title:i,children:r,raw:`:::${o} ${i}
|
|
150
|
-
${r.map(c=>c.raw).join(`
|
|
151
|
-
`)}
|
|
152
|
-
:::`},a+1]}const JB=new Set(["warning","info","note","tip","danger","caution"]);function QB(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const s=n.search(/\s/),o=(s===-1?n:n.slice(0,s)).toLowerCase();return JB.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function eF(e,t,n){const s=e[t];let o="note",i="";const r=s.type.match(/^container_(\w+)_open$/);if(r){o=r[1];const d=String(s.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(o)){const f=d.slice(o.length).trim();f&&(i=f)}}else{const d=QB(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=Ar(n,!0);let c=t+1;const u=new RegExp(`^container_${o}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const f=d.children||[];let h=-1;for(let g=f.length-1;g>=0;g--){const S=f[g];if(S.type==="text"&&/:+/.test(S.content)){h=g;break}}const p={type:"paragraph",children:Mn((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]=Aa(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=Ea(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Ch(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:o,title:i,children:l,raw:`:::${o} ${i}
|
|
153
|
-
${l.map(d=>d.raw).join(`
|
|
154
|
-
`)}
|
|
155
|
-
:::`},c+1]}const tF=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function nF(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=tF.exec(String(s.info??""));return o?ZB(e,t,o,n):null}const Mv={parseContainer:(e,t,n)=>eF(e,t,n),matchAdmonition:nF};function Ea(e,t,n){const s=[],o=Ar(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:Mn(r.children||[],String(r.content??""),void 0,o.options()),raw:String(r.content??"")};s.push(l),o.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=Aa(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=Ea(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=Av(e,i,o.options(),Mv);r?(s.push(r[0]),o.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:s,raw:s.map(r=>r.raw).join(`
|
|
156
|
-
`)},i+1]}function sF(e){if(e.info?.startsWith("diff"))return xv(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let s=t;n?.[1]&&(s=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:s,raw:s,loading:!o}}function oF(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=Ar(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=Mn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:Mn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(s.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
157
|
-
`)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
|
|
158
|
-
`)},o+1]}function iF(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=Ar(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:Mn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:o,children:i,raw:`[^${o}]: ${i.map(a=>a.raw).join(`
|
|
159
|
-
`)}`},l+1]}function rF(e,t,n){const s=e[t],o=s.attrs,i=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(s.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:Mn(a.children||[],c,void 0,n),raw:c}}function lF(e,t,n){const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=Tn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(o.test(c)){const u=Tn(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 xT(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const s=Tn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=ml.has(n),l=Sh(o),a=(s===-1?-1:lF(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
160
|
-
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function aF(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 cF(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,s]=t;if(!s)continue;const o=String(s).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(o);if(i)return i[1].toLowerCase()}}return"left"}function TT(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function MT(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return TT(n)?n:void 0}function uF(e,t,n){const s=MT(mu(t),n);if(!TT(s))return e;const o=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:o?.filename||s?.filename,explicitFilename:o?.explicitFilename||s?.explicitFilename,marketTicker:o?.marketTicker||s?.marketTicker}}}function dF(e,t,n){let s=t+1,o=null;const i=[];let r=!1;for(;s<e.length&&e[s].type!=="table_close";)if(e[s].type==="thead_open")r=!0,s++;else if(e[s].type==="thead_close")r=!1,s++;else if(e[s].type==="tbody_open"||e[s].type==="tbody_close")s++;else if(e[s].type==="tr_open"){const a=[];let c=s+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",h=e[c+1],p=String(h.content??""),g=cF(e[c].attrs),S=a.length,_=!f&&!r,y=_?o?.cells[S]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:Mn(h.children||[],p,void 0,uF(n,y,_?u:void 0)),raw:p,align:g}),_&&(u=MT(u,mu(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?o=d:i.push(d),s=c+1}else s++;o||(o={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:o,rows:i,loading:l&&!n?.final&&i.length===0,raw:[o,...i].map(a=>a.raw).join(`
|
|
161
|
-
`)},s+1]}function fF(){return{type:"thematic_break",raw:"---"}}let km=null;const bm=new WeakMap;function C_(){return km||(km={allowedTagSet:Th(),customTagSet:null}),km}function hF(e){if(!e||e.length===0)return C_();const t=bm.get(e);if(t)return t;const n=e.map(Oo).filter(Boolean);if(!n.length){const o=C_();return bm.set(e,o),o}const s={allowedTagSet:Th({customHtmlTags:e}),customTagSet:new Set(n)};return bm.set(e,s),s}function pF(e,t,n){const s=e[t],o=s.attrs;let i="";const r={};if(o){for(const[h,p]of o)if(h==="class"){const g=p.match(/(?:\s|^)vmr-container-(\S+)/);g&&(i=g[1])}else if(h.startsWith("data-")){const g=h.slice(5);try{r[g]=JSON.parse(p)}catch{r[g]=p}}}const l=[],a=Ar(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:Mn(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]=Aa(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=Ea(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=Ch(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+=`
|
|
162
|
-
`,l.length>0&&(f+=s.raw??l.map(h=>h.raw).join(`
|
|
163
|
-
`),f+=`
|
|
164
|
-
`),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 mF(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function gF(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function vF(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${ro(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${ro(s)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=Tn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(o.test(c)){const u=Tn(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 yF(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${s}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n||0);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=Tn(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 g=e.slice(p);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(g)},h=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),end:e.length};if(h(p)){const g=e.indexOf(">",p);if(g===-1)return null;if(u--,u===0){const S=g+1;return{raw:e.slice(r,S),end:S}}d=g+1;continue}if(f(p)){const g=Tn(e.slice(p));if(g===-1)return null;u++,d=p+g+1;continue}d=p+1}return{raw:e.slice(r),end:e.length}}function qg(e){return Number.isFinite(e)&&e>0?e:0}function kF(e,t){const n=qg(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
|
|
165
|
-
`&&(s++,s===n))return o+1;return e.length}function Ch(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[rF(e,t,n),t+3];case"code_block":return[sF(s),t+1];case"fence":return[xv(s),t+1];case"math_block":return[aF(s),t+1];case"html_block":{const o=xT(s),i=o.tag?hF(n?.customHtmlTags):null;if(o.tag&&o.loading&&i&&!i.allowedTagSet.has(o.tag)){const r=String(s.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(o.tag&&i?.customTagSet?.has(o.tag)){const r=o.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(s.map)?kF(l,Number(s.map?.[0]??0)):0,u=yF(l,r,Math.max(qg(a),qg(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),f=Tn(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),g=f===-1?null:vF(d,r,f+1),S=g?.start??-1;let _="";f!==-1&&(S!==-1&&f<S?_=d.slice(f+1,S):_=d.slice(f+1)),S===-1&&(_=gF(_,r));const y=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let v;for(;(v=b.exec(h))!==null;){const N=v[1];if(!N||N.toLowerCase()===r)continue;const E=v[2]||v[3]||v[4]||"";y.push([N,E])}const w=!n?.final&&!p&&g==null;return[{type:r,tag:r,content:mF(_),raw:String(u?.raw??o.raw??d),loading:w,attrs:y.length?y:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=dF(e,t,n);return[o,i]}case"dl_open":{const[o,i]=oF(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=iF(e,t,n);return[o,i]}case"hr":return[fF(),t+1]}return null}function Av(e,t,n,s){const o=Ch(e,t,n);if(o)return o;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(s?.parseContainer)return s.parseContainer(e,t,n);break;case"container_open":if(s?.matchAdmonition){const i=s.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return pF(e,t,n)}return null}function bF(){return{type:"hardbreak",raw:`\\
|
|
166
|
-
`}}function _F(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:Mn(s.children||[],o,void 0,n),raw:o}}const x_=new WeakMap,xh=new WeakMap,wF=["$$","\\["];function wa(){return typeof performance<"u"?performance.now():Date.now()}function Ev(e,t,n){e&&(e[t]=(e[t]??0)+n)}function AT(e){return e.__timing}function _m(e,t,n){return t&&Ev(t,"parseMarkdownToStructureTotalMs",wa()-n),e}function T_(e,t,n){if(!n)return O_(e,t);const s=wa(),o=O_(e,t);return Ev(n,"processTokensMs",wa()-s),o}function SF(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=Ma(t);return n.length?new Set(n):null}function CF(e,t){const n=e;let s=x_.get(n);s||(s=new Map,x_.set(n,s));const o=t.__markstreamFinal===!0?"final":"streaming";let i=s.get(o);i||(i={},s.set(o,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function xF(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function fd(e,t,n){for(const s of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,s);if(!o||!("value"in o))continue;const i=Object.getOwnPropertyDescriptor(t,s);i&&(!("value"in i)||i.writable===!1)||(t[s]=Jr(o.value,n))}}function Jr(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,s=t.get(n);if(s)return s;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(Jr(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Jr(l,t),Jr(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Jr(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),fd(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),fd(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),fd(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!xF(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),fd(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=Jr(i[r],t);return o}function ET(e,t=!0){if(!t)return ll(e);const n=Object.create(Object.getPrototypeOf(e)),s=new WeakMap;for(const o of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,o);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,o,i);continue}const r=i.value;let l=r;o==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):o==="map"&&Array.isArray(r)?l=[...r]:o==="children"&&Array.isArray(r)?l=r.map(a=>ET(a,t)):t&&r&&typeof r=="object"&&(l=Jr(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function M_(e,t=!0){return e.map(n=>ET(n,t))}function $T(e,t){const n=t,s=e.stream,o=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(o===!0||o==="auto"&&t.final!==!0)&&s?.enabled===!0&&typeof s.parse=="function"}function TF(e,t){const n=t,s=t.streamParse??"auto",o=e.stream;return t.final===!0&&s==="auto"&&n.__disableStreamParse!==!0&&o?.enabled===!0&&typeof o.reset=="function"}function MF(e){xh.delete(e)}function AF(e,t,n){xh.set(e,{source:t,key:n,pendingCandidate:n===null&&gT(t)})}function EF(e){return e.endsWith("$")||e.endsWith("\\")}function $F(e){const t=Math.max(e.lastIndexOf(`
|
|
167
|
-
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return wF.some(s=>n.endsWith(s))}function IF(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||$F(e)&&/[\r\n]/.test(t)):!1}function NF(e,t){if(!cT(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const s=e,o=xh.get(s);if(o?.source===t)return;if(o&&t.startsWith(o.source)){const l=t.slice(o.source.length);if(o.key===null&&o.pendingCandidate===!1&&!IF(o.source,l)&&!EF(t)){o.source=t;return}}const i=VD(t),r=o?!t.startsWith(o.source):!1;(o&&(r||o.key!==i)||!o&&i)&&n.reset(),AF(e,t,i)}function LF(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function OF(e,t){const n=e?.map,s=t?.map;return n===s?!0:!Array.isArray(n)||!Array.isArray(s)?!1:n.length===s.length&&n.every((o,i)=>o===s[i])}function wm(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&&OF(e,t)}function A_(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function PF(e){for(let t=0;t+5<e.length;t++)if(A_(e,t)&&A_(e,t+3)&&wm(e[t],e[t+3])&&wm(e[t+1],e[t+4])&&wm(e[t+2],e[t+5]))return!0;return!1}function RF(e,t,n){return cT(e)&&gT(t)&&PF(n)}function DF(e){const t=xh.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function E_(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!$T(e,s)||(NF(e,t),DF(e)))return e.parse(t,n);const o=e.stream.parse(t,CF(e,n));if(RF(e,t,o))return e.stream?.reset?.(),e.parse(t,n);if(!LF(s))return o;const i=AT(s);if(!i)return M_(o,!0);const r=wa(),l=M_(o,!0);return Ev(i,"tokenCloneMs",wa()-r),l}function Th(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Zc;const n=new Set(Zc);for(const s of Ma(t))s&&n.add(s);return n}function BF(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 $_(e){return{type:"paragraph",children:e,raw:e.map(BF).join("")}}function I_(e,t){if(e.type!=="paragraph")return null;const n=e.children,s=Array.isArray(n)?n:[];if(s.length===0)return null;const o=SF(t);if(!o?.size)return null;let i=-1;for(let u=0;u<s.length;u++){const d=s[u];if(!o.has(String(d?.type??"").toLowerCase()))continue;const f=s.slice(0,u);if(String(d.content??"").trim()&&f.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=s.slice(0,i),l=s[i];if(!l)return null;const a=[];r.length&&a.push($_(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push($_(c)),a}function FF(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),s=/<\/html>\s*$/i.test(t);return!n||!s?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function Mc(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function HF(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*${ro(t)}\s*>\s*$`,"i").test(n)}function $v(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${ro(s)}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=Tn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(ml.has(s)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*${ro(s)}(?=\s|>|/)`,"i").test(g)},h=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${ro(s)}(?=\s|>)`,"i").test(g)};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 g=Tn(e.slice(p));if(g===-1)return null;u--;const S=p+g+1;if(u===0)return{raw:e.slice(r,S),start:r,end:S,closed:!0};d=S;continue}if(f(p)){const g=Tn(e.slice(p));if(g===-1)return null;const S=e.slice(p,p+g+1);/\/\s*>$/.test(S)||u++,d=p+g+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function WF(e,t){if(!t)return 0;let n=0,s=0;for(;n<e.length&&s<t.length;){if(e[n]===t[s]){n++,s++;continue}if(e[n]==="\r"||e[n]===`
|
|
168
|
-
`){n++;continue}return-1}return s===t.length?n:-1}function UF(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
169
|
-
</${t}>`}function N_(e){return e.replace(/\r\n/g,`
|
|
170
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function jF(e,t,n){return n?e.includes(n,t)?!0:N_(e.slice(Math.max(0,t))).includes(N_(n)):!1}function qF(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
171
|
-
`&&n++,n):e[n]===`
|
|
172
|
-
`?n+1:t}function L_(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 zF(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function Iv(e,t){const n=new RegExp(String.raw`<\s*\/\s*${ro(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function IT(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const VF=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),KF=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function GF(e){return/\n\s*\n/.test(e)||KF.test(e)}function YF(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>VF.has(String(s?.type??"").toLowerCase()))||t.some(s=>{if(s?.type!=="html_block")return!1;const o=s;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!GF(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function XF(e,t,n,s){return e.map(o=>{if(o?.type!=="html_block")return o;const i=o,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||Vx.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=Tn(l);if(a===-1)return o;const c=Iv(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=Ac(u,t,IT(n,s));return YF(u,d)?{...o,children:d}:o})}function Ac(e,t,n){return e.trim()?LT(e,t,{...n,__disableStreamParse:!0}):[]}function ZF(e,t,n){const s=Ac(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function JF(e,t,n){const s=xT({content:e}),o=Tn(e),i=Iv(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=ZF(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function QF(e,t,n){const s=Tn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=$v(o,"summary",0);if(!i)return Ac(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...Ac(r,t,n),JF(i.raw,t,n),...Ac(l,t,n)]}function NT(e,t,n,s,o,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=Mc(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!L_(c)){r.push(c);continue}const f=String(c.raw??Mc(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,g=-1;for(let se=a+1;se<e.length;se++){const Y=e[se];if(L_(Y)){p++;continue}if(zF(Y)&&(p--,p===0)){g=se;break}}const S=$v(t,"details",h),_=g===-1&&S?.closed===!0,y=_?(()=>{const se=Iv(f,"details");return se!==-1?f.slice(0,se):f})():f,[b]=NT(_?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,s,o,h+f.length),v=QF(y,n,IT(s,o)),w=g===-1?"</details>":String(e[g].raw??Mc(e[g])??"</details>"),N=_||g!==-1&&S?.closed===!0,E=w.replace(/[\t\r\n ]+$/,""),k=N?(()=>{const se=(S?.raw??"").lastIndexOf(E);return se===-1?t.length:h+se})():t.length,A=Tn(f),I=_&&A!==-1?h+A+1:h+f.length,P=t.slice(I,k===-1?t.length:k),M=n.parse(P,{__markstreamFinal:o}),L=n.renderer.render(M,n.options,{__markstreamFinal:o}),R=k+E.length,B=N?Math.max(k+w.length,qF(t,R)):t.length,W=N?t.slice(k,B):w,K=N?t.slice(h,B):t.slice(h),V=_&&A!==-1?f.slice(0,A+1):f;if(r.push({...c,tag:"details",attrs:Sh(f.slice(0,A+1)),raw:K,content:`${V}${L}${W}`,children:[...v,...b],loading:!o&&!N}),l=N?B:t.length,g===-1&&!_)break;g!==-1&&(a=g)}return[r,l]}function e9(e,t,n){if(!n)return e;const s=e.slice();let o=0;for(let i=0;i<s.length;i++){const r=s[i],l=Mc(r),a=l?n.indexOf(l,o):-1;if(r?.type!=="html_block"){a!==-1&&(o=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(o=a+l.length);continue}const u=$v(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),f=String(r.raw??d),h=UF(u.raw,c,u.closed),p=!t&&!u.closed,g=d!==h||f!==u.raw||!!r.loading!==p,S=Tn(u.raw),_=S===-1?"":u.raw.slice(0,S+1),y=_?Sh(_):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=y.length?y:void 0,!g)continue;let b=WF(u.raw,f);b===-1&&(b=0);const v=i+1;for(;v<s.length;){if(u.closed&&HF(s[v],c)){s.splice(v,1);continue}const w=Mc(s[v]);if(!w)break;const N=u.raw.indexOf(w,b);if(N===-1){if(jF(n,u.end,w))break;s.splice(v,1);continue}b=N+w.length,s.splice(v,1)}}return s}function t9(e){const t=l=>l===" "||l===" "||l===`
|
|
173
|
-
`||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=g=>{const S=g.charCodeAt(0);return S>=65&&S<=90||S>=97&&S<=122},u=g=>{const S=g.charCodeAt(0);return S>=48&&S<=57},d=g=>g==="!"||c(g),f=g=>c(g)||u(g)||g===":"||g==="-",h=g=>c(g)||u(g)||g==="_"||g==="."||g===":"||g==="-",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 g=l[a];if(g==='"'||g==="'"){for(a++;a<l.length&&l[a]!==g;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const S=l[a];if(t(S)||S==="<"||S===">"||S==='"'||S==="'"||S==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const f=y=>y===" "||y===" ",h=y=>{let b=0;for(;b<y.length&&f(y[b]);)b++;const v=y[b];if(v!=="`"&&v!=="~")return null;let w=b;for(;w<y.length&&y[w]===v;)w++;const N=w-b;return N<3?null:{markerChar:v,markerLen:N,rest:y.slice(w)}},p=y=>{let b=0;for(;b<y.length&&f(y[b]);)b++;let v=!1;for(;b<y.length&&y[b]===">";)for(v=!0,b++;b<y.length&&f(y[b]);)b++;return v?y.slice(b):null},g=y=>{const b=h(y);if(b)return b;const v=p(y);return v==null?null:h(v)};let S=0;const _=l.split(/\r?\n/);for(const y of _){const b=S,v=S+y.length;if(a<b)break;const w=g(y);if(w){const N=w.markerChar,E=w.markerLen;c?N===u&&E>=d&&/^\s*$/.test(w.rest)&&(c=!1,u="",d=0):(c=!0,u=N,d=E)}if(a<=v)break;S=v+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
|
|
174
|
-
`||l==="\r",c=o[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return o}const r=o.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
175
|
-
`||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function n9(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 s=p=>p===" "||p===" ",o=p=>{const g=p.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let g=0;for(let S=0;S<p.length;S++){const _=p[S];if(_===" "){if(g++,g>=4)return!0;continue}if(_===" ")return!0;break}return!1},r=p=>{let g=!1,S=!1;for(let _=0;_<p.length;_++){const y=p[_];if(y==="\\"){_++;continue}if(!S&&y==="'"){g=!g;continue}if(!g&&y==='"'){S=!S;continue}if(!g&&!S&&y===">")return _}return-1},l=p=>{let g=0;for(;g<p.length&&s(p[g]);)g++;const S=p[g];if(S!=="`"&&S!=="~")return null;let _=g;for(;_<p.length&&p[_]===S;)_++;const y=_-g;return y<3?null:{markerChar:S,markerLen:y,rest:p.slice(_)}},a=(p,g)=>{if(i(p))return-1;const S=p.replace(/^[ \t]+/,"");if(!S||S.startsWith(">")||S.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(S))return-1;let _=!1,y=0;for(;y<p.length;){const b=p[y];if(b!=="<"){s(b)||(_=!0),y++;continue}const v=r(p.slice(y));if(v===-1){_=!0,y++;continue}const w=p.slice(y,y+v+1);let N=1;for(;N<w.length&&s(w[N]);)N++;if(N>=w.length){_=!0,y++;continue}const E=w[N];if(E==="!"||E==="?"){_=!0,y+=v+1;continue}if(E==="/"){_=!0,y+=v+1;continue}const k=N;for(;N<w.length&&o(w[N]);)N++;if(N===k){_=!0,y++;continue}const A=w.slice(k,N).toLowerCase(),I=w[N];if(I&&I!==" "&&I!==" "&&I!==">"&&I!=="/"){_=!0,y++;continue}const P=new RegExp(String.raw`<\s*\/\s*${A}\s*>`,"i"),M=/\/\s*>$/.test(w),L=P.test(p.slice(y+v+1)),R=P.test(e.slice(g+y+v+1)),B=/[\r\n]/.test(e.slice(g+y+v+1));if(_&&n.has(A)&&!M&&!L&&(R||B))return y;_=!0,y+=v+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
|
|
176
|
-
`,h),g=p!==-1,S=g&&p>h&&e[p-1]==="\r",_=g?S?p-1:p:e.length,y=e.slice(h,_),b=g?S?`\r
|
|
177
|
-
`:`
|
|
178
|
-
`:"",v=l(y);let w=y;if(!c&&!v){const N=a(y,h);if(N!==-1){const E=b||`
|
|
179
|
-
`;w=`${y.slice(0,N).replace(/[ \t]+$/,"")}${E}${E}${y.slice(N).replace(/^[ \t]+/,"")}`}}f+=w,f+=b,v&&(c?v.markerChar===u&&v.markerLen>=d&&/^\s*$/.test(v.rest)&&(c=!1,u="",d=0):(c=!0,u=v.markerChar,d=v.markerLen)),h=g?p+1:e.length}return f}function s9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const s=d=>d===" "||d===" ",o=d=>{const 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&&s(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,h=!1;for(let p=0;p<d.length;p++){const g=d[p];if(g==="\\"){p++;continue}if(!h&&g==="'"){f=!f;continue}if(!f&&g==='"'){h=!h;continue}if(!f&&!h&&g===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let S=g+1;for(;S<d.length&&s(d[S]);)S++;if(S>=d.length||d[S]!=="/"){g=d.indexOf("<",g+1);continue}for(S++;S<d.length&&s(d[S]);)S++;if(S+p.length>d.length){g=d.indexOf("<",g+1);continue}let _=!0;for(let b=0;b<p.length;b++){const v=d[S+b];if((v>="A"&&v<="Z"?String.fromCharCode(v.charCodeAt(0)+32):v)!==p[b]){_=!1;break}}if(!_){g=d.indexOf("<",g+1);continue}let y=S+p.length;if(y<d.length&&o(d[y])){g=d.indexOf("<",g+1);continue}for(;y<d.length&&s(d[y]);)y++;if(y<d.length&&d[y]===">")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f<d.length&&s(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&s(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const h=f;for(;f<d.length&&o(d[f]);)f++;if(f===h)return d;const p=d.slice(h,f).toLowerCase();if(!n.has(p))return d;const g=r(d.slice(f));if(g===-1)return d;const S=f+g;if(l(d,S+1,p))return d;const _=i(d.slice(S+1));return _?`${d.slice(0,S+1)}
|
|
180
|
-
${_}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
181
|
-
`,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
|
|
182
|
-
`:`
|
|
183
|
-
`,u=d+1}return c}function o9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const s=f=>f===" "||f===" ",o=f=>{let h=0,p=!1,g=0;for(;h<f.length;){for(;h<f.length&&s(f[h]);)h++;if(h>=f.length||f[h]!==">")break;for(p=!0,h++;h<f.length&&s(f[h]);)h++;g=h}return p?{prefix:f.slice(0,g),content:f.slice(g)}:null},i=f=>{let h=0;for(;h<f.length&&s(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let g=h;for(;g<f.length&&f[g]===p;)g++;const S=g-h;return S<3?null:{markerChar:p,markerLen:S,rest:f.slice(g)}},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(`
|
|
184
|
-
`,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",g=h?p?f-1:f:e.length,S=e.slice(d,g),_=h?p?`\r
|
|
185
|
-
`:`
|
|
186
|
-
`:"",y=o(S),b=y?.prefix??"",v=y?.content??S,w=i(v);w&&(l?w.markerChar===a&&w.markerLen>=c&&/^\s*$/.test(w.rest)&&(l=!1,a="",c=0):(l=!0,a=w.markerChar,c=w.markerLen));let N=v;if(!l&&N.includes("</"))for(const E of r)N=N.replace(E,(k,A,I,P)=>{if(P.replace(/^[\t ]+/,"").startsWith("|"))return k;const M=P.slice(0,I).replace(/^[\t ]+/,"");if(M.length>0){const L=A.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",R=M.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!L||!R||L!==R)return k}return`${A}
|
|
187
|
-
|
|
188
|
-
`});if(b){const E=b+N.split(`
|
|
189
|
-
`).join(`
|
|
190
|
-
${b}`);u+=E}else u+=N;u+=_,d=h?f+1:e.length}return u}function i9(e,t){if(!e||!t.length)return e;const n=new Set(t.map(M=>String(M??"").toLowerCase()));if(!n.size)return e;const s=M=>M===" "||M===" ",o=M=>{if(!M)return!1;if(M[0]===" ")return!0;let L=0;for(let R=0;R<M.length;R++){const B=M[R];if(B===" "){if(L++,L>=4)return!0;continue}if(B===" ")return!0;break}return!1},i=M=>{const L=M.charCodeAt(0);return L>=65&&L<=90||L>=97&&L<=122||L>=48&&L<=57||M==="_"||M==="-"||M===":"},r=M=>{let L=0;for(;L<M.length&&s(M[L]);)L++;return M.slice(L)},l=M=>{let L=0,R=!1,B=0;for(;L<M.length;){for(;L<M.length&&s(M[L]);)L++;if(L>=M.length||M[L]!==">")break;for(R=!0,L++;L<M.length&&s(M[L]);)L++;B=L}if(!R)return null;const W=M.slice(0,B);return{prefix:W,key:W.replace(/[ \t]+$/,""),content:M.slice(B)}},a=M=>r(M).startsWith("<"),c=M=>{for(let L=0;L<M.length;L++){const R=M[L];if(R!==" "&&R!==" ")return!1}return!0},u=M=>{if(o(M))return"";const L=r(M);if(!L.startsWith("<"))return"";let R=1;for(;R<L.length&&s(L[R]);)R++;if(R>=L.length||L[R]==="/"||L[R]==="!"||L[R]==="?")return"";const B=R;for(;R<L.length&&i(L[R]);)R++;if(R===B)return"";const W=L.slice(B,R).toLowerCase();if(!n.has(W))return"";const K=L[R];return K&&K!==" "&&K!==" "&&K!==">"&&K!=="/"?"":W},d=M=>{if(o(M))return null;const L=r(M);if(!L.startsWith("<"))return null;let R=1;for(;R<L.length&&s(L[R]);)R++;if(R>=L.length)return null;const B=L[R]==="/";if(B)for(R++;R<L.length&&s(L[R]);)R++;const W=L[R];if(!W||W==="!"||W==="?")return null;const K=R;for(;R<L.length&&i(L[R]);)R++;if(R===K)return null;const V=L.slice(K,R).toLowerCase();if(!n.has(V))return null;const se=L[R];if(se&&se!==" "&&se!==" "&&se!==">"&&se!=="/")return null;if(B)return{type:"close",name:V};if(/\/\s*>\s*$/.test(L))return{type:"open",name:V,complete:!0};const Y=L.indexOf(">",R);if(Y!==-1){const G=L.slice(Y+1);if(new RegExp(`<\\s*\\/\\s*${V}\\s*>`,"i").test(G))return{type:"open",name:V,complete:!0}}return{type:"open",name:V,complete:!1}},f=M=>{if(o(M))return null;const L=r(M).replace(/[ \t]+$/,"");if(!L.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(L))return null;const R=L.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(R?.[1])return R[1].toLowerCase();const B=L.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!B?.[1]||!B[2])return null;const W=B[1].toLowerCase();return W===B[2].toLowerCase()?W:null};let h=!1,p="",g=0;const S=M=>{let L=0;for(;L<M.length&&s(M[L]);)L++;const R=M[L];if(R!=="`"&&R!=="~")return null;let B=L;for(;B<M.length&&M[B]===R;)B++;const W=B-L;return W<3?null:{markerChar:R,markerLen:W,rest:M.slice(B)}},_=M=>S(M),y=M=>{const L=r(M);return L?o(M)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(L):!1},b=(M,L,R)=>{let B=M,W=0;for(;B<e.length;){const K=e.indexOf(`
|
|
191
|
-
`,B),V=K!==-1,se=V&&K>B&&e[K-1]==="\r",Y=V?se?K-1:K:e.length,G=e.slice(B,Y),ee=l(G),we=ee?.key??"";if(W>0&&L&&we!==L)break;const de=ee?.content??G,Le=d(de);if(Le?.name===R){if(Le.type==="open")Le.complete||W++;else if(W>0&&(W--,W===0))return!1}else if(W>0&&(c(de)||y(de)))return!0;if(V)B=K+1;else break}return!1};let v="",w=0,N=!0,E=!1,k=!1,A=`
|
|
192
|
-
`;const I=[];let P="";for(;w<e.length;){const M=e.indexOf(`
|
|
193
|
-
`,w),L=M!==-1,R=L&&M>w&&e[M-1]==="\r",B=L?R?M-1:M:e.length,W=e.slice(w,B),K=L?R?`\r
|
|
194
|
-
`:`
|
|
195
|
-
`:"",V=l(W),se=V?.key??"",Y=V?.content??W,G=_(Y);G&&(h?G.markerChar===p&&G.markerLen>=g&&/^\s*$/.test(G.rest)&&(h=!1,p="",g=0):(h=!0,p=G.markerChar,g=G.markerLen));const ee=I.length>0;if(!h&&!ee){const de=u(Y),Le=!!de&&!N&&E&&k&&b(w,se,de);de&&!N&&(!E||Le)&&(se&&P&&se===P?v+=`${se}${A}`:se||(v+=A))}if(v+=W,v+=K,K&&(A=K),!h){const de=d(Y);if(de){if(de.type==="open")de.complete||I.push(de.name);else for(let Le=I.length-1;Le>=0;Le--)if(I[Le]===de.name){I.length=Le;break}}}const we=c(Y);N=we,E=!we&&a(Y),k=!we&&!!f(Y),P=se,w=L?M+1:e.length}return v}function LT(e,t,n={}){const s=AT(n),o=s?wa():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(TF(t,n)&&(t.stream.reset(),MF(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,S=>S.startsWith(`
|
|
196
|
-
`)?`
|
|
197
|
-
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,S=>S.startsWith(`
|
|
198
|
-
`)?`
|
|
199
|
-
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,S=>S.startsWith(`
|
|
200
|
-
`)?`
|
|
201
|
-
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
202
|
-
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,S=>S.startsWith(`
|
|
203
|
-
`)?`
|
|
204
|
-
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(S,_,y)=>`${_}${y.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,S=>S.startsWith(`
|
|
205
|
-
`)?`
|
|
206
|
-
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
207
|
-
`))),n.customHtmlTags?.length&&r.includes("<")){const S=Ma(n.customHtmlTags);if(S.length&&(r=n9(r,S),r=s9(r,S),r=i9(r,S),r=o9(r,S),r.includes("</")))for(const _ of S){const y=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${_}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(y,"$1$2$2")}}i||(r=t9(r));const l=FF(r);if(l){const S=n.preTransformTokens,_=n.postTransformTokens;if($T(t,n)||typeof S=="function"||typeof _=="function"){const y=E_(t,r,{__markstreamFinal:i},n),b=typeof S=="function"&&S(y)||y;typeof _=="function"&&_(b)}return _m(l,s,o)}const a=E_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return _m([],s,o);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 g=T_(d,p,s);if(u&&typeof u=="function"){const S=u(d);if(Array.isArray(S)){const _=S[0],y=_?.type;_&&typeof y=="string"?g=T_(S,void 0,s):g=S}}if(g=e9(g,i,r),g=NT(g,r,t,n,i)[0],g=XF(g,t,n,i),i){const S=new WeakSet,_=y=>{if(!y||typeof y!="object"||S.has(y))return;if(S.add(y),Array.isArray(y)){for(const v of y)_(v);return}const b=y;b.type==="html_block"&&b.loading===!0&&(b.loading=!1);for(const v of Object.values(b))_(v)};_(g)}return n.debug&&console.log("Parsed Markdown Tree Structure:",g),_m(g,s,o)}function O_(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=Ar(t);let o=0;for(;o<e.length;){const i=Av(e,o,s.options(),Mv);if(i){n.push(i[0]),s.remember(i[0].raw),o=i[1];continue}const r=e[o];switch(r.type){case"paragraph_open":{const l=String(e[o+1]?.content??""),a=_F(e,o,s.options(l)),c=I_(a,t);c?n.push(...c):n.push(a),s.remember(a.raw),o+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=Aa(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=Ea(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),s.remember(String(r.content??"")),o++;break}case"hardbreak":n.push(bF()),s.reset(),o++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),s.remember(l),o++;break}case"inline":{const l=String(r.content??""),a=Mn(r.children||[],l,void 0,s.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=I_(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const r9=new Set([...pu,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),l9=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"]),P_=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function R_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a9(e){return typeof e=="string"?e:e==null?"":String(e)}function OT(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function ar(e){return a9(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function PT(e){return ar(e).replace(/`/g,"`")}function Mh(e){return String(e??"").trim().toLowerCase()}function Nv(e,t="safe"){const n=Mh(e);return n?t==="escape"?!0:t==="trusted"?pu.has(n):!l9.has(n):!1}function RT(e,t="safe"){const n=Mh(e);return n?t==="escape"?!0:t==="trusted"?pu.has(n):r9.has(n):!1}function D_(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${PT(s)}"`).join("")}function c9(e,t){const n=e.split(",").map(s=>s.trim()).filter(Boolean);return n.length===0?!1:n.some(s=>{const o=s.split(/\s+/,1)[0]??"";return!o||ha(o,{tagName:t,attrName:"srcset"})})}function DT(e,t,n,s){return ZR.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?c9(t,s):!!(JR.has(e)&&t&&ha(t,{tagName:s,attrName:e}))}function Qr(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function BT(e,t,n,s=!1){if(t!=="safe"||Mh(n)!=="a")return e;const o=Qr(e,"href");if(s&&(!o||!e[o])){const a=Qr(e,"target"),c=Qr(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Qr(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Qr(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function B_(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!OT(r)||DT(l,i,t,n)||(s[r]=i)}return BT(s,t,n,!!Qr(e,"href"))}function FT(e,t){const n=e.toLowerCase();return zx.has(n)?!1:R_(t,n)||R_(t,e)}function Lv(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!OT(r)||DT(l,i,t,n)||(s[r]=i)}return BT(s,t,n,!!Qr(e,"href"))}function Of(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,s]of e)n&&(t[String(n)]=s==null?"":String(s));return t}function zg(e,t="safe",n){const s=Lv(Of(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function u9(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const s=Number(e);if(e!==""&&!Number.isNaN(s))return s}return e}function d9(e){const t={};for(const[n,s]of Object.entries(e))t[n]=u9(s,n);return t}function F_(e){return e.trim().length>0}function f9(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const s=e.indexOf("<",n);if(s===-1){if(n<e.length){const a=e.slice(n);F_(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);F_(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",s+1)){const a=e.indexOf("]]>",s);if(a!==-1){t.push({type:"text",content:e.slice(s,a+3)}),n=a+3;continue}break}if(e.startsWith("!",s+1)){const a=e.indexOf(">",s);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||ml.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function h9(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 s=e.indexOf("<",n);if(s===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(s>n&&t.push({type:"text",content:e.slice(n,s)}),e.startsWith("![CDATA[",s+1)){const f=e.indexOf("]]>",s);if(f!==-1){t.push({type:"text",content:e.slice(s,f+3)}),n=f+3;continue}break}if(e.startsWith("!",s+1)){const f=e.indexOf(">",s);if(f!==-1){n=f+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim();if(!i){n=o+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=o+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||ml.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function p9(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${ar(t)}>`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${ar(s)}`:` ${ar(s)}="${PT(o)}"`).join("");return e.type==="self_closing"?`<${ar(t)}${n} />`:`<${ar(t)}${n}>`}function m9(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;P_.lastIndex=0;let n;for(;(n=P_.exec(e))!==null;)if(FT(n[1],t))return!0;return!1}function pa(e,t="safe"){if(!e)return"";if(t==="escape")return ar(e);const n=h9(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(ar(r.content??""));continue}const l=Mh(r.tagName);if(!l)continue;if(RT(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"&&Nv(l,t)){o.push(p9(r));continue}if(r.type==="self_closing"){o.push(`<${l}${D_(B_(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${D_(B_(r.attrs??{},t,l))}>`),ml.has(l)||s.push(l);continue}const a=s.lastIndexOf(l);if(a===-1)continue;for(;s.length>a+1;){const u=s.pop();u&&o.push(`</${u}>`)}const c=s.pop();c&&o.push(`</${c}>`)}for(;s.length>0;){const r=s.pop();r&&o.push(`</${r}>`)}return o.join("")}const g9=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],H_="http://www.w3.org/2000/svg",v9=new Set(["script","style","iframe","object","embed","link","meta"]),y9=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"]),k9=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),b9=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),_9=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function w9(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function S9(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function C9(e){const t=e.nodeName.toLowerCase();return t==="use"?w9(e):t==="image"?S9(e):t==="text"||t==="tspan"?!!e.textContent?.trim():_9.has(t)}function x9(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 T9(e,t,n){const s=e.toLowerCase(),o=t.toLowerCase(),i=String(n??"").trim();return i?(s==="use"||s==="marker"||s==="clippath"||s==="mask")&&(o==="href"||o==="xlink:href")?i.startsWith("#")?i:"":s==="a"&&(o==="href"||o==="xlink:href")?ha(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ha(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":ha(i,{tagName:s,attrName:o})?"":i:""}function M9(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const s=e[n];if(s==='"'||s==="'"){const i=n+1,r=e.indexOf(s,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const o=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(o,n)}}function HT(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const s=n.trim();if(/^[0-9a-f]+$/i.test(s)){const o=Number.parseInt(s,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function WT(e){const t=HT(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=M9(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function W_(e){const t=HT(e);return g9.some(n=>n.test(t))||WT(t)}function A9(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 hd(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function UT(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,s=n.tagName.toLowerCase();if(!v9.has(s)){if(s==="br"){t.push(`
|
|
208
|
-
`);return}for(const o of Array.from(n.childNodes))UT(o,t)}}function E9(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];UT(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=hd(t.getAttribute("width")),i=hd(t.getAttribute("height")),r=hd(t.getAttribute("x")),l=hd(t.getAttribute("y")),a=e.ownerDocument.createElementNS(H_,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),s.length===1)a.textContent=s[0];else{const u=-.6*(s.length-1);for(const[d,f]of s.entries()){const h=e.ownerDocument.createElementNS(H_,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function $9(e){E9(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!y9.has(s)){n.remove();continue}if(s==="style"&&W_(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const i of o){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&W_(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(k9.has(r)&&i.value){const l=T9(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(b9.has(r)&&i.value&&WT(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=x9(i.value);l!==i.value&&n.setAttribute(i.name,l)}}A9(n)}}function ape(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 $9(n),I9(n)?null:n}catch{return null}}function I9(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const i=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let s=!1;for(const o of n){C9(o)&&(s=!0);for(const i of Array.from(o.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!s}const U_=[];function Sm(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function N9(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function L9(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function j_(e=`editor-${Date.now()}`,t={}){const n=XD(t),s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;o=h=>f[h]??s[h]??h}else o=f=>s[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const h=f;if(Array.isArray(h)){const[p,...g]=h;typeof p=="function"&&n.use(p,...g)}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(U_.length)for(const f of U_)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(H8),n.use(j8),n.use(D8);const i=sL,r=i.default??i;n.use(r),n.use(R8),n.use(P8),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,g=!!h.env?.__markstreamFinal,S=p.split(/\r?\n/);for(const _ of h.tokens){if(_.type!=="fence"||!_.map||!_.markup)continue;const y=_.map[0],b=_.map[1],v=_.markup,w=v[0],N=v.length,E=S[Math.max(0,b-1)]??"";let k=0;for(;k<E.length&&(E[k]===" "||E[k]===" ");)k++;let A=0;for(;k+A<E.length&&E[k+A]===w;)A++;let I=k+A;for(;I<E.length&&(E[I]===" "||E[I]===" ");)I++;const P=g?!0:b>y+1&&A>=N&&I===E.length,M=_;M.meta=M.meta??{},M.meta.unclosed=!P,M.meta.closed=!!P}});const l=(f,h)=>{const p=f,g=p.pos;if(p.src[g]!=="~")return!1;const S=p.src[g-1],_=p.src[g+1];if(/\d/.test(S)&&/\d/.test(_)){if(!h){const y=p.push("text","",0);y.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],g=String(p.info??"").trim(),S=String(p.content??""),_=btoa(unescape(encodeURIComponent(S))),y=N9(g),b=Sm(y),v=L9(`editor-${e}-${h}-${y}`),w=Sm(o("common.copy"));return`<div class="code-block" data-code="${_}" data-lang="${b}" id="${v}">
|
|
209
|
-
<div class="code-header">
|
|
210
|
-
<span class="code-lang">${Sm(y.toUpperCase())}</span>
|
|
211
|
-
<button class="copy-button" data-code="${_}">${w}</button>
|
|
212
|
-
</div>
|
|
213
|
-
<div class="code-editor"></div>
|
|
214
|
-
</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 g=a.exec(p.src.slice(p.pos));if(!g)return!1;const S=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(S))return!1;const _=p.src.slice(p.pos+g[0].length);if(_.startsWith("](")||_.startsWith("(")||u(_))return!1;if(!h){const y=g[1],b=p.push("reference","span",0);b.content=y,b.markup=g[0],b.raw=g[0]}return p.pos+=g[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,h)=>{const g=String(f[h].content??"");return`<span class="reference-link" data-reference-id="${g}" role="button" tabindex="0" title="Click to view reference">${g}</span>`},n}const O9="modulepreload",P9=function(e){return"/"+e},q_={},oo=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(c=>{if(c=P9(c),c in q_)return;q_[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":O9,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 o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function R9({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 jT({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:R9({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const z_=new WeakMap;function D9(e){let t=z_.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},z_.set(e,t)),t}function V_(e,t){if(!t?.length)return[...e];const n=[...e],s=new Set(n);for(const o of t)s.has(o)||(s.add(o),n.push(o));return n}function Ov(e){return!!(e.themes?.length||e.langs?.length)}function qT(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function B9(e,t){return!t?.length||e.registeredAllLangs?!0:qT(e.registeredLangs,t)}function Cm(e,t){return Ov(t)&&qT(e.registeredThemes,t.themes)&&B9(e,t.langs)}function F9(e,t){if(!Ov(t))return t;const n=V_(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:V_(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const H9={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 W9(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function zT(e){const t=W9(e);return H9[t]??t}function VT(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>zT(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function KT(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const s of e){if(typeof s!="string")continue;const o=s.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function U9(e){return KT(e)?.join("\0")??""}function GT(e,t){const n=KT(e),s=VT(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function Pf(e,t){return`${U9(e)}\0\0${VT(t)?.join("\0")??""}`}function cpe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=GT(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:Pf(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function upe(e,t={},n){if(!e)return"ready";const s=GT(t.themes,t.langs),o=Pf(s.themes,s.langs),i=n&&n===o?n:o,r=D9(e);if(r.completed.has(i))return"ready";if(Cm(r,s))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)||Cm(r,s))return r.completed.add(i),"ready";const c=F9(r,s),u=Pf(c.themes,c.langs);return r.completed.has(u)||Cm(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(Ov(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 Bl(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function K_(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var j9=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=G_();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=G_();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,g=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,S=K9(p/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(S-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const _=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),y=V9(this.source.slice(this.visible.length),_,this.segmenter);y.text&&(this.visible+=y.text,this.charBudget=Math.max(0,this.charBudget-y.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Bl(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Bl(s,1e3,1)),this.normalizedTargetLatencyMs=Bl(o,900,1),this.normalizedCatchUpLatencyMs=Bl(i,350,1),this.normalizedCatchUpThreshold=K_(r,600),this.normalizedStartDelayMs=K_(a,80),this.maxCommitFps=Math.trunc(Bl(l,30,1)),this.maxCharsPerCommit=Math.trunc(Bl(c,80,1)),this.flushOnFinish=u,this.segmenter=z9(),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 q9(e={},t){const n=new j9(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 z9(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function V9(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function G_(){return typeof performance<"u"?performance.now():Date.now()}function K9(e,t,n){return Math.min(n,Math.max(t,e))}var G9=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Vg=Symbol.for("markstream-vue:node-lifecycle"),Y_='<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>',X_='<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>',Y9={id:"material",core:{"":X_,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:X_,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:Y_,csharp:Y_,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:()=>oo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Kg=new Map;let Z_="material";const Jl=new Map,J_=new Map;let Gg=null;function X9(e){Kg.set(e.id,e)}function Z9(e){return G9(this,null,function*(){var t,n,s;if(Jl.has(e.id))return(t=Jl.get(e.id))!=null?t:null;let o=J_.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(Jl.set(e.id,i),Gg?.(),i)).catch(()=>(Jl.set(e.id,null),null)),J_.set(e.id,o)),o})}const J9=hl(0);Gg=()=>{J9.value++},X9(Y9);const Q9={"":"",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 Pv(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=Q9[n])!=null?t:n}function dpe(e){const t=Pv(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function fpe(e){return(function(s){const o=Kg.get(Z_);if(!o)return;const i=o.core[s];if(i)return i;const r=Jl.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!Jl.has(o.id)&&Z9(o)})(Pv(e))||((n=(t=Kg.get(Z_))==null?void 0:t.fallback)!=null?n:"");var t,n}const hpe={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 YT=!1;function ppe(){return YT}function mpe(){YT=!0}var Ah=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let no=null,Ld=!1,Eh=Dv;function $h(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Rv(){try{const e=globalThis;return $h(e?.katex)}catch{return null}}function Dv(){return Ah(null,null,function*(){const e=Rv();if(e)return e;const t=yield oo(()=>import("./katex-HP8lGamR.js"),[]);try{yield oo(()=>import("./mhchem-KEf2LMH_.js"),__vite__mapDeps([0,1]))}catch{}return $h(t)})}function eH(e){Eh=e,no=null,Ld=!1}function tH(e){eH(Dv)}function XT(){return typeof Eh=="function"}function gpe(){var e;const t=Eh;if(!t||t===Dv)return null;if(no)return no;const n=Rv();if(n)return no=n,no;try{const s=t();return s&&typeof s?.then!="function"?(no=(e=$h(s))!=null?e:s,no):null}catch{return null}}function Bv(){return Ah(this,null,function*(){var e;const t=Rv();if(t)return no=t,no;if(no)return no;if(Ld)return null;const n=Eh;if(!n)return Ld=!0,null;try{const s=yield n();if(s)return no=(e=$h(s))!=null?e:s,no}catch{}return Ld=!0,null})}function ZT(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Fl=null;const JT=new Map,hc=new Map;let QT=5;const nl=new Set;function nH(){if(JT.size<QT&&nl.size){const e=Array.from(nl);nl.clear();for(const t of e)try{t()}catch{}}}function sH(e,t=!0,n=2e3,s){return Ah(this,null,function*(){performance.now();const o=ZT(e);if(!XT()){const l=new Error("KaTeX rendering disabled");return l.name="KaTeXDisabled",l.code="KATEX_DISABLED",Promise.reject(l)}if(Fl)return Promise.reject(Fl);const i=`${t?"d":"i"}:${o}`,r=hc.get(i);return r?Promise.resolve(r):(Fl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Fl.name="WorkerInitError",Fl.code="WORKER_INIT_ERROR",Promise.reject(Fl))})}function vpe(e,t=!0,n){const s=`${t?"d":"i"}:${ZT(e)}`;if(hc.set(s,n),hc.size>200){const o=hc.keys().next().value;hc.delete(o)}}const oH="WORKER_BUSY";function iH(e=2e3,t){return JT.size<QT?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),nl.delete(r),n())};if(nl.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,nl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>nH()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),nl.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const ic={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function ype(e){return Ah(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!XT()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=s.timeout)!=null?o:ic.timeout,c=(i=s.waitTimeout)!=null?i:ic.waitTimeout,u=(r=s.backoffMs)!=null?r:ic.backoffMs,d=(l=s.maxRetries)!=null?l:ic.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):ic.maxRetries,h=s.signal;let p=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield sH(t,n,a,h)}catch(g){if(g?.code!==oH||p>=f)throw g;if(p++,yield iH(c,h).catch(()=>{}),h?.aborted){const S=new Error("Aborted");throw S.name="AbortError",S}u>0&&(yield new Promise(S=>globalThis.setTimeout(S,u*p)))}}})}function Ql(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function rH(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function Yg(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=rH(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function Xg(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 eM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function Zg(e,t=360,n=500){return eM(e,t,n)}function Jg(e,t=360,n=500){return eM(e,t,n)}var lH=Object.defineProperty,aH=Object.defineProperties,cH=Object.getOwnPropertyDescriptors,Q_=Object.getOwnPropertySymbols,uH=Object.prototype.hasOwnProperty,dH=Object.prototype.propertyIsEnumerable,ew=(e,t,n)=>t in e?lH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qe=(e,t)=>{for(var n in t||(t={}))uH.call(t,n)&&ew(e,n,t[n]);if(Q_)for(var n of Q_(t))dH.call(t,n)&&ew(e,n,t[n]);return e},wt=(e,t)=>aH(e,cH(t)),Cn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const fH="__global__",xm="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Qg=(()=>{const e=globalThis;if(e[xm])return e[xm];const t={scopedCustomComponents:{},revision:hl(0)};return e[xm]=t,t})(),tw=Qg.revision,hH=Symbol("markstreamCustomComponents"),pH=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 vu(e){return pH.has(String(e).trim().toLowerCase())}function mH(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Tm(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([Oo(n),Oo(mH(n))]))!o||vu(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function Vn(e){const t=Dt(hH,null);return F(()=>{var n;return tw.value,(function(s,o={}){return tw.value,Qe(Qe(Qe({},Tm(Qg.scopedCustomComponents[fH]||{})),Tm(o)),Tm((function(i){return i&&Qg.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const gH=["aria-label"],vH={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"},yH={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"},en=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},lo=en(Xe({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(x(),$("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(x(),$("svg",yH,[...n[1]||(n[1]=[m("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),m("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(x(),$("svg",vH,[...n[0]||(n[0]=[m("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,gH))}),[["__scopeId","data-v-be21ab83"]]);lo.install=e=>{e.component(lo.__name,lo)};const kH={class:"emoji-node"},Us=en(Xe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(x(),$("span",kH,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Us.install=e=>{e.component(Us.__name,Us)};const bH=["id"],_H=["title"],ao=en(Xe({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(x(),$("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[m("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,_H)],8,bH))}}),[["__scopeId","data-v-c1463a29"]]);ao.install=e=>{e.component(ao.__name,ao)};const tM=(()=>{try{return!1}catch{}return!1})();function Mm(e){tM&&console.warn(e)}function nw(e,t="safe",n){return Lv(e,t,n)}function nM(e){return d9(e)}function Am(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function Fv(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=zg((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),Am(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Am(r.value)]):Object.entries(o).map(([r,l])=>[r,Am(l)]):null,t,n);var o;if(!s)return;const i=nM(Of(s));return Object.keys(i).length>0?i:void 0}function sw(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function rc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Em(e,t,n,s,o,i,r=!1){const l=(function(d,f){return FT(d,f)})(e,s);if(pu.has(e.toLowerCase())||!l&&RT(e,i))return null;if(!l&&Nv(e,i))return r?[sw(e,t,!0)]:[sw(e,t),...n,`</${e}>`];const a=Lv(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],f=nM(a);return Jt(d,wt(Qe({},f),{key:u}),n.length>0?n:void 0)}return Jt(e,wt(Qe({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function sM(e,t){return m9(e,t)}function Rf(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=Em(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);rc(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(),g=Em(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?rc(c[c.length-1].children,g):rc(u,g),p.tagName.toLowerCase()!==f&&c.length>h&&Mm(`Auto-closing unclosed tag: <${p.tagName}>`)}else Mm(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=Em(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?rc(c[c.length-1].children,f):rc(u,f),Mm(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(f9(e),t,n)}catch(o){return s=o,tM&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const wH=["innerHTML"],co=en(Xe({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Dt("markstreamHtmlPolicy",void 0),s=F(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=Vn(()=>t.customId),i=Xe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=F(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:pa(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Rf(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!sM(l,o.value))return{mode:"html",content:pa(l,s.value)};const a=Rf(l,o.value,s.value);return a===null?{mode:"html",content:pa(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(x(),$("span",{key:0,class:Oe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[gt(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(x(),$("span",{key:1,class:Oe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(x(),$("span",{key:2,class:Oe(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,wH))}}),[["__scopeId","data-v-d17f12b0"]]);co.install=e=>{e.component(co.__name,co)};const SH={class:"inline-code"},CH={key:0},Cs=en(Xe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=uu(),s=Dt("markstreamFade",void 0),o=Dt("markstreamTextStreamState",void 0),i=Dt("markstreamStreamVersion",void 0),r=F(()=>{const y=n.fade;return y===""||y===!0||y==="true"||y!==!1&&y!=="false"&&void 0}),l=F(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=F(()=>{var y;return String((y=t.node.code)!=null?y:"")}),c=F(()=>!l.value),u=F(()=>{var y;const b=(y=n["index-key"])!=null?y:n.indexKey;return b==null||b===""?"":String(b)}),d=te(t.node.code),f=te("");let h=i?.value;const p=te(0);function g(){return d.value+f.value}function S(){f.value&&(d.value=g(),f.value="")}Ve([()=>t.node.code,u,l,()=>i?.value],([y,b,v,w])=>{const N=String(y??""),E=u.value,k=w!==h;h=w;const A=jT({nextContent:N,persistedContent:E?o?.get(E):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:k});d.value=A.settledContent,f.value=A.streamedDelta,A.appended&&(p.value+=1),E&&o?.set(E,N)},{immediate:!0}),Ve(l,y=>{var b;y||(b=g(),d.value=b,f.value="")});const _=F(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(y,b)=>(x(),$("code",SH,[c.value?(x(),$(Pe,{key:0},[dt(O(a.value),1)],64)):(x(),$(Pe,{key:1},[d.value?(x(),$("span",CH,O(d.value),1)):ie("",!0),f.value?(x(),$("span",{key:1,class:Oe(["inline-code-stream-delta",[_.value]]),onAnimationend:S},O(f.value),35)):ie("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);Cs.install=e=>{e.component(Cs.__name,Cs)};const e1=te(!1),ow=te(""),iw=te("top"),Ec=te(null),$c=te(null),t1=te(null),n1=te(null),rw=te(null);let Od=null,Pd=null,s1=0;function oM(){Od&&(clearTimeout(Od),Od=null),Pd&&(clearTimeout(Pd),Pd=null)}let pd=!1,md=null,lw=!1;function xH(e,t,n="top",s=!1,o,i){if(!e)return;const r=++s1;oM();const l=()=>Cn(null,null,function*(){var a,c;if(yield(function(){return Cn(this,null,function*(){if(!pd&&!lw&&typeof document<"u"){md!=null||(md=Cn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([oo(()=>import("./vue.runtime.esm-bundler-DNelV8ct.js"),[]),oo(()=>import("./Tooltip-D4SNb85I.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:e1.value,"anchor-el":Ec.value,content:ow.value,placement:iw.value,id:$c.value,originX:t1.value,originY:n1.value,isDark:(p=rw.value)!=null?p:void 0})}}).mount(h),pd=!0}));try{yield md}catch(u){pd=!1,md=null,lw=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),pd&&r===s1){$c.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Ec.value=e,ow.value=t,iw.value=n,t1.value=(a=o?.x)!=null?a:null,n1.value=(c=o?.y)!=null?c:null,rw.value=typeof i=="boolean"?i:null,e1.value=!0;try{e.setAttribute("aria-describedby",$c.value)}catch{}}});s?l():Od=setTimeout(l,80)}function TH(e=!1){s1+=1,oM();const t=()=>{if(Ec.value&&$c.value)try{Ec.value.removeAttribute("aria-describedby")}catch{}e1.value=!1,Ec.value=null,$c.value=null,t1.value=null,n1.value=null};e?t():Pd=setTimeout(t,120)}const o1={"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..."},i1=e=>{var t;return(t=o1[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function aw(e){return{t(t){if(e.te&&o1[t]&&!e.te(t))return i1(t);const n=e.t(t);return n===t&&o1[t]?i1(t):n}}}function MH(){const e=(function(){var t,n;try{const s=ds(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return aw(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return aw({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:i1}}function AH(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const EH=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],$H={key:1,class:"image-placeholder"},IH={key:1,class:"image-node__raw-text"},NH={key:0,class:"image-shimmer-overlay"},LH={key:1,class:"image-node__raw-text"},OH={key:2,class:"image-error"},mr=en(Xe({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=te(!1),i=te(!1),r=te(""),l=te("primary"),a=te(null),c=uu(),u=Dt(Vg,null);let d="",f=null;const h=F(()=>Kb(n.node.src)),p=F(()=>Kb(n.fallbackSrc)),g=F(()=>r.value),S=F(()=>!n.lazy),_=F(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),y=F(()=>l.value==="failed"),b=F(()=>!S.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),v=F(()=>AH(n,c));function w(R=v.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function N(R=v.value){R&&ft(()=>{w(R)})}function E(){f&&(clearTimeout(f),f=null)}function k(){const R=v.value;R&&d!==R&&(d&&u?.markSettled(d),E(),d=R,u?.markPending(R),typeof window<"u"&&(f=window.setTimeout(()=>{d===R&&(N(R),A())},8e3)))}function A(){return Cn(this,null,function*(){const R=d;R&&(E(),d="",yield ft(),w(R),u?.markSettled(R))})}function I(){if(l.value==="primary"&&p.value&&p.value!==r.value)return l.value="fallback",r.value=p.value,o.value=!1,i.value=!1,void N();l.value="failed",i.value=!0,s("error",r.value),N()}function P(){o.value=!0,i.value=!1,s("load",g.value),N()}function M(R){R.preventDefault(),o.value&&!i.value&&s("click",[R,g.value])}const{t:L}=MH();return Ve([h,p,()=>n.node.loading],()=>(o.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}),Ve([_,o,i,g,()=>n.lazy],([R,B,W,K,V])=>R&&K&&!W?B?(A(),void N()):V?(k(),void N()):void(B||W||k()):(A(),void N()),{flush:"post",immediate:!0}),Ks(()=>{(function(){const R=d;R&&(E(),d="",u?.markSettled(R))})()}),(R,B)=>{var W,K,V,se,Y;return x(),$("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[_.value?(x(),$("img",{key:0,src:g.value,alt:String((K=(W=n.node.alt)!=null?W:n.node.title)!=null?K:""),title:String((se=(V=n.node.title)!=null?V:n.node.alt)!=null?se:""),class:Oe(["image-node__img",{"is-loading":!S.value&&!o.value,"is-loaded":S.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:S.value?"high":void 0,decoding:S.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(Y=n.node.alt)!=null?Y:C(L)("image.preview"),onError:I,onLoad:P,onClick:M},null,42,EH)):ie("",!0),e.node.loading&&!i.value?(x(),$("span",$H,[n.usePlaceholder?ia(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[0]||(B[0]=m("span",{class:"image-shimmer"},null,-1))],!0):(x(),$("span",IH,O(e.node.raw),1))])):ie("",!0),gt(Pi,{name:"shimmer-fade"},{default:Ln(()=>[b.value&&!e.node.loading?(x(),$("span",NH,[n.usePlaceholder?ia(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[1]||(B[1]=m("span",{class:"image-shimmer"},null,-1))],!0):(x(),$("span",LH,O(e.node.raw),1))])):ie("",!0)]),_:3}),y.value?(x(),$("span",OH,[ia(R.$slots,"error",{node:n.node,displaySrc:g.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[2]||(B[2]=m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[m("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)),m("span",null,O(C(L)("image.loadError")),1)],!0)])):ie("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);mr.install=e=>{e.component(mr.__name,mr)};const PH={key:2},ai=Xe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Vn(()=>t.customId),s=Dt("markstreamHtmlPolicy",void 0),o=Dt("markstreamNestedRendererProps",void 0),i=F(()=>{var p;return(p=s?.value)!=null?p:"safe"}),r=F(()=>{var p,g;const S=(p=o?.value)!=null?p:{};return wt(Qe({},S),{customId:(g=t.customId)!=null?g:S.customId,htmlPolicy:i.value})}),l=ii({loader:()=>Promise.resolve().then(()=>Vv),suspensible:!1}),a=F(()=>t.components[String(t.node.type)]),c=F(()=>!!(a.value&&n.value[t.node.type]&&!vu(String(t.node.type)))),u=F(()=>c.value?Fv(t.node,i.value):void 0),d=F(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=F(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=F(()=>{var p,g;return String((g=(p=t.node.content)!=null?p:t.node.raw)!=null?g:"")});return(p,g)=>a.value&&c.value?(x(),je(_s(a.value),tn({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:Ln(()=>[d.value?(x(),je(C(l),tn({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?(x(),je(C(l),tn({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?(x(),je(_s(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(x(),$("span",PH,O(h.value),1)):ie("",!0)}}),RH=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],DH={key:0,translate:"no",class:"markstream-pre__diff-code"},BH={class:"markstream-pre__diff-number","aria-hidden":"true"},FH={class:"markstream-pre__diff-content"},HH={class:"markstream-pre__diff-content-inner"},WH={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},UH=["textContent"],Qs=Xe({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=F(()=>{var M,L,R;const B=String((L=(M=t.node)==null?void 0:M.language)!=null?L:"");return String((R=String(B).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=F(()=>`language-${n.value}`),o=F(()=>{var M,L,R,B,W;return((M=t.node)==null?void 0:M.diff)===!0?String((R=(L=t.node)==null?void 0:L.code)!=null?R:""):(function(K,V){const se=String(K??"");return V?se:se.replace(/\r\n$|\n$|\r$/,"")})((B=t.node)==null?void 0:B.code,((W=t.node)==null?void 0:W.loading)===!0)}),i=F(()=>o.value.split(/\r\n|\n|\r/)),r=F(()=>Array.from({length:Math.max(1,i.value.length)},(M,L)=>L+1)),l=F(()=>{var M;return t.showLineNumbers===!0&&((M=t.node)==null?void 0:M.diff)===!0}),a=F(()=>l.value&&t.diffInline===!0),c=F(()=>{const M=Number(t.reservedHeightPx);if(!Number.isFinite(M)||M<=0)return;const L=`${Math.ceil(M)}px`;return{height:L,minHeight:L,maxHeight:L,overflow:"auto"}});function u(M){return String(M??"").trim().length===0}function d(M,L="context",R={}){const B=u(M);return{code:M,kind:B&&L!=="hunk"&&!R.preserveBlankKind?"context":L,empty:B}}function f(M){const L=String(M??"");return L?L.split(/\r\n|\n|\r/):[]}function h(M,L){return!u(M[L])||L<M.length-1}function p(M){return M.startsWith("-")&&!M.startsWith("---")}function g(M){return M.startsWith("+")&&!M.startsWith("+++")}function S(M,L){const R=f(M),B=f(L),W=(function(ee,we){const de=ee.length,Le=we.length;if((de+1)*(Le+1)>15e5)return null;const ce=Le+1,_e=new Uint32Array((de+1)*(Le+1));for(let ye=1;ye<=de;ye++)for(let Se=1;Se<=Le;Se++){const U=ye*ce+Se;if(ee[ye-1]===we[Se-1])_e[U]=_e[(ye-1)*ce+(Se-1)]+1;else{const Z=_e[(ye-1)*ce+Se],fe=_e[ye*ce+(Se-1)];_e[U]=Z>=fe?Z:fe}}const me=[];let $e=de,J=Le;for(;$e>0&&J>0;)ee[$e-1]===we[J-1]?(me.push({originalIndex:$e-1,modifiedIndex:J-1}),$e--,J--):_e[($e-1)*ce+J]>=_e[$e*ce+(J-1)]?$e--:J--;return me.reverse(),me})(R,B);if(W){const ee=[];let we=0,de=0;for(const Le of W){for(;we<Le.originalIndex;)ee.push(wt(Qe({},d(R[we],"removed",{preserveBlankKind:h(R,we)})),{key:`inline-removed-source-${we}`,number:""})),we++;for(;de<Le.modifiedIndex;)ee.push(wt(Qe({},d(B[de],"added",{preserveBlankKind:h(B,de)})),{key:`inline-added-source-${de}`,number:de+1})),de++;ee.push(wt(Qe({},d(B[Le.modifiedIndex])),{key:`inline-context-source-${Le.originalIndex}-${Le.modifiedIndex}`,number:Le.modifiedIndex+1})),we=Le.originalIndex+1,de=Le.modifiedIndex+1}for(;we<R.length;)ee.push(wt(Qe({},d(R[we],"removed",{preserveBlankKind:h(R,we)})),{key:`inline-removed-source-${we}`,number:""})),we++;for(;de<B.length;)ee.push(wt(Qe({},d(B[de],"added",{preserveBlankKind:h(B,de)})),{key:`inline-added-source-${de}`,number:de+1})),de++;return ee}const K=[];let V=0,se=R.length-1,Y=B.length-1;for(;V<=se&&V<=Y&&R[V]===B[V];)K.push(wt(Qe({},d(B[V])),{key:`inline-prefix-${V}`,number:V+1})),V++;const G=[];for(;se>=V&&Y>=V&&R[se]===B[Y];)G.unshift(wt(Qe({},d(B[Y])),{key:`inline-suffix-${Y}`,number:Y+1})),se--,Y--;for(let ee=V;ee<=se;ee++)K.push(wt(Qe({},d(R[ee],"removed",{preserveBlankKind:h(R,ee)})),{key:`inline-removed-source-${ee}`,number:""}));for(let ee=V;ee<=Y;ee++)K.push(wt(Qe({},d(B[ee],"added",{preserveBlankKind:h(B,ee)})),{key:`inline-added-source-${ee}`,number:ee+1}));return K.concat(G)}const _=F(()=>{var M,L,R,B;const W=(function(Y){const G=Y.some(we=>p(we)),ee=Y.some(we=>g(we));return G&&ee||(function(){var we,de,Le,ce;if(n.value==="diff")return!0;const _e=(ce=(Le=String((de=(we=t.node)==null?void 0:we.raw)!=null?de:"").split(/\r?\n/,1)[0])==null?void 0:Le.trim())!=null?ce:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(_e)})()&&(G||ee)})(i.value),K=(function(){var Y,G;return((Y=t.node)==null?void 0:Y.originalCode)!=null||((G=t.node)==null?void 0:G.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:W?(function(Y){const G=[];let ee=1;for(const[we,de]of Y.entries())if(de.startsWith("@@"))G.push(wt(Qe({},d(de,"hunk")),{key:`inline-hunk-${we}`,number:""}));else if(p(de))G.push(wt(Qe({},d(de.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${we}`,number:""}));else if(g(de))G.push(wt(Qe({},d(de.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${we}`,number:ee++}));else{const Le=de.startsWith(" ")?de.slice(1):de;G.push(wt(Qe({},d(Le)),{key:`inline-context-${we}`,number:ee})),ee++}return G})(i.value):S((M=t.node)==null?void 0:M.originalCode,(L=t.node)==null?void 0:L.updatedCode)}];if(!W&&K){const Y=f((R=t.node)==null?void 0:R.originalCode),G=f((B=t.node)==null?void 0:B.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:Y.map((ee,we)=>{const de=G[we]===ee?"context":"removed";return wt(Qe({},d(ee,de,{preserveBlankKind:h(Y,we)})),{key:`original-${we}`,number:we+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:G.map((ee,we)=>{const de=Y[we]===ee?"context":"added";return wt(Qe({},d(ee,de,{preserveBlankKind:h(G,we)})),{key:`modified-${we}`,number:we+1})})}]}const V=[],se=[];for(const Y of i.value)if(Y.startsWith("@@"))V.push(d(Y,"hunk")),se.push(d(Y,"hunk"));else if(Y.startsWith("-")&&!Y.startsWith("---"))V.push(d(Y.slice(1),"removed",{preserveBlankKind:!0}));else if(Y.startsWith("+")&&!Y.startsWith("+++"))se.push(d(Y.slice(1),"added",{preserveBlankKind:!0}));else{const G=Y.startsWith(" ")?Y.slice(1):Y;V.push(d(G)),se.push(d(G))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:V.map((Y,G)=>wt(Qe({},Y),{key:`original-${G}`,number:G+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:se.map((Y,G)=>wt(Qe({},Y),{key:`modified-${G}`,number:G+1}))}]}),y=F(()=>{const M=n.value;return M?`Code block: ${M}`:"Code block"}),b=te(null),v=te([]);let w=null,N=null;function E(M){const L=Number.parseFloat(String(M??""));return Number.isFinite(L)&&L>0?L:0}function k(M,L){var R;if(!M)return L;const B=M.querySelector(".markstream-pre__diff-content"),W=B?.getBoundingClientRect(),K=(R=W?.height)!=null?R:0;return Math.max(L,Math.ceil(K))}function A(){typeof window<"u"&&(w!=null&&window.cancelAnimationFrame(w),w=window.requestAnimationFrame(()=>{(function(){var M,L;w=null;const R=b.value;if(!R||!l.value)return void(v.value.length&&(v.value=[]));const B=(function(ee){const we=window.getComputedStyle(ee),de=E(we.getPropertyValue("--markstream-pre-diff-line-height"));if(de>0)return de;const Le=E(we.lineHeight);return Le>0?Le:18})(R),W=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),K=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),V=Math.max(W.length,K.length),se=[];for(let ee=0;ee<V;ee++){const we=k((M=W[ee])!=null?M:null,B),de=k((L=K[ee])!=null?L:null,B),Le=Math.max(B,we,de);se.push({rowHeight:Le,originalHeight:we,modifiedHeight:de})}var Y,G;Y=v.value,G=se,Y.length===G.length&&Y.every((ee,we)=>{const de=G[we];return de&&Math.abs(ee.rowHeight-de.rowHeight)<=.5&&Math.abs(ee.originalHeight-de.originalHeight)<=.5&&Math.abs(ee.modifiedHeight-de.modifiedHeight)<=.5})||(v.value=se)})()}))}function I(M){N?.disconnect(),N=null,M&&l.value&&typeof ResizeObserver<"u"&&(N=new ResizeObserver(()=>{A()}),N.observe(M))}function P(M,L){const R=v.value[M];if(!R)return;const B=L==="original"?R.originalHeight:R.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(R.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(B)}px`}}return Ve(b,M=>{I(M),ft(()=>A())},{flush:"post"}),Ve([l,_],()=>{I(b.value),ft(()=>A())},{flush:"post",immediate:!0}),Ks(()=>{w!=null&&(window.cancelAnimationFrame(w),w=null),N?.disconnect(),N=null}),(M,L)=>(x(),$("pre",{ref_key:"preRef",ref:b,style:Ft(c.value),class:Oe([s.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":y.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(x(),$("code",DH,[(x(!0),$(Pe,null,Ye(_.value,R=>(x(),$("span",{key:R.key,class:Oe(["markstream-pre__diff-pane",R.className])},[(x(!0),$(Pe,null,Ye(R.lines,(B,W)=>(x(),$("span",{key:B.key,class:Oe(["markstream-pre__diff-line",[`markstream-pre__diff-line--${B.kind}`,{"markstream-pre__diff-line--empty":B.empty}]]),style:Ft(P(W,R.key))},[L[0]||(L[0]=m("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),m("span",BH,O(B.number),1),m("span",FH,[m("span",HH,O(B.code),1)])],6))),128))],2))),128))])):(x(),$(Pe,{key:1},[t.showLineNumbers?(x(),$("span",WH,[(x(!0),$(Pe,null,Ye(r.value,R=>(x(),$("span",{key:R,class:"markstream-pre__line-number"},O(R),1))),128))])):ie("",!0),m("code",{translate:"no",class:"markstream-pre__code",textContent:O(o.value)},null,8,UH)],64))],14,RH))}});Qs.install=e=>{e.component(Qs.__name,Qs)};const $m=hl(!1);let cw=null;const jH={key:0},On=en(Xe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(cw||(cw=Bv().then(_=>{$m.value=!!_}).catch(()=>{$m.value=!1})),Kd($m)),s=uu(),o=Dt("markstreamFade",void 0),i=Dt("markstreamTextStreamState",void 0),r=Dt("markstreamStreamVersion",void 0),l=F(()=>{const _=s.fade;return _===""||_===!0||_==="true"||_!==!1&&_!=="false"&&void 0}),a=F(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=F(()=>{var _;const y=(_=s["index-key"])!=null?_:s.indexKey;return y==null||y===""?"":String(y)}),u=te(t.node.content),d=te("");let f=r?.value;const h=te(0);function p(){return u.value+d.value}function g(){d.value&&(u.value=p(),d.value="")}Ve([()=>t.node.content,c,a,()=>r?.value],([_,y,b,v])=>{const w=String(_??""),N=c.value,E=v!==f;f=v;const k=jT({nextContent:w,persistedContent:N?i?.get(N):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:E});u.value=k.settledContent,d.value=k.streamedDelta,k.appended&&(h.value+=1),N&&i?.set(N,w)},{immediate:!0}),Ve(a,_=>{var y;_||(y=p(),u.value=y,d.value="")});const S=F(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(_,y)=>(x(),$("span",{class:Oe([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(x(),$("span",jH,O(u.value),1)):ie("",!0),d.value?(x(),$("span",{key:1,class:Oe(["text-node-stream-delta",[S.value]]),onAnimationend:g},O(d.value),35)):ie("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);On.install=e=>{e.component(On.__name,On)};const iM=Xe({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return Jt(Qs,wt(Qe({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),Im=ii({loader:()=>Cn(null,null,function*(){try{return(yield oo(()=>import("./CodeBlockNode-Ds9FDojm.js"),__vite__mapDeps([2,3,4]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),Qs}}),loadingComponent:iM,delay:0,suspensible:!1}),qo=ii(()=>Cn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return Jt(On,wt(Qe({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield Bv())return(yield oo(()=>import("./index6-Dd2WDK6a.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return Jt(On,wt(Qe({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),rM=ii(()=>Cn(null,null,function*(){try{if(yield Bv())return(yield oo(()=>import("./index5-6RR-0mhw.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return Jt(On,wt(Qe({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),Is=en(Xe({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(x(),$("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Is.install=e=>{e.component(Is.__name,Is)};const qH={class:"superscript-node"},js=en(Xe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Vn(()=>t.customId),s=F(()=>Qe({text:On,inline_code:Cs,link:Os,html_inline:co,strong:Ns,emphasis:Ps,footnote_reference:ao,strikethrough:Ls,highlight:uo,insert:zs,subscript:qs,emoji:Us,math_inline:qo,reference:Is},n.value));return(o,i)=>(x(),$("sup",qH,[(x(!0),$(Pe,null,Ye(e.node.children,(r,l)=>(x(),je(C(ai),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);js.install=e=>{e.component(js.__name,js)};const zH={class:"subscript-node"},qs=en(Xe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Vn(()=>t.customId),s=F(()=>Qe({text:On,inline_code:Cs,link:Os,html_inline:co,strong:Ns,emphasis:Ps,footnote_reference:ao,strikethrough:Ls,highlight:uo,insert:zs,superscript:js,emoji:Us,math_inline:qo,reference:Is},n.value));return(o,i)=>(x(),$("sub",zH,[(x(!0),$(Pe,null,Ye(e.node.children,(r,l)=>(x(),je(C(ai),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);qs.install=e=>{e.component(qs.__name,qs)};const VH={class:"strong-node"},Ns=en(Xe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Vn(()=>t.customId),s=F(()=>Qe({text:On,inline_code:Cs,link:Os,html_inline:co,emphasis:Ps,strikethrough:Ls,highlight:uo,insert:zs,subscript:qs,superscript:js,emoji:Us,footnote_reference:ao,math_inline:qo,reference:Is},n.value));return(o,i)=>(x(),$("strong",VH,[(x(!0),$(Pe,null,Ye(e.node.children,(r,l)=>(x(),je(C(ai),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Ns.install=e=>{e.component(Ns.__name,Ns)};const KH={class:"strikethrough-node"},Ls=en(Xe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Vn(()=>t.customId),s=F(()=>Qe({text:On,inline_code:Cs,link:Os,html_inline:co,strong:Ns,emphasis:Ps,highlight:uo,insert:zs,subscript:qs,superscript:js,emoji:Us,footnote_reference:ao,math_inline:qo,reference:Is},n.value));return(o,i)=>(x(),$("del",KH,[(x(!0),$(Pe,null,Ye(e.node.children,(r,l)=>(x(),je(C(ai),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);Ls.install=e=>{e.component(Ls.__name,Ls)};const GH=["href","title","aria-label","aria-hidden","target","rel"],YH=["aria-hidden"],XH={class:"link-text-wrapper relative inline-flex"},ZH={class:"leading-[normal] link-text"},Os=en(Xe({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Dt("markstreamShowTooltips",void 0),s=F(()=>{const _=n?.value;return typeof _=="boolean"?_:t.showTooltip}),o=F(()=>{var _,y,b,v,w;const N=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",E=(_=t.animationOpacity)!=null?_:.35,k=Math.max(.12,Math.min(.5*E,E)),A={"--underline-height":`${(y=t.underlineHeight)!=null?y:2}px`,"--underline-bottom":N,"--underline-opacity":String(E),"--underline-rest-opacity":String(k),"--underline-duration":`${(b=t.animationDuration)!=null?b:1.6}s`,"--underline-timing":(v=t.animationTiming)!=null?v:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(w=t.animationIteration)!=null?w:"infinite"};return t.color&&(A["--link-color"]=t.color),A}),i=Vn(()=>t.customId),r=F(()=>Qe({text:On,strong:Ns,strikethrough:Ls,emphasis:Ps,image:mr,html_inline:co,inline_code:Cs},i.value)),l=uu(),a=F(()=>{var _,y;const b=(_=t.node)==null?void 0:_.attrs;if(!b||typeof b!="object")return{};const v={};if(Array.isArray(b))for(const w of b)Array.isArray(w)&&w[0]&&(v[String(w[0])]=String((y=w[1])!=null?y:""));else for(const[w,N]of Object.entries(b))w&&N!=null&&N!==!1&&(v[w]=N===!0?"":String(N));return nw(v,"safe","a")}),c=F(()=>Qe(Qe({},l),a.value)),u=F(()=>{var _,y;return nw({href:String((y=(_=t.node)==null?void 0:_.href)!=null?y:"")},"safe","a").href}),d=F(()=>{if(!u.value)return;const _=c.value.target;return(typeof _=="string"?_.trim():String(_??"").trim())||(t7(u.value)?"_blank":void 0)}),f=F(()=>{var _;return String((_=d.value)!=null?_:"").trim().toLowerCase()==="_blank"}),h=F(()=>{if(!u.value)return;const _=c.value.rel,y=new Set((typeof _=="string"?_:String(_??"")).split(/\s+/).filter(Boolean)),b=new Set(Array.from(y).filter(v=>v.toLowerCase()!=="opener"));return f.value&&(b.add("noopener"),b.add("noreferrer")),b.size>0?Array.from(b).join(" "):void 0}),p=F(()=>{const _=Qe({},c.value);return delete _.title,delete _.href,delete _.target,delete _.rel,_});function g(){s.value&&TH()}const S=F(()=>{var _,y;const b=(_=t.node)==null?void 0:_.title;return typeof b=="string"&&b.trim().length>0?b:String((y=u.value)!=null?y:"")});return(_,y)=>{var b,v;return e.node.loading?(x(),$("span",tn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:o.value}),[m("span",XH,[m("span",ZH,[gt(C(On),{class:"leading-[normal] link-text",node:{type:"text",content:String((b=e.node.text)!=null?b:""),raw:String((v=e.node.text)!=null?v:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),y[1]||(y[1]=m("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,YH)):(x(),$("a",tn({key:0,class:"link-node",href:u.value,title:s.value?"":S.value,"aria-label":`Link: ${S.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:o.value,onMouseenter:y[0]||(y[0]=w=>(function(N){var E,k,A,I;if(!s.value)return;const P=N,M=P?.clientX!=null&&P?.clientY!=null?{x:P.clientX,y:P.clientY}:void 0,L=((E=t.node)==null?void 0:E.title)||((k=u.value)!=null&&k.includes("xn--")&&((I=(A=t.node)==null?void 0:A.text)!=null&&I.includes("://"))?t.node.text:u.value)||"";xH(N.currentTarget,L,"top",!1,M)})(w)),onMouseleave:g}),[(x(!0),$(Pe,null,Ye(e.node.children,(w,N)=>(x(),je(C(ai),{key:`${e.indexKey||"emphasis"}-${N}`,components:r.value,node:w,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${N}`},null,8,["components","node","custom-id","index-key"]))),128))],16,GH))}}}),[["__scopeId","data-v-367e6ca4"]]);Os.install=e=>{e.component(Os.__name,Os)};const JH={class:"insert-node"},zs=en(Xe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Vn(()=>t.customId),s=F(()=>Qe({text:On,inline_code:Cs,link:Os,html_inline:co,strong:Ns,emphasis:Ps,strikethrough:Ls,highlight:uo,subscript:qs,superscript:js,emoji:Us,footnote_reference:ao,math_inline:qo,reference:Is},n.value));return(o,i)=>(x(),$("ins",JH,[(x(!0),$(Pe,null,Ye(e.node.children,(r,l)=>(x(),je(C(ai),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);zs.install=e=>{e.component(zs.__name,zs)};const QH={class:"highlight-node"},uo=en(Xe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Vn(()=>t.customId),s=F(()=>Qe({text:On,inline_code:Cs,link:Os,html_inline:co,strong:Ns,emphasis:Ps,strikethrough:Ls,insert:zs,subscript:qs,superscript:js,emoji:Us,footnote_reference:ao,math_inline:qo,reference:Is},n.value));return(o,i)=>(x(),$("mark",QH,[(x(!0),$(Pe,null,Ye(e.node.children,(r,l)=>(x(),je(C(ai),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);uo.install=e=>{e.component(uo.__name,uo)};const eW={class:"emphasis-node"},Ps=en(Xe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Vn(()=>t.customId),s=F(()=>Qe({text:On,inline_code:Cs,link:Os,html_inline:co,strong:Ns,strikethrough:Ls,highlight:uo,insert:zs,subscript:qs,superscript:js,emoji:Us,footnote_reference:ao,math_inline:qo,reference:Is},n.value));return(o,i)=>(x(),$("em",eW,[(x(!0),$(Pe,null,Ye(e.node.children,(r,l)=>(x(),je(C(ai),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Ps.install=e=>{e.component(Ps.__name,Ps)};const tW={class:"hard-break"},gr=en(Xe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(x(),$("br",tW))}),[["__scopeId","data-v-50c58f70"]]);gr.install=e=>{e.component(gr.__name,gr)};const tu=Xe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=cr({checkbox:lo,checkbox_input:lo,emoji:Us,emphasis:Ps,hardbreak:gr,highlight:uo,inline_code:Cs,insert:zs,link:Os,reference:Is,strikethrough:Ls,strong:Ns,subscript:qs,superscript:js,text:On}),s=Vn(()=>t.customId),o=F(()=>{const i=s.value;return Object.keys(i).length>0?Qe(Qe({},n),i):n});return(i,r)=>(x(!0),$(Pe,null,Ye(e.nodes,(l,a)=>(x(),je(C(ai),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function r1(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(r1)}function Df(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(r1))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(r1)?o:null}function Sa(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const nW=["cite"],sW={key:0,dir:"auto",class:"paragraph-node"},oW=["custom-id"],Rd=en(Xe({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Vn(()=>t.customId),s=F(()=>!!n.value.paragraph),o=F(()=>!!n.value.text),i=F(()=>Df(t.node.children,!s.value)),r=F(()=>t.fade!==!1||o.value?null:Sa(i.value));return kn("markstreamShowTooltips",F(()=>t.showTooltips)),kn("markstreamFade",F(()=>t.fade)),(l,a)=>(x(),$("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(x(),$("p",sW,[r.value!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,oW)):(x(),je(C(tu),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(x(),je(C(Vs),{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,nW))}}),[["__scopeId","data-v-abfecebc"]]);Rd.install=e=>{e.component(Rd.__name,Rd)};const iW={class:"definition-list"},rW={class:"definition-term"},lW={class:"definition-desc"},Dd=en(Xe({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(x(),$("dl",iW,[(x(!0),$(Pe,null,Ye(t.node.items,(o,i)=>(x(),$(Pe,{key:i},[m("dt",rW,[gt(C(Vs),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),m("dd",lW,[gt(C(Vs),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Dd.install=e=>{e.component(Dd.__name,Dd)};const aW=["href","title"],Ic=en(Xe({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(x(),$("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,aW))}}),[["__scopeId","data-v-e1eb37b6"]]);Ic.install=e=>{e.component(Ic.__name,Ic)};const cW=["id"],uW={class:"flex-1"},Bd=Xe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(x(),$("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[m("div",uW,[gt(C(Vs),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,cW))}});Bd.install=e=>{e.component(Bd.__name,Bd)};const dW=["custom-id"],l1=en(Xe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Vn(()=>t.customId),s=Dt("markstreamFade",void 0),o=F(()=>s?.value!==!1||n.value.text?null:Sa(t.node.children)),i=F(()=>Qe({text:On,inline_code:Cs,link:Os,image:mr,strong:Ns,emphasis:Ps,strikethrough:Ls,highlight:uo,insert:zs,subscript:qs,superscript:js,emoji:Us,checkbox:lo,checkbox_input:lo,footnote_reference:ao,hardbreak:gr,math_inline:qo,reference:Is},n.value));return(r,l)=>(x(),je(_s(`h${e.node.level}`),tn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ln(()=>[o.value!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(o.value),9,dW)):(x(!0),$(Pe,{key:1},Ye(e.node.children,(a,c)=>(x(),je(C(ai),{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"]]),Bf=l1;Bf.install=e=>{e.component(l1.__name,l1)};const fW={key:0,dir:"auto",class:"paragraph-node"},hW=["custom-id"],pW={dir:"auto",class:"paragraph-node"},mW=["custom-id"],ma=en(Xe({__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=F(()=>{var h;return(h=t.node)!=null?h:t.item}),s=Vn(()=>t.customId),o=F(()=>!!s.value.paragraph),i=F(()=>!!s.value.text),r=F(()=>{var h;return Df((h=n.value)==null?void 0:h.children,!o.value)}),l=F(()=>{var h;if(o.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const g=p[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const S=p.slice(1);if(!S.every(y=>y?.type==="list"))return null;const _=Df([g]);return _?{paragraphChildren:_,nestedLists:S}:null});function a(){return t.fade===!1&&!i.value}const c=F(()=>a()?Sa(r.value):null),u=F(()=>{var h;return a()?Sa((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=F(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return kn("markstreamShowTooltips",F(()=>t.showTooltips)),kn("markstreamFade",F(()=>t.fade)),(h,p)=>{var g,S;return x(),$("li",tn({class:"list-item",dir:"auto"},f.value),[r.value?(x(),$("p",fW,[c.value!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,hW)):(x(),je(C(tu),{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?(x(),$(Pe,{key:1},[m("p",pW,[u.value!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,mW)):(x(),je(C(tu),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(x(!0),$(Pe,null,Ye(l.value.nestedLists,(_,y)=>(x(),je(C(Vs),{key:y,nodes:[_],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${y}`,"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]=b=>h.$emit("copy",b))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(x(),je(C(Vs),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(S=(g=n.value)==null?void 0:g.children)!=null?S:[],"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"]]);ma.install=e=>{e.component(ma.__name,ma)};const ga=en(Xe({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=Vn(()=>e.customId),n=F(()=>t.value.list_item||ma);return(s,o)=>(x(),je(_s(e.node.ordered?"ol":"ul"),{class:Oe(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ln(()=>[(x(!0),$(Pe,null,Ye(e.node.items,(i,r)=>{var l;return x(),je(_s(n.value),tn({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:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);ga.install=e=>{e.component(ga.__name,ga)};const lM=Symbol("ViewportPriority");function gW(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?te(t):t,r=o?(n=window.requestIdleCallback)!=null?n:_=>window.setTimeout(()=>_({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:_=>window.clearTimeout(_):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function h(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||(function(){if(f!=null){try{l?.(f)}catch{}f=null}})()}}function p(_){const y=u.get(_);if(y){if(!y.visible.value){y.visible.value=!0;try{y.resolve()}catch{}}try{a?.unobserve(_)}catch{}u.delete(_),d.delete(_),h()}}function g(){r&&f==null&&d.size&&(f=r(()=>{f=null;const _=d.values().next().value;_&&(d.delete(_),p(_),d.size&&g())},{timeout:1200}))}const S=(_,y)=>{const b=te(!1);let v,w=!1;const N=new Promise(A=>{v=()=>{w||(w=!0,A())}}),E=()=>{try{a?.unobserve(_)}catch{}u.delete(_),d.delete(_),h()};if(!o||!i.value)return b.value=!0,v(),{isVisible:b,whenVisible:N,destroy:E};const k=(function(A,I){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const P=(function(R,B){var W,K,V;return{root:(W=e?.(R??null))!=null?W:null,rootMargin:(K=B?.rootMargin)!=null?K:"300px",threshold:(V=B?.threshold)!=null?V:0}})(A,I);if(a&&(L=P,(M=c)&&M.root===L.root&&M.rootMargin===L.rootMargin&&M.threshold===L.threshold))return a;var M,L;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(R=>{for(const B of R)(B.isIntersecting||B.intersectionRatio>0)&&p(B.target)},{root:P.root,rootMargin:P.rootMargin,threshold:P.threshold}),c=P;for(const R of u.keys())a.observe(R);return a})(_,y);return k?(u.set(_,{resolve:v,visible:b}),k.observe(_),d.add(_),g(),{isVisible:b,whenVisible:N,destroy:E}):(b.value=!0,v(),{isVisible:b,whenVisible:N,destroy:E})};return kn(lM,S),S}function vW(){var e,t;const n=Dt(lM,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e: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=s.get(f);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()}},d=()=>{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=te(!1);let p,g=!1;const S=new Promise(b=>{p=()=>{g||(g=!0,b())}}),_=()=>{try{o?.unobserve(f)}catch{}s.delete(f),i.delete(f),i.size||c()},y=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(b=>{for(const v of b)(v.isIntersecting||v.intersectionRatio>0)&&u(v.target)},{root:null,rootMargin:"300px",threshold:0}),o));return y?(s.set(f,{resolve:p,visible:h}),y.observe(f),i.add(f),d(),{isVisible:h,whenVisible:S,destroy:_}):(h.value=!0,p(),{isVisible:h,whenVisible:S,destroy:_})}}const yW={key:2,class:"html-block-node__raw"},kW=["innerHTML"],bW={key:1,class:"html-block-node__placeholder"},Nc=en(Xe({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Dt("markstreamHtmlPolicy",void 0),s=Dt("markstreamNestedRendererProps",void 0),o=F(()=>{var N,E;return(E=(N=t.htmlPolicy)!=null?N:n?.value)!=null?E:"safe"}),i=F(()=>{var N,E;const k=(N=s?.value)!=null?N:{};return wt(Qe({},k),{customId:(E=t.customId)!=null?E:k.customId,htmlPolicy:o.value})}),r=ii({loader:()=>Promise.resolve().then(()=>Vv),suspensible:!1}),l=F(()=>{const N=zg(t.node.attrs,o.value);if(!N)return;const E=Of(N);return Object.keys(E).length>0?E:void 0}),a=F(()=>{const N=String(t.node.tag||"").trim(),E=zg(t.node.attrs,o.value,N);if(!E)return;const k=Of(E);return Object.keys(k).length>0?k:void 0}),c=Vn(()=>t.customId),u=Xe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=te(null),f=te(typeof window>"u"),h=te(t.node.content),p=F(()=>Array.isArray(t.node.children)?t.node.children:[]),g=F(()=>String(t.node.tag||"div")),S=F(()=>{const N=g.value.trim().toLowerCase();return Vx.has(N)||Nv(N,o.value)}),_=F(()=>p.value.length>0&&!!t.node.tag&&!S.value),y=F(()=>{var N,E,k;if(_.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(N=h.value)!=null?N:""};const A=(E=h.value)!=null?E:t.node.content;if(!A)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:pa(A,o.value)};if(t.node.loading){const P=Rf(A,c.value,o.value);return P===null?{mode:"text",content:(k=t.node.raw)!=null?k:A}:{mode:"dynamic",nodes:P}}if(!sM(A,c.value))return{mode:"html",content:pa(A,o.value)};const I=Rf(A,c.value,o.value);return I===null?{mode:"html",content:pa(A,o.value)}:{mode:"dynamic",nodes:I}}),b=vW(),v=te(null),w=!!t.node.loading;return typeof window<"u"?(Ve(d,N=>{var E,k;if((k=(E=v.value)==null?void 0:E.destroy)==null||k.call(E),v.value=null,!w)return f.value=!0,void(h.value=t.node.content);if(!N)return void(f.value=!1);const A=b(N,{rootMargin:"400px"});v.value=A,f.value=A.isVisible.value,A.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Ve(()=>t.node.content,N=>{w&&!f.value||(h.value=N)})):f.value=!0,Ks(()=>{var N,E;(E=(N=v.value)==null?void 0:N.destroy)==null||E.call(N),v.value=null}),(N,E)=>(x(),je(_s(_.value?g.value:"div"),tn({ref_key:"htmlRef",ref:d,class:"html-block-node"},_.value?a.value:void 0),{default:Ln(()=>[f.value?(x(),$(Pe,{key:0},[y.value.mode==="structured"?(x(),je(C(r),tn({key:0},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):y.value.mode==="dynamic"?(x(),je(C(u),{key:1,nodes:y.value.nodes},null,8,["nodes"])):y.value.mode==="text"?(x(),$("pre",yW,O(y.value.content),1)):(x(),$("div",tn({key:3},l.value,{innerHTML:y.value.content}),null,16,kW))],64)):(x(),$("div",bW,[ia(N.$slots,"placeholder",{node:e.node},()=>[E[0]||(E[0]=m("span",{class:"html-block-node__placeholder-bar"},null,-1)),E[1]||(E[1]=m("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),E[2]||(E[2]=m("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Nc.install=e=>{e.component(Nc.__name,Nc)};const _W={dir:"auto",class:"paragraph-node"},wW=["custom-id"],al=en(Xe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Vn(()=>t.customId),s=Dt("markstreamHtmlPolicy",void 0),o=Dt("markstreamFade",void 0),i=Dt("markstreamParseOptions",void 0),r=Dt("markstreamCustomMarkdownIt",void 0),l=Dt("markstreamNestedRendererProps",void 0),a=F(()=>{var k;return(k=s?.value)!=null?k:"safe"}),c=F(()=>{var k;return(k=t.parseOptions)!=null?k:i?.value}),u=F(()=>{var k;return(k=t.customMarkdownIt)!=null?k:r?.value}),d=F(()=>{var k,A;return(A=t.customHtmlTags)!=null?A:(k=l?.value)==null?void 0:k.customHtmlTags}),f=F(()=>{var k,A;const I=(k=l?.value)!=null?k:{};return wt(Qe({},I),{customId:(A=t.customId)!=null?A:I.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=ii({loader:()=>Promise.resolve().then(()=>Vv),suspensible:!1});function p(k){var A;return k.type==="text"&&String((A=k.content)!=null?A:"").trim()===""}const g=F(()=>t.node.children.filter(k=>!p(k))),S=F(()=>g.value.length>0&&g.value.every(k=>k.type==="image"||(function(A){var I;const P=(function(M){return M.type==="link"&&Array.isArray(M.children)?M.children.filter(L=>!p(L)):[]})(A);return P.length===1&&((I=P[0])==null?void 0:I.type)==="image"})(k))),_=F(()=>new Set(Ma(d.value))),y=F(()=>{if(!S.value||g.value.length<=1)return t.node.children;const k=[];for(let A=0;A<t.node.children.length;A++){const I=t.node.children[A];if(!p(I)){k.push(I);continue}const P=k.length>0,M=t.node.children.slice(A+1).some(L=>!p(L));P&&M&&k.push(wt(Qe({},I),{content:" ",raw:" "}))}return k}),b=F(()=>o?.value===!1&&!n.value.text),v=F(()=>b.value?Sa(y.value):null);function w(k,A){return{node:k,"index-key":`${t.indexKey}-${A}`,"custom-id":t.customId,"custom-html-tags":d.value}}const N=F(()=>Qe({inline_code:Cs,image:mr,link:Os,hardbreak:gr,emphasis:Ps,strong:Ns,strikethrough:Ls,highlight:uo,insert:zs,subscript:qs,superscript:js,html_inline:co,html_block:Nc,emoji:Us,checkbox:lo,math_inline:qo,checkbox_input:lo,reference:Is,footnote_anchor:Ic,footnote_reference:ao,text:On},n.value)),E=F(()=>y.value.map((k,A)=>{var I;const P=(function(M){var L,R,B,W;if(M.type==="html_block"||M.type==="html_inline"){const K=String((L=M.tag)!=null?L:"").trim().toLowerCase()||Xx(M.content);if(K&&!_.value.has(K)&&Zx((R=M.content)!=null?R:M.raw,K)){const V=String((W=(B=M.content)!=null?B:M.raw)!=null?W:"");return{child:{type:"text",content:V,raw:V},component:On,isCustomComponent:!1}}}return{child:M,component:N.value[M.type],isCustomComponent:!!(n.value[M.type]&&!vu(String(M.type)))}})(k);return wt(Qe({},P),{index:A,key:`${t.indexKey||"paragraph"}-${A}`,customAttrs:P.isCustomComponent?Fv(P.child,a.value):void 0,hasSlotChildren:Array.isArray(P.child.children)&&P.child.children.length>0,slotContent:String((I=P.child.content)!=null?I:""),originalChild:k})}));return(k,A)=>(x(),$("p",_W,[v.value!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(v.value),9,wW)):(x(!0),$(Pe,{key:1},Ye(E.value,I=>{return x(),$(Pe,{key:I.key},[S.value&&p(I.originalChild)?(x(),$(Pe,{key:0},[dt(O((P=I.originalChild,String((M=P.content)!=null?M:""))),1)],64)):I.isCustomComponent?(x(),je(_s(I.component),tn({key:1,ref_for:!0},I.customAttrs,{node:I.child,loading:I.child.loading,"index-key":I.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ln(()=>[I.hasSlotChildren?(x(),je(C(h),tn({key:0,ref_for:!0},f.value,{nodes:I.child.children,"index-key":I.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):I.slotContent?(x(),je(C(h),tn({key:1,ref_for:!0},f.value,{content:I.slotContent,final:!I.child.loading,"index-key":`${I.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"])):(x(),je(_s(I.component),tn({key:2,ref_for:!0},w(I.child,I.index)),null,16))],64);var P,M}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);al.install=e=>{e.component(al.__name,al)};const SW={class:"table-node-wrapper"},CW=["aria-busy"],xW={key:0},TW=["custom-id"],MW=["aria-label","onPointerdown"],AW=["custom-id"],EW={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Lc=en(Xe({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=F(()=>{var _;return(_=t.node.loading)!=null&&_}),s=F(()=>{var _;return(_=t.node.rows)!=null?_:[]}),o=te(null),i=te([]);let r=null;const l=F(()=>t.node.header.cells.length),a=F(()=>i.value.some(_=>Number.isFinite(_)&&_>0)),c=F(()=>a.value?i.value.map(_=>_>0?{width:`${_}px`}:void 0):[]);kn("markstreamShowTooltips",F(()=>t.showTooltips)),kn("markstreamFade",F(()=>t.fade));const u=Vn(()=>t.customId),d=F(()=>!!u.value.text),f=F(()=>!!u.value.paragraph),h=new WeakMap;function p(_){const y=t.fade===!1&&!d.value,b=!f.value,v=h.get(_);if(v?.children===_.children&&v.textFastPath===y&&v.paragraphFastPath===b)return v.info;const w=Df(_.children,b,!0),N={simpleChildren:w,plainText:w&&y?Sa(w):null};return h.set(_,{children:_.children,textFastPath:y,paragraphFastPath:b,info:N}),N}function g(_){if(!r)return;_.preventDefault();const y=r.startWidth+r.nextStartWidth,b=Math.min(48,Math.floor(y/2)),v=Math.max(b,Math.min(y-b,Math.round(r.startWidth+_.clientX-r.startX))),w=[...r.widths];w[r.index]=v,w[r.index+1]=y-v,i.value=w}function S(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),r=null)}return Ve(l,()=>{S(),i.value=[]}),Ks(S),(_,y)=>(x(),$("div",SW,[m("table",{ref_key:"tableRef",ref:o,class:Oe(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(x(),$("colgroup",xW,[(x(!0),$(Pe,null,Ye(e.node.header.cells,(b,v)=>(x(),$("col",{key:v,style:Ft(c.value[v])},null,4))),128))])):ie("",!0),m("thead",null,[m("tr",null,[(x(!0),$(Pe,null,Ye(e.node.header.cells,(b,v)=>(x(),$("th",{key:v,dir:"auto",class:Oe([b.align==="right"?"text-right":b.align==="center"?"text-center":"text-left"])},[p(b).plainText!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(p(b).plainText),9,TW)):p(b).simpleChildren?(x(),je(C(tu),{key:1,nodes:p(b).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${v}`},null,8,["nodes","custom-id","index-key"])):(x(),je(C(Vs),{key:2,nodes:b.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:y[0]||(y[0]=w=>_.$emit("copy",w))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),v<e.node.header.cells.length-1?(x(),$("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${v+1} and ${v+2}`,onPointerdown:w=>(function(N,E){if(E.button!==0)return;const k=(function(){var P;const M=(P=o.value)==null?void 0:P.querySelectorAll("thead th");return Array.from(M??[],L=>Math.round(L.getBoundingClientRect().width))})(),A=k[N],I=k[N+1];A&&I&&(E.preventDefault(),r={index:N,startX:E.clientX,startWidth:A,nextStartWidth:I,widths:k},i.value=k,window.addEventListener("pointermove",g),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S))})(v,w)},null,40,MW)):ie("",!0)],2))),128))])]),m("tbody",null,[(x(!0),$(Pe,null,Ye(s.value,(b,v)=>(x(),$("tr",{key:v},[(x(!0),$(Pe,null,Ye(b.cells,(w,N)=>(x(),$("td",{key:N,class:Oe([w.align==="right"?"text-right":w.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(w).plainText!==null?(x(),$("span",{key:0,class:"text-node","custom-id":t.customId},O(p(w).plainText),9,AW)):p(w).simpleChildren?(x(),je(C(tu),{key:1,nodes:p(w).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${v}-${N}`},null,8,["nodes","custom-id","index-key"])):(x(),je(C(Vs),{key:2,nodes:w.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:y[1]||(y[1]=E=>_.$emit("copy",E))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,CW),gt(Pi,{name:"table-node-fade"},{default:Ln(()=>[n.value?(x(),$("div",EW,[ia(_.$slots,"loading",{isLoading:n.value},()=>[y[2]||(y[2]=m("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),y[3]||(y[3]=m("span",{class:"sr-only"},"Loading",-1))],!0)])):ie("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Lc.install=e=>{e.component(Lc.__name,Lc)};const $W={class:"hr-node"},Fd=en({},[["render",function(e,t){return x(),$("hr",$W)}],["__scopeId","data-v-39b2349c"]]);Fd.install=e=>{e.component(Fd.__name,Fd)};const IW={class:"unknown-node"},a1=Xe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(x(),$("div",IW,O(e.node.raw),1))}),Hd=en(Xe({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=F(()=>`vmr-container vmr-container-${t.node.name}`),s=Vn(()=>t.customId),o=F(()=>Qe({text:On,paragraph:al,heading:Bf,inline_code:Cs,link:Os,image:mr,strong:Ns,emphasis:Ps,strikethrough:Ls,insert:zs,subscript:qs,superscript:js,checkbox:lo,checkbox_input:lo,hardbreak:gr,math_inline:qo,reference:Is,list:ga,math_block:rM,table:Lc},s.value));return(i,r)=>(x(),$("div",tn({class:n.value},e.node.attrs),[(x(!0),$(Pe,null,Ye(e.node.children,(l,a)=>{return x(),je(_s((c=l.type,o.value[c]||a1)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);Hd.install=e=>{e.component(Hd.__name,Hd)};const NW=["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"],uw=[[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 LW(e){if(e<=255)return NW[e];let t=0,n=uw.length-1;for(;t<=n;){const s=t+n>>1,o=uw[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const OW=/[ \t\n\r\f]+/g,PW=/[\t\n\r\f]| {2,}|^ | $/;let Nm=null;const RW=new RegExp("\\p{Script=Arabic}","u"),Ih=new RegExp("\\p{M}","u"),aM=new RegExp("\\p{Nd}","u");function dw(e){return RW.test(e)}function fw(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 Ei(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(fw(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(fw(n))return!0}}return!1}const DW=new Set([" "," ","","\uFEFF"]);function BW(e){return Ei(e)}function c1(e){return!(function(t){const n=Ff(t);return n!==null&&(Hv.has(n)||dl.has(n))})(e)&&!(function(t){const n=Ff(t);return n!==null&&DW.has(n)})(e)}const Hv=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Nh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Wv=new Set(["'","’"]),dl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),FW=new Set([":",".","،","؛"]),HW=new Set(["၏"]),WW=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function UW(e){if(Uv(e))return!0;let t=!1;for(const n of e)if(dl.has(n))t=!0;else if(!t||!Ih.test(n))return!1;return t}function jW(e){for(const t of e)if(!Hv.has(t)&&!dl.has(t))return!1;return e.length>0}function qW(e){if(Uv(e))return!0;for(const t of e)if(!Nh.has(t)&&!Wv.has(t)&&!Ih.test(t))return!1;return e.length>0}function Uv(e){let t=!1;for(const n of e)if(n!=="\\"&&!Ih.test(n)){if(!(Nh.has(n)||dl.has(n)||Wv.has(n)))return!1;t=!0}return t}function cM(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function Ff(e){if(e.length===0)return null;const t=cM(e,e.length);return e.slice(t)}function zW(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(Ih.test(s))n--;else{if(!Nh.has(s)&&!Wv.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function VW(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function hw(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function pw(e,t){return e&&t!==null&&FW.has(t)}function KW(e){const t=Ff(e);return t!==null&&HW.has(t)}function GW(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 u1(e){let t=e.length;for(;t>0;){const n=cM(e,t),s=e.slice(n,t);if(WW.has(s))return!0;if(!dl.has(s))return!1;t=n}return!1}function YW(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
215
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const XW=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function xo(e){return e.length===1?e[0]:e.join("")}function ZW(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),xo(n)}function JW(e,t,n,s){if(!XW.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=YW(u,s),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&o.push({text:xo(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&&o.push({text:xo(r),isWordLike:a,kind:i,start:l}),o}function Lm(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const QW=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function eU(e,t){const n=e.texts[t];return!!n.startsWith("www.")||QW.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function tU(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const nU=new Set([":","-","/","×",",",".","+","–","—"]),mw=/^[A-Za-z0-9_]+[,:;]*$/,gw=/[,:;]+$/;function vw(e){for(const t of e)if(aM.test(t))return!0;return!1}function Wd(e){if(e.length===0)return!1;for(const t of e)if(!aM.test(t)&&!nU.has(t))return!1;return!0}function yw(e,t,n){var s,o,i;const r=(Nm===null&&(Nm=new Intl.Segmenter(void 0,{granularity:"word"})),Nm);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],g=[],S=[],_=[],y=[],b=[];for(const k of r.segment(e))for(const A of JW(k.segment,(s=k.isWordLike)!=null&&s,k.index,n)){let I=function(){h[V]!==null&&(c[V]=[hw(a,h,p,V)],h[V]=null),c[V].push(A.text),u[V]=u[V]||A.isWordLike,g[V]=g[V]||L,S[V]=S[V]||R,_[V]=W,y[V]=K,b[V]=pw(S[V],B)};const P=A.kind==="text",M=VW(A.text,A.isWordLike,A.kind),L=Ei(A.text),R=dw(A.text),B=Ff(A.text),W=u1(A.text),K=KW(A.text),V=l-1;t.carryCJKAfterClosingQuote&&P&&l>0&&d[V]==="text"&&L&&g[V]&&_[V]||P&&l>0&&d[V]==="text"&&jW(A.text)&&g[V]||P&&l>0&&d[V]==="text"&&y[V]?I():P&&l>0&&d[V]==="text"&&A.isWordLike&&R&&b[V]?(I(),u[V]=!0):M!==null&&l>0&&d[V]==="text"&&h[V]===M?p[V]=((o=p[V])!=null?o:1)+1:P&&!A.isWordLike&&l>0&&d[V]==="text"&&(UW(A.text)||A.text==="-"&&u[V])?I():(a[l]=A.text,c[l]=[A.text],u[l]=A.isWordLike,d[l]=A.kind,f[l]=A.start,h[l]=M,p[l]=M===null?0:1,g[l]=L,S[l]=R,_[l]=W,y[l]=K,b[l]=pw(R,B),l++)}for(let k=0;k<l;k++)h[k]===null?a[k]=xo(c[k]):a[k]=hw(a,h,p,k);for(let k=1;k<l;k++)d[k]==="text"&&!u[k]&&Uv(a[k])&&d[k-1]==="text"&&(a[k-1]+=a[k],u[k-1]=u[k-1]||u[k],a[k]="");const v=Array.from({length:l},()=>null);let w=-1;for(let k=l-1;k>=0;k--){const A=a[k];if(A.length!==0){if(d[k]==="text"&&!u[k]&&qW(A)&&w>=0&&d[w]==="text"){const I=(i=v[w])!=null?i:[];I.push(A),v[w]=I,f[w]=f[k],a[k]="";continue}w=k}}for(let k=0;k<l;k++){const A=v[k];A!=null&&(a[k]=ZW(A,a[k]))}let N=0;for(let k=0;k<l;k++){const A=a[k];A.length!==0&&(N!==k&&(a[N]=A,u[N]=u[k],d[N]=d[k],f[N]=f[k]),N++)}a.length=N,u.length=N,d.length=N,f.length=N;const E=(function(k){const A=k.texts.slice(),I=k.isWordLike.slice(),P=k.kinds.slice(),M=k.starts.slice();for(let L=0;L<A.length-1;L++){if(P[L]!=="text"||P[L+1]!=="text"||!Ei(A[L])||!Ei(A[L+1]))continue;const R=zW(A[L]);R!==null&&(A[L]=R.head,A[L+1]=R.tail+A[L+1],M[L+1]=M[L]+R.head.length)}return{len:A.length,texts:A,isWordLike:I,kinds:P,starts:M}})((function(k){const A=[],I=[],P=[],M=[];for(let L=0;L<k.len;L++){const R=k.texts[L],B=k.kinds[L],W=k.isWordLike[L];if(B==="text"&&W&&mw.test(R)){const K=[R];let V=gw.test(R),se=L+1;for(;V&&se<k.len&&k.kinds[se]==="text"&&k.isWordLike[se]&&mw.test(k.texts[se]);){const Y=k.texts[se];K.push(Y),V=gw.test(Y),se++}A.push(xo(K)),I.push(!0),P.push("text"),M.push(k.starts[L]),L=se-1;continue}A.push(R),I.push(W),P.push(B),M.push(k.starts[L])}return{len:A.length,texts:A,isWordLike:I,kinds:P,starts:M}})((function(k){const A=[],I=[],P=[],M=[];for(let L=0;L<k.len;L++){const R=k.texts[L];if(k.kinds[L]==="text"&&R.includes("-")){const B=R.split("-");let W=B.length>1;for(let K=0;K<B.length;K++){const V=B[K];if(!W)break;V.length!==0&&vw(V)&&Wd(V)||(W=!1)}if(W){let K=0;for(let V=0;V<B.length;V++){const se=B[V],Y=V<B.length-1?`${se}-`:se;A.push(Y),I.push(!0),P.push("text"),M.push(k.starts[L]+K),K+=Y.length}continue}}A.push(R),I.push(k.isWordLike[L]),P.push(k.kinds[L]),M.push(k.starts[L])}return{len:A.length,texts:A,isWordLike:I,kinds:P,starts:M}})((function(k){const A=[],I=[],P=[],M=[];for(let L=0;L<k.len;L++){const R=k.texts[L],B=k.kinds[L];if(B==="text"&&Wd(R)&&vw(R)){const W=[R];let K=L+1;for(;K<k.len&&k.kinds[K]==="text"&&Wd(k.texts[K]);)W.push(k.texts[K]),K++;A.push(xo(W)),I.push(!0),P.push("text"),M.push(k.starts[L]),L=K-1;continue}A.push(R),I.push(k.isWordLike[L]),P.push(B),M.push(k.starts[L])}return{len:A.length,texts:A,isWordLike:I,kinds:P,starts:M}})((function(k){const A=[],I=[],P=[],M=[];for(let L=0;L<k.len;L++){const R=k.texts[L];if(A.push(R),I.push(k.isWordLike[L]),P.push(k.kinds[L]),M.push(k.starts[L]),!tU(R))continue;const B=L+1;if(B>=k.len||Lm(k.kinds[B]))continue;const W=[],K=k.starts[B];let V=B;for(;V<k.len&&!Lm(k.kinds[V]);)W.push(k.texts[V]),V++;W.length>0&&(A.push(xo(W)),I.push(!0),P.push("text"),M.push(K),L=V-1)}return{len:A.length,texts:A,isWordLike:I,kinds:P,starts:M}})((function(k){const A=k.texts.slice(),I=k.isWordLike.slice(),P=k.kinds.slice(),M=k.starts.slice();for(let R=0;R<k.len;R++){if(P[R]!=="text"||!eU(k,R))continue;const B=[A[R]];let W=R+1;for(;W<k.len&&!Lm(P[W]);){B.push(A[W]),I[R]=!0;const K=A[W].includes("?");if(P[W]="text",A[W]="",W++,K)break}A[R]=xo(B)}let L=0;for(let R=0;R<A.length;R++){const B=A[R];B.length!==0&&(L!==R&&(A[L]=B,I[L]=I[R],P[L]=P[R],M[L]=M[R]),L++)}return A.length=L,I.length=L,P.length=L,M.length=L,{len:L,texts:A,isWordLike:I,kinds:P,starts:M}})((function(k){const A=[],I=[],P=[],M=[];let L=0;for(;L<k.len;){const R=[k.texts[L]];let B=k.isWordLike[L],W=k.kinds[L],K=k.starts[L];if(W==="glue"){const V=[R[0]],se=K;for(L++;L<k.len&&k.kinds[L]==="glue";)V.push(k.texts[L]),L++;const Y=xo(V);if(!(L<k.len&&k.kinds[L]==="text")){A.push(Y),I.push(!1),P.push("glue"),M.push(se);continue}R[0]=Y,R.push(k.texts[L]),B=k.isWordLike[L],W="text",K=se,L++}else L++;if(W==="text")for(;L<k.len&&k.kinds[L]==="glue";){const V=[];for(;L<k.len&&k.kinds[L]==="glue";)V.push(k.texts[L]),L++;const se=xo(V);L<k.len&&k.kinds[L]==="text"?(R.push(se,k.texts[L]),B=B||k.isWordLike[L],L++):R.push(se)}A.push(xo(R)),I.push(B),P.push(W),M.push(K)}return{len:A.length,texts:A,isWordLike:I,kinds:P,starts:M}})({len:N,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let k=0;k<E.len-1;k++){const A=GW(E.texts[k]);A!==null&&(E.kinds[k]!=="space"&&E.kinds[k]!=="preserved-space"||E.kinds[k+1]!=="text"||!dw(E.texts[k+1])||(E.texts[k]=A.space,E.isWordLike[k]=!1,E.kinds[k]=E.kinds[k]==="preserved-space"?"preserved-space":"space",E.texts[k+1]=A.marks+E.texts[k+1],E.starts[k+1]=E.starts[k]+A.space.length))}return E}function sU(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let Hl=null;const kw=new Map;let Wl=null;const oU=new RegExp("\\p{Emoji_Presentation}","u"),iU=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Om=null;const bw=new Map;function d1(){if(Hl!==null)return Hl;if(typeof OffscreenCanvas<"u")return Hl=new OffscreenCanvas(1,1).getContext("2d"),Hl;if(typeof document<"u")return Hl=document.createElement("canvas").getContext("2d"),Hl;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function er(e,t){let n=t.get(e);return n===void 0&&(n={width:d1().measureText(e).width,containsCJK:Ei(e)},t.set(e,n)),n}function Lh(){if(Wl!==null)return Wl;if(typeof navigator>"u")return Wl={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Wl;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 Wl={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Wl}function uM(){return Om===null&&(Om=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Om}function rU(e){return oU.test(e)||e.includes("️")}function Yr(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=uM();for(const a of l.segment(i))rU(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function lU(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 aU(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function _w(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+Lh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(v=u,w=d,N=a){l++,a=0,c=!1,f=-1,h=0}function g(v,w){c=!0,u=v+1,d=0,a=w}function S(v,w,N){c=!0,u=v,d=w+1,a=N}function _(v,w){c?(a+=w,u=v+1,d=0):g(v,w)}function y(v,w){const N=i[v];for(let E=w;E<N.length;E++){const k=N[E];c?a+k>r?(p(),S(v,E,k)):(a+=k,u=v,d=E+1):S(v,E,k)}c&&u===v&&d===N.length&&(u=v+1,d=0)}let b=0;for(;b<s.length&&(c||(b=lU(e,b),!(b>=s.length)));){const v=s[b],w=o[b],N=w==="space"||w==="preserved-space"||w==="tab"||w==="zero-width-break"||w==="soft-hyphen";if(c)if(a+v>r){if(N){_(b,v),p(b+1,0,a-v),b++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(v>t&&i[b]!==null){p(),y(b,0),b++;continue}p()}else _(b,v),N&&(f=b+1,h=a-v),b++;else v>t&&i[b]!==null?y(b,0):g(b,v),N&&(f=b+1,h=a-v),b++}return c&&p(),l}let Pm=null;function cU(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,f,h){s=[d],o=f,i=h,r=u1(d),l=Nh.has(d)}function u(d,f){s.push(d),i=i||f;const h=u1(d);r=d.length===1&&dl.has(d)&&r||h,l=!1}for(const d of(Pm===null&&(Pm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Pm).segment(e)){const f=d.segment,h=Ei(f);s.length!==0?l||Hv.has(f)||dl.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 uU(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=Ei(e[0].text),i=c1(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=Ei(a.text),u=c1(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function dU(e,t,n,s){const o=Lh(),{cache:i,emojiCorrection:r}=(function(E,k){d1().font=E;const A=(function(M){let L=kw.get(M);return L||(L=new Map,kw.set(M,L)),L})(E),I=(function(M){const L=M.match(/(\d+(?:\.\d+)?)\s*px/);return L?parseFloat(L[1]):16})(E),P=k?(function(M,L){let R=bw.get(M);if(R!==void 0)return R;const B=d1();B.font=M;const W=B.measureText("😀").width;if(R=0,W>L+.5&&typeof document<"u"&&document.body!==null){const K=document.createElement("span");K.style.font=M,K.style.display="inline-block",K.style.visibility="hidden",K.style.position="absolute",K.textContent="😀",document.body.appendChild(K);const V=K.getBoundingClientRect().width;document.body.removeChild(K),W-V>.5&&(R=W-V)}return bw.set(M,R),R})(E,I):0;return{cache:A,fontSize:I,emojiCorrection:P}})(t,(l=e.normalized,iU.test(l)));var l;const a=Yr("-",er("-",i),r),c=8*Yr(" ",er(" ",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 g=null,S=[],_=n?[]:null,y=Array.from({length:e.len});function b(E,k,A,I,P,M,L){P!=="text"&&P!=="space"&&P!=="zero-width-break"&&(p=!1),u.push(k),d.push(A),f.push(I),h.push(P),S.push(L),_!==null&&_.push(E)}function v(E,k,A,I,P){const M=er(E,i),L=Yr(E,M,r),R=k==="space"||k==="preserved-space"||k==="zero-width-break"?0:L,B=k==="space"||k==="zero-width-break"?0:L;if(P&&I&&E.length>1){let W="sum-graphemes";Wd(E)?W="pair-context":o.preferPrefixWidthsForBreakableRuns&&(W="segment-prefixes");const K=(function(V,se,Y,G,ee){if(se.breakableFitAdvances!==void 0)return se.breakableFitAdvances;const we=uM(),de=[];for(const me of we.segment(V))de.push(me.segment);if(de.length<=1)return se.breakableFitAdvances=null,se.breakableFitAdvances;if(ee==="sum-graphemes"){const me=[];for(const $e of de){const J=er($e,Y);me.push(Yr($e,J,G))}return se.breakableFitAdvances=me,se.breakableFitAdvances}if(ee==="pair-context"||de.length>96){const me=[];let $e=null,J=0;for(const ye of de){const Se=Yr(ye,er(ye,Y),G);if($e===null)me.push(Se);else{const U=$e+ye,Z=er(U,Y);me.push(Yr(U,Z,G)-J)}$e=ye,J=Se}return se.breakableFitAdvances=me,se.breakableFitAdvances}const Le=[];let ce="",_e=0;for(const me of de){ce+=me;const $e=Yr(ce,er(ce,Y),G);Le.push($e-_e),_e=$e}return se.breakableFitAdvances=Le,se.breakableFitAdvances})(E,M,i,r,W);return void b(E,L,R,B,k,A,K)}b(E,L,R,B,k,A,null)}for(let E=0;E<e.len;E++){y[E]=u.length;const k=e.texts[E],A=e.isWordLike[E],I=e.kinds[E],P=e.starts[E];if(I==="soft-hyphen"){b(k,0,a,a,I,P,null);continue}if(I==="hard-break"){b(k,0,0,0,I,P,null);continue}if(I==="tab"){b(k,0,0,0,I,P,null);continue}const M=er(k,i);if(I==="text"&&M.containsCJK){const L=cU(k,o),R=s==="keep-all"?uU(L):L;for(let B=0;B<R.length;B++){const W=R[B];v(W.text,"text",P+W.start,A,s==="keep-all"||!Ei(W.text))}continue}v(k,I,P,A,!0)}const w=(function(E,k,A){const I=[];for(let P=0;P<E.length;P++){const M=E[P],L=M.startSegmentIndex<k.length?k[M.startSegmentIndex]:A,R=M.endSegmentIndex<k.length?k[M.endSegmentIndex]:A,B=M.consumedEndSegmentIndex<k.length?k[M.consumedEndSegmentIndex]:A;I.push({startSegmentIndex:L,endSegmentIndex:R,consumedEndSegmentIndex:B})}return I})(e.chunks,y,u.length),N=g===null?null:(function(E,k){const A=(function(P){const M=P.length;if(M===0)return null;const L=new Array(M);let R=!1;for(let Y=0;Y<M;){const G=P.charCodeAt(Y);let ee=G,we=1;if(G>=55296&&G<=56319&&Y+1<M){const Le=P.charCodeAt(Y+1);Le>=56320&&Le<=57343&&(ee=Le-56320+(G-55296<<10)+65536,we=2)}const de=LW(ee);de!=="R"&&de!=="AL"&&de!=="AN"||(R=!0);for(let Le=0;Le<we;Le++)L[Y+Le]=de;Y+=we}if(!R)return null;let B=0;for(let Y=0;Y<M;Y++){const G=L[Y];if(G==="L"){B=0;break}if(G==="R"||G==="AL"){B=1;break}}const W=new Int8Array(M);for(let Y=0;Y<M;Y++)W[Y]=B;const K=1&B?"R":"L",V=K;let se=V;for(let Y=0;Y<M;Y++)L[Y]==="NSM"?L[Y]=se:se=L[Y];se=V;for(let Y=0;Y<M;Y++){const G=L[Y];G==="EN"?L[Y]=se==="AL"?"AN":"EN":G!=="R"&&G!=="L"&&G!=="AL"||(se=G)}for(let Y=0;Y<M;Y++)L[Y]==="AL"&&(L[Y]="R");for(let Y=1;Y<M-1;Y++)L[Y]==="ES"&&L[Y-1]==="EN"&&L[Y+1]==="EN"&&(L[Y]="EN"),L[Y]!=="CS"||L[Y-1]!=="EN"&&L[Y-1]!=="AN"||L[Y+1]!==L[Y-1]||(L[Y]=L[Y-1]);for(let Y=0;Y<M;Y++){if(L[Y]!=="EN")continue;let G;for(G=Y-1;G>=0&&L[G]==="ET";G--)L[G]="EN";for(G=Y+1;G<M&&L[G]==="ET";G++)L[G]="EN"}for(let Y=0;Y<M;Y++){const G=L[Y];G!=="WS"&&G!=="ES"&&G!=="ET"&&G!=="CS"||(L[Y]="ON")}se=V;for(let Y=0;Y<M;Y++){const G=L[Y];G==="EN"?L[Y]=se==="L"?"L":"EN":G!=="R"&&G!=="L"||(se=G)}for(let Y=0;Y<M;Y++){if(L[Y]!=="ON")continue;let G=Y+1;for(;G<M&&L[G]==="ON";)G++;const ee=(Y>0?L[Y-1]:V)!=="L"?"R":"L";if(ee===((G<M?L[G]:V)!=="L"?"R":"L"))for(let we=Y;we<G;we++)L[we]=ee;Y=G-1}for(let Y=0;Y<M;Y++)L[Y]==="ON"&&(L[Y]=K);for(let Y=0;Y<M;Y++){const G=L[Y];1&W[Y]?G!=="L"&&G!=="AN"&&G!=="EN"||W[Y]++:G==="R"?W[Y]++:G!=="AN"&&G!=="EN"||(W[Y]+=2)}return W})(E);if(A===null)return null;const I=new Int8Array(k.length);for(let P=0;P<k.length;P++)I[P]=A[k[P]];return I})(e.normalized,g);return _!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:N,breakableFitAdvances:S,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:w,segments:_}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:N,breakableFitAdvances:S,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:w}}function fU(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return dU((function(c,u,d="normal",f="normal"){const h=(function(S){const _=S??"normal";return _==="pre-wrap"?{mode:_,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:_,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(S){return/[\r\f]/.test(S)?S.replace(/\r\n/g,`
|
|
216
|
-
`).replace(/[\r\f]/g,`
|
|
217
|
-
`):S.replace(/\r\n/g,`
|
|
218
|
-
`)})(c):(function(S){if(!PW.test(S))return S;let _=S.replace(OW," ");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 g=f==="keep-all"?(function(S){if(S.len<=1)return S;const _=[],y=[],b=[],v=[];let w=null,N=!1,E=0,k=!1,A=!1;function I(){w!==null&&(_.push(xo(w)),y.push(N),b.push("text"),v.push(E),w=null)}for(let P=0;P<S.len;P++){const M=S.texts[P],L=S.kinds[P],R=S.isWordLike[P],B=S.starts[P];if(L==="text"){const W=BW(M),K=c1(M);if(w!==null&&k&&A){w.push(M),N=N||R,k=k||W,A=K;continue}I(),w=[M],N=R,E=B,k=W,A=K;continue}I(),_.push(M),y.push(R),b.push(L),v.push(B)}return I(),{len:_.length,texts:_,isWordLike:y,kinds:b,starts:v}})(yw(p,u,h)):yw(p,u,h);return Qe({normalized:p,chunks:sU(g,h)},g)})(s,Lh(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const Rm="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Yn=(()=>{const e=globalThis;if(e[Rm])return e[Rm];const t={configs:{},controllers:{},revision:hl(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Rm]=t,t})();let lc=null;const ww=Yn.revision;function Sw(e){var t;return e&&(t=Yn.configs[e])!=null?t:null}function Cw(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function hU(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Dm(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!hU(i))return null;i.type==="text"?o+=String((t=i.content)!=null?t:""):i.type==="emoji"?o+=String((s=(n=i.name)!=null?n:i.raw)!=null?s:""):i.type==="hardbreak"&&(o+=`
|
|
219
|
-
`)}return o.length>0?o:null}function Bm(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(lc!=null)return lc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return lc=!!((i=r.getContext)!=null&&i.call(r,"2d")),lc}catch{return lc=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Yn.blockEstimateCache.get(r);if(l)return Yn.blockEstimateCache.delete(r),Yn.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(h,p,g){const S=`${g}\0${p}\0${h}`,_=Yn.preparedCache.get(S);if(_)return Yn.preparedCache.delete(S),Yn.preparedCache.set(S,_),_.prepared;const y=fU(h,p,{whiteSpace:g});for(Yn.preparedCache.set(S,{prepared:y});Yn.preparedCache.size>240;){const b=Yn.preparedCache.keys().next().value;if(!b)break;Yn.preparedCache.delete(b)}return y})(e,n.font,a),u=(function(h,p,g){const S=(function(_,y){return _.simpleLineWalkFastPath?_w(_,y):(function(b,v){if(b.simpleLineWalkFastPath)return _w(b,v);const{widths:w,lineEndFitAdvances:N,lineEndPaintAdvances:E,kinds:k,breakableFitAdvances:A,discretionaryHyphenWidth:I,tabStopAdvance:P,chunks:M}=b;if(w.length===0||M.length===0)return 0;const L=Lh(),R=L.lineFitEpsilon,B=v+R;let W=0,K=0,V=!1,se=0,Y=0,G=-1,ee=0,we=0,de=null;function Le(){G=-1,ee=0,we=0,de=null}function ce(Z=se,fe=Y,oe=K){W++,K=0,V=!1,Le()}function _e(Z,fe){V=!0,se=Z+1,Y=0,K=fe}function me(Z,fe,oe){V=!0,se=Z,Y=fe+1,K=oe}function $e(Z,fe){V?(K+=fe,se=Z+1,Y=0):_e(Z,fe)}function J(Z,fe,oe,he){if(!fe)return;const H=Z==="tab"?0:N[oe],X=Z==="tab"?he:E[oe];G=oe+1,ee=K-he+H,we=K-he+X,de=Z}function ye(Z,fe){const oe=A[Z];for(let he=fe;he<oe.length;he++){const H=oe[he];V?K+H>B?(ce(),me(Z,he,H)):(K+=H,se=Z,Y=he+1):me(Z,he,H)}V&&se===Z&&Y===oe.length&&(se=Z+1,Y=0)}function Se(Z){if(de!=="soft-hyphen")return!1;const fe=A[Z];if(fe==null)return!1;const{fitCount:oe,fittedWidth:he}=(function(H,X,ae,ke,Me){let Ie=0,re=X;for(;Ie<H.length;){const le=re+H[Ie];if((Ie+1<H.length?le+Me:le)>ae+ke)break;re=le,Ie++}return{fitCount:Ie,fittedWidth:re}})(fe,K,v,R,I);return oe!==0&&(K=he,se=Z,Y=oe,Le(),oe===fe.length?(se=Z+1,Y=0,!0):(ce(Z,oe,he+I),ye(Z,oe),!0))}function U(Z){W++,Le()}for(let Z=0;Z<M.length;Z++){const fe=M[Z];if(fe.startSegmentIndex===fe.endSegmentIndex){U();continue}V=!1,K=0,fe.startSegmentIndex,se=fe.startSegmentIndex,Y=0,Le();let oe=fe.startSegmentIndex;for(;oe<fe.endSegmentIndex;){const he=k[oe],H=he==="space"||he==="preserved-space"||he==="tab"||he==="zero-width-break"||he==="soft-hyphen",X=he==="tab"?aU(K,P):w[oe];if(he!=="soft-hyphen")if(V){if(K+X>B){const ae=K+(he==="tab"?0:N[oe]),ke=K+(he==="tab"?X:E[oe]);if(de==="soft-hyphen"&&L.preferEarlySoftHyphenBreak&&ee<=B){ce(G,0,we);continue}if(de==="soft-hyphen"&&Se(oe)){oe++;continue}if(H&&ae<=B){$e(oe,X),ce(oe+1,0,ke),oe++;continue}if(G>=0&&ee<=B){if(se>G||se===G&&Y>0){ce();continue}const Me=G;ce(Me,0,we),oe=Me;continue}if(X>v&&A[oe]!==null){ce(),ye(oe,0),oe++;continue}ce();continue}$e(oe,X),J(he,H,oe,X),oe++}else X>v&&A[oe]!==null?ye(oe,0):_e(oe,X),J(he,H,oe,X),oe++;else V&&(se=oe+1,Y=0,G=oe+1,ee=K+I,we=K+I,de=he),oe++}if(V){const he=G===fe.consumedEndSegmentIndex?we:K;ce(fe.consumedEndSegmentIndex,0,he)}}return W})(_,y)})(h,p);return{lineCount:S,height:S*g}})(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(Yn.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Yn.blockEstimateCache.size>4e3;){const h=Yn.blockEstimateCache.keys().next().value;if(!h)break;Yn.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function dM(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Dm(e.children);return i&&n.paragraph?Bm(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Dm(e.children),l=n.headings[i];return r&&l?Bm(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=Dm((o=i[0])==null?void 0:o.children);return r?Bm(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=dM(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 gd(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function pU(e,t){var n;if(!e||e.type!=="code_block")return null;const s=t.rendererKind,o=t.showHeader!==!1,i=(function(u){var d,f,h;return u.diff?Math.max(gd(String((d=u.originalCode)!=null?d:"")),gd(String((f=u.updatedCode)!=null?f:"")),gd(String((h=u.code)!=null?h:""))):gd((function(p,g){const S=String(p??"");return g?S:S.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(s==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,p){const g=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*g)})(u,r),f=(function(h,p){var g,S;if(!p)return 0;const _=typeof((g=h?.padding)==null?void 0:g.top)=="number"?h.padding.top:10,y=typeof((S=h?.padding)==null?void 0:S.bottom)=="number"?h.padding.bottom:22;return Math.max(0,_)+Math.max(0,y)})(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 s==="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+(o?40:0)),contentHeight:c,rendererKind:s}}function mU(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function Fm(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=Cw(s.lineHeight,1.5*Cw(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:mU(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const gU=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function xw(e,t={}){var n;const s={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return s;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))gU.has(r)||o.has(r)||l.enumerable&&"value"in l&&(s[r]=l.value);return s}const vU=!1;function kpe(){return vU}function Tw(e,t,n,s){var o;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(!s.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=s.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(o=s.epsilonPx)!=null?o:2;Math.abs(s.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const fM=Symbol("MarkstreamMathBlockMinHeightCache");function bpe(){return Dt(fM,null)}const yU=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],kU=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],bU=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),hM=["raw","content","code","originalCode","updatedCode"],Mw=new WeakMap,Aw=new WeakMap;let _U=1;function Bo(){return typeof performance<"u"?performance.now():Date.now()}function Ew(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Ao(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=Mw.get(t);return n||(n=_U++,Mw.set(t,n)),String(n)}function $w(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:Ao(t),customMarkdownIt:Ao(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:Ao(e.validateLink),preTransformTokens:Ao(e.preTransformTokens),postTransformTokens:Ao(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function Iw(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
220
|
-
`,t-1)+1;return e.slice(n,t).trim()}function Nw(e){const t=pM(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function pM(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function mM(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 jv(e){const t=String(e??"");return`${t.length}:${mM(t)}`}function f1(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?jv(r):`${r.length}:${mM(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Ao(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${Ao(s)}`;const i=Ao(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>f1(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}:${f1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Hf(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function gM(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Hf(s)?Cr(s,t,n+1):gM(s,t,n+1)).join(",")}`:Hf(e)?Cr(e,t,n):f1(e,t,n)}function wU(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!hM.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${jv(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${Ao(o)}`:bU.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${gM(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${Ao(o)}`:""}).filter(Boolean).join(";")}function SU(e){return hM.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${jv(n)}`:""}).filter(Boolean).join(";")}function Cr(e,t=new WeakMap,n=0){const s=Aw.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${Ao(o)}`;const r=Ao(o);t.set(o,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=>Cr(p,c,u+1)).join("|"):"";return[a.type,SU(d),wU(d,c,u),f.length,h].join(":")})(e,t,n);return Aw.set(o,l),l}function vM(e,t){return Cr(e)===Cr(t)}function qv(e,t,n){const s=Bo(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Bo()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function Lw(e,t,n){return qv(t,n,()=>Cr(e))}function yM(e,t,n){return Lw(e,n,"stabilizeSignatureMs")===Lw(t,n,"stabilizeSignatureMs")}function Hm(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function Ow(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function CU(e,t){return e.length===t.length&&e===t}function zv(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const s=e,o=t,i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const f=s[d],h=o[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"||!CU(f,h))return!1}const l=Object.prototype.hasOwnProperty.call(s,"children");if(l!==Object.prototype.hasOwnProperty.call(o,"children"))return!1;if(!l)return!0;const a=s.children,c=o.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!Hf(d)||!Hf(f))return null;const h=zv(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function xU(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=zv(e,t);return n??vM(e,t)}function TU(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return qv(n,"stabilizeSignatureMs",()=>{s=zv(e,t)}),s??yM(e,t,n)}function MU(e,t){const n={};for(const s of yU){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function AU(e,t){var n;const s=j_(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:F(()=>!1),r=te(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=Bo();function g(){l&&(clearTimeout(l),l=void 0)}function S(){g();const A=t.renderContent.value;r.value!==A&&(r.value=A),p=Bo()}Ve([t.renderContent,t.effectiveFinal,i],([A,I,P])=>{r.value!==A&&(!P||I||(function(M,L){if(!M&&L||L.length<=80||L.length<M.length||!L.startsWith(M))return!0;const R=L.slice(M.length);return!!R&&(!!Nw(Iw(L))||!(!R.includes(`
|
|
221
|
-
|
|
222
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(R))||R.endsWith(`
|
|
223
|
-
`)&&!(function(B){const W=Iw(B);if(Nw(W))return!1;const K=pM(W);return K.length>=2&&K.some(V=>V.trim())})(L))})(r.value,A)?S():(function(){if(h+=1,l)return;const M=Math.max(0,(function(L){const R=L.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(Bo()-p));M<=0?S():l=setTimeout(S,M)})())},{flush:"sync",immediate:!0}),$1(g);const _=F(()=>{var A,I,P,M;return o7(e.customHtmlTags,(A=e.parseOptions)==null?void 0:A.customHtmlTags,(M=(P=(I=t.customComponentsMap)==null?void 0:I.value)!=null?P:{},Object.entries(M).map(([L,R])=>{const B=Oo(L);return R==null||!B||vu(B)||zx.has(B)||pu.has(B)?"":B}).filter(Boolean)))}),y=F(()=>{const{key:A,tags:I}=i7(_.value);if(!A)return s;const P=o.get(A);if(P)return P;const M=j_(t.instanceMsgId,{customHtmlTags:I});return o.set(A,M),M}),b=F(()=>{const A=y.value;return e.customMarkdownIt?e.customMarkdownIt(A):A}),v=F(()=>{var A,I;const P=(A=e.parseOptions)!=null?A:{},M=t.effectiveFinal.value,L=_.value,R=M!=null,B=L.length>0;return R||B||P.streamParse==null?Qe(Qe(wt(Qe({},P),{streamParse:(I=P.streamParse)==null||I}),R?{final:M}:{}),B?{customHtmlTags:L}:{}):P}),w=F(()=>{var A;return new Set(((A=v.value.customHtmlTags)!=null?A:[]).map(I=>String(I).trim().toLowerCase()).filter(Boolean))}),N=F(()=>$w(v.value,b.value,e.customMarkdownIt,{includeFinal:!0})),E=F(()=>$w(v.value,b.value,e.customMarkdownIt,{includeFinal:!1}));Ve([N,E],([A,I],[P,M])=>{P&&(A===P&&I===M||(S(),I!==M&&(a=[],d="")))},{flush:"sync"});const k=F(()=>{var A,I,P,M,L,R,B,W;if((A=e.nodes)!=null&&A.length)return a=[],d="",cr(e.nodes.slice());const K=r.value;if(!K)return a=[],d="",[];const V=t.debugPerformanceEnabled.value,se=V?Bo():0,Y=b.value,G=N.value,ee=E.value;c&&G!==c&&(function(fe){var oe,he;(he=(oe=fe.stream)==null?void 0:oe.reset)==null||he.call(oe)})(Y),u&&ee!==u&&(a=[],d="");const we=a.length>0&&K.startsWith(d)&&ee===u,de=V?Ew(Y):null,Le=V?{}:void 0,ce=Le?wt(Qe({},v.value),{__timing:Le}):v.value,_e=LT(K,Y,ce),me=V?Bo():0,$e=V?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let J,ye=V?Hm(_e.length):void 0,Se=0,U=0;if(we){const fe=V?Bo():0;if($e){const oe=(function(he,H,X){if(!H.length)return{nodes:he,metrics:Hm(he.length)};const ae=(function(Ie,re,le){const Ce=Math.min(Ie.length,re.length);for(let We=0;We<Ce;We++)if(!TU(re[We],Ie[We],le))return We;return Ie.length===re.length?-1:Ce})(he,H,X);if(ae<0)return{nodes:H,metrics:{reusedNodeCount:he.length,dirtyStartIndex:ae,stablePrefixNodeCount:he.length,dirtyTailNodeCount:0}};const ke=he.slice();let Me=ae;for(let Ie=0;Ie<ae;Ie++)ke[Ie]=H[Ie];for(let Ie=ae;Ie<he.length;Ie++){const re=H[Ie],le=he[Ie];re&&yM(re,le,X)&&(ke[Ie]=re,Me+=1)}return{nodes:ke,metrics:{reusedNodeCount:Me,dirtyStartIndex:ae,stablePrefixNodeCount:ae,dirtyTailNodeCount:Ow(ae,he,H)}}})(_e,a,$e);J=oe.nodes,ye=oe.metrics}else{const oe=(function(he,H){if(!H.length)return{nodes:he,metrics:Hm(he.length)};const X=(function(Me,Ie){const re=Math.min(Me.length,Ie.length);for(let le=0;le<re;le++)if(!xU(Ie[le],Me[le]))return le;return Me.length===Ie.length?-1:re})(he,H);if(X<0)return{nodes:H,metrics:{reusedNodeCount:he.length,dirtyStartIndex:X,stablePrefixNodeCount:he.length,dirtyTailNodeCount:0}};const ae=he.slice();let ke=X;for(let Me=0;Me<X;Me++)ae[Me]=H[Me];for(let Me=X;Me<he.length;Me++){const Ie=H[Me],re=he[Me];Ie&&vM(Ie,re)&&(ae[Me]=Ie,ke+=1)}return{nodes:ae,metrics:{reusedNodeCount:ke,dirtyStartIndex:X,stablePrefixNodeCount:X,dirtyTailNodeCount:Ow(X,he,H)}}})(_e,a);J=oe.nodes,ye=oe.metrics}Se=V?Bo()-fe:0,U=ye?.dirtyStartIndex==null||ye.dirtyStartIndex<0?J.length:ye.dirtyStartIndex}else J=_e;$e?(function(fe,oe,he=0){for(let H=Math.max(0,he);H<fe.length;H++)qv(oe,"primeSignatureMs",()=>Cr(fe[H]))})(J,$e,U):(function(fe,oe=0){for(let he=Math.max(0,oe);he<fe.length;he++)Cr(fe[he])})(J,U);const Z=V?Bo()-me:0;if(f+=1,d=K,c=G,u=ee,a=J,V){const fe=Ew(Y),oe=typeof fe?.total=="number"&&fe.total>((I=de?.total)!=null?I:0);t.logPerf(oe?"parse(stream)":"parse(sync)",Qe(Qe(Qe({rendererId:t.instanceMsgId,ms:Math.round(Bo()-se),nodes:J.length,contentLength:K.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:Z,signatureMs:(P=$e?.signatureMs)!=null?P:0,stabilizeSignatureMs:(M=$e?.stabilizeSignatureMs)!=null?M:0,primeSignatureMs:(L=$e?.primeSignatureMs)!=null?L:0,signatureCallCount:(R=$e?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(B=$e?.stabilizeSignatureCallCount)!=null?B:0,primeSignatureCallCount:(W=$e?.primeSignatureCallCount)!=null?W:0,stabilizeMs:Se},ye??{}),Le?Object.fromEntries(kU.map(he=>{var H;return[he,(H=Le[he])!=null?H:0]})):{}),fe?{streamMode:fe.lastMode,streamDelta:MU(fe,de),streamStats:fe}:{}))}return cr(J)});return{effectiveCustomHtmlTags:_,effectiveCustomHtmlTagsSet:w,mdBase:y,mdInstance:b,mergedParseOptions:v,parsedNodes:k}}function EU(e){const{isClient:t}=e,n=te(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,h){if((g=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!g)return;var p,g;const S=n.value,_=S.has(f);if(h){if(_)return;const b=new Set(S);return b.add(f),void(n.value=b)}if(!_)return;const y=new Set(S);y.delete(f),n.value=y})(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 o.entries())f<c||(h(),o.delete(f));for(const[f,h]of s.entries())f<c||(h.destroy(),s.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 o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function $U(e={}){const t=te(""),n=te(""),s=te(!1),o=q9(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=F(()=>Math.max(0,t.value.length-n.value.length)),a=F(()=>l.value===0),c=F(()=>s.value&&a.value);return E1()&&$1(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const Pw=/auto|scroll|overlay/i;function IU(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return Pw.test(t)||Pw.test(n)}function NU(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 LU=Xe({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=F(()=>{var n,s;return Jg((s=Ql(e.estimatedPreviewHeightPx))!=null?s:Xg(String((n=e.node.code)!=null?n:"")))});return()=>Jt("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?Jt("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)"}},[Jt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Jt("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Jt("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Jt("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},()=>Jt("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,Jt("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Jt("div",{class:"absolute inset-0"},[Jt("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),OU=Xe({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=F(()=>{var n,s;return Zg((s=Ql(e.estimatedPreviewHeightPx))!=null?s:Yg(String((n=e.node.code)!=null?n:"")))});return()=>Jt("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?Jt("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)"}},[Jt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Jt("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Jt("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},()=>Jt("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Jt("span",{class:"action-icon block"})])))]):null,Jt("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)"}},[Jt("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"}})])])}}),PU=["data-custom-id"],RU={class:"m-0 p-0"},DU=["data-probe"],BU=["data-node-index","data-node-type"],kM=en(Xe(wt(Qe({},{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 s=e,o=n,i=ds(),r=Dt("markstreamNestedRendererProps",void 0);function l(T){var D,j;const q=s[T];return(function(Q){const ve=i?.vnode.props;return!!ve&&(Object.prototype.hasOwnProperty.call(ve,Q)||Object.prototype.hasOwnProperty.call(ve,String(Q).replace(/[A-Z]/g,be=>`-${be.toLowerCase()}`)))})(T)?q:(j=(D=r?.value)==null?void 0:D[T])!=null?j:q}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:320,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=F(()=>{return(T=l("mode"))==="chat"||T==="minimal"||T==="docs"?T:"docs";var T}),u=F(()=>{const T=l("renderCodeBlocksAsPre"),D=l("codeRenderer");return T===!0?"pre":D==="pre"||D==="shiki"||D==="monaco"?D:T===!1||c.value==="docs"?"monaco":"pre"}),d=F(()=>a[c.value]),f=F(()=>{var T;return(T=l("showTooltips"))!=null?T:d.value.showTooltips}),h=F(()=>{var T;return(T=l("fade"))!=null?T:d.value.fade}),p=F(()=>{var T;return(T=l("batchRendering"))!=null?T:d.value.batchRendering}),g=F(()=>{var T;return(T=l("initialRenderBatchSize"))!=null?T:d.value.initialRenderBatchSize}),S=F(()=>{var T;return(T=l("renderBatchSize"))!=null?T:d.value.renderBatchSize}),_=F(()=>{var T;return(T=l("renderBatchDelay"))!=null?T:d.value.renderBatchDelay}),y=F(()=>{var T;return(T=l("renderBatchBudgetMs"))!=null?T:d.value.renderBatchBudgetMs}),b=F(()=>{var T;return(T=l("renderBatchIdleTimeoutMs"))!=null?T:d.value.renderBatchIdleTimeoutMs}),v=F(()=>{var T;return(T=l("deferNodesUntilVisible"))!=null?T:d.value.deferNodesUntilVisible}),w=F(()=>{var T;return(T=l("maxLiveNodes"))!=null?T:d.value.maxLiveNodes}),N=F(()=>{var T;return(T=l("liveNodeBuffer"))!=null?T:d.value.liveNodeBuffer}),E=F(()=>{var T;return(T=l("nodeVirtual"))!=null?T:d.value.nodeVirtual}),k={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return s.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 s.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return p.value},get initialRenderBatchSize(){return g.value},get renderBatchSize(){return S.value},get renderBatchDelay(){return _.value},get renderBatchBudgetMs(){return y.value},get renderBatchIdleTimeoutMs(){return b.value},get deferNodesUntilVisible(){return v.value},get maxLiveNodes(){return w.value},get liveNodeBuffer(){return N.value},get nodeVirtual(){return E.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function A(T){o("height-change",T)}function I(T){o("virtual-state-change",T)}function P(T){o("anchor-change",T)}const M=te(),L=te(null),R=te(null),B=te(null),W=so({1:null,2:null,3:null,4:null,5:null,6:null}),K=te(!1),V=new Map,se=te(0),Y=te(0),G=te({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ee(){var T,D;if(((T=s.virtualScroll)==null?void 0:T.enabled)!==!0)return null;const j=(D=s.virtualScroll)==null?void 0:D.scrollRoot;return we(typeof j=="function"?j():j)}function we(T){return T?typeof HTMLElement<"u"&&T instanceof HTMLElement?T:typeof T=="object"&&"value"in T?we(T.value):typeof T=="object"&&"$el"in T?we(T.$el):null:null}const{isClient:de,renderAsFragment:Le,debugPerformanceEnabled:ce,resolvedShowTooltips:_e,resolvedHtmlPolicy:me,inheritedSmoothStreaming:$e,ownsTypewriterCursor:J}=(function(T){const D=typeof window<"u",j=uu(),q=Dt("markstreamHtmlPolicy",void 0),Q=Dt("markstreamTypewriterCursor",void 0),ve=Dt("markstreamSmoothStreaming",void 0),be=F(()=>T.renderAsFragment===!0),xe=F(()=>!!(T.debugPerformance&&D&&typeof console<"u")),Re=F(()=>{var De;if(typeof T.showTooltips=="boolean")return T.showTooltips;const Ee=(De=j.showTooltips)!=null?De:j["show-tooltips"];return Ee===""||Ee===!0||Ee==="true"||Ee!==!1&&Ee!=="false"&&void 0}),Ae=F(()=>{var De,Ee;return(Ee=(De=T.htmlPolicy)!=null?De:q?.value)!=null?Ee:"safe"}),Fe=F(()=>Q?.value!==!0);return{isClient:D,renderAsFragment:be,debugPerformanceEnabled:xe,resolvedShowTooltips:Re,resolvedHtmlPolicy:Ae,inheritedSmoothStreaming:ve,inheritedTypewriterCursor:Q,ownsTypewriterCursor:Fe}})(k),{resolveViewportRoot:ye,resolveScrollContainer:Se,isReverseFlexScrollRoot:U,getNormalizedScrollTop:Z,getOffsetTopWithinRoot:fe}=(function(T,D){function j(){var xe,Re;return(Re=(xe=D.scrollRoot)==null?void 0:xe.call(D))!=null?Re:null}function q(xe){if(typeof window>"u")return null;const Re=j();if(Re)return Re;const Ae=xe??T.value;if(!Ae)return null;const Fe=Ae.ownerDocument||document,De=Fe.scrollingElement||Fe.documentElement;let Ee=Ae;for(;Ee&&Ee!==Fe.body&&Ee!==De;){if(IU(window.getComputedStyle(Ee))&&NU(Ee))return Ee;Ee=Ee.parentElement}return null}function Q(xe){if(!D.isClient)return!1;try{const Re=window.getComputedStyle(xe);return!!(Re.display||"").toLowerCase().includes("flex")&&(Re.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function ve(xe,Re,Ae){var Fe,De;if(Ae)return be(Re);const Ee=xe.scrollTop;if(!Q(xe))return Ee;const Be=Ee<0?-Ee:Ee;return Math.max(0,((Fe=xe.scrollHeight)!=null?Fe:0)-((De=xe.clientHeight)!=null?De:0))-Be}function be(xe){var Re,Ae,Fe,De,Ee;const Be=Number((Re=xe.scrollingElement)==null?void 0:Re.scrollTop),qe=Number((Fe=(Ae=xe.documentElement)==null?void 0:Ae.scrollTop)!=null?Fe:0),ze=Number((Ee=(De=xe.body)==null?void 0:De.scrollTop)!=null?Ee:0);return Math.max(0,Number.isFinite(Be)?Be:0,Number.isFinite(qe)?qe:0,Number.isFinite(ze)?ze:0)}return{resolveViewportRoot:q,resolveScrollContainer:function(xe){var Re,Ae,Fe,De;const Ee=j();if(Ee)return Ee;const Be=q((Re=xe??T.value)!=null?Re:null);if(Be)return Be;const qe=(De=(Fe=xe?.ownerDocument)!=null?Fe:(Ae=T.value)==null?void 0:Ae.ownerDocument)!=null?De:typeof document<"u"?document:null;return qe?.scrollingElement||qe?.documentElement||null},isReverseFlexScrollRoot:Q,getNormalizedScrollTop:ve,getOffsetTopWithinRoot:function(xe,Re){const Ae=Re.ownerDocument||xe.ownerDocument||document;if((function(Be,qe){return Be===qe.documentElement||Be===qe.body||Be===qe.scrollingElement})(Re,Ae))return xe.getBoundingClientRect().top+be(Ae);const Fe=Re.getBoundingClientRect(),De=xe.getBoundingClientRect(),Ee=ve(Re,Ae,!1);return De.top-Fe.top+Ee}}})(M,{isClient:de,scrollRoot:ee});kn("markstreamShowTooltips",_e),kn("markstreamHtmlPolicy",me),kn("markstreamTypewriter",F(()=>k.typewriter!==!1)),kn("markstreamFade",F(()=>k.fade!==!1)),kn("markstreamTypewriterCursor",F(()=>!0)),kn("markstreamTextStreamState",V),kn("markstreamStreamVersion",se),kn("markstreamParseOptions",F(()=>k.parseOptions)),kn("markstreamCustomMarkdownIt",F(()=>k.customMarkdownIt));const{smoothStreamingEnabled:oe,renderContent:he,effectiveFinal:H}=(function(T,D){const j=$U(T.smoothStreamingOptions),q=F(()=>{var Ae,Fe,De;return T.smoothStreaming!==!1&&!((Ae=T.nodes)!=null&&Ae.length)&&(T.smoothStreaming===!0||!((Fe=D.inheritedSmoothStreaming)!=null&&Fe.value))&&(T.smoothStreaming===!0||T.typewriter===!0||((De=T.maxLiveNodes)!=null?De:0)<=0)}),Q=te(!D.isClient||T.smoothStreaming===!0);Qt(()=>{Q.value=!0});const ve=F(()=>Q.value&&q.value),be=F(()=>{var Ae;return ve.value?j.visible.value:(Ae=T.content)!=null?Ae:""}),xe=F(()=>{var Ae,Fe;const De=(Ae=T.parseOptions)!=null?Ae:{};return(Fe=T.final)!=null?Fe:De.final}),Re=F(()=>{const Ae=xe.value;return ve.value&&Ae!=null?!!Ae&&j.caughtUp.value:Ae});return Ve([()=>T.content,()=>T.nodes,ve,xe],([Ae,Fe,De,Ee])=>{if(Fe?.length)return void j.reset("");const Be=Ae??"";if(!De)return j.reset(Be),void(Ee&&j.finish({flush:!0}));const qe=j.source.value;Be?Be===qe||(Be.startsWith(qe)?j.enqueue(Be.slice(qe.length)):j.reset(Be)):j.reset(""),Ee&&j.finish()},{immediate:!0}),{smoothStream:j,smoothStreamingEligible:q,smoothStreamingEnabled:ve,renderContent:be,requestedFinal:xe,effectiveFinal:Re}})(k,{isClient:de,inheritedSmoothStreaming:$e});kn("markstreamSmoothStreaming",oe);const X=te(!1);let ae="",ke=!1,Me=null;function Ie(){de&&Me!=null&&(window.clearTimeout(Me),Me=null)}function re(){X.value=!1,Ie()}function le(T,D){if(!ce.value)return;const j=(function(){if(!ce.value)return null;const q=bt(Ce),Q=bt(We),ve=Math.max(lt,Q);if(q<=0&&ve<=0)return null;const be={total:q,maxPerFrame:ve,byLabel:(xe=Ce,Object.fromEntries(Array.from(xe.entries()).sort((Re,Ae)=>Ae[1]-Re[1]||Re[0].localeCompare(Ae[0]))))};var xe;return Ce.clear(),We.clear(),lt=0,be})();console.info(`[markstream-vue][perf] ${T}`,j?wt(Qe({},D),{layoutReads:j}):D)}Ve([he,()=>s.nodes,H],([T,D,j])=>{const q=T??"";return D?.length||j===!0?(re(),ae=q,void(ke=!0)):ke?(ae&&q.length>ae.length&&q.startsWith(ae)?(X.value=!0,de&&(Ie(),Me=window.setTimeout(()=>{var Q;Me=null,H.value===!0||(Q=s.nodes)!=null&&Q.length||(El(),X.value=!1,hi())},1200))):(q.length<ae.length||!q.startsWith(ae))&&re(),void(ae=q)):(ae=q,void(ke=!0))},{flush:"sync",immediate:!0});const Ce=new Map,We=new Map;let nt=!1,lt=0;function bt(T){let D=0;for(const j of T.values())D+=j;return D}function St(){lt=Math.max(lt,bt(We)),We.clear(),nt=!1}function ct(T,D){return(function(j){var q,Q;ce.value&&(Ce.set(j,((q=Ce.get(j))!=null?q:0)+1),We.set(j,((Q=We.get(j))!=null?Q:0)+1),nt||(nt=!0,de&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(St):typeof queueMicrotask!="function"?setTimeout(St,0):queueMicrotask(St)))})(T),D()}const It=k.customId?`renderer-${k.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,hn=(function(T){const D=new Map;return{scope:T,cache:D,clear:()=>D.clear()}})(It),vn=F(()=>`${It}:${se.value}`);kn(fM,hn);const $t=Vn(()=>k.customId),{effectiveCustomHtmlTagsSet:pn,mergedParseOptions:un,parsedNodes:et}=AU(k,{instanceMsgId:It,renderContent:he,effectiveFinal:H,smoothStreamingEnabled:oe,debugPerformanceEnabled:ce,customComponentsMap:$t,logPerf:le});Ve(et,()=>{hn.clear(),se.value+=1},{immediate:!0});const Rn=F(()=>({customId:k.customId,customHtmlTags:un.value.customHtmlTags,parseOptions:k.parseOptions,customMarkdownIt:k.customMarkdownIt,htmlPolicy:me.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:_e.value,themes:k.themes,langs:k.langs,isDark:k.isDark,typewriter:k.typewriter,smoothStreamingOptions:k.smoothStreamingOptions,parseCoalesceMs:k.parseCoalesceMs,fade:k.fade}));kn("markstreamNestedRendererProps",Rn);const Po=F(()=>et.value),fs=F(()=>et.value.length),Fn=te(null),sn=te(null),En=te(null),Kn=te(null),_n=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),xs=!_n&&k.customId?Sw(k.customId):null,Hn=F(()=>xs?(ww.value,Sw(k.customId)):null),hs=F(()=>{var T;return!!(de&&!Le.value&&k.customId&&!_n&&((T=Hn.value)!=null&&T.enabled))}),ps=F(()=>{var T;return!!(!Le.value&&((T=s.virtualScroll)!=null&&T.enabled))}),ss=te(!1);Qt(()=>{ss.value=!0});const Tt=F(()=>!!(de&&ps.value));kn("markstreamHostScrollManaged",Tt);const ms=F(()=>!!(ss.value&&Tt.value)),qt=F(()=>hs.value||Tt.value),Ts=F(()=>hs.value||ms.value),Ke=F(()=>{var T;return qt.value&&((T=Hn.value)==null?void 0:T.textEstimation)!==!1}),Ue=F(()=>{var T;return qt.value&&((T=Hn.value)==null?void 0:T.codeBlockEstimation)!==!1});function Je(){const T=Y.value||ct("getMeasuredContainerWidth.clientWidth",()=>{var D;return((D=M.value)==null?void 0:D.clientWidth)||0});return Number.isFinite(T)&&T>0?T:0}const Mt=F(()=>{const T=Je();return T>0?Math.max(1,Math.round(T)):640}),Ne=F(()=>{var T;return Math.max(1,(T=k.maxLiveNodes)!=null?T:320)}),ge=F(()=>{var T;return!Le.value&&k.nodeVirtual!==!1&&!(((T=k.maxLiveNodes)!=null?T:0)<=0)&&(k.nodeVirtual===!0?et.value.length>0:et.value.length>Ne.value)}),He=F(()=>ge.value||hs.value||Tt.value),zt=F(()=>k.viewportPriority!==!1&&!K.value),Yt=gW(T=>{var D;return ye((D=T??M.value)!=null?D:null)},zt),{requestFrame:Nt,cancelFrame:Pt,hasIdleCallback:po,isTestEnv:mo}=(function(T){const D=T.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,j=T.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,q=T.isClient&&typeof window.requestIdleCallback=="function",Q=(function(){var ve;if(typeof globalThis>"u"||!("process"in globalThis))return;const be=(ve=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:ve.value;return be?.env})();return{requestFrame:D,cancelFrame:j,hasIdleCallback:q,isTestEnv:Q?.NODE_ENV==="test"}})({isClient:de}),{resolvedBatchSize:Bi,resolvedInitialBatch:zo,batchingEnabled:Fi,incrementalRenderingActive:Vo,renderedCount:Jn,previousRenderContext:Hi,adaptiveBatchSize:vl,previousBatchConfig:Er}=(function(T,D){var j;const q=F(()=>{var De;const Ee=Math.trunc((De=T.renderBatchSize)!=null?De:80);return Number.isFinite(Ee)?Math.max(0,Ee):0}),Q=F(()=>{var De;const Ee=Math.trunc((De=T.initialRenderBatchSize)!=null?De:q.value);return Number.isFinite(Ee)?Math.max(0,Ee):q.value}),ve=F(()=>!D.renderAsFragment.value&&T.batchRendering!==!1&&q.value>0&&D.isClient&&!D.isTestEnv),be=te(0),xe=te({key:T.indexKey,total:0}),Re=te(Math.max(1,q.value||1)),Ae=F(()=>{var De;return ve.value&&((De=T.maxLiveNodes)!=null?De:0)<=0}),Fe=te({batchSize:q.value,initial:Q.value,delay:(j=T.renderBatchDelay)!=null?j:16,enabled:Ae.value});return{resolvedBatchSize:q,resolvedInitialBatch:Q,batchingEnabled:ve,incrementalRenderingActive:Ae,renderedCount:be,previousRenderContext:xe,adaptiveBatchSize:Re,previousBatchConfig:Fe}})(k,{isClient:de,isTestEnv:mo,renderAsFragment:Le}),ue=new Map,pe=new Map,z=new WeakMap;let ne=null;const Ge=new WeakMap,tt=new Map,Ct=te(0),mn=F(()=>(Ct.value,Array.from(ue.entries()).sort((T,D)=>T[0]-D[0]))),Dn=te(null),wn=te(null);let ln=null,an=0,Sn=null;const{activeRestoreAnchor:go,getRelativeScrollTopWithinContainer:$r,setRelativeScrollTopWithinContainer:Ir,resolveAnchorOffset:yl,clearRestoreReconcile:ui,scheduleRestoreReconcile:Nr,captureRestoreAnchor:r0,restoreAnchor:l0,getAnchorDrift:T3}=(function(T){const{isClient:D,containerRef:j,parsedNodeCount:q,requestFrame:Q,cancelFrame:ve,resolveScrollContainer:be,getNormalizedScrollTop:xe,getOffsetTopWithinRoot:Re,isReverseFlexScrollRoot:Ae,estimateIndexForOffset:Fe,estimateHeightRange:De,getFallbackNodeHeight:Ee,clamp:Be}=T,qe=te(null);let ze=null,ht=[];function st(){const yt=be(),At=j.value;if(!yt||!At)return null;const xt=yt.ownerDocument||At.ownerDocument||document;if(yt===xt.documentElement||yt===xt.body||yt===xt.scrollingElement){const Xt=At.getBoundingClientRect();return Math.max(0,-Xt.top)}return Math.max(0,xe(yt,xt,!1)-Re(At,yt))}function ot(yt){var At;const xt=be(),Xt=j.value;if(!xt||!Xt)return;const Zs=Math.max(0,yt),Ms=xt.ownerDocument||Xt.ownerDocument||document,Ro=Ms.defaultView||(typeof window<"u"?window:null);if(xt===Ms.documentElement||xt===Ms.body||xt===Ms.scrollingElement){const Vi=xe(xt,Ms,!0)+Xt.getBoundingClientRect().top;return void((At=Ro?.scrollTo)==null||At.call(Ro,0,Math.max(0,Vi+Zs)))}Tw(xt,Ms,Re(Xt,xt)+Zs,{isReverseFlexScrollRoot:Vi=>{var Ki;return(Ki=Ae?.(Vi))!=null&&Ki},getNormalizedScrollTop:xe})}function mt(yt){const At=q.value,xt=Be(yt.nodeIndex,0,Math.max(0,At-1));return De(0,xt)+Math.max(0,yt.offsetWithinNodePx)}function pt(){if(ze!=null&&(ve?.(ze),ze=null),D)for(const yt of ht)window.clearTimeout(yt);ht=[]}function Wt(yt){const At=mt(yt),xt=st();xt!=null&&Math.abs(xt-At)<=.5||ot(At)}return{activeRestoreAnchor:qe,getRelativeScrollTopWithinContainer:st,setRelativeScrollTopWithinContainer:ot,resolveAnchorOffset:mt,clearRestoreReconcile:pt,applyRestoreAnchor:Wt,scheduleRestoreReconcile:function(){qe.value&&D&&ze==null&&(ze=Q?Q(()=>{ze=null,qe.value&&Wt(qe.value)}):null,ze==null&&qe.value&&Wt(qe.value))},captureRestoreAnchor:function(){const yt=st(),At=q.value;if(yt==null||At<=0)return null;const xt=Be(Fe(yt+1),0,At-1),Xt=De(0,xt),Zs=Ee(xt);return{nodeIndex:xt,offsetWithinNodePx:Be(yt-Xt,0,Math.max(0,Zs-1))}},restoreAnchor:function(yt){const At=q.value;if(qe.value={nodeIndex:Be(yt.nodeIndex,0,Math.max(0,At-1)),offsetWithinNodePx:Math.max(0,yt.offsetWithinNodePx)},pt(),Wt(qe.value),D)for(const xt of[0,120,280,480])ht.push(window.setTimeout(()=>{qe.value&&Wt(qe.value)},xt))},getAnchorDrift:function(yt){const At=st();return At==null?null:At-mt(yt)}}})({isClient:de,containerRef:M,parsedNodeCount:fs,requestFrame:Nt,cancelFrame:Pt,resolveScrollContainer:()=>Dn.value||Se(),getNormalizedScrollTop:Z,getOffsetTopWithinRoot:fe,isReverseFlexScrollRoot:U,estimateIndexForOffset:$p,estimateHeightRange:zi,getFallbackNodeHeight:Eu,clamp:is}),{nodeHeights:vo,heightStats:yo,heightTreeSize:Na,heightSumTree:Vh,heightKnownTree:Kh,averageNodeHeight:Ko,resetHeightMeasurements:M3,pruneHeightMeasurements:A3,rebuildHeightTrees:bu,recordNodeHeight:E3,removeNodeHeights:$3,exportHeightCache:I3,importHeightCache:N3,fenwickRangeSum:_u}=(function(T={}){const D=so({}),j=so({total:0,count:0}),q=te(0),Q=te([]),ve=te([]);function be(){for(const Ee of Object.keys(D))delete D[Number(Ee)];j.total=0,j.count=0,q.value=0,Q.value=[],ve.value=[]}function xe(Ee,Be,qe){for(let ze=Be+1;ze<Ee.length;ze+=ze&-ze)Ee[ze]+=qe}function Re(Ee,Be){let qe=0;for(let ze=Be+1;ze>0;ze-=ze&-ze)qe+=Ee[ze];return qe}function Ae(Ee){q.value=Ee;const Be=new Array(Ee+1).fill(0),qe=new Array(Ee+1).fill(0);for(const[ze,ht]of Object.entries(D)){const st=Number(ze),ot=Number(ht);!Number.isFinite(st)||st<0||st>=Ee||!Number.isFinite(ot)||ot<=0||(xe(Be,st,ot),xe(qe,st,1))}Q.value=Be,ve.value=qe}function Fe(Ee){if(!Number.isInteger(Ee)||Ee<0)return!1;const Be=D[Ee];if(!Number.isFinite(Be)||Be<=0)return!1;if(delete D[Ee],j.total=Math.max(0,j.total-Be),j.count=Math.max(0,j.count-1),q.value>Ee){const qe=Q.value,ze=ve.value;qe.length&&ze.length&&(xe(qe,Ee,-Be),xe(ze,Ee,-1))}return!0}const De=F(()=>j.count>0?Math.max(12,j.total/j.count):32);return{nodeHeights:D,heightStats:j,heightTreeSize:q,heightSumTree:Q,heightKnownTree:ve,averageNodeHeight:De,resetHeightMeasurements:be,pruneHeightMeasurements:function(Ee){if(Ee<=0)return void be();let Be=0,qe=0;for(const[ze,ht]of Object.entries(D)){const st=Number(ze),ot=Number(ht);!Number.isFinite(st)||st<0||st>=Ee||!Number.isFinite(ot)||ot<=0?delete D[st]:(Be+=ot,qe++)}j.total=Be,j.count=qe},rebuildHeightTrees:Ae,recordNodeHeight:function(Ee,Be,qe={}){(function(ze,ht,st={}){var ot;if(!Number.isFinite(ht)||ht<=0)return!1;const mt=D[ze];if(mt&&(st.allowShrink===!1&&ht<mt||Math.abs(ht-mt)<=1))return!1;if(D[ze]=ht,mt?j.total+=ht-mt:(j.total+=ht,j.count++),q.value>ze){const pt=Q.value,Wt=ve.value;if(pt.length&&Wt.length)if(mt){const yt=ht-mt;yt!==0&&xe(pt,ze,yt)}else xe(pt,ze,ht),xe(Wt,ze,1)}st.notify!==!1&&((ot=T.onHeightRecorded)==null||ot.call(T))})(Ee,Be,wt(Qe({},qe),{notify:!0}))},removeNodeHeight:function(Ee,Be={}){var qe;const ze=Fe(Ee);return ze&&Be.notify!==!1&&((qe=T.onHeightRecorded)==null||qe.call(T)),ze},removeNodeHeights:function(Ee,Be={}){var qe;let ze=0;for(const ht of Ee)Fe(Number(ht))&&ze++;return ze>0&&Be.notify!==!1&&((qe=T.onHeightRecorded)==null||qe.call(T)),ze},exportHeightCache:function(){return Object.entries(D).map(([Ee,Be])=>({index:Number(Ee),height:Number(Be)})).filter(Ee=>Number.isFinite(Ee.index)&&Ee.index>=0&&Number.isFinite(Ee.height)&&Ee.height>0).sort((Ee,Be)=>Ee.index-Be.index)},importHeightCache:function(Ee,Be={}){var qe;if(!Array.isArray(Ee))return;const ze=q.value;let ht=!1;if(Be.mode!=="merge"){const st=Object.keys(D);if(st.length>0){for(const ot of st)delete D[Number(ot)];ht=!0}}for(const st of Ee){const ot=Number(st.index),mt=Number(st.height);if(!Number.isInteger(ot)||ot<0||ze>0&&ot>=ze||!Number.isFinite(mt)||mt<=0)continue;const pt=D[ot];pt&&Math.abs(pt-mt)<=1||(D[ot]=mt,ht=!0)}ht&&((function(){let st=0,ot=0;const mt=q.value;for(const[pt,Wt]of Object.entries(D)){const yt=Number(pt),At=Number(Wt);!Number.isFinite(yt)||yt<0||mt>0&&yt>=mt||!Number.isFinite(At)||At<=0?delete D[yt]:(st+=At,ot++)}j.total=st,j.count=ot})(),ze>0&&Ae(ze),(qe=T.onHeightRecorded)==null||qe.call(T))},fenwickRangeSum:function(Ee,Be,qe){if(qe<=Be)return 0;const ze=Re(Ee,qe-1);return Be<=0?ze:ze-Re(Ee,Be-1)}}})({onHeightRecorded:()=>{bo(),Tt.value&&Ga(),go.value&&Nr(),wn.value&&Tl(),dn("node-resize")}});function wu(){M3(),tt.clear()}function a0(T){!Number.isInteger(T)||T<0||T>=et.value.length||tt.set(T,Da(T))}function c0(T,D,j={}){const q=vo[T];E3(T,D,j);const Q=vo[T];Q&&Q>0?a0(T):q&&tt.delete(T)}function u0(T,D){const j=ct("getNodeLayoutHeight.slot.offsetHeight",()=>{var q,Q;return(Q=(q=ue.get(T))==null?void 0:q.offsetHeight)!=null?Q:0});return j>0?j:ct("getNodeLayoutHeight.content.offsetHeight",()=>D.offsetHeight)}function d0(T,D={}){N3(T,D),_p()}const Wi=F(()=>{var T;return!Le.value&&k.deferNodesUntilVisible!==!1&&!(((T=k.maxLiveNodes)!=null?T:0)<=0)&&!ge.value&&!(et.value.length>900)&&zt.value}),f0=F(()=>!!Yt&&(Wi.value||ge.value)),h0=F(()=>ge.value||Tt.value),{liveNodeBufferResolved:La,focusIndex:ko,liveRange:os,updateLiveRange:Lr}=(function(T,D){const{parsedNodeCount:j,virtualizationEnabled:q,maxLiveNodesResolved:Q,clamp:ve}=D,be=F(()=>{var Ae;return Math.max(0,(Ae=T.liveNodeBuffer)!=null?Ae:60)}),xe=te(0),Re=so({start:0,end:0});return{liveNodeBufferResolved:be,focusIndex:xe,liveRange:Re,updateLiveRange:function(){const Ae=j.value;if(!q.value||Ae===0)return Re.start=0,void(Re.end=Ae);const Fe=Math.min(Q.value,Ae),De=be.value,Ee=ve(xe.value-De,0,Math.max(0,Ae-Fe));Re.start=Ee,Re.end=Math.min(Ae,Ee+Fe)}}})(k,{parsedNodeCount:fs,virtualizationEnabled:ge,maxLiveNodesResolved:Ne,clamp:is}),Go=new Map,Or=new Map,Ui=new Map,Su=[],di=new Map,ji=new Set,p0=te(0);let Gh=!1;const m0=F(()=>(p0.value,ji.size)),Gs=new Map,Yo=new Map,g0=te(0),Yh=F(()=>{g0.value;let T=0;for(const D of Gs.values())T+=Math.max(0,D);return T});let Ys=null,Xh=!0,v0=[0],y0="";function bo(){Xh=!0}const Cu=F(()=>{if(!ge.value)return et.value.length;const T=La.value,D=Math.max(os.end+T,zo.value),j=Math.min(et.value.length,D);return Math.max(Jn.value,j)});function xu(){Gh||(Gh=!0,queueMicrotask(()=>{Gh=!1,p0.value+=1}))}function k0(T,D,j="node-resize"){if(!de||typeof window>"u")return null;const q=window.setTimeout(()=>{ji.delete(q)&&xu();try{D()}finally{dn(j)}},Math.max(0,T));return ji.add(q),xu(),q}function Tu(T){de&&T!=null&&(ji.delete(T)&&xu(),window.clearTimeout(T))}function b0(){if(de&&typeof window<"u")for(const T of ji)window.clearTimeout(T);ji.size&&(ji.clear(),xu()),Su.length=0,Ui.clear()}function L3(T){var D,j;return(j=(D=Kn.value)==null?void 0:D[T])!=null?j:null}const{cancelScheduledFocusSync:Zh,scheduleFocusSync:Xo}=(function(T){const{isClient:D,containerRef:j,virtualizationEnabled:q,requestFrame:Q,cancelFrame:ve,syncFocusToScroll:be}=T;let xe=null;function Re(){var Fe,De,Ee;return(Ee=(De=(Fe=j.value)==null?void 0:Fe.ownerDocument)==null?void 0:De.defaultView)!=null?Ee:typeof window<"u"?window:null}function Ae(){if(!xe)return;const Fe=Re();xe.viaTimeout?Fe?Fe.clearTimeout(xe.id):clearTimeout(xe.id):ve?.(xe.id),xe=null}return{cancelScheduledFocusSync:Ae,scheduleFocusSync:function(Fe={}){if(!q.value)return;if(!D)return void be(!0);if(Fe.immediate)return Ae(),void be(!0);if(xe)return;const De=()=>{xe=null,be()};if(Q)return void(xe={id:Q(De),viaTimeout:!1});const Ee=Re();xe={id:Ee?Ee.setTimeout(De,16):setTimeout(De,16),viaTimeout:!0}}}})({isClient:de,containerRef:M,virtualizationEnabled:ge,requestFrame:Nt,cancelFrame:Pt,syncFocusToScroll:function(T=!1){var D;if(!ge.value)return;const j=Dn.value||Se();if(!j)return;const q=j.ownerDocument||((D=M.value)==null?void 0:D.ownerDocument)||document,Q=q?.defaultView||(typeof window<"u"?window:null),ve=j===q?.documentElement||j===q?.body,be=et.value.length;if(!ve&&be>0&&U(j)){const qe=ct("syncFocusToScroll.clientHeight",()=>j.clientHeight||0),ze=ct("syncFocusToScroll.scrollTop",()=>j.scrollTop),ht=ze<0?-ze:ze,st=(function(mt){var pt,Wt;const yt=et.value;if(!yt.length)return 0;if(mt<=0)return Math.max(0,yt.length-1);if(qt.value){const xt=(pt=np()[yt.length])!=null?pt:0;return A0(Math.max(0,xt-mt))}if(Na.value===yt.length){const xt=zi(0,yt.length);return $p(Math.max(0,xt-mt))}let At=mt;for(let xt=yt.length-1;xt>=0;xt--){const Xt=(Wt=vo[xt])!=null?Wt:Ko.value;if(At<=Xt)return xt;At-=Xt}return 0})(Math.max(0,ht)+.5*Math.max(0,qe)),ot=is(st,0,Math.max(0,be-1));return void((T||Math.abs(ot-ko.value)>1)&&(ko.value=ot,Lr()))}const xe=ve?null:ct("syncFocusToScroll.root.getBoundingClientRect",()=>j.getBoundingClientRect()),Re=ve?0:xe.top,Ae=ve?ct("syncFocusToScroll.viewport.clientHeight",()=>{var qe,ze;return(ze=(qe=Q?.innerHeight)!=null?qe:j.clientHeight)!=null?ze:0}):xe.bottom,Fe=mn.value;let De=null,Ee=null;for(const[qe,ze]of Fe){if(!ze)continue;const ht=ct("syncFocusToScroll.slot.getBoundingClientRect",()=>ze.getBoundingClientRect());ht.bottom<=Re||ht.top>=Ae||(De==null&&(De=qe),Ee=qe)}if(De==null||Ee==null){const qe=M.value;if(!qe)return;const ze=ve?{top:0}:ct("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>j.getBoundingClientRect()),ht=ct("syncFocusToScroll.fallback.scrollTop",()=>Z(j,q,ve)),st=ve?(()=>{const pt=ct("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>qe.getBoundingClientRect()),Wt=(ve?0:ze.top)-pt.top;return Math.max(0,Wt)})():(()=>{const pt=fe(qe,j);return Math.max(0,ht-pt)})(),ot=ve?ct("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var pt,Wt,yt,At;return(At=(yt=(Wt=Q?.innerHeight)!=null?Wt:(pt=q?.documentElement)==null?void 0:pt.clientHeight)!=null?yt:j.clientHeight)!=null?At:0}):ct("syncFocusToScroll.fallback.root.clientHeight",()=>j.clientHeight),mt=$p(st+.5*Math.max(0,ot));return ko.value=is(mt,0,Math.max(0,et.value.length-1)),void Lr()}const Be=Math.round((De+Ee)/2);!T&&Math.abs(Be-ko.value)<=1||(ko.value=is(Be,0,Math.max(0,et.value.length-1)),Lr())}}),{visibleNodeIndices:Jh,nodeVisibilityHandles:kl,nodeVisibilityWatchStops:Mu,nodeVisibilityFallbackTimers:_0,clearVisibilityFallback:Au,markNodeVisible:qi,cleanupNodeVisibility:O3,destroyNodeVisibilityState:Qh}=EU({isClient:de,shouldTrackVisibleNodeIndices:()=>Wi.value,shouldCleanupNodeVisibility:()=>ge.value,onNodeMarkedVisible:T=>{ge.value?Xo():ko.value=is(T,0,Math.max(0,et.value.length-1))},onNodeVisibilityCleaned:T=>{ue.delete(T)&&X0()}}),{cleanupScrollListener:w0,setupScrollListener:P3}=(function(T){const{isClient:D,virtualizationEnabled:j,listenerEnabled:q,scrollRootElement:Q,resolveScrollContainer:ve,scheduleFocusSync:be,onScroll:xe}=T;let Re=null,Ae=null;function Fe(){Re&&(Re(),Re=null),Ae=null,Q.value=null}function De(Ee){const Be=T.getScrollTop?T.getScrollTop(Ee):Ee.scrollTop;return Math.max(0,Number.isFinite(Be)?Math.abs(Be):0)}return{cleanupScrollListener:Fe,setupScrollListener:function(){if(!D)return;if(!((Ee=q?.value)!=null?Ee:j.value))return void Fe();var Ee;const Be=ve();if(!Be)return void Fe();if(Q.value===Be&&Re)return;Fe(),Ae=De(Be);const qe=()=>{if(xe?.(),j.value){const ze=(function(ht){const st=De(ht),ot=Ae;Ae=st;const mt=Math.max(480,.75*(ht.clientHeight||0));return ot==null?st>mt?{immediate:!0}:void 0:Math.abs(st-ot)>mt?{immediate:!0}:void 0})(Be);ze?be(ze):be()}};Be.addEventListener("scroll",qe,{passive:!0}),Q.value=Be,Re=()=>{Be.removeEventListener("scroll",qe)}}}})({isClient:de,virtualizationEnabled:ge,listenerEnabled:h0,scrollRootElement:Dn,resolveScrollContainer:Se,scheduleFocusSync:Xo,onScroll:function(){const T=wn.value;if(!T)return;const D=Ra();if(!D||(function(q){if(Ua()>=an)return Sn=null,!1;const Q=Sn;if(Q==null)return!0;const ve=Math.abs(q.scrollTop-Q)<=2;return ve||(Sn=null),ve})(D))return;const j=D0(D);j!=null?(j<-32||Math.abs(Math.max(0,j)-Math.max(0,T.distanceFromBottomPx))>32)&&xl("restore"):xl("restore")},getScrollTop:T=>{var D;const j=T.ownerDocument||((D=M.value)==null?void 0:D.ownerDocument)||document,q=T===j.documentElement||T===j.body||T===j.scrollingElement;return ct("scrollListener.getScrollTop",()=>Z(T,j,q))}});function is(T,D,j){return Math.min(Math.max(T,D),j)}function ep(T){return T?.firstElementChild}function S0(T,D){var j;return T?(j=T.matches)!=null&&j.call(T,D)?T:T.querySelector(D):null}function C0(){if(!qt.value)return void(Y.value=0);const T=ct("updateExperimentContainerWidth.clientWidth",()=>{var D,j;return(j=(D=M.value)==null?void 0:D.clientWidth)!=null?j:0});Y.value=T>0?T:0}let Oa=null;function tp(){Oa?.disconnect(),Oa=null}const x0=ii({loader:()=>Cn(null,null,function*(){return(yield oo(()=>import("./index8-C1M9n-68.js"),__vite__mapDeps([5,4]))).default}),loadingComponent:iM,delay:0,suspensible:!1});function T0(T){return T===x0}const M0=F(()=>u.value==="pre"?Qs:u.value==="shiki"?x0:Im),Pr=F(()=>{const T=et.value;if(!T.length||!qt.value)return T.map(()=>null);const D=Y.value||ct("estimatedNodeHeights.clientWidth",()=>{var j;return((j=M.value)==null?void 0:j.clientWidth)||0});return!Number.isFinite(D)||D<=0?T.map(()=>null):T.map((j,q)=>{const Q=vo[q],ve=typeof Q=="number"&&Q>0;if(Ke.value&&!ve){const xe=dM(j,D,G.value);if(xe)return xe}if(Ue.value&&j.type==="code_block"){const xe=(function(Re){if(Re.type!=="code_block")return null;const Ae=cy(Re,Ru(Re));return T0(Ae)?"markdown":Ae===Qs?"pre":Ae===M0.value||Ae===Im?"monaco":null})(j);if(xe==="monaco"||xe==="markdown"||xe==="pre")return pU(j,{rendererKind:xe,monacoOptions:k.codeBlockMonacoOptions,showHeader:((be=k.codeBlockProps)==null?void 0:be.showHeader)!==!1})}var be;return null})});function Eu(T){var D;const j=vo[T];if(Number.isFinite(j)&&j>0)return j;const q=(D=Pr.value[T])==null?void 0:D.height;return Number.isFinite(q)&&q>0?q:Math.max(Ko.value,(function(Q){var ve,be,xe,Re,Ae,Fe,De,Ee,Be,qe,ze,ht,st;const ot=et.value[Q];if(!ot||typeof ot!="object")return 32;const mt=String((ve=ot.type)!=null?ve:""),pt=Je()||640;switch(mt){case"heading":return 44;case"paragraph":return bl(String((xe=(be=ot.raw)!=null?be:ot.content)!=null?xe:""),pt,34);case"list":{const Wt=Array.isArray(ot.items)?ot.items.length:1;return Math.max(48,30*Wt+12)}case"list_item":return bl(String((Ae=(Re=ot.raw)!=null?Re:ot.content)!=null?Ae:""),pt,34);case"blockquote":return bl(String((De=(Fe=ot.raw)!=null?Fe:ot.content)!=null?De:""),pt,56);case"table":{const Wt=Array.isArray(ot.rows)?ot.rows.length:Array.isArray(ot.children)?ot.children.length:3;return Math.max(120,38*Wt+48)}case"code_block":return bl(String((Be=(Ee=ot.code)!=null?Ee:ot.raw)!=null?Be:""),pt,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return bl(String((ze=(qe=ot.raw)!=null?qe:ot.content)!=null?ze:""),pt,96);case"thematic_break":return 24;default:return bl(String((st=(ht=ot.raw)!=null?ht:ot.content)!=null?st:""),pt,40)}})(T))}function bl(T,D,j,q=22){const Q=String(T??"");if(!Q)return j;const ve=Math.max(18,Math.floor(Math.max(320,D)/8)),be=Q.split(/\r?\n/).length,xe=Math.ceil(Q.length/ve),Re=Math.max(1,be,xe);return Math.max(j,Math.ceil(Re*q+12))}function Pa(T){const D=Number(T);return!Number.isFinite(D)||D<=0?-1:Math.round(D/32)}function np(){var T,D;const j=et.value.length,q=Pa(Y.value||ct("getFallbackHeightPrefix.clientWidth",()=>{var xe;return((xe=M.value)==null?void 0:xe.clientWidth)||0})),Q=((T=s.virtualScroll)==null?void 0:T.measurementKey)==null?"":String(s.virtualScroll.measurementKey),ve=[j,yo.count,Math.round(yo.total),Math.round(100*Ko.value),Q,q,qt.value?1:0,ww.value,se.value].join(":");if(!Xh&&y0===ve)return v0;const be=new Array(j+1);be[0]=0;for(let xe=0;xe<j;xe++)be[xe+1]=be[xe]+(qt.value?Eu(xe):(D=vo[xe])!=null?D:Ko.value);return v0=be,y0=ve,Xh=!1,be}function A0(T){var D,j;const q=et.value.length;if(q<=0||T<=0)return 0;const Q=np();if(T>=((D=Q[q])!=null?D:0))return q-1;let ve=0,be=q-1,xe=q-1;for(;ve<=be;){const Re=ve+be>>1;((j=Q[Re+1])!=null?j:0)>=T?(xe=Re,be=Re-1):ve=Re+1}return xe}function zi(T,D){var j,q;if(T>=D)return 0;if(qt.value)return(function(be,xe){var Re,Ae;const Fe=et.value.length,De=is(Math.trunc(be),0,Fe),Ee=is(Math.trunc(xe),De,Fe);if(De>=Ee)return 0;const Be=np();return((Re=Be[Ee])!=null?Re:0)-((Ae=Be[De])!=null?Ae:0)})(T,D);if(Na.value!==et.value.length){let be=0;for(let xe=T;xe<D;xe++)be+=(j=vo[xe])!=null?j:Ko.value;return be}const Q=Vh.value,ve=Kh.value;if(!Q.length||!ve.length){let be=0;for(let xe=T;xe<D;xe++)be+=(q=vo[xe])!=null?q:Ko.value;return be}return _u(Q,T,D)+(D-T-_u(ve,T,D))*Ko.value}Ve(()=>et.value.length,T=>{bo(),T<=0?wu():(T<Na.value&&A3(T),T!==Na.value&&bu(T))},{immediate:!0});const R3=F(()=>{if(!ge.value)return et.value.map((q,Q)=>({node:q,index:Q}));const T=et.value.length,D=is(os.start,0,T),j=is(os.end,D,T);return et.value.slice(D,j).map((q,Q)=>({node:q,index:D+Q}))}),sp=F(()=>ge.value?zi(0,Math.min(os.start,et.value.length)):0),op=F(()=>{if(!ge.value)return 0;const T=et.value.length;return zi(Math.min(os.end,T),T)});function E0(){if(!qt.value)return 0;let T=0;const D=Pr.value;for(let j=0;j<D.length;j++){if(!D[j])continue;const q=vo[j];Number.isFinite(q)&&q>0||T++}return T}function $0(){const T=et.value.length;return{totalNodes:T,measuredCount:yo.count,estimatedCount:E0(),averageNodeHeight:Ko.value,topSpacerHeight:sp.value,bottomSpacerHeight:op.value,estimatedTotalHeight:zi(0,T),width:Rr()}}function D3(){const T=et.value,D=$0();return wt(Qe({},D),{probe:{paragraphReady:!!G.value.paragraph,listItemReady:!!G.value.listItem,listWrapperOverhead:G.value.listWrapperOverhead,headingReadyLevels:Object.entries(G.value.headings).filter(([,j])=>!!j).map(([j])=>Number(j))},nodes:T.map((j,q)=>{var Q,ve,be,xe,Re,Ae,Fe,De,Ee;return{index:q,type:j.type,estimateKind:(ve=(Q=Pr.value[q])==null?void 0:Q.kind)!=null?ve:null,rendererKind:(xe=(be=Pr.value[q])==null?void 0:be.rendererKind)!=null?xe:null,estimatedHeight:(Ae=(Re=Pr.value[q])==null?void 0:Re.height)!=null?Ae:null,estimatedContentHeight:(De=(Fe=Pr.value[q])==null?void 0:Fe.contentHeight)!=null?De:null,measuredHeight:(Ee=vo[q])!=null?Ee:null}})})}function ip(){return s.indexKey!=null?String(s.indexKey):ps.value?`virtual-${yn()}`:"markdown-renderer"}function I0(T){const D=String(T),j=`${ip()}-`;if(!D.startsWith(j))return null;const q=D.slice(j.length).match(/^(\d+)(?:$|-)/);if(!q)return null;const Q=Number(q[1]);return!Number.isInteger(Q)||Q<0||Q>=et.value.length?null:Q}function yn(){var T,D,j;const q=(T=s.virtualScroll)==null?void 0:T.sessionKey;return String(q!=null&&q!==""?q:(j=(D=s.indexKey)!=null?D:k.customId)!=null?j:It)}function Gn(){var T;const D=(T=s.virtualScroll)==null?void 0:T.threadKey;return D==null||D===""?void 0:String(D)}function rp(T){var D;return(T??"")===((D=Gn())!=null?D:"")}function B3(){var T;const D=(T=s.virtualScroll)==null?void 0:T.measurementKey;return D==null?"":String(D)}function F3(){var T,D;const j=u.value,q=j==="monaco"?k.codeBlockMonacoOptions:void 0,Q=k.codeBlockProps,ve=j==="shiki";return[k.isDark?"dark":"light",j==="monaco"?"code-rich":j==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",Qn(k.codeBlockMinWidth),Qn(k.codeBlockMaxWidth),...ve?[Pf((T=Q?.themes)!=null?T:k.themes,(D=Q?.langs)!=null?D:k.langs)]:[],Qn(q?.fontSize),Qn(q?.lineHeight),Qn(q?.fontFamily),Qn(q?.tabSize),Qn(q?.MAX_HEIGHT),Qn(q?.wordWrap),Qn(q?.wrappingIndent),Qn(q?.padding),Qn(Q?.showHeader),Qn(Q?.showCopyButton),Qn(Q?.showExpandButton),Qn(Q?.showPreviewButton),Qn(Q?.showCollapseButton),Qn(Q?.showFontSizeButtons)].join("\0")}function fi(){return[B3(),F3()].join("\0")}function Rr(){return Je()}const $u=F(()=>Pa(Rr())),Xs=F(()=>[fi(),$u.value].join("\0")),H3=F(()=>{var T;return ps.value?["virtual",(T=Gn())!=null?T:"",yn(),Xs.value].join("\0"):s.indexKey});function _l(){g0.value+=1}function lp(T){return!(!T||!Number.isInteger(T.index)||T.index<0||T.index>=et.value.length||T.sessionKey!==yn()||T.threadKey!==Gn()||T.layoutEpochKey!==Xs.value)}function N0(T){const D=String(T),j=Yo.get(D);return j?lp(j)?j.index:null:I0(D)}function L0(T="async-node"){(Gs.size||Yo.size)&&(Gs.clear(),Yo.clear(),_l(),dn(T))}const wl=Dt(Vg,null),ap={reportHeight(T,D){if(!Tt.value)return;const j=N0(T);if(j==null)return;const q=Go.get(j);if(!q)return;const Q=Number(D),ve=u0(j,q);c0(j,Number.isFinite(Q)&&Q>0?Math.max(Q,ve||0):ve)},markPending(T){if(!Tt.value)return;const D=I0(T);D!=null&&(function(j,q){var Q;const ve=Yo.get(j);if(ve&&lp(ve))return Gs.set(j,Math.max(0,(Q=Gs.get(j))!=null?Q:0)+1),_l(),void dn("async-node");Gs.set(j,1),Yo.set(j,(function(be){return{index:be,sessionKey:yn(),threadKey:Gn(),layoutEpochKey:Xs.value}})(q)),_l(),dn("async-node")})(String(T),D)},markSettled(T){if(!Tt.value)return;const D=String(T),j=N0(T);(j!=null||(function(q){return Gs.has(String(q))})(D))&&(function(q){var Q;const ve=(Q=Gs.get(q))!=null?Q:0;return!(ve<=0||(ve<=1?(Gs.delete(q),Yo.delete(q)):Gs.set(q,ve-1),_l(),ve===1&&dn("async-node"),0))})(D)&&j!=null&&hi()}};function W3(){let T=0;for(const D of Go.values())T+=ct("getVisibleDomHeight.offsetHeight",()=>{var j;return(j=D?.offsetHeight)!=null?j:0});return Math.ceil(Math.max(0,T))}kn(Vg,{reportHeight(T,D){ap.reportHeight(T,D),wl?.reportHeight(T,D)},markPending(T){ap.markPending(T),wl?.markPending(T)},markSettled(T){ap.markSettled(T),wl?.markSettled(T)}});let cp,up=null,Sl=null;function Iu(T){return T!==!1&&T!=null&&T!==""}function O0(){return ge.value?(function(){if(!ge.value)return!0;const T=et.value.length,D=is(os.start,0,T),j=is(os.end,D,T);if(D>=j)return!0;for(let q=D;q<j;q++)if(!ue.has(q)||Ip(q)&&!Go.has(q))return!1;return!0})():Jn.value>=Cu.value}function dp(){return H.value===!0&&!X.value&&Yh.value===0&&ji.size===0&&di.size===0&&Ys==null&&O0()}function P0(){var T,D;if(((T=s.virtualScroll)==null?void 0:T.settleMode)!=="manual"||up===yn()&&cp===Gn())return!0;const j=(D=s.virtualScroll)==null?void 0:D.settledToken;return!!Iu(j)&&Sl===Ya(j)}function fp(){return dp()&&P0()}function U3(T,D){return D.totalNodes<=0?T==="final"?"final":"estimate":D.measuredCount>=D.totalNodes?T==="final"?"final":"measured":D.measuredCount>0||D.estimatedCount>0?"mixed":"estimate"}function Dr(T="manual",D){const j=$0(),q=(function(Q){return Q||(H.value!==!0?et.value.length>0?"streaming":"estimating":!O0()||di.size>0||Ys!=null?"measuring":fp()?"settled":"settling")})(D);return{sessionKey:yn(),threadKey:Gn(),phase:q,nodeCount:j.totalNodes,liveRange:{start:os.start,end:os.end},renderedCount:Jn.value,measuredCount:j.measuredCount,estimatedCount:j.estimatedCount,averageNodeHeight:j.averageNodeHeight,topSpacerHeight:j.topSpacerHeight,bottomSpacerHeight:j.bottomSpacerHeight,visibleDomHeight:W3(),totalHeight:R0(),width:j.width,final:H.value===!0,stable:fp(),confidence:U3(q,j),reason:T}}function Ra(){const T=Dn.value||Se(),D=M.value;if(!T||!D)return null;const j=T.ownerDocument||D.ownerDocument||document,q=T===j.documentElement||T===j.body||T===j.scrollingElement,Q=ct("getScrollBox.scrollTop",()=>Z(T,j,q)),ve=ct("getScrollBox.scrollHeight",()=>{var xe,Re,Ae,Fe,De;return q?Math.max((Re=(xe=j.documentElement)==null?void 0:xe.scrollHeight)!=null?Re:0,(Fe=(Ae=j.body)==null?void 0:Ae.scrollHeight)!=null?Fe:0,(De=T.scrollHeight)!=null?De:0):T.scrollHeight}),be=ct("getScrollBox.clientHeight",()=>{var xe;return q?((xe=j.documentElement)==null?void 0:xe.clientHeight)||T.clientHeight||0:T.clientHeight});return{root:T,doc:j,isViewportRoot:q,scrollTop:Q,scrollHeight:ve,clientHeight:be}}function R0(){const T=et.value.length,D=Math.max(0,zi(0,T)),j=ct("getRendererLogicalHeight.offsetHeight",()=>{var Q,ve;return(ve=(Q=M.value)==null?void 0:Q.offsetHeight)!=null?ve:0}),q=Math.max(0,j>0?j:ct("getRendererLogicalHeight.scrollHeight",()=>{var Q,ve;return(ve=(Q=M.value)==null?void 0:Q.scrollHeight)!=null?ve:0}));return T<=0?Math.ceil(j):ge.value?D>0?Math.max(1,Math.ceil(D),(function(){let Q=sp.value+op.value;for(const ve of ue.values())ve&&(Q+=Math.max(0,ct("getVirtualizedDomLogicalHeight.offsetHeight",()=>ve.offsetHeight||0)));return Math.ceil(Math.max(0,Q))})(),(function(Q,ve){return Q<=0||ve<=0?0:ve<=Q+Math.max(512,.05*Q)?Math.ceil(ve):0})(D,q)):Math.max(1,Math.ceil(q)):Tt.value?D>0||yo.count>0||E0()>0?(Vo.value&&Jn.value,Math.max(1,Math.ceil(q),Math.ceil(D))):Math.ceil(q):Math.max(1,Math.ceil(q),Math.ceil(D))}function D0(T){const D=M.value;if(!D)return null;const j=ct("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>D.getBoundingClientRect());return(function(Q){return Q.isViewportRoot?Q.clientHeight:ct("getViewportBottomInRoot.getBoundingClientRect",()=>Q.root.getBoundingClientRect().bottom)})(T)-j.bottom}function j3(T={}){const D=T.requireViewport!==!1,j=(function(ve=64){const be=Ra(),xe=M.value;if(!be||!xe)return!1;const Re=(function(Fe){if(Fe.isViewportRoot)return{top:0,bottom:Fe.clientHeight};const De=ct("getVirtualViewportRect.getBoundingClientRect",()=>Fe.root.getBoundingClientRect());return{top:De.top,bottom:De.bottom}})(be),Ae=ct("isRendererNearVirtualViewport.getBoundingClientRect",()=>xe.getBoundingClientRect());return Ae.bottom>=Re.top-ve&&Ae.top<=Re.bottom+ve})();if(D&&!j)return null;const q=(function(){const ve=Ra(),be=M.value;if(!ve||!be||Math.max(0,ve.scrollHeight-ve.scrollTop-ve.clientHeight)>64)return null;const xe=D0(ve);return xe==null?null:xe>=-8&&xe<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,xe)}:null})();if(q)return{anchor:q,captured:!0};const Q=r0();if(Q)return{anchor:{type:"node",nodeIndex:Q.nodeIndex,offsetWithinNodePx:Q.offsetWithinNodePx},captured:j};if(T.allowFallback===!0){const ve=(function(){const be=et.value.length;return be<=0?null:{type:"node",nodeIndex:is(ko.value,0,Math.max(0,be-1)),offsetWithinNodePx:0}})();return ve?{anchor:ve,captured:!1}:null}return null}function hp(T){let D=2166136261;for(let j=0;j<T.length;j++)D^=T.charCodeAt(j),D=Math.imul(D,16777619);return(D>>>0).toString(36)}function q3(T,D){let j=T;for(let q=0;q<D.length;q++)j^=D.charCodeAt(q),j=Math.imul(j,16777619);return j^=31,j=Math.imul(j,16777619),j}const z3=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Nu(T,D=new WeakSet,j=0){if(T==null||typeof T=="number"||typeof T=="boolean")return String(T);if(typeof T=="string")return`s:${(function(q){const Q=q.length>8192?`${q.slice(0,8192)}...${q.length}`:q;return`${q.length}:${hp(Q)}`})(T)}`;if(typeof T=="function")return"fn";if(typeof T!="object")return typeof T;if(D.has(T))return"cycle";if(j>=6)return"max-depth";D.add(T);try{if(Array.isArray(T)){if(T.length<=160){const Ae=[];for(let Fe=0;Fe<T.length;Fe++)Ae.push(Nu(T[Fe],D,j+1));return`a:${T.length}:${Ae.join(",")}`}const ve=[],be=[],xe=Math.max(0,T.length-32);let Re=2166136261;for(let Ae=0;Ae<T.length;Ae++){const Fe=Nu(T[Ae],D,j+1);Re=q3(Re,Fe),Ae<32&&ve.push(Fe),Ae>=xe&&be.push(Fe)}return[`a:${T.length}`,`h=${ve.join(",")}`,`t=${be.join(",")}`,`all=${(Re>>>0).toString(36)}`].join(":")}const q=T,Q=Object.keys(q).filter(ve=>{const be=q[ve];return ve!=="parent"&&ve!=="el"&&ve!=="component"&&(be==null||typeof be=="string"||typeof be=="number"||typeof be=="boolean"||z3.has(ve))}).sort();return`o:${Q.length}:${Q.map(ve=>`${ve}=${Nu(q[ve],D,j+1)}`).join(";")}`}finally{D.delete(T)}}let B0=-1,pp="";function Da(T){const D=et.value[T];return D?hp(Nu(D)):""}function mp(){const T=se.value;if(B0===T)return pp;let D=2166136261;for(let j=0;j<et.value.length;j++){const q=Da(j);for(let Q=0;Q<q.length;Q++)D^=q.charCodeAt(Q),D=Math.imul(D,16777619)}return pp=(D>>>0).toString(36),B0=T,pp}function Cl(T,D={}){var j;const q=D.includeHeightCache===!0,Q=(j=D.includeContentHash)!=null?j:q,ve=q?(function(xe){const Re=(function(){var ze,ht;const st=Number((ht=(ze=s.virtualScroll)==null?void 0:ze.heightCacheLimit)!=null?ht:5e3);return!Number.isFinite(st)||st<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(st))})();if(!Number.isFinite(Re)||xe.length<=Re)return xe;const Ae=new Map,Fe=ze=>{!ze||Ae.size>=Re||Ae.set(ze.index,ze)},De=et.value.length,Ee=is(os.start-2*La.value,0,De),Be=is(os.end+2*La.value,Ee,De);for(const ze of xe)ze.index>=Ee&&ze.index<Be&&Fe(ze);const qe=Math.max(1,Math.ceil(xe.length/Re));for(let ze=0;ze<xe.length&&Ae.size<Re;ze+=qe)Fe(xe[ze]);for(let ze=xe.length-1;ze>=0&&Ae.size<Re;ze-=qe)Fe(xe[ze]);return Array.from(Ae.values()).sort((ze,ht)=>ze.index-ht.index).slice(0,Re)})(I3().map(xe=>{var Re;const Ae=et.value[xe.index];return Ae?wt(Qe({},xe),{nodeType:String((Re=Ae.type)!=null?Re:""),signature:Da(xe.index)}):null}).filter(xe=>!!xe)):[],be=j3({allowFallback:D.allowAnchorFallback===!0,requireViewport:D.requireViewport});return be||ve.length||D.includeEmptyState===!0?wt(Qe({sessionKey:T.sessionKey,threadKey:T.threadKey},be?{anchor:be.anchor,anchorCaptured:be.captured}:{anchorCaptured:!1}),{metrics:T,width:T.width,contentHash:Q?mp():void 0,measurementKey:fi()||void 0,heightCache:ve.length?ve:void 0}):null}function gp(T){var D,j;const q=Ra();if(!q)return;const Q=(function(xe){const Re=M.value;if(!Re)return null;const Ae=fe(Re,xe.root),Fe=et.value.length,De=ct("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Re.offsetHeight||0),Ee=Math.max(0,De>0?De:Fe>0?ct("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Re.scrollHeight||0):0),Be=R0();return Ae+Math.max(Ee,Be)})(q);if(Q==null)return;const ve=Math.max(0,T.distanceFromBottomPx),be=Math.max(0,Q-q.clientHeight-ve);(function(xe){an=Ua()+120,Sn=xe})(be),q.isViewportRoot?(j=(D=q.doc.defaultView)==null?void 0:D.scrollTo)==null||j.call(D,0,be):Tw(q.root,q.doc,be,{isReverseFlexScrollRoot:U,getNormalizedScrollTop:Z})}const vp=[];function F0(){if(de)for(ln!=null&&(Pt?.(ln),ln=null);vp.length;){const T=vp.pop();T!=null&&window.clearTimeout(T)}}function xl(T){const D=!!wn.value;wn.value=null,an=0,Sn=null,F0(),D&&T&&dn(T)}function Tl(){if(!wn.value||!de||ln!=null)return;const T=()=>{ln=null;const D=wn.value;D&&gp(D)};ln=Nt?Nt(T):null,ln==null&&T()}function H0(T,D={}){const j=et.value.length;return j<=0?[]:T.filter(q=>!(!Number.isInteger(q.index)||q.index<0||q.index>=j)&&!(!Number.isFinite(q.height)||q.height<=0)&&!(D.requireSignature&&!q.signature)&&!(D.requireCompatibilityMetadata&&!q.nodeType&&!q.signature)&&(function(Q){var ve;const be=et.value[Q.index];return!(!be||Q.nodeType&&Q.nodeType!==String((ve=be.type)!=null?ve:"")||Q.signature&&Q.signature!==Da(Q.index))})(q))}function W0(T){const D=Pa(Rr()),j=Pa(T);return D!==-1&&j!==-1&&D===j}function yp(T){var D;const j=Number(T?.width);if(Number.isFinite(j)&&j>0)return j;const q=Number((D=T?.metrics)==null?void 0:D.width);return Number.isFinite(q)&&q>0?q:null}function U0(T){var D;return T.sessionKey===yn()&&!!rp(T.threadKey)&&((D=T.measurementKey)!=null?D:"")===fi()&&!!W0(yp(T))&&!!(function(j){const q=j.heightCache;return!!q?.length&&(j0(j)?q.some(Q=>!!(Q.nodeType||Q.signature)):q.some(Q=>!!Q.signature))})(T)}function j0(T){return!!(T.contentHash&&T.contentHash===mp())}function V3(T){return!j0(T)}let Br=null,Fr=null,Lu=null,Ba=null,Fa=null;function kp(T){var D;const j=T.map(Q=>{var ve,be;return[Q.index,Math.round(10*Q.height),(ve=Q.nodeType)!=null?ve:"",(be=Q.signature)!=null?be:""].join("")}).join(""),q=Pa(Rr());return[(D=Gn())!=null?D:"",yn(),fi(),et.value.length,q,T.length,hp(j)].join(":")}function q0(T=(D=>(D=s.virtualScroll)==null?void 0:D.heightCache)()){if(!Tt.value||!T?.length||et.value.length<=0||!W0((D=s.virtualScroll)==null?void 0:D.heightCacheWidth))return!1;var D;const j=H0(T,{requireSignature:!0});if(!j.length)return!1;const q=kp(j);return q===Br?(Fr="standalone",!0):(d0(j,{mode:"merge"}),bo(),Br=q,Fr="standalone",qa(),dn("restore"),!0)}function bp(T,D={}){var j,q,Q;if(!Tt.value||!T||T.sessionKey!==yn()||!rp(T.threadKey)||et.value.length<=0)return!1;const ve=!!((j=T.heightCache)!=null&&j.length)&&!Ou(),be=!T.anchor||T.anchorCaptured===!1&&D.allowUncapturedAnchor!==!0?null:T.anchor,xe=D.restoreAnchor===!0&&!!be&&!Ou()&&Number(yp(T))>0;let Re=!1;if((q=T.heightCache)!=null&&q.length&&U0(T)){const Fe=H0(T.heightCache,{requireCompatibilityMetadata:!T.contentHash,requireSignature:V3(T)});Fe.length&&(d0(Fe,{mode:"merge"}),bo(),Br=kp(Fe),Fr="restore",qa(),Re=!0)}if(ve||xe)return!1;if(!D.restoreAnchor||!be)return Re&&dn("restore"),!0;const Ae=(function(Fe,De){var Ee;const Be=Fe.anchor,qe=Be?Be.type==="bottom"?`bottom:${Math.round(Be.distanceFromBottomPx)}`:`node:${Be.nodeIndex}:${Math.round(Be.offsetWithinNodePx)}`:"none";return[(Ee=Gn())!=null?Ee:"",yn(),fi(),$u.value,De,qe].join(":")})(T,(Q=D.restoreToken)!=null?Q:"imperative");return Lu===Ae?(Re&&dn("restore"),!0):(Lu=Ae,(function(Fe){const De=()=>{if(Fe.type==="node")return xl(),void l0({nodeIndex:Fe.nodeIndex,offsetWithinNodePx:Fe.offsetWithinNodePx});if(ui(),go.value=null,wn.value=Fe,F0(),gp(Fe),de)for(const Ee of[0,120,280,480])vp.push(window.setTimeout(()=>{const Be=wn.value;Be&&gp(Be)},Ee))};(function(Ee){if(!ge.value)return!1;const Be=et.value.length;return!(Be<=0||(ko.value=Ee.type==="node"?is(Ee.nodeIndex,0,Be-1):Be-1,Lr(),0))})(Fe)?ft(De):De()})(be),dn("restore"),!0)}function Ou(){const T=Rr();return Number.isFinite(T)&&T>0}function z0(T){var D;return T.sessionKey===yn()&&!!rp(T.threadKey)&&(et.value.length<=0||!(!((D=T.heightCache)!=null&&D.length)||Ou())||!(!(T.anchor&&Number(yp(T))>0)||Ou()))}function _p(){tt.clear();for(const T of Object.keys(vo)){const D=Number(T);Number.isInteger(D)&&D>=0&&D<et.value.length&&a0(D)}}function Ha(){Ys!=null&&(Pt?.(Ys),Ys=null),Np()}function V0(){return!de||mo?Promise.resolve():new Promise(T=>{let D=!1,j=null;const q=()=>{D||(D=!0,j!=null&&window.clearTimeout(j),T())};if(Nt)return Nt(q),void(j=window.setTimeout(q,50));j=window.setTimeout(q,0)})}function wp(T,D=Gn(),j=Xs.value){return yn()===T&&Gn()===D&&Xs.value===j}function Sp(){return Cn(this,arguments,function*(T={}){var D,j,q,Q,ve;const be=yn(),xe=Gn(),Re=Xs.value,Ae=(D=T.frames)!=null?D:2,Fe=(j=T.timeoutMs)!=null?j:120,De=(q=T.reason)!=null?q:"manual",Ee=T.expectedSettledTokenKey,Be=T.flushPendingTimers===!0,qe=Dr(De),ze=()=>wt(Qe({},qe),{phase:qe.final?"settling":qe.phase,stable:!1,confidence:qe.confidence==="final"?"mixed":qe.confidence,reason:De}),ht=()=>wp(be,xe,Re)&&(Ee==null||ja()===Ee);for(let pt=0;pt<Ae;pt++){if(yield ft(),!ht()||(yield V0(),!ht()))return ze();hi(),Ha()}if(yield(function(pt){return!de||pt<=0?Promise.resolve():new Promise(Wt=>window.setTimeout(Wt,pt))})(Fe),!ht()||(Be&&b0(),hi(),Ha(),!ht()))return ze();const st=dp();st&&(up=be,cp=xe,((Q=s.virtualScroll)==null?void 0:Q.settleMode)==="manual"&&Ee!=null&&Iu((ve=s.virtualScroll)==null?void 0:ve.settledToken)&&ja()===Ee&&(Sl=Ya(s.virtualScroll.settledToken)));const ot=ht()&&st&&P0(),mt=Dr(De,ot?"final":void 0);return Ap(mt,!0),mt})}let Cp="content",Hr=null,Wr=null,xp=0,Wa=null,Ml=null,Tp=null,Mp=null;function Ua(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function K0(T){var D,j;const q=Wa;if(!q)return!0;const Q=(j=(D=s.virtualScroll)==null?void 0:D.heightDiffThresholdPx)!=null?j:1;return Math.abs(T.totalHeight-q.totalHeight)>Q||T.sessionKey!==q.sessionKey||T.phase!==q.phase||T.stable!==q.stable||T.final!==q.final||T.threadKey!==q.threadKey||T.nodeCount!==q.nodeCount||T.measuredCount!==q.measuredCount||T.width!==q.width}function Qn(T){if(T==null)return"";if(typeof T=="string"||typeof T=="number"||typeof T=="boolean")return String(T);try{return JSON.stringify(T)}catch{return String(T)}}function ja(T=(D=>(D=s.virtualScroll)==null?void 0:D.settledToken)()){return Qn(T)}function G0(T,D){var j,q;return[T,D.sessionKey,(j=D.threadKey)!=null?j:"",fi(),mp(),Qn((q=s.virtualScroll)==null?void 0:q.settledToken),Math.round(D.totalHeight),Math.round(D.width)].join("\0")}function qa(){Tp=null,Mp=null,Ml=null}function K3(T){const D=T.heightCache;return D?.length?kp(D):""}function za(T){var D,j,q;const Q=T.metrics,ve=T.anchor?(be=T.anchor).type==="bottom"?`bottom:${Math.round(be.distanceFromBottomPx)}`:`node:${be.nodeIndex}:${Math.round(be.offsetWithinNodePx)}`:"none";var be;return[T.sessionKey,(D=T.threadKey)!=null?D:"",(j=T.measurementKey)!=null?j:fi(),(q=T.contentHash)!=null?q:"",K3(T),ve,T.anchorCaptured?1:0,Q.liveRange.start,Q.liveRange.end,Q.renderedCount,Q.nodeCount,Math.round(Q.totalHeight),Math.round(Q.width),Q.phase,Q.stable?1:0].join("\0")}function Ap(T,D=!1){if(!Tt.value||(function(be=!1){return!be&&ps.value&&!ms.value})(D))return;const j=D||K0(T),q=(function(be,xe=!1){return xe||be.stable||be.phase==="final"?{state:Cl(be,{includeHeightCache:!0})}:{state:Cl(be)}})(T,D),Q=q.state,ve=!!(Q&&(j||(function(be,xe=!1){return!!xe||za(be)!==Ml})(Q,D)));if(j&&(A(T),Wa=T,xp=Ua()),Q&&ve&&(I(Q),Q.anchor&&P(Q.anchor),Ml=za(Q)),T.stable){const be=G0("settled",T);if(be!==Tp){Tp=be;const xe=Cl(T,{includeHeightCache:!0});xe&&(I(xe),Ml=za(xe)),(function(Re){o("render-settled",Re)})(T)}}if(T.phase==="final"){const be=G0("final",T);if(be!==Mp){Mp=be;const xe=Cl(T,{includeHeightCache:!0});xe&&(I(xe),Ml=za(xe)),(function(Re){o("render-final",Re)})(T)}}}function Ep(){Hr!=null&&(Pt?.(Hr),Hr=null),Wr!=null&&de&&(window.clearTimeout(Wr),Wr=null)}function Y0(){Hr=null,Wr=null,(function(T){if(di.size>0||Ys!=null)return!0;switch(T){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Cp)&&(hi(),Ha()),Ap(Dr(Cp))}function dn(T){var D,j;if(!Tt.value||(Cp=T,Hr!=null||Wr!=null))return;const q=Math.max(0,(j=(D=s.virtualScroll)==null?void 0:D.emitIntervalMs)!=null?j:32),Q=Math.max(0,q-(Ua()-xp)),ve=()=>{Wr=null,Hr=Nt?Nt(Y0):null,Hr==null&&Y0()};de&&Q>0?Wr=window.setTimeout(ve,Q):ve()}function $p(T){var D;if(T<=0)return 0;const j=et.value;if(qt.value)return A0(T);if(Na.value===j.length&&Vh.value.length&&Kh.value.length){const Q=Ko.value,ve=Vh.value,be=Kh.value,xe=De=>De<=0?0:_u(ve,0,De)+(De-_u(be,0,De))*Q;let Re=0,Ae=j.length-1,Fe=j.length-1;for(;Re<=Ae;){const De=Re+Ae>>1;xe(De+1)>=T?(Fe=De,Ae=De-1):Re=De+1}return Fe}let q=T;for(let Q=0;Q<j.length;Q++){const ve=(D=vo[Q])!=null?D:Ko.value;if(q<=ve)return Q;q-=ve}return Math.max(0,j.length-1)}function X0(){Ct.value+=1}function Ip(T){return!(Vo.value&&T>=Jn.value)&&(!Wi.value||T<zo.value||Jh.value.has(T))}function Al(T){const D=Mu.get(T);D&&(D(),Mu.delete(T));const j=kl.get(T);j&&(j.destroy(),kl.delete(T)),Au(T)}function Z0(T,D){let j=!1;if(D){const ve=ue.get(T);ue.set(T,D),ve!==D&&(j=!0)}else ue.delete(T)&&(j=!0);if(j&&X0(),D||Au(T),!f0.value||!Yt||!ge.value&&Wi.value&&!K.value&&kl.size>=640&&(K.value||(K.value=!0,Qh()),!f0.value||!Yt))return Al(T),void(D&&qi(T,!0));if(T<zo.value&&!ge.value||Jh.value.has(T))return Al(T),void qi(T,!0);if(!D)return void Al(T);Al(T);const q=Yt(D,{rootMargin:"400px"});if(!q)return;kl.set(T,q),qi(T,q.isVisible.value),Wi.value&&(function(ve){if(!de||!Wi.value)return;Au(ve);const be=ve%17*23,xe=window.setTimeout(()=>{if(_0.delete(ve),!Wi.value||Jh.value.has(ve))return;const Re=ue.get(ve);if(!Re)return;const Ae=Se(Re),Fe=Re.ownerDocument||document,De=Fe.defaultView||window,Ee=!Ae||Ae===Fe.documentElement||Ae===Fe.body,Be=!Ee&&Ae?ct("nodeVisibilityFallback.root.getBoundingClientRect",()=>Ae.getBoundingClientRect()):null,qe=Ee?0:Be.top,ze=Ee?ct("nodeVisibilityFallback.clientHeight",()=>{var st,ot;return(ot=(st=De.innerHeight)!=null?st:Ae?.clientHeight)!=null?ot:0}):Be.bottom,ht=ct("nodeVisibilityFallback.node.getBoundingClientRect",()=>Re.getBoundingClientRect());ht.bottom>=qe-500&&ht.top<=ze+500&&qi(ve,!0)},1800+be);_0.set(ve,xe)})(T);let Q=null;Q=Ve(()=>q.isVisible.value,ve=>{if(ve){Au(T),qi(T,!0),Q?.(),Mu.delete(T),kl.get(T)===q&&kl.delete(T);try{q.destroy()}catch{}}},{immediate:!0}),Mu.set(T,Q),ge.value&&Xo()}function Np(){Ys=null;for(const[T,D]of di)di.delete(T),Go.get(T)===D.el&&Or.get(T)===D.version&&c0(T,D.height,{allowShrink:D.allowShrink})}function El(){Ys!=null&&(Pt?.(Ys),Ys=null),di.clear()}function Pu(T,D){(function(j,q,Q){var ve;if(!Number.isFinite(Q)||Q<=0||Go.get(j)!==q)return;const be=Or.get(j);if(be==null)return;const xe=et.value[j],Re=X.value&&H.value!==!0&&!((ve=s.nodes)!=null&&ve.length)&&j>=et.value.length-2,Ae=!(xe?.loading===!0||Re),Fe=di.get(j),De=Fe?Fe.allowShrink&&Ae:Ae,Ee=Fe&&!De?Math.max(Fe.height,Q):Q;di.set(j,{height:Ee,allowShrink:De,version:be,el:q}),Ys==null&&(Ys=Nt?Nt(Np):null,Ys==null&&Np())})(T,D,u0(T,D))}function hi(){for(const[T,D]of Go)D&&Pu(T,D)}function J0(){ne?.disconnect(),ne=null,pe.clear()}function Lp(){for(;Su.length;)Tu(Su.pop())}Ve(ms,T=>{T&&dn("content")},{flush:"post"}),t({getVirtualMetrics:Dr,captureVirtualState:function(T={}){var D;return Cl(Dr("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:T.allowFallbackAnchor===!0,requireViewport:T.requireViewport===!0,includeEmptyState:(D=T.includeEmptyState)==null||D})},restoreVirtualState:function(T,D={}){const j=D.restoreAnchor===!0,q=D.restoreToken==null?"imperative":String(D.restoreToken);Ba=T,Fa={restoreAnchor:j,restoreToken:q,allowUncapturedAnchor:D.allowUncapturedAnchor===!0},!bp(T,{restoreAnchor:j,restoreToken:q,allowUncapturedAnchor:D.allowUncapturedAnchor===!0})&&z0(T)||(Ba=null,Fa=null)},forceMeasure:function(T="manual"){return Cn(this,null,function*(){yield ft(),yield V0(),hi(),Ha(),yield ft();const D=Dr(T);return Ap(D,!0),D})},settle:Sp,scrollToNode:function(T,D="start"){xl(),ui();const j=et.value.length;if(j<=0)return;const q=is(T,0,j-1),Q=()=>{var ve;const be=yl({nodeIndex:q,offsetWithinNodePx:0}),xe=Eu(q),Re=Ra(),Ae=(ve=Re?.clientHeight)!=null?ve:0,Fe=$r();let De=be;if(D==="center")De=be-Ae/2+xe/2;else if(D==="end")De=be-Ae+xe;else if(D==="nearest"&&Fe!=null){if(be>=Fe&&be+xe<=Fe+Ae)return;De=be<Fe?be:be-Ae+xe}Ir(Math.max(0,De)),Xo({immediate:!0}),ge.value&&(ko.value=q,Lr())};if(ge.value)return ko.value=q,Lr(),void ft(Q);Q()}}),Ve(()=>He.value,T=>{if(!T){J0();for(const D of Ui.values())for(const j of D)Tu(j);Ui.clear(),Or.clear(),Lp(),El()}},{immediate:!0}),Ve(H,T=>{T&&(function(){if(de&&H.value&&Go.size){Lp();for(const D of[80,240,640]){const j=k0(D,()=>{for(const[q,Q]of Go)Q&&Pu(q,Q)},"final");j!=null&&Su.push(j)}}})(),dn(T?"final":"content")}),Ve([()=>et.value.length,()=>Jn.value],()=>{wn.value&&Tl(),dn("content")},{flush:"post",immediate:!0}),Ve([()=>os.start,()=>os.end],()=>{dn("batch")},{flush:"post"});const{cleanupBatchScheduler:G3}=(function(T){const{props:D,isClient:j,isTestEnv:q,parsedNodesIdentity:Q,parsedNodeCount:ve,desiredRenderedCount:be,datasetKey:xe,batchingEnabled:Re,incrementalRenderingActive:Ae,resolvedBatchSize:Fe,resolvedInitialBatch:De,renderedCount:Ee,adaptiveBatchSize:Be,previousRenderContext:qe,previousBatchConfig:ze,requestFrame:ht,cancelFrame:st,hasIdleCallback:ot,cleanupNodeVisibility:mt,onDatasetKeyChanged:pt,onDatasetChanged:Wt}=T;let yt=null,At=null,xt=!1,Xt=null,Zs=null,Ms=0,Ro=!1,Vi=!1;const Ki=new Set,jr=new Set;function gy(){if(j){yt!=null&&(st?.(yt),yt=null),At!=null&&(window.clearTimeout(At),At=null),Zs!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Zs),Zs=null),Ms+=1;for(const gs of Ki)st?.(gs);Ki.clear();for(const gs of jr)window.clearTimeout(gs);jr.clear(),xt=!1,Xt=null,Ro=!1,Vi=!1}}function Uu(){return typeof performance<"u"?performance.now():Date.now()}function vy(gs){(function(pi){var Gi;if(!Ae.value)return;const mi=Math.max(2,(Gi=D.renderBatchBudgetMs)!=null?Gi:6),gi=Math.max(1,Fe.value||1),Do=Math.max(1,Math.floor(gi/4));pi>1.2*mi?Be.value=Math.max(Do,Math.floor(.7*Be.value)):pi<.5*mi&&Be.value<gi&&(Be.value=Math.min(gi,Math.ceil(1.2*Be.value)))})(gs),Ro=!1;const Rs=Vi||Ee.value<be.value;Vi=!1,Rs&&by()}function yy(gs,Rs={}){var pi,Gi;if(!Ae.value)return;const mi=be.value;if(Ee.value>=mi)return;const gi=Math.max(1,gs),Do=()=>{const Nl=Uu();let Ll=0;yt=null,At=null,Zs=null,xt=!1;const Ol=Xt??gi;Xt=null;const Wp=Uu();Ee.value=Math.min(mi,Ee.value+Ol),mt(Ee.value),Ll=Uu()-Wp,(function(Up,_y){if(!j)return void vy(_y);Ro=!0;const wy=++Ms;ft().then(()=>{var Sy;if(wy!==Ms)return;const pA=Uu(),mA=Math.max(_y,pA-Up),Cy=()=>{wy===Ms&&vy(mA)};if(ht){let Ty=!1,vi=null;const My=()=>{Ty||(Ty=!0,Cy())},ju=ht(()=>{Ki.delete(ju),vi!=null&&(window.clearTimeout(vi),jr.delete(vi),vi=null),My()});return Ki.add(ju),vi=window.setTimeout(()=>{vi!=null&&jr.delete(vi),vi=null,st?.(ju),Ki.delete(ju),My()},Math.max(32,(Sy=D.renderBatchIdleTimeoutMs)!=null?Sy:120)),void jr.add(vi)}const xy=window.setTimeout(()=>{jr.delete(xy),Cy()},0);jr.add(xy)})})(Nl,Ll)};if(!j||Rs.immediate)return void Do();const Yi=Math.max(0,(pi=D.renderBatchDelay)!=null?pi:16);if(Xt=Xt!=null?Math.max(Xt,gi):gi,!xt){if(xt=!0,!q&&ot&&window.requestIdleCallback){const Nl=Math.max(0,(Gi=D.renderBatchIdleTimeoutMs)!=null?Gi:120);return void(Zs=window.requestIdleCallback(()=>Do(),{timeout:Nl}))}ht&&!q?yt=ht(()=>{Yi!==0?At=window.setTimeout(()=>Do(),Yi):Do()}):At=window.setTimeout(()=>Do(),Yi)}}function ky(gs,Rs={}){Ro?Vi=!0:gs==null?by():yy(gs,Rs)}function by(){Ae.value&&yy(Re.value?Math.max(1,Math.round(Be.value)):Math.max(1,Fe.value))}return Ve([Q,ve,xe,Ae,Fe,De,()=>D.renderBatchDelay],()=>{var gs;const Rs=ve.value,pi=qe.value,Gi=xe.value,mi=!Object.is(Gi,pi.key),gi=Rs!==pi.total,Do=mi||gi;qe.value={key:Gi,total:Rs};const Yi=ze.value,Nl=(gs=D.renderBatchDelay)!=null?gs:16,Ll=Yi.batchSize!==Fe.value||Yi.initial!==De.value||Yi.delay!==Nl||Yi.enabled!==Ae.value;ze.value={batchSize:Fe.value,initial:De.value,delay:Nl,enabled:Ae.value},mi&&pt(Rs),(Do||Ll||!Ae.value)&&gy(),(Do||Ll)&&(Be.value=Math.max(1,Fe.value||1)),Do&&Wt();const Ol=be.value;if(!Rs)return Ee.value=0,void mt(0);if(!Ae.value)return Ee.value=Ol,void mt(Ee.value);const Wp=mi||pi.total===0;Ee.value=Wp||Ll?Math.min(Ol,De.value):Math.min(Ee.value,Ol);const Up=Math.max(1,De.value||Fe.value||Rs);Ee.value<Ol?ky(Up,{immediate:!j}):mt(Ee.value)},{immediate:!0}),Ve(be,(gs,Rs)=>{Ae.value&&(typeof Rs=="number"&&gs<=Rs||gs>Ee.value&&ky())}),{cleanupBatchScheduler:gy}})({props:k,isClient:de,isTestEnv:mo,parsedNodesIdentity:Po,parsedNodeCount:fs,desiredRenderedCount:Cu,datasetKey:H3,batchingEnabled:Fi,incrementalRenderingActive:Vo,resolvedBatchSize:Bi,resolvedInitialBatch:zo,renderedCount:Jn,adaptiveBatchSize:vl,previousRenderContext:Hi,previousBatchConfig:Er,requestFrame:Nt,cancelFrame:Pt,hasIdleCallback:po,cleanupNodeVisibility:O3,onDatasetKeyChanged:T=>{El(),wu(),bo(),qa(),T>0&&bu(T)},onDatasetChanged:()=>{ge.value&&Xo({immediate:!0})}});Ve([h0,ge,()=>M.value,()=>ee()],([T,D])=>{if(!T)return w0(),void Zh();P3(),D?Xo({immediate:!0}):Zh()},{flush:"post",immediate:!0}),Ve([()=>et.value.length,()=>ge.value],T=>Cn(null,[T],function*([D,j]){j&&D&&de&&(yield ft(),Xo({immediate:!0}))}),{flush:"post"}),Ve(qt,T=>{T&&(function(){var D;if(Fn.value&&sn.value&&En.value&&((D=Kn.value)!=null&&D[1]))return;const j=cr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),q=cr({type:"list_item",children:[j],raw:"- Probe paragraph text"}),Q=cr({type:"list",ordered:!1,items:[q],raw:"- Probe paragraph text"});Fn.value=j,sn.value=q,En.value=Q;const ve={1:null,2:null,3:null,4:null,5:null,6:null};for(let be=1;be<=6;be++)ve[be]=cr({type:"heading",level:be,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(be)} Probe heading`});Kn.value=ve})()},{immediate:!0}),Ve([()=>M.value,qt],()=>{if(!qt.value)return tp(),void(Y.value=0);C0(),tp(),qt.value&&M.value&&typeof ResizeObserver<"u"&&(Oa=new ResizeObserver(()=>{C0(),go.value&&Nr(),wn.value&&Tl(),dn("resize")}),Oa.observe(M.value))},{immediate:!0}),Ve([qt,Mt,Xs],()=>Cn(null,null,function*(){if(!qt.value)return G.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void bo();yield ft(),(function(){if(!qt.value||typeof window>"u")return G.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void bo();const T={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},D=S0(ep(L.value),".paragraph-node");T.paragraph=Fm(L.value,D,"pre-wrap");const j=ep(R.value),q=j?.querySelector(".paragraph-node");T.listItem=Fm(R.value,q,"pre-wrap");const Q=ct("readSimpleTextProbeProfile.list.offsetHeight",()=>{var be,xe;return(xe=(be=B.value)==null?void 0:be.offsetHeight)!=null?xe:0}),ve=ct("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var be,xe;return(xe=(be=R.value)==null?void 0:be.offsetHeight)!=null?xe:0});T.listWrapperOverhead=Math.max(0,Q-ve);for(let be=1;be<=6;be++){const xe=S0(ep(W[be]),`h${be}`);T.headings[be]=Fm(W[be],xe,"pre-wrap")}G.value=T,bo()})()}),{flush:"post",immediate:!0}),Ve(()=>et.value.length,()=>{ge.value&&Xo({immediate:!0})}),Ve([qt,Y],()=>{bo(),ge.value&&Xo({immediate:!0}),go.value&&Nr(),wn.value&&Tl(),dn("resize")},{immediate:!1}),Ve(()=>Wi.value,T=>{if(T)for(const[D,j]of ue)Z0(D,j);else{Qh();for(const[D,j]of ue)j&&qi(D,!0)}},{immediate:!1}),Ve([()=>k.viewportPriority,()=>et.value.length],([T,D])=>{T!==!1?K.value&&D<=200&&(K.value=!1):K.value=!1}),Ve(()=>Jn.value,()=>{ge.value&&Xo({immediate:!0})}),Ve([ko,Ne,La,()=>et.value.length,ge],()=>{Lr()},{immediate:!0});let Va=null,Ka=!1,$l=null;function Ga(){Va=null,up=null,cp=void 0,Sl=null,qa()}function Op(){El(),wu(),bo(),tt.clear();const T=et.value.length;T>0&&bu(T),_p()}function Pp(){Ep(),b0(),Wa=null,Br=null,Fr=null,Lu=null,Ba=null,Fa=null,Ka=!1,Ga(),L0("restore"),ui(),xl()}function Ya(T){var D;return[(D=Gn())!=null?D:"",yn(),fi(),$u.value,ja(T),et.value.length,Math.round(zi(0,et.value.length)),Math.round(Rr()),yo.count,Math.round(yo.total)].join(":")}function Q0(){return Cn(this,null,function*(){var T,D,j,q;const Q=(T=s.virtualScroll)==null?void 0:T.settledToken,ve=ja(Q),be=yn(),xe=Gn(),Re=Xs.value;if(Tt.value&&((D=s.virtualScroll)==null?void 0:D.settleMode)==="manual"&&Iu(Q))if(dp()){if(Ya(Q)!==Sl&&!Ka){Ka=!0;try{const Ae=yield Sp({reason:"manual",expectedSettledTokenKey:ve}),Fe=ja()===ve;wp(be,xe,Re)&&Ae.sessionKey===be&&Ae.threadKey===xe&&Fe&&Ae.stable&&Ae.phase==="final"&&(Sl=Ya((j=s.virtualScroll)==null?void 0:j.settledToken))}finally{Ka=!1,yield ft();const Ae=(q=s.virtualScroll)==null?void 0:q.settledToken,Fe=Iu(Ae)?Ya(Ae):"";wp(be,xe,Re)&&Fe&&Sl!==Fe&&Q0()}}}else dn("manual")})}Ve(Tt,(T,D)=>{if(T!==D){if(!T)return Pp(),void Ep();Pp(),Op(),$l=Xs.value,dn("content")}},{flush:"post"}),Ve([Tt,Xs],([T,D])=>{T?$l!=null?$l!==D&&($l=D,(function(j="resize"){El(),wu(),bo(),tt.clear();const q=et.value.length;q>0&&bu(q),_p(),Br=null,Fr=null,Lu=null,Wa=null,Ka=!1,Ga(),q0(),ft(()=>{hi(),go.value&&Nr(),wn.value&&Tl(),dn(j)})})("resize")):$l=D:$l=null},{flush:"post",immediate:!0}),Ve([Tt,()=>yn(),()=>Gn()],([T])=>{T&&(Pp(),Op(),L0("content"),dn("content"))}),Ve([Tt,()=>yn(),()=>Gn(),Xs,()=>et.value.length],([T])=>{T&&(function(D="async-node"){let j=!1;for(const[q,Q]of Array.from(Yo.entries()))lp(Q)||(Yo.delete(q),Gs.delete(q),j=!0);j&&(_l(),dn(D))})("async-node")},{flush:"post"}),Ve([Tt,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.sessionKey},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.measurementKey},()=>s.indexKey,()=>se.value],([T])=>{T&&(qa(),(function(D="content"){if(!Tt.value)return;const j=[],q=et.value.length;for(const Q of Array.from(tt.keys())){if(Q>=q){j.push(Q);continue}const ve=Da(Q),be=tt.get(Q);be!=null&&be!==ve&&j.push(Q),tt.set(Q,ve)}for(const Q of Array.from(tt.keys()))Q>=q&&tt.delete(Q);j.length&&((function(Q,ve={}){const be=Array.from(Q,Number);$3(be,ve)>0&&(function(Re){for(const Ae of Re)tt.delete(Ae)})(be)})(j,{notify:!1}),bo(),Ga(),go.value&&Nr(),wn.value&&Tl(),dn(D))})("content"))},{flush:"post",immediate:!0}),Ve([Tt,()=>et.value.length,()=>yn(),()=>Gn()],([T,D,j,q],[Q,ve,be,xe])=>{T&&Q&&j===be&&q===xe&&D!==ve&&Ga()},{flush:"post"}),Ve([Tt,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.heightCache},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.heightCacheWidth},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.restoreState},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.measurementKey},()=>et.value.length,()=>yn(),Y],()=>{q0()},{flush:"post",immediate:!0}),Ve([Tt,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.restoreState},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.restoreAnchor},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.measurementKey},()=>et.value.length,()=>yn(),Y],T=>Cn(null,[T],function*([D,j]){if(!D||!j)return;yield ft();const q=(function(){var Q;const ve=(Q=s.virtualScroll)==null?void 0:Q.restoreAnchor;return ve==null||ve===!1?null:ve===!0?"true":String(ve)})();bp(j,{restoreAnchor:q!=null,restoreToken:q??void 0})}),{flush:"post",immediate:!0}),Ve([Tt,Y,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.restoreState},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.measurementKey}],([T])=>{var D;if(!T)return;const j=(D=s.virtualScroll)==null?void 0:D.restoreState;j&&Br&&Fr==="restore"&&(U0(j)||(Op(),Br=null,Fr=null,dn("resize")))},{flush:"post"}),Ve([Tt,()=>et.value.length,()=>yn(),Y],T=>Cn(null,[T],function*([D]){var j;const q=Ba,Q=Fa;D&&q&&(yield ft(),!bp(q,{restoreAnchor:Q?.restoreAnchor===!0,restoreToken:(j=Q?.restoreToken)!=null?j:"imperative",allowUncapturedAnchor:Q?.allowUncapturedAnchor===!0})&&z0(q)||(Ba=null,Fa=null))}),{flush:"post",immediate:!0}),Ve([Tt,H,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.settleMode},()=>yn(),()=>Gn(),Xs,Yh,m0,()=>Jn.value,Cu,()=>yo.count,()=>yo.total],([T,D,j])=>{if(!T||D!==!0||j==="manual"||!fp())return;const q=(function(){var Q;const ve=et.value.length;return[(Q=Gn())!=null?Q:"",yn(),fi(),$u.value,ve,Math.round(zi(0,ve)),Math.round(Rr()),yo.count,Math.round(yo.total)].join(":")})();Va!==q&&(Va=q,Sp({reason:"final"}).then(Q=>{Q.stable||Va!==q||(Va=null)}))},{flush:"post",immediate:!0}),Ve([Tt,H,()=>{var T;return(T=s.virtualScroll)==null?void 0:T.settleMode},()=>{var T;return(T=s.virtualScroll)==null?void 0:T.settledToken},()=>yn(),()=>Gn(),Xs,Yh,m0,()=>Jn.value,Cu,()=>et.value.length,()=>yo.count,()=>yo.total],()=>{Q0()},{flush:"post",immediate:!0}),Ve([()=>et.value.length,ge,Ne,La,()=>os.start,()=>os.end],([T,D,j,q,Q,ve])=>{ce.value&&le("virtualization",{nodes:T,virtualization:D,maxLiveNodes:j,buffer:q,focusIndex:ko.value,scroll:D?(()=>{const be=Dn.value||Se();return be?{reverse:U(be),scrollTop:Math.round(be.scrollTop),scrollTopAbs:Math.round(Math.abs(be.scrollTop)),scrollHeight:Math.round(be.scrollHeight),clientHeight:Math.round(be.clientHeight)}:null})():null,liveRange:{start:Q,end:ve},rendered:Jn.value})}),Ve([()=>k.customId],([T],D,j)=>{if(!T||_n)return;const q=(function(Q,ve){return Q?(Yn.controllers[Q]=ve,()=>{Yn.controllers[Q]===ve&&delete Yn.controllers[Q]}):()=>{}})(T,{captureRestoreAnchor:r0,restoreAnchor:l0,getAnchorDrift:T3,getReport:D3});j(()=>{q()})},{immediate:!0}),Ks(()=>{(function(){if(Tt.value)try{hi(),Ha();const T=Dr("manual");K0(T)&&(A(T),Wa=T,xp=Ua());const D=Cl(T,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});D&&(I(D),D.anchor&&P(D.anchor),Ml=za(D))}catch{}})(),G3(),Qh(),Ie(),J0();for(const T of Ui.values())for(const D of T)Tu(D);Ui.clear(),Or.clear(),tt.clear(),Lp(),El(),tp(),ui(),xl(),Ep(),w0(),Zh()});const Y3=ii({loader:()=>Cn(null,null,function*(){try{return(yield oo(()=>import("./index11-DEbZPqF_.js"),__vite__mapDeps([6,3]))).default}catch(T){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".',T),Qs}}),loadingComponent:OU,delay:0}),X3=ii({loader:()=>Cn(null,null,function*(){try{return(yield oo(()=>import("./index10-CgqlibfL.js"),[])).default}catch(T){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.',T),Qs}}),loadingComponent:LU,delay:0}),Z3=ii(()=>Cn(null,null,function*(){try{return(yield oo(()=>import("./index7-DhrSWRIG.js"),[])).default}catch(T){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".',T),Qs}})),ey={text:On,paragraph:al,heading:Bf,code_block:Im,list:ga,list_item:ma,blockquote:Rd,table:Lc,definition_list:Dd,footnote:Bd,footnote_reference:ao,footnote_anchor:Ic,admonition:Ud,vmr_container:Hd,hardbreak:gr,link:Os,image:mr,thematic_break:Fd,math_inline:qo,math_block:rM,strong:Ns,emphasis:Ps,strikethrough:Ls,highlight:uo,insert:zs,subscript:qs,superscript:js,emoji:Us,checkbox:lo,checkbox_input:lo,inline_code:Cs,html_inline:co,reference:Is,html_block:Nc},J3=F(()=>ip()),ty=F(()=>xw(k.codeBlockProps)),Q3=F(()=>xw(k.codeBlockProps,{omit:["langs"]})),ny=F(()=>Qe(Qe({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 _e.value=="boolean"?{showTooltips:_e.value}:{}),Q3.value)),sy=F(()=>Qe(wt(Qe({},ny.value),{langs:k.langs}),ty.value));function oy(T){return typeof T=="boolean"?T:void 0}const eA=F(()=>{const T=k.codeBlockProps||{},D={},j=oy(T.showLineNumbers);j!==void 0&&(D.showLineNumbers=j);const q=oy(T.diffInline);q!==void 0&&(D.diffInline=q);const Q=(function(ve){const be=Number(ve);return Number.isFinite(be)&&be>0?be:void 0})(T.reservedHeightPx);return Q!==void 0&&(D.reservedHeightPx=Q),D}),tA=F(()=>Qe(Qe({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,themes:k.themes,langs:k.langs,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof _e.value=="boolean"?{showTooltips:_e.value}:{}),ty.value)),nA=F(()=>Qe({},k.mermaidProps||{})),iy=F(()=>Qe({},k.d2Props||{})),sA=F(()=>Qe({},k.infographicProps||{})),Xa=F(()=>({typewriter:k.typewriter,fade:k.fade,customHtmlTags:un.value.customHtmlTags})),oA=F(()=>Qe(Qe({},Xa.value),typeof _e.value=="boolean"?{showTooltip:_e.value}:{})),iA=F(()=>Qe(Qe({},Xa.value),typeof _e.value=="boolean"?{showTooltips:_e.value}:{})),rA=F(()=>Qe(Qe({},Xa.value),typeof _e.value=="boolean"?{showTooltips:_e.value}:{})),lA=F(()=>Qe(Qe({},Xa.value),typeof _e.value=="boolean"?{showTooltips:_e.value}:{}));function aA(T){return Array.isArray(T.children)&&T.children.length>0}const Rp=F(()=>R3.value.map(T=>{var D,j,q,Q,ve,be,xe,Re;let Ae=(function(st){var ot,mt,pt,Wt,yt,At,xt;if(st.type!=="code_block")return st;const Xt=st,Zs=[String((ot=Xt.language)!=null?ot:""),String((mt=Xt.loading)!=null?mt:""),String((pt=Xt.diff)!=null?pt:""),String((Wt=Xt.code)!=null?Wt:""),String((yt=Xt.originalCode)!=null?yt:""),String((At=Xt.updatedCode)!=null?At:""),String((xt=Xt.raw)!=null?xt:"")].join("\0"),Ms=Ge.get(Xt);if(Ms&&Ms.signature===Zs)return Ms.node;const Ro=Qe({},Xt);return Ge.set(Xt,{signature:Zs,node:Ro}),Ro})(T.node);const Fe=Ru(Ae);let De=cy(Ae,Fe);if((Ae.type==="html_block"||Ae.type==="html_inline")&&De===ey[Ae.type]){const st=Ae,ot=String((D=st.tag)!=null?D:"").trim().toLowerCase()||Xx(st.content);if(ot){const mt=$t.value[ot];if(pn.value.has(ot)&&mt)De=mt,Ae=wt(Qe({},st),{type:ot,tag:ot,content:l7(st.content,ot)});else if(Zx((j=st.content)!=null?j:st.raw,ot)){const pt=String((Q=(q=st.content)!=null?q:st.raw)!=null?Q:"");Ae.type==="html_inline"?(De=On,Ae={type:"text",content:pt,raw:pt}):(De=al,Ae={type:"paragraph",children:[{type:"text",content:pt,raw:pt}],raw:pt})}}}const Ee=Ae.type==="code_block"&&u.value==="pre"&&De===Qs&&!Dp($t.value,Fe);let Be=Qe({},(function(st,ot,mt){const pt=ot??Ru(st);if(st.type==="code_block"){const Wt=pt?Dp($t.value,pt):void 0;if(mt&&u.value==="pre"&&!Wt&&mt===Qs)return eA.value;if(mt&&pt&&mt===Wt)return pt==="mermaid"?ly(st):pt==="infographic"?ay(st):pt==="d2"||pt==="d2lang"?iy.value:sy.value;if(mt&&mt===$t.value.code_block)return sy.value;if(T0(mt))return tA.value}return pt==="mermaid"?ly(st):pt==="infographic"?ay(st):pt==="d2"||pt==="d2lang"?iy.value:st.type==="link"?oA.value:st.type==="list"?iA.value:st.type==="blockquote"?rA.value:st.type==="table"?lA.value:st.type==="code_block"?ny.value:Xa.value})(Ae,Fe,De));const qe=Pr.value[T.index];Ae.type==="code_block"&&qe?.kind==="code-block"&&(Be=wt(Qe({},Be),Ee?{reservedHeightPx:(ve=qe.height)!=null?ve:qe.contentHeight}:{estimatedHeightPx:qe.height,estimatedContentHeightPx:qe.contentHeight})),Ee||Ae.type!=="code_block"||Fe!=="mermaid"||Ql(Be.estimatedPreviewHeightPx)!=null||(Be=wt(Qe({},Be),{estimatedPreviewHeightPx:Zg(Yg(String((be=Ae.code)!=null?be:"")))})),Ee||Ae.type!=="code_block"||Fe!=="infographic"||Ql(Be.estimatedPreviewHeightPx)!=null||(Be=wt(Qe({},Be),{estimatedPreviewHeightPx:Jg(Xg(String((xe=Ae.code)!=null?xe:"")))})),Ae.type==="math_block"&&(Be=wt(Qe({},Be),{cacheScope:vn.value}));const ze=(function(st,ot){const mt=String(st.type);return!vu(mt)&&$t.value[mt]===ot})(Ae,De),ht=ze?Fv(Ae,me.value):void 0;return wt(Qe({},T),{node:Ae,component:De,bindings:Be,customBindings:Qe(Qe({},ht??{}),Be),rendersCustomNode:ze,hasSlotChildren:aA(Ae),slotContent:String((Re=Ae.content)!=null?Re:""),isCodeBlock:Ae.type==="code_block",indexKey:`${J3.value}-${T.index}`})}));function Ru(T){var D;return T?.type==="code_block"?String((D=T.language)!=null?D:"").trim().toLowerCase():""}function Dp(T,D){const j=D.trim().toLowerCase();if(j)for(const q of[j,Pv(j),zT(j)]){const Q=q&&T[q];if(Q)return Q}}function ry(T,D,j,q){var Q,ve;const be=Qe({},T.value);return Ql(be.estimatedPreviewHeightPx)==null&&(be.estimatedPreviewHeightPx=q(j(String((Q=D?.code)!=null?Q:"")),void 0,be.maxHeight==="none"?null:(ve=Ql(be.maxHeight))!=null?ve:void 0)),be}function ly(T){return ry(nA,T,Yg,Zg)}function ay(T){return ry(sA,T,Xg,Jg)}function cy(T,D){if(!T)return a1;const j=$t.value,q=j[String(T.type)];if(T.type==="code_block"){const Q=D??Ru(T),ve=Q?Dp(j,Q):void 0;return ve||(u.value==="pre"?j.code_block||Qs:Q==="mermaid"?j.mermaid||Y3:Q==="infographic"?j.infographic||X3:Q==="d2"||Q==="d2lang"?j.d2||Z3:q||j.code_block||M0.value)}return q||ey[String(T.type)]||a1}function Bp(T){o("click",T)}function cA(T){var D;(D=T.target)!=null&&D.closest("[data-node-index]")&&o("mouseover",T)}function uA(T){var D;(D=T.target)!=null&&D.closest("[data-node-index]")&&o("mouseout",T)}function uy(T){o("mouseover",T)}function dy(T){o("mouseout",T)}const Ur=te(null),Zo=te(!1);let Za,Il=null,Fp=0,Du=0,Bu=0;const fy=["code_block","admonition","table","math_block","html_block","image","thematic_break"],dA=new Set(fy),hy=[".typewriter-cursor",".height-estimation-probes",...fy.map(T=>`[data-node-type="${T}"]`),"script","style"].join(",");function py(T){if(!T||typeof T!="object")return!1;const D=T.type;return typeof D=="string"&&dA.has(D)}function Fu(T){var D,j;if(!T||typeof T!="object")return 0;const q=T,Q=(j=(D=q.raw)!=null?D:q.content)!=null?j:q.code;if(typeof Q=="string")return Q.length;const ve=q.children;if(Array.isArray(ve))return ve.reduce((xe,Re)=>xe+Fu(Re),0);const be=q.items;return Array.isArray(be)?be.reduce((xe,Re)=>xe+Fu(Re),0):0}function Hu(){Za&&(clearTimeout(Za),Za=void 0)}function my(){Fp+=1,Il!=null&&(Pt?.(Il),Il=null)}function Wu(){my(),Ur.value&&(Ur.value.style.visibility="hidden")}function fA(T){var D;if(T.nodeType!==Node.TEXT_NODE||!((D=T.textContent)!=null?D:"").trim())return!1;const j=T.parentElement;return!!j&&!j.closest(hy)}function hA(T){let D=T.lastChild;for(;D;){if(fA(D))return D;if(D.nodeType===Node.ELEMENT_NODE){const j=D;if(!j.matches(hy)&&j.lastChild){D=j.lastChild;continue}}for(;D&&D!==T&&!D.previousSibling;)D=D.parentNode;if(!D||D===T)break;D=D.previousSibling}return null}function Hp(){if(!de||!Zo.value||Il!=null)return;const T=Fp,D=()=>{Il=null,T===Fp&&(function(){var j,q;if(!(de&&Zo.value&&M.value&&Ur.value))return;const Q=M.value,ve=Ur.value;ve.style.visibility="hidden";const be=(function(){const De=Rp.value;for(let Ee=De.length-1;Ee>=0;Ee--){const Be=De[Ee];if(!Be||py(Be.node)||!Ip(Be.index))continue;const qe=ue.get(Be.index);if(!qe)continue;const ze=hA(qe);if(ze)return ze}return null})();if(!be)return;let xe=0,Re=0,Ae=20,Fe=!1;if(be?.textContent){const De=be.textContent.length,Ee=document.createRange();Ee.setStart(be,Math.max(0,De-1)),Ee.setEnd(be,De);const Be=typeof Ee.getClientRects=="function"?Ee.getClientRects():void 0,qe=(q=Be?.[Be.length-1])!=null?q:(j=be.parentElement)==null?void 0:j.getBoundingClientRect();if(qe){const ze=ct("typewriterCursor.root.getBoundingClientRect",()=>Q.getBoundingClientRect());xe=qe.right-ze.left+Q.scrollLeft,Re=qe.top-ze.top+Q.scrollTop,Ae=qe.height||Ae,Fe=!0}Ee.detach()}Fe&&(ve.style.transform=`translate(${Math.max(0,xe)}px, ${Math.max(0,Re)}px)`,ve.style.height=`${Ae}px`,ve.style.visibility="visible")})()};Nt?Il=Nt(D):D()}return Ve([he,()=>s.content,()=>s.nodes,()=>k.typewriter,H],()=>Cn(null,null,function*(){var T,D;if(!de||Le.value||!J.value)return;if(H.value)return Zo.value=!1,Hu(),void Wu();if((T=s.nodes)!=null&&T.length)return Zo.value=!1,Hu(),Wu(),Du=((D=s.content)!=null?D:"").length,void(Bu=he.value.length);const j=(function(){var xe,Re;return(xe=s.nodes)!=null&&xe.length?s.nodes.reduce((Ae,Fe)=>Ae+Fu(Fe),0):((Re=s.content)!=null?Re:"").length})(),q=(function(){var xe;return(xe=s.nodes)!=null&&xe.length?s.nodes.reduce((Re,Ae)=>Re+Fu(Ae),0):he.value.length})(),Q=!py(et.value[et.value.length-1]),ve=j>Du,be=q>Bu;if(k.typewriter===!1||!Q||!ve&&!be)return k.typewriter!==!1&&Q||(Zo.value=!1,Wu()),Du=j,void(Bu=q);Du=j,Bu=q,Zo.value=!0,Ur.value&&(Ur.value.style.visibility="hidden"),Hu(),yield ft(),Hp(),Za=setTimeout(()=>{Za=void 0,Zo.value=!1},3e3)}),{flush:"post",immediate:!0}),Ve(Zo,T=>Cn(null,null,function*(){T?(yield ft(),Hp()):Wu()}),{flush:"post"}),Ve([()=>Jn.value,()=>os.start,()=>os.end],()=>Cn(null,null,function*(){de&&!Le.value&&J.value&&Zo.value&&(yield ft(),Hp())}),{flush:"post"}),Ks(()=>{Hu(),my(),hn.clear()}),(T,D)=>{const j=HE("NodeRenderer",!0);return C(Le)?(x(!0),$(Pe,{key:0},Ye(Rp.value,q=>(x(),$(Pe,{key:q.index},[q.rendersCustomNode?(x(),je(_s(q.component),tn({key:0,ref_for:!0},q.customBindings,{node:q.node,loading:q.node.loading,"index-key":q.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onClick:Bp,onMouseover:uy,onMouseout:dy,onCopy:D[0]||(D[0]=Q=>o("copy",Q)),onHandleArtifactClick:D[1]||(D[1]=Q=>o("handleArtifactClick",Q))}),{default:Ln(()=>[q.hasSlotChildren?(x(),je(j,tn({key:0,ref_for:!0},Rn.value,{nodes:q.node.children,"index-key":q.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):q.slotContent?(x(),je(j,tn({key:1,ref_for:!0},Rn.value,{content:q.slotContent,final:!q.node.loading,"index-key":`${q.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"])):(x(),je(_s(q.component),tn({key:1,node:q.node,loading:q.node.loading,"index-key":q.indexKey},{ref_for:!0},q.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onClick:Bp,onMouseover:uy,onMouseout:dy,onCopy:D[2]||(D[2]=Q=>o("copy",Q)),onHandleArtifactClick:D[3]||(D[3]=Q=>o("handleArtifactClick",Q))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(x(),$("div",{key:1,ref_key:"containerRef",ref:M,class:Oe(["markstream-vue markdown-renderer",[{dark:k.isDark},{virtualized:ge.value},{"virtual-scroll-coordinated":ms.value}]]),"data-custom-id":k.customId,onClick:Bp,onMouseover:cA,onMouseout:uA},[Ts.value||ge.value?(x(),$(Pe,{key:0},[Ts.value?(x(),$("div",{key:0,class:"height-estimation-probes",style:Ft({width:`${Mt.value}px`}),"aria-hidden":"true"},[m("div",{ref_key:"paragraphProbeWrapperRef",ref:L,class:"node-content","data-probe":"paragraph"},[gt(C(al),{node:Fn.value,"index-key":"probe-paragraph"},null,8,["node"])],512),m("div",{ref_key:"listItemProbeWrapperRef",ref:R,class:"node-content","data-probe":"list-item"},[m("ul",RU,[gt(C(ma),{node:sn.value,"index-key":"probe-list-item"},null,8,["node"])])],512),m("div",{ref_key:"listProbeWrapperRef",ref:B,class:"node-content","data-probe":"list"},[gt(C(ga),{node:En.value,"index-key":"probe-list"},null,8,["node"])],512),(x(),$(Pe,null,Ye(6,q=>m("div",{key:`probe-heading-${q}`,ref_for:!0,ref:Q=>(function(ve,be){ve<1||ve>6||(W[ve]=be)})(q,Q),class:"node-content","data-probe":`heading-${q}`},[gt(C(Bf),{node:L3(q),"index-key":`probe-heading-${q}`},null,8,["node","index-key"])],8,DU)),64))],4)):ie("",!0),ge.value?(x(),$("div",{key:1,class:"node-spacer",style:Ft({height:`${sp.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],64)):ie("",!0),(x(!0),$(Pe,null,Ye(Rp.value,q=>(x(),$("div",{key:q.index,ref_for:!0,ref:Q=>Z0(q.index,Q),class:"node-slot","data-node-index":q.index,"data-node-type":q.node.type},[Ip(q.index)?(x(),$("div",{key:0,ref_for:!0,ref:Q=>(function(ve,be){var xe;be||(function(De){const Ee=`${ip()}-${De}`;let Be=!1;for(const qe of Array.from(Gs.keys())){const ze=Yo.get(qe);(ze?.index===De||qe===Ee||qe.startsWith(`${Ee}-`))&&(Gs.delete(qe),Yo.delete(qe),Be=!0)}Be&&(_l(),dn("async-node"))})(ve),di.delete(ve),(function(De){var Ee;const Be=((Ee=Or.get(De))!=null?Ee:0)+1;Or.set(De,Be)})(ve);const Re=Ui.get(ve);if(Re){for(const De of Re)Tu(De);Ui.delete(ve)}if((function(De){const Ee=pe.get(De);Ee&&(ne?.unobserve(Ee),z.delete(Ee),pe.delete(De))})(ve),!be||!He.value)return Go.delete(ve),void Or.delete(ve);Go.set(ve,be);const Ae=()=>{Pu(ve,be)};queueMicrotask(Ae);const Fe=(ne||typeof ResizeObserver>"u"||(ne=new ResizeObserver(De=>{if(De.length)for(const Ee of De){const Be=z.get(Ee.target),qe=pe.get(Be??-1);Be!=null&&qe&&Pu(Be,qe)}else hi()})),ne);if(Fe&&(pe.set(ve,be),z.set(be,ve),Fe.observe(be)),typeof window<"u"){const De=((xe=et.value[ve])==null?void 0:xe.type)==="code_block"?[16,80,240,800]:H.value?[80]:[];if(De.length){const Ee=De.map(Be=>k0(Be,Ae,"node-resize")).filter(Be=>Be!=null);Ee.length&&Ui.set(ve,Ee)}}})(q.index,Q),class:"node-content"},[q.isCodeBlock?q.rendersCustomNode?(x(),je(_s(q.component),tn({key:1,ref_for:!0},q.customBindings,{node:q.node,loading:q.node.loading,"index-key":q.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:D[8]||(D[8]=Q=>o("copy",Q)),onHandleArtifactClick:D[9]||(D[9]=Q=>o("handleArtifactClick",Q))}),{default:Ln(()=>[q.hasSlotChildren?(x(),je(j,tn({key:0,ref_for:!0},Rn.value,{nodes:q.node.children,"index-key":q.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):q.slotContent?(x(),je(j,tn({key:1,ref_for:!0},Rn.value,{content:q.slotContent,final:!q.node.loading,"index-key":`${q.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"])):(x(),je(_s(q.component),tn({key:2,node:q.node,loading:q.node.loading,"index-key":q.indexKey},{ref_for:!0},q.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:D[10]||(D[10]=Q=>o("copy",Q)),onHandleArtifactClick:D[11]||(D[11]=Q=>o("handleArtifactClick",Q))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(x(),je(Pi,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:Ln(()=>[q.rendersCustomNode?(x(),je(_s(q.component),tn({key:0,ref_for:!0},q.customBindings,{node:q.node,loading:q.node.loading,"index-key":q.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:D[4]||(D[4]=Q=>o("copy",Q)),onHandleArtifactClick:D[5]||(D[5]=Q=>o("handleArtifactClick",Q))}),{default:Ln(()=>[q.hasSlotChildren?(x(),je(j,tn({key:0,ref_for:!0},Rn.value,{nodes:q.node.children,"index-key":q.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):q.slotContent?(x(),je(j,tn({key:1,ref_for:!0},Rn.value,{content:q.slotContent,final:!q.node.loading,"index-key":`${q.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"])):(x(),je(_s(q.component),tn({key:1,node:q.node,loading:q.node.loading,"index-key":q.indexKey},{ref_for:!0},q.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:D[6]||(D[6]=Q=>o("copy",Q)),onHandleArtifactClick:D[7]||(D[7]=Q=>o("handleArtifactClick",Q))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(x(),$("div",{key:1,class:"node-placeholder",style:Ft({height:`${Eu(q.index)}px`})},null,4))],8,BU))),128)),Zo.value?(x(),$("span",{key:1,ref_key:"typewriterCursorRef",ref:Ur,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ie("",!0),ge.value?(x(),$("div",{key:2,class:"node-spacer",style:Ft({height:`${op.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],42,PU))}}})),[["__scopeId","data-v-6eca2e33"]]),Vs=kM;Vs.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Vs.__name,Vs.name].filter(n=>!!n));for(const n of t)e.component(n,kM)};const Vv=Object.freeze(Object.defineProperty({__proto__:null,default:Vs},Symbol.toStringTag,{value:"Module"})),FU={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"},HU={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"},WU={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"},UU={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"},jU={class:"admonition-title"},qU=["aria-expanded","aria-controls"],zU=["id"],Ud=en(Xe({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=F(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=te(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(x(),$("div",{class:Oe(["admonition",[`admonition-${s.node.kind}`]])},[m("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(x(),$("svg",FU,[...u[1]||(u[1]=[m("circle",{cx:"12",cy:"12",r:"10"},null,-1),m("path",{d:"M12 16v-4"},null,-1),m("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(x(),$("svg",HU,[...u[2]||(u[2]=[m("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),m("path",{d:"M9 18h6"},null,-1),m("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(x(),$("svg",WU,[...u[3]||(u[3]=[m("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),m("path",{d:"M12 9v4"},null,-1),m("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(x(),$("svg",UU,[...u[4]||(u[4]=[m("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),m("path",{d:"M12 8v4"},null,-1),m("path",{d:"M12 16h.01"},null,-1)])])):ie("",!0),m("span",jU,O(i.value),1),s.node.collapsible?(x(),$("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(x(),$("svg",{style:Ft({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]=[m("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,qU)):ie("",!0)]),Ot(m("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[gt(C(Vs),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,zU),[[Ho,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Ud.install=e=>{e.component(Ud.__name,Ud)};const bM=()=>oo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let vd=null,VU=bM;function _pe(){return Cn(this,null,function*(){if(vd)return vd;const e=VU;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===bM?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(vd=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),vd):null})}function wpe(){return!1}function Spe(){return Cn(this,null,function*(){return null})}const yd=te(!1);let Rw=!1;function Wm(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function KU(){return!Rw&&typeof window<"u"&&typeof document<"u"&&(Rw=!0,yd.value=Wm(),new MutationObserver(()=>{yd.value=Wm()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{yd.value=Wm()})),yd}const _M=["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"],GU=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),h1=[..._M].sort((e,t)=>t.length-e.length).join("|"),Um=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${h1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${h1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),wM=/[),.;!?,。;!?)]+$/;function YU(e){const t=e.toLowerCase();return _M.some(n=>t.endsWith(`.${n}`))}function XU(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${h1}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function ZU(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace(wM,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=GU.has(i),a=YU(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function JU(e,t={}){const n=[];Um.lastIndex=0;let s;for(;(s=Um.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace(wM,""),u=a.length-c.length;a=c;const d=ZU(a,t);if(!d)continue;const f=s.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(Um.lastIndex-=u)}return n}const QU=12e4,ej=6e4,tj=32,nj=3e4,Dw=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function sj(e){let t=0,n=0,s=0;Dw.lastIndex=0;let o;for(;(o=Dw.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=QU||n>=ej||t>=tj||s>=nj?"pre":"shiki",codeFenceCount:t,codeChars:n}}const oj={key:1,class:"diff-wrap"},ij={class:"diff-bar"},rj=["title","onClick"],lj={class:"diff-pre"},aj="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Bw="github-light",Fw="github-dark",cj=Xe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){tH();function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=_t(),s=Dt("resolveImage"),o=te(null),i=e,r=F(()=>!i.streaming),l=F(()=>XU(i.text??"")),a=F(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:sj(i.text??"")),c=KU(),u=F(()=>!i.streaming),d=so(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function g(R){return!/^(https?:|data:|blob:)/i.test(R)}function S(R){if(!s)return;const B=[];for(const W of[h,p]){W.lastIndex=0;let K;for(;(K=W.exec(R))!==null;)B.push(K[2]??"")}for(const W of B)!W||!g(W)||d.has(W)||f.has(W)||(f.add(W),s(W).then(K=>{d.set(W,K!==W?K:"")}).catch(()=>{d.set(W,"")}).finally(()=>{f.delete(W)}))}function _(R){if(!s)return R;const B=W=>{if(!g(W))return null;const K=d.get(W);return K===void 0?aj:K===""?null:K};return R.replace(h,(W,K,V,se)=>{const Y=B(V);return Y===null?W:`${K}${Y}${se}`}).replace(p,(W,K,V,se)=>{const Y=B(V);return Y===null?W:`${K}${Y}${se}`})}Ve(()=>i.text,R=>S(R??""),{immediate:!0});function y(){if(!o.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),B=[];let W=R.nextNode();for(;W;){const K=W,V=K.parentElement;V&&!V.closest("a, pre, .md-file-link")&&K.data.trim().length>0&&B.push(K),W=R.nextNode()}for(const K of B){const V=JU(K.data,{aliases:l.value});if(V.length===0||!K.parentNode)continue;const se=document.createDocumentFragment();let Y=0;for(const G of V){G.start>Y&&se.append(document.createTextNode(K.data.slice(Y,G.start)));const ee=document.createElement("button");ee.type="button",ee.className="md-file-link",ee.textContent=G.text,ee.title=G.line?`${G.path}:${G.line}`:G.path,ee.addEventListener("click",we=>{we.preventDefault(),we.stopPropagation(),i.openFile?.({path:G.path,line:G.line})}),se.append(ee),Y=G.end}Y<K.data.length&&se.append(document.createTextNode(K.data.slice(Y))),K.parentNode.replaceChild(se,K)}}function b(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function v(R){let B=R.length;for(const W of["#","?"]){const K=R.indexOf(W);K!==-1&&K<B&&(B=K)}return R.slice(0,B)}function w(){if(!o.value||!i.openFile||i.streaming)return;const R=o.value.querySelectorAll("a[href]");for(const B of R){if(B.dataset.mdLinkHandled==="true")continue;const W=B.getAttribute("href")??"";b(W)&&(B.dataset.mdLinkHandled="true",B.addEventListener("click",K=>{K.preventDefault(),K.stopPropagation(),i.openFile?.({path:v(W)})}))}}function N(){ft().then(()=>{y(),w()})}Ve(()=>i.text,N),Ve(()=>i.streaming,N);let E=null;Qt(()=>{N(),o.value&&(E=new MutationObserver(N),E.observe(o.value,{childList:!0,subtree:!0}))}),Ht(()=>{E?.disconnect()});const k={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},A=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,I=F(()=>{const R=_(i.text??""),B=[];let W=0;A.lastIndex=0;let K;for(;(K=A.exec(R))!==null;){const se=K[1]??"",Y=R.slice(W,K.index)+(se||"");Y.trim()&&B.push({kind:"md",text:Y}),B.push({kind:"diff",code:K[2]??""}),W=A.lastIndex}const V=R.slice(W);return(V.trim()||B.length===0)&&B.push({kind:"md",text:V}),B});function P(R){return R.split(`
|
|
224
|
-
`).map(B=>/^\+(?!\+\+)/.test(B)?{cls:"diff-add",text:B}:/^-(?!--)/.test(B)?{cls:"diff-del",text:B}:B.startsWith("@@")?{cls:"diff-hunk",text:B}:{cls:"diff-ctx",text:B})}const M=te(null);function L(R,B){Ss(R).then(W=>{W&&(M.value=B,setTimeout(()=>{M.value=null},1400))})}return(R,B)=>(x(),$("div",{ref_key:"mdRef",ref:o,class:"md"},[(x(!0),$(Pe,null,Ye(I.value,(W,K)=>(x(),$(Pe,{key:K},[W.kind==="md"?(x(),je(C(Vs),{key:0,content:W.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":Bw,"code-block-dark-theme":Fw,themes:[Bw,Fw],"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"])):(x(),$("div",oj,[m("div",ij,[B[0]||(B[0]=m("span",{class:"diff-lang"},"diff",-1)),m("button",{class:"diff-copy",title:C(n)("filePreview.copyCode"),onClick:V=>L(W.code,K)},O(M.value===K?"✓":"⧉"),9,rj)]),m("pre",lj,[m("code",null,[(x(!0),$(Pe,null,Ye(P(W.code),(V,se)=>(x(),$("span",{key:se,class:Oe(V.cls)},O(V.text),3))),128))])])]))],64))),128))],512))}}),nu=vt(cj,[["__scopeId","data-v-84213e3a"]]),uj={class:"tc-anim"},dj={class:"prev-anim"},fj={class:"prev"},hj=Xe({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=F(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=F(()=>n.foldable&&o.value.length>1),r=F(()=>n.streaming||!i.value),l=F(()=>o.value.pop()??""),a=te(null);return Qt(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ve(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||ft(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(x(),$("div",{class:Oe(["think",{mob:e.mobile}])},[i.value?(x(),$("div",{key:0,class:Oe(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[m("div",uj,[m("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),m("div",dj,[m("span",fj,O(l.value),1)])],2)):(x(),$("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),Hw=vt(hj,[["__scopeId","data-v-42c6573c"]]),pj={class:"activity-notice",role:"status"},mj={class:"an-moon","aria-hidden":"true"},gj={class:"an-label"},vj=120,yj=Xe({__name:"ActivityNotice",props:{label:{}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"],n=te(0);let s=null;return Qt(()=>{s=setInterval(()=>{n.value=(n.value+1)%t.length},vj)}),Ht(()=>{s&&(clearInterval(s),s=null)}),(o,i)=>(x(),$("div",pj,[m("span",mj,O(t[n.value]),1),m("span",gj,O(e.label),1)]))}}),Ww=vt(yj,[["__scopeId","data-v-dfa53d2b"]]),kj=["disabled"],bj={class:"agent-main"},_j={class:"agent-title-row"},wj={class:"agent-name"},Sj={key:0,class:"agent-type"},Cj={class:"agent-phase"},xj={key:0,class:"agent-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Tj=Xe({__name:"AgentCard",props:{member:{},compact:{type:Boolean}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=F(()=>(n.member.outputLines??[]).map(u=>u.trimEnd()).filter(u=>u.length>0).slice(-8)),i=F(()=>o.value.at(-1)),r=F(()=>n.member.phase==="queued"||n.member.phase==="working"||n.member.phase==="suspended"),l=F(()=>!!(n.member.summary||n.member.suspendedReason||n.member.prompt||o.value.length>0));function a(u){switch(u){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function c(){l.value&&s("open",n.member.id)}return(u,d)=>(x(),$("div",{class:Oe(["agent-card",[`phase-${e.member.phase}`,{compact:e.compact}]])},[m("button",{class:"agent-head",type:"button",disabled:!l.value,onClick:c},[d[1]||(d[1]=m("span",{class:"agent-dot","aria-hidden":"true"},null,-1)),m("span",bj,[m("span",_j,[m("span",wj,O(e.member.name),1),e.member.subagentType?(x(),$("span",Sj,O(e.member.subagentType),1)):ie("",!0),r.value?(x(),$("span",{key:1,class:Oe(["agent-live",{empty:!i.value}])},O(i.value),3)):ie("",!0)])]),m("span",Cj,O(a(e.member.phase)),1),l.value?(x(),$("svg",xj,[...d[0]||(d[0]=[m("path",{d:"M6 4l4 4-4 4"},null,-1)])])):ie("",!0)],8,kj)],2))}}),p1=vt(Tj,[["__scopeId","data-v-bb535d33"]]),Mj={class:"agent-group"},Aj={class:"group-count"},Ej={key:0,class:"group-live"},$j={key:0,class:"group-body"},Ij=Xe({__name:"AgentGroup",props:{members:{}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=te(!0),i=F(()=>n.members.filter(l=>l.phase==="completed"||l.phase==="failed").length),r=F(()=>n.members.filter(l=>l.phase==="queued"||l.phase==="working"||l.phase==="suspended").length);return(l,a)=>(x(),$("section",Mj,[m("button",{class:"group-head",type:"button",onClick:a[0]||(a[0]=c=>o.value=!o.value)},[a[3]||(a[3]=m("span",{class:"group-title"},"Agents",-1)),m("span",Aj,O(i.value)+"/"+O(e.members.length),1),r.value>0?(x(),$("span",Ej,O(r.value)+" running",1)):ie("",!0),(x(),$("svg",{class:Oe(["group-chevron",{open:o.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...a[2]||(a[2]=[m("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),o.value?(x(),$("div",$j,[(x(!0),$(Pe,null,Ye(e.members,c=>(x(),je(p1,{key:c.id,member:c,compact:"",onOpen:a[1]||(a[1]=u=>s("open",u))},null,8,["member"]))),128))])):ie("",!0)]))}}),Uw=vt(Ij,[["__scopeId","data-v-17ab3c41"]]),Nj=["aria-label"],Lj=120,Oj=60,Pj=Xe({__name:"MoonSpinner",props:{fast:{type:Boolean},label:{default:"Working…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*Lj}ms`,"--moon-frame-fast-delay":`${s*Oj}ms`}}return(s,o)=>(x(),$("span",{class:Oe(["moon-spin",{"moon-spin--fast":e.fast}]),"aria-label":e.label,role:"img"},[(x(),$(Pe,null,Ye(t,(i,r)=>m("span",{key:i,class:"moon-frame",style:Ft(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,Nj))}}),m1=vt(Pj,[["__scopeId","data-v-e7ccbb9a"]]);function Rj(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}function jw(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function qw(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 Oh(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 Dj(e){return!(e.tool.status==="ok"&&e.tool.media)}function zw(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function Vw(e){const t=Oh(e),n=[];let s=[];const o=()=>{if(s.length===1){const[i]=s;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else s.length>1&&n.push({kind:"tool-stack",tools:s});s=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(Dj(i)){s.push({tool:i.tool,sourceIndex:r});return}o(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}o(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"?n.push({kind:"text",text:i.text,sourceIndex:r}):i.kind==="agent"?n.push({kind:"agent",member:i.member,sourceIndex:r}):n.push({kind:"agentGroup",members:i.members,sourceIndex:r})}),o(),n}function Bj(e){return Oh(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
225
|
-
|
|
226
|
-
`)}function Fj(e){const t=[];for(const n of Oh(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
227
|
-
> ${n.thinking.split(`
|
|
228
|
-
`).join(`
|
|
229
|
-
> `)}`);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 s=n.tool.output.join(`
|
|
230
|
-
`);t.push(`\`\`\`
|
|
231
|
-
[${n.tool.name}]
|
|
232
|
-
${s}
|
|
233
|
-
\`\`\``)}else n.kind==="agent"?t.push(`**Agent** ${n.member.name} (${n.member.phase})`):n.kind==="agentGroup"&&t.push(`**Agents**
|
|
234
|
-
|
|
235
|
-
${n.members.map(s=>`- ${s.name}: ${s.phase}`).join(`
|
|
236
|
-
`)}`);return t.join(`
|
|
237
|
-
|
|
238
|
-
`)}function g1(e){return e.tool.id||`tool-${e.sourceIndex}`}function Kw(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?g1({tool:e.tool,sourceIndex:e.sourceIndex}):e.kind==="agent"?`agent-${e.member.id}-${e.sourceIndex}`:e.kind==="agentGroup"?`agent-group-${e.members[0]?.id??e.sourceIndex}`:`${e.kind}-${e.sourceIndex}`}const Hj={key:0,class:"chat"},Wj={key:0,class:"chat-loading"},Uj={class:"chat-loading-text"},jj={key:1,class:"chat-empty"},qj={key:1,class:"top-sentinel-text"},zj=["data-turn-id"],Vj={key:0,class:"u-imgs"},Kj=["src"],Gj=["src","alt"],Yj={key:1,class:"skill-act"},Xj={class:"skill-act-head"},Zj={key:0,class:"skill-act-args"},Jj={key:2,class:"u-text"},Qj={key:0,class:"u-meta"},eq=["data-tooltip","onClick"],tq={class:"u-edit-text"},nq=["onClick"],sq=["data-tooltip","onClick"],oq={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},iq={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},rq=["onClick"],lq=["data-turn-id"],aq=["onClick"],cq={class:"cd-view"},uq={key:1,class:"cd-label"},dq=["data-turn-id"],fq={key:1,class:"msg"},hq={key:2,class:"tool-stack"},pq={key:0,class:"a-msg-ft"},mq=["title"],gq=["onClick"],vq={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},yq={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},kq={class:"a-cpbtn-text"},bq={key:4,class:"sending-placeholder"},_q={key:1,class:"term"},wq={key:0,class:"chat-loading"},Sq={class:"chat-loading-text"},Cq={key:1,class:"chat-empty"},xq={key:1,class:"top-sentinel-text"},Tq=["data-turn-id"],Mq=["onClick"],Aq={class:"cd-view"},Eq={key:1,class:"cd-label"},$q=["data-turn-id"],Iq={class:"no"},Nq={class:"tx"},Lq={class:"role-row"},Oq=["onClick"],Pq={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Rq={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Dq={class:"cpbtn-text"},Bq=["title"],Fq={key:0,class:"u-text"},Hq={key:0,class:"skill-act"},Wq={class:"skill-act-head"},Uq={key:0,class:"skill-act-args"},jq={key:2,class:"tool-stack"},qq=["data-tooltip","onClick"],zq={class:"u-edit-text"},Vq=["onClick"],Kq={key:4,class:"ln sending-line"},Gq={class:"tx"},Yq=Xe({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},bubble:{type:Boolean,default:!1},mobile:{type:Boolean,default:!1},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages"],setup(e,{expose:t,emit:n}){const{t:s}=_t();Ht(()=>{W!==null&&(clearTimeout(W),W=null),A!==null&&(clearTimeout(A),A=null),y!==null&&(clearTimeout(y),y=null)});const o=e,i=F(()=>o.bubble||o.mobile),r=te(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Y=>{Y[0]?.isIntersecting&&o.hasMoreMessages&&!o.loadingMore&&!o.loadingMoreError&&!o.sessionLoading&&!o.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}Qt(a),Ht(()=>{l?.disconnect(),l=null}),Ve(()=>[o.hasMoreMessages,o.loadingMore,o.loadingMoreError],()=>{ft().then(a)});const c=F(()=>{if(!o.running||o.turns.length===0)return null;const Y=o.turns.at(-1);return Y.role==="assistant"?Y.id:null}),u=F(()=>o.sending||o.running),d=n,f=F(()=>{for(let Y=o.turns.length-1;Y>=0;Y--)if(o.turns[Y].role==="user")return o.turns[Y].id;return null});function h(Y){return Y.role==="user"&&Y.id===f.value&&!o.running&&!o.sending&&!Y.skillActivation}function p(Y){const G=Y.compaction,ee=G?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof G?.tokensBefore=="number"&&typeof G?.tokensAfter=="number"?ee+s("conversation.compactedTokens",{before:jw(G.tokensBefore),after:jw(G.tokensAfter)}):ee}const g=te(null),S=te(null),_=te(null);let y=null;const b=te(new Set);function v(Y){return b.value.has(Y)}function w(Y){const G=new Set(b.value);G.has(Y)?G.delete(Y):G.add(Y),b.value=G}function N(Y,G){if(v(G)){const ee=new Date(Y);if(Number.isNaN(ee.getTime()))return Y;const we=de=>String(de).padStart(2,"0");return`${ee.getFullYear()}-${we(ee.getMonth()+1)}-${we(ee.getDate())} ${we(ee.getHours())}:${we(ee.getMinutes())}`}return Rj(Y,s("conversation.yesterday"))}function E(Y){_.value===null&&(S.value=null,_.value=Y.id,y=setTimeout(()=>{y=null,d("editMessage",Y.text),_.value=null},240))}const k=te(!1);let A=null;function I(){if(o.turns.length===0)return;const Y=[];for(const ee of o.turns){if(ee.role==="compaction")continue;const we=ee.role==="user"?"User":"Assistant",de=Fj(ee);de.trim()&&Y.push(`**${we}**
|
|
239
|
-
|
|
240
|
-
${de}`)}const G=Y.join(`
|
|
241
|
-
|
|
242
|
-
---
|
|
243
|
-
|
|
244
|
-
`);Ss(G).then(ee=>{ee&&(k.value=!0,d("copyConversationCopied"),A!==null&&clearTimeout(A),A=setTimeout(()=>{A=null,k.value=!1},2e3))}).catch(()=>{})}function P(Y){const G=[];for(let ee=Y;ee>=0;ee--){const we=o.turns[ee];if(!we||we.role!=="assistant")break;G.unshift(we)}return G}function M(Y){return P(Y).map(G=>Bj(G)).filter(Boolean).join(`
|
|
245
|
-
|
|
246
|
-
`)}function L(){for(let Y=o.turns.length-1;Y>=0;Y-=1)if(o.turns[Y]?.role==="assistant")return M(Y);return""}function R(){const Y=L();Y.trim()&&Ss(Y).then(G=>{G&&(k.value=!0,d("copyConversationCopied"),A!==null&&clearTimeout(A),A=setTimeout(()=>{A=null,k.value=!1},2e3))}).catch(()=>{})}t({copyConversation:I,copyFinalSummary:R});function B(Y){const G=o.turns[Y];if(!G||G.role!=="assistant")return!1;const ee=o.turns[Y+1];return!ee||ee.role!=="assistant"}let W=null;function K(Y){const G=o.turns[Y];if(!G)return;const ee=M(Y);ee.trim()&&Ss(ee).then(we=>{we&&(g.value=G.id,W!==null&&clearTimeout(W),W=setTimeout(()=>{W=null,g.value=null},1400))}).catch(()=>{})}function V(Y){const G=Y.text;G.trim()&&Ss(G).then(ee=>{ee&&(g.value=Y.id,W!==null&&clearTimeout(W),W=setTimeout(()=>{W=null,g.value=null},1400))}).catch(()=>{})}function se(Y,G){return Y.id!==c.value?!1:G.sourceIndex===Oh(Y).length-1}return(Y,G)=>i.value?(x(),$("div",Hj,[e.sessionLoading?(x(),$("div",Wj,[G[18]||(G[18]=m("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),m("span",Uj,O(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),$("div",jj)):ie("",!0),e.hasMoreMessages||e.loadingMore?(x(),$("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Oe(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),$("span",qj,[G[19]||(G[19]=m("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),dt(" "+O(C(s)("conversation.loadingOlder")),1)])):(x(),$("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:G[0]||(G[0]=ee=>d("loadOlderMessages"))},O(C(s)("conversation.loadOlder")),1))],2)):ie("",!0),(x(!0),$(Pe,null,Ye(e.turns,(ee,we)=>(x(),$(Pe,{key:ee.id},[ee.role==="user"?(x(),$(Pe,{key:0},[m("div",{class:Oe(["u-bub turn-anchor",{undoing:_.value===ee.id}]),"data-turn-id":ee.id},[ee.images&&ee.images.length>0?(x(),$("div",Vj,[(x(!0),$(Pe,null,Ye(ee.images,(de,Le)=>(x(),$(Pe,{key:Le},[de.kind==="video"?(x(),$("video",{key:0,class:"u-img",src:de.url,controls:"",playsinline:"",preload:"metadata"},null,8,Kj)):(x(),$("img",{key:1,class:"u-img",src:de.url,alt:de.alt||"",loading:"lazy"},null,8,Gj))],64))),128))])):ie("",!0),ee.skillActivation?(x(),$("div",Yj,[m("div",Xj,[G[20]||(G[20]=m("span",{class:"skill-act-arrow"},"▶",-1)),m("span",null,O(C(s)("conversation.activatedSkill",{name:ee.skillActivation.name})),1)]),ee.skillActivation.args?(x(),$("div",Zj,O(ee.skillActivation.args),1)):ie("",!0)])):(x(),$("div",Jj,O(ee.text),1))],10,zj),ee.createdAt||h(ee)?(x(),$("div",Qj,[h(ee)?(x(),$("div",{key:0,class:Oe(["u-edit-wrap",{undoing:_.value===ee.id}])},[S.value!==ee.id?(x(),$("button",{key:0,type:"button",class:"u-edit","data-tooltip":C(s)("conversation.undoTooltip"),onClick:de=>S.value=ee.id},[m("span",tq,O(C(s)("conversation.undo")),1),G[21]||(G[21]=m("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),m("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1))],8,eq)):(x(),$("div",{key:1,class:"u-edit-confirm",onClick:G[2]||(G[2]=Ze(()=>{},["stop"]))},[m("span",null,O(C(s)("conversation.undoConfirm")),1),m("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ze(de=>E(ee),["stop"])},O(C(s)("conversation.confirm")),9,nq),m("button",{type:"button",class:"u-edit-confirm-btn",onClick:G[1]||(G[1]=Ze(de=>S.value=null,["stop"]))},O(C(s)("conversation.cancel")),1)]))],2)):ie("",!0),ee.text.trim().length>0?(x(),$("button",{key:1,type:"button",class:"u-copy","data-tooltip":C(s)("filePreview.copy"),onClick:Ze(de=>V(ee),["stop"])},[g.value!==ee.id?(x(),$("svg",oq,[...G[22]||(G[22]=[m("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),m("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(x(),$("svg",iq,[...G[23]||(G[23]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])]))],8,sq)):ie("",!0),ee.createdAt?(x(),$("button",{key:2,type:"button",class:"u-time",onClick:Ze(de=>w(ee.id),["stop"])},O(N(ee.createdAt,ee.id)),9,rq)):ie("",!0)])):ie("",!0)],64)):ee.role==="compaction"?(x(),$("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":ee.id,role:"separator"},[G[24]||(G[24]=m("span",{class:"cd-line","aria-hidden":"true"},null,-1)),ee.text?(x(),$("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:de=>d("openCompaction",{turnId:ee.id})},[m("span",null,O(p(ee)),1),m("span",cq,O(C(s)("conversation.viewSummary")),1)],8,aq)):(x(),$("span",uq,O(p(ee)),1)),G[25]||(G[25]=m("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,lq)):(x(),$("div",{key:2,class:"a-msg turn-anchor","data-turn-id":ee.id},[(x(!0),$(Pe,null,Ye(C(Vw)(ee),(de,Le)=>(x(),$(Pe,{key:C(Kw)(de,Le)},[de.kind==="thinking"?(x(),je(Hw,{key:0,text:de.thinking,mobile:i.value,streaming:se(ee,de),onOpen:ce=>d("openThinking",{turnId:ee.id,blockIndex:de.sourceIndex})},null,8,["text","mobile","streaming","onOpen"])):de.kind==="text"&&de.text?(x(),$("div",fq,[gt(nu,{text:de.text,streaming:se(ee,de),"open-file":ce=>d("openFile",ce)},null,8,["text","streaming","open-file"])])):de.kind==="tool-stack"?(x(),$("div",hq,[(x(!0),$(Pe,null,Ye(de.tools,(ce,_e)=>(x(),je(sd,{key:C(g1)(ce),tool:ce.tool,mobile:i.value,"stack-position":C(zw)(_e,de.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[3]||(G[3]=me=>d("openMedia",me)),onOpenFile:G[4]||(G[4]=me=>d("openFile",me)),onOpenToolDiff:G[5]||(G[5]=me=>d("openToolDiff",me))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])):de.kind==="agent"?(x(),je(p1,{key:3,member:de.member,onOpen:ce=>d("openAgent",{turnId:ee.id,blockIndex:de.sourceIndex,memberId:ce})},null,8,["member","onOpen"])):de.kind==="agentGroup"?(x(),je(Uw,{key:4,members:de.members,onOpen:ce=>d("openAgent",{turnId:ee.id,blockIndex:de.sourceIndex,memberId:ce})},null,8,["members","onOpen"])):de.kind==="tool"?(x(),je(sd,{key:5,tool:de.tool,mobile:i.value,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[6]||(G[6]=ce=>d("openMedia",ce)),onOpenFile:G[7]||(G[7]=ce=>d("openFile",ce)),onOpenToolDiff:G[8]||(G[8]=ce=>d("openToolDiff",ce))},null,8,["tool","mobile","tool-diff-panel"])):ie("",!0)],64))),128)),ee.id!==c.value&&B(we)&&(M(we).trim().length>0||ee.durationMs!==void 0)?(x(),$("div",pq,[ee.durationMs!==void 0?(x(),$("span",{key:0,class:"a-duration",title:`${ee.durationMs} ms`},O(C(qw)(ee.durationMs)),9,mq)):ie("",!0),M(we).trim().length>0?(x(),$("button",{key:1,class:"a-cpbtn",tabindex:"-1",onClick:de=>K(we)},[g.value!==ee.id?(x(),$("svg",vq,[...G[26]||(G[26]=[m("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),m("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(x(),$("svg",yq,[...G[27]||(G[27]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),m("span",kq,O(C(s)("filePreview.copy")),1)],8,gq)):ie("",!0)])):ie("",!0)],8,dq))],64))),128)),e.compaction?(x(),je(Ww,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):ie("",!0),u.value?(x(),$("div",bq,[gt(m1,{fast:e.fastMoon},null,8,["fast"])])):ie("",!0)])):(x(),$("div",_q,[e.sessionLoading?(x(),$("div",wq,[G[28]||(G[28]=m("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),m("span",Sq,O(C(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),$("div",Cq)):ie("",!0),e.hasMoreMessages||e.loadingMore?(x(),$("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Oe(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),$("span",xq,[G[29]||(G[29]=m("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),dt(" "+O(C(s)("conversation.loadingOlder")),1)])):(x(),$("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:G[9]||(G[9]=ee=>d("loadOlderMessages"))},O(C(s)("conversation.loadOlder")),1))],2)):ie("",!0),(x(!0),$(Pe,null,Ye(e.turns,(ee,we)=>(x(),$(Pe,{key:ee.id},[ee.role==="compaction"?(x(),$("div",{key:0,class:"compact-divider turn-anchor","data-turn-id":ee.id,role:"separator"},[G[30]||(G[30]=m("span",{class:"cd-line","aria-hidden":"true"},null,-1)),ee.text?(x(),$("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:de=>d("openCompaction",{turnId:ee.id})},[m("span",null,O(p(ee)),1),m("span",Aq,O(C(s)("conversation.viewSummary")),1)],8,Mq)):(x(),$("span",Eq,O(p(ee)),1)),G[31]||(G[31]=m("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Tq)):(x(),$("div",{key:1,class:Oe(["ln turn-anchor",[ee.role==="user"?"userline":"ai",{undoing:_.value===ee.id}]]),"data-turn-id":ee.id},[m("span",Iq,O(ee.no),1),m("div",Nq,[m("div",Lq,[ee.role==="user"?(x(),$(Pe,{key:0},[G[32]||(G[32]=m("span",{class:"pr"},"user@kimi",-1)),G[33]||(G[33]=m("span",{class:"who"}," $ ",-1))],64)):(x(),$(Pe,{key:1},[G[34]||(G[34]=m("span",{class:"pr"},"kimi",-1)),G[35]||(G[35]=m("span",{class:"who"}," > ",-1))],64)),ee.id!==c.value&&B(we)&&M(we).trim().length>0?(x(),$("button",{key:2,class:"cpbtn",onClick:de=>K(we),tabindex:"-1"},[g.value!==ee.id?(x(),$("svg",Pq,[...G[36]||(G[36]=[m("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),m("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(x(),$("svg",Rq,[...G[37]||(G[37]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),m("span",Dq,O(C(s)("filePreview.copy")),1)],8,Oq)):ie("",!0),ee.durationMs!==void 0&&ee.role==="assistant"?(x(),$("span",{key:3,class:"turn-duration",title:`${ee.durationMs} ms`},O(C(qw)(ee.durationMs)),9,Bq)):ie("",!0)]),ee.role==="user"?(x(),$("div",Fq,[ee.skillActivation?(x(),$("div",Hq,[m("div",Wq,[G[38]||(G[38]=m("span",{class:"skill-act-arrow"},"▶",-1)),m("span",null,O(C(s)("conversation.activatedSkill",{name:ee.skillActivation.name})),1)]),ee.skillActivation.args?(x(),$("div",Uq,O(ee.skillActivation.args),1)):ie("",!0)])):(x(),$(Pe,{key:1},[dt(O(ee.text),1)],64))])):(x(!0),$(Pe,{key:1},Ye(C(Vw)(ee),(de,Le)=>(x(),$(Pe,{key:C(Kw)(de,Le)},[de.kind==="thinking"?(x(),je(Hw,{key:0,text:de.thinking,streaming:se(ee,de),onOpen:ce=>d("openThinking",{turnId:ee.id,blockIndex:de.sourceIndex})},null,8,["text","streaming","onOpen"])):de.kind==="text"&&de.text?(x(),je(nu,{key:1,text:de.text,streaming:se(ee,de),"open-file":ce=>d("openFile",ce)},null,8,["text","streaming","open-file"])):de.kind==="tool-stack"?(x(),$("div",jq,[(x(!0),$(Pe,null,Ye(de.tools,(ce,_e)=>(x(),je(sd,{key:C(g1)(ce),tool:ce.tool,"stack-position":C(zw)(_e,de.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[10]||(G[10]=me=>d("openMedia",me)),onOpenFile:G[11]||(G[11]=me=>d("openFile",me)),onOpenToolDiff:G[12]||(G[12]=me=>d("openToolDiff",me))},null,8,["tool","stack-position","tool-diff-panel"]))),128))])):de.kind==="agent"?(x(),je(p1,{key:3,member:de.member,onOpen:ce=>d("openAgent",{turnId:ee.id,blockIndex:de.sourceIndex,memberId:ce})},null,8,["member","onOpen"])):de.kind==="agentGroup"?(x(),je(Uw,{key:4,members:de.members,onOpen:ce=>d("openAgent",{turnId:ee.id,blockIndex:de.sourceIndex,memberId:ce})},null,8,["members","onOpen"])):de.kind==="tool"?(x(),je(sd,{key:5,tool:de.tool,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[13]||(G[13]=ce=>d("openMedia",ce)),onOpenFile:G[14]||(G[14]=ce=>d("openFile",ce)),onOpenToolDiff:G[15]||(G[15]=ce=>d("openToolDiff",ce))},null,8,["tool","tool-diff-panel"])):ie("",!0)],64))),128))]),ee.role==="user"&&h(ee)?(x(),$("div",{key:0,class:Oe(["u-edit-wrap ln-edit-wrap",{undoing:_.value===ee.id}])},[S.value!==ee.id?(x(),$("button",{key:0,type:"button",class:"u-edit","data-tooltip":C(s)("conversation.undoTooltip"),onClick:de=>S.value=ee.id},[G[39]||(G[39]=m("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),m("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1)),m("span",zq,O(C(s)("conversation.undo")),1)],8,qq)):(x(),$("div",{key:1,class:"u-edit-confirm",onClick:G[17]||(G[17]=Ze(()=>{},["stop"]))},[m("span",null,O(C(s)("conversation.undoConfirm")),1),m("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ze(de=>E(ee),["stop"])},O(C(s)("conversation.confirm")),9,Vq),m("button",{type:"button",class:"u-edit-confirm-btn",onClick:G[16]||(G[16]=Ze(de=>S.value=null,["stop"]))},O(C(s)("conversation.cancel")),1)]))],2)):ie("",!0)],10,$q))],64))),128)),e.compaction?(x(),je(Ww,{key:3,label:C(s)("conversation.compacting")},null,8,["label"])):ie("",!0),u.value?(x(),$("div",Kq,[G[41]||(G[41]=m("span",{class:"no"},"—",-1)),m("div",Gq,[G[40]||(G[40]=m("div",{class:"role-row"},[m("span",{class:"pr"},"kimi"),m("span",{class:"who"}," > ")],-1)),gt(m1,{fast:e.fastMoon,label:"Sending…"},null,8,["fast"])])])):ie("",!0)]))}}),SM=vt(Yq,[["__scopeId","data-v-4ea264b2"]]),Xq={class:"chat-header"},Zq={class:"ch-id"},Jq={key:0,class:"ch-ws"},Qq={key:1,class:"ch-sep"},ez=["onKeydown"],tz=["title"],nz=["title","aria-label","aria-expanded"],sz=["title"],oz=["title"],iz={key:0,class:"ch-pill ch-sync-pill"},rz={key:0,class:"ch-ahead"},lz={key:1,class:"ch-behind"},az={key:1,class:"ch-pill ch-diff-pill"},cz={key:0,class:"ch-add"},uz={key:1,class:"ch-del"},dz=["title"],fz=Xe({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=F(()=>s.ahead??0),r=F(()=>s.behind??0),l=F(()=>s.gitDiffStats?.totalAdditions??0),a=F(()=>s.gitDiffStats?.totalDeletions??0),c=F(()=>l.value>0||a.value>0),u=te(!1),d=te(null),f=te(null),h=te({});function p(K){const V=K.target;f.value?.contains(V)||d.value?.contains(V)||_()}function g(){_()}async function S(K){if(K.stopPropagation(),u.value){_();return}u.value=!0,document.addEventListener("mousedown",p),document.addEventListener("scroll",g,!0),window.addEventListener("resize",g),await ft();const V=d.value,se=f.value;if(!V||!se)return;const Y=V.getBoundingClientRect(),G=4,ee=8,we=se.offsetWidth,de=se.offsetHeight;let Le=Y.bottom+G;Le+de>window.innerHeight-ee&&(Le=Math.max(ee,Y.top-de-G));let ce=Y.left;ce+we>window.innerWidth-ee&&(ce=Math.max(ee,Y.right-we)),h.value={top:`${Math.round(Le)}px`,left:`${Math.round(ce)}px`}}function _(){u.value=!1,B(),document.removeEventListener("mousedown",p),document.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}Ht(()=>{document.removeEventListener("mousedown",p),document.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)});function y(){o("copyAll"),_()}function b(){o("copyFinalSummary"),_()}const v=te(!1);function w(){s.sessionId&&Ss(s.sessionId).then(K=>{K&&(v.value=!0,setTimeout(()=>{v.value=!1},1200))})}const N=te(!1),E=te(""),k=te(null);async function A(){if(_(),!!s.sessionId){N.value=!0,E.value=s.sessionTitle??"",await ft();try{k.value?.focus(),k.value?.select()}catch{}}}function I(){const K=E.value.trim();K&&s.sessionId&&K!==(s.sessionTitle??"").trim()&&o("renameSession",s.sessionId,K),N.value=!1}function P(){N.value=!1}function M(){s.sessionId&&(_(),o("forkSession",s.sessionId))}const L=te(!1);let R;function B(){clearTimeout(R),L.value=!1}function W(){if(s.sessionId){if(L.value){o("archiveSession",s.sessionId),_();return}L.value=!0,R=setTimeout(()=>{L.value=!1},2500)}}return(K,V)=>(x(),$("header",Xq,[m("div",Zq,[e.workspaceName?(x(),$("span",Jq,O(e.workspaceName),1)):ie("",!0),e.workspaceName&&e.sessionTitle?(x(),$("span",Qq,"/")):ie("",!0),N.value?Ot((x(),$("input",{key:2,ref_key:"renameInputRef",ref:k,"onUpdate:modelValue":V[0]||(V[0]=se=>E.value=se),class:"ch-rename",type:"text",onKeydown:[Eo(Ze(I,["stop"]),["enter"]),Eo(Ze(P,["stop"]),["esc"])],onBlur:I,onClick:V[1]||(V[1]=Ze(()=>{},["stop"]))},null,40,ez)),[[xn,E.value]]):e.sessionTitle?(x(),$("span",{key:3,class:"ch-ses",title:e.sessionTitle},O(e.sessionTitle),9,tz)):ie("",!0)]),m("button",{ref_key:"kebabRef",ref:d,type:"button",class:Oe(["ch-act ch-act-more",{open:u.value}]),title:C(n)("header.options"),"aria-label":C(n)("header.options"),"aria-expanded":u.value,"aria-haspopup":"menu",onClick:V[2]||(V[2]=Ze(se=>S(se),["stop"]))},[...V[6]||(V[6]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"3",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"13",cy:"8",r:"1.3"})],-1)])],10,nz),u.value?(x(),$("div",{key:0,ref_key:"menuRef",ref:f,class:"ch-menu",style:Ft(h.value),onClick:V[3]||(V[3]=Ze(()=>{},["stop"]))},[m("button",{type:"button",class:"chm-item",onClick:Ze(y,["stop"])},O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1),m("button",{type:"button",class:"chm-item",onClick:Ze(b,["stop"])},O(C(n)("header.copyFinalSummary")),1),e.sessionId?(x(),$(Pe,{key:0},[V[7]||(V[7]=m("div",{class:"chm-divider"},null,-1)),m("button",{type:"button",class:"chm-item",onClick:Ze(w,["stop"])},[m("span",null,O(v.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),m("button",{type:"button",class:"chm-item",onClick:Ze(A,["stop"])},O(C(n)("header.renameSession")),1),m("button",{type:"button",class:"chm-item",onClick:Ze(M,["stop"])},O(C(n)("header.forkSession")),1),m("button",{type:"button",class:"chm-item del",onClick:Ze(W,["stop"])},O(L.value?C(n)("header.confirmArchive"):C(n)("header.archiveSession")),1)],64)):ie("",!0)],4)):ie("",!0),V[9]||(V[9]=m("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(x(),$("button",{key:1,type:"button",class:"ch-git",title:C(n)("header.gitTooltip"),onClick:V[4]||(V[4]=se=>o("openChanges"))},[m("span",{class:Oe(["ch-branch",{"ch-detached":!e.branch}]),title:e.branch||C(n)("header.detached")},O(e.branch||C(n)("header.detached")),11,oz),i.value>0||r.value>0?(x(),$("span",iz,[i.value>0?(x(),$("span",rz,"↑"+O(i.value),1)):ie("",!0),r.value>0?(x(),$("span",lz,"↓"+O(r.value),1)):ie("",!0)])):ie("",!0),c.value?(x(),$("span",az,[l.value>0?(x(),$("span",cz,"+"+O(l.value),1)):ie("",!0),a.value>0?(x(),$("span",uz,"-"+O(a.value),1)):ie("",!0)])):ie("",!0)],8,sz)):ie("",!0),e.pr?(x(),$("button",{key:2,type:"button",class:Oe(["ch-pill ch-pr",`pr-${e.pr.state}`]),title:C(n)("header.openPr"),onClick:V[5]||(V[5]=se=>e.pr&&o("openPr",e.pr.url))},[V[8]||(V[8]=kr('<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-7eb81c61><circle cx="5" cy="6" r="3" data-v-7eb81c61></circle><path d="M5 9v12" data-v-7eb81c61></path><circle cx="19" cy="18" r="3" data-v-7eb81c61></circle><path d="m15 9-3-3 3-3" data-v-7eb81c61></path><path d="M12 6h5a2 2 0 0 1 2 2v7" data-v-7eb81c61></path></svg>',1)),m("span",null,"PR #"+O(e.pr.number)+" · "+O(e.pr.state),1)],10,dz)):ie("",!0)]))}}),hz=vt(fz,[["__scopeId","data-v-7eb81c61"]]),pz={key:0,class:"slash-menu",role:"listbox"},mz=["aria-selected","onMouseenter","onMousedown"],gz={class:"slash-name"},vz={class:"slash-desc"},yz=Xe({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te([]);return Ve(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(x(),$("div",pz,[(x(!0),$(Pe,null,Ye(e.items,(a,c)=>(x(),$("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Oe(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:Ze(u=>o("select",a),["prevent"])},[m("span",gz,O(a.name),1),m("span",vz,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,mz))),128))])):ie("",!0)}}),kz=vt(yz,[["__scopeId","data-v-738976e5"]]),bz={class:"mention-menu",role:"listbox"},_z={key:0,class:"mention-state dim"},wz={key:1,class:"mention-state dim"},Sz=["aria-selected","onMouseenter","onMousedown"],Cz=["innerHTML"],xz={class:"mention-name"},Tz={class:"mention-path"},Mz='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',Az='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><polyline points="5.5,5 2.5,8 5.5,11"/><polyline points="10.5,5 13.5,8 10.5,11"/></svg>',Ez='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><line x1="6" y1="8" x2="11" y2="8"/><line x1="6" y1="10.5" x2="11" y2="10.5"/></svg>',$z='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="3" width="12" height="10" rx="1"/><circle cx="5.5" cy="6.5" r="1.1"/><path d="M3 12l3.5-3.5L9 11l2-2 3 3"/></svg>',Gw='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><polyline points="9,1.5 9,4.5 12,4.5"/></svg>',Iz=Xe({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),r=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),l=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function a(c){const u=c.path;if(u.endsWith("/"))return Mz;const d=c.name||u.split("/").pop()||u,f=d.lastIndexOf("."),h=f>0?d.slice(f+1).toLowerCase():"";return h?i.has(h)?Az:r.has(h)?Ez:l.has(h)?$z:Gw:Gw}return(c,u)=>(x(),$("div",bz,[n.loading?(x(),$("div",_z,O(C(o)("mention.searching")),1)):n.items.length===0?(x(),$("div",wz,O(C(o)("mention.noMatch")),1)):(x(!0),$(Pe,{key:2},Ye(n.items,(d,f)=>(x(),$("div",{key:d.path,class:Oe(["mention-item",{active:f===n.activeIndex}]),role:"option","aria-selected":f===n.activeIndex,onMouseenter:h=>s("hover",f),onMousedown:Ze(h=>s("select",d),["prevent"])},[m("span",{class:"mention-icon",innerHTML:a(d),"aria-hidden":"true"},null,8,Cz),m("span",xz,O(d.name),1),m("span",Tz,O(d.path),1)],42,Sz))),128))]))}}),Nz=vt(Iz,[["__scopeId","data-v-86e06bbf"]]),CM=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/sessions",desc:"commands.sessions.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/provider",desc:"commands.provider.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/permission",desc:"commands.permission.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/status",desc:"commands.status.desc"}];function Lz(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 xM(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...CM,...t]}function Oz(e,t=CM){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((s,o)=>{const i=s.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:s,index:o,score:r}}).filter(({score:s})=>s>0).sort((s,o)=>s.score!==o.score?o.score-s.score:s.index-o.index).map(({item:s})=>s)}function TM(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 Yw(e,t){switch(TM(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const Xw=200;function Pz(){const e=nv(Et.inputHistory);return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}function Rz(e){const{text:t,textareaRef:n,autosize:s}=e,o=te(Pz());let i=-1,r="";function l(g){const S=g.trim();if(i=-1,!S||o.value.at(-1)===S)return;const _=[...o.value,S];o.value=_.length>Xw?_.slice(-Xw):_,sv(Et.inputHistory,o.value)}function a(){const g=n.value;if(!g)return!1;const S=g.selectionStart??0;return g.value.lastIndexOf(`
|
|
247
|
-
`,S-1)===-1}function c(g){t.value=g,ft(()=>{const S=n.value;if(!S)return;s();const _=g.length;S.setSelectionRange(_,_)})}function u(){if(o.value.length!==0){if(i===-1)r=t.value,i=o.value.length-1;else if(i>0)i-=1;else return;c(o.value[i])}}function d(){i!==-1&&(i<o.value.length-1?(i+=1,c(o.value[i])):(i=-1,c(r)))}function f(){i=-1}function h(){return i!==-1}function p(){return o.value.length>0}return{push:l,caretAtFirstLine:a,recallOlder:u,recallNewer:d,resetBrowsing:f,isBrowsing:h,hasHistory:p}}function Dz(e){const{text:t,textareaRef:n,autosize:s,skills:o,emitCommand:i,historyPush:r}=e,l=te(!1),a=te([]),c=te(0);function u(){const f=t.value;f.startsWith("/")&&!f.includes(" ")?(a.value=Oz(f,xM(o())),c.value=0,l.value=a.value.length>0):l.value=!1}function d(f){if(l.value=!1,f.acceptsInput){t.value=`${f.name} `,ft(()=>{const h=n.value;if(!h)return;const p=t.value.length;h.setSelectionRange(p,p),h.focus(),s()});return}t.value="",r(f.name),i(f.name)}return{open:l,items:a,active:c,update:u,select:d}}function Bz(e){const{text:t,textareaRef:n,autosize:s,searchFiles:o}=e,i=te(!1),r=te([]),l=te(0),a=te(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let g=p-1;for(;g>=0&&!/\s/.test(h[g]);)g--;g++;const S=h.slice(g,p);return S.startsWith("@")?{token:S.slice(1),start:g,end:p}:null}function d(){const h=u(),p=o();if(!h||!p){i.value=!1;return}const g=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(g)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const g=t.value;t.value=g.slice(0,p.start)+h.path+g.slice(p.end),i.value=!1,ft(()=>{const S=n.value;if(!S)return;const _=p.start+h.path.length;S.setSelectionRange(_,_),S.focus(),s()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function Fz(e){const{sessionId:t}=e;function n(a){return An(Gk(a))??""}function s(a,c){const u=Gk(a);c?Pn(u,c):Kc(u)}const o=te(n(t())),i=te(null);function r(){const a=i.value;a&&(a.style.height="auto",a.style.height=`${a.scrollHeight}px`)}Ve(o,a=>{ft(r),s(t(),a)}),Ve(t,(a,c)=>{a!==c&&(s(c,o.value),o.value=n(a),ft(r))});function l(a){o.value=a,ft(()=>{const c=i.value;if(!c)return;c.focus();const u=a.length;c.setSelectionRange(u,u),r()})}return{text:o,textareaRef:i,autosize:r,loadForEdit:l}}function Hz(e){const{uploadImage:t}=e,n=te([]),s=te(null),o=te(null),i=te(!1);let r=0;function l(){return`att_${++r}`}function a(w){try{URL.revokeObjectURL(w.previewUrl)}catch{}}function c(w){return w.startsWith("image/")?"image":w.startsWith("video/")?"video":null}async function u(w){const N=t();if(!N)return;const E=w.map(k=>({file:k,kind:c(k.type)})).filter(k=>k.kind!==null);if(E.length!==0)for(const{file:k,kind:A}of E){const I=l(),P=URL.createObjectURL(k),M={localId:I,name:k.name,kind:A,previewUrl:P,uploading:!0};n.value=[...n.value,M],N(k,k.name).then(L=>{n.value=n.value.map(R=>R.localId===I?{...R,uploading:!1,fileId:L?.fileId,error:L===null}:R)}).catch(()=>{n.value=n.value.map(L=>L.localId===I?{...L,uploading:!1,error:!0}:L)})}}function d(w){const N=n.value.find(E=>E.localId===w);s.value?.localId===w&&(s.value=null),N&&a(N),n.value=n.value.filter(E=>E.localId!==w)}function f(w){s.value=w}function h(){s.value=null}function p(){o.value?.click()}function g(w){const N=w.target,E=Array.from(N.files??[]);u(E),N.value=""}function S(w){if(!t())return;const N=w.clipboardData;if(!N)return;const E=[],k=new Set,A=(I,P)=>{const M=`${I.size}:${I.type}:${P}`;if(k.has(M))return;k.add(M);const L=I.type.split("/")[1]??"png",R=P.includes(".")?P:`paste-${Date.now()}.${L}`;E.push(I instanceof File?I:new File([I],R,{type:I.type}))};for(const I of Array.from(N.items))if(I.kind==="file"&&c(I.type)){const P=I.getAsFile();P&&A(P,P.name||`paste-${Date.now()}.${I.type.split("/")[1]??"png"}`)}for(const I of Array.from(N.files))c(I.type)&&A(I,I.name);E.length!==0&&(w.preventDefault(),u(E))}function _(w){!t()||!Array.from(w.dataTransfer?.items??[]).some(E=>E.kind==="file")||(w.preventDefault(),i.value=!0)}function y(){i.value=!1}function b(w){if(i.value=!1,!t())return;w.preventDefault();const N=Array.from(w.dataTransfer?.files??[]);u(N)}function v(){for(const w of n.value)a(w);n.value=[]}return Qt(()=>{document.addEventListener("paste",S)}),Ht(()=>{document.removeEventListener("paste",S);for(const w of n.value)a(w);s.value=null}),{attachments:n,previewAttachment:s,fileInputRef:o,isDragOver:i,removeAttachment:d,openAttachmentPreview:f,closeAttachmentPreview:h,openFilePicker:p,handleFileInputChange:g,handleDragOver:_,handleDragLeave:y,handleDrop:b,clearAfterSubmit:v}}const Wz={key:0,class:"att-strip"},Uz=["title","onClick"],jz=["src"],qz=["src","alt"],zz={key:2,class:"att-video-badge","aria-hidden":"true"},Vz={class:"att-name"},Kz=["aria-label"],Gz=["title"],Yz=["title","onClick"],Xz={class:"att-lightbox-card"},Zz=["title"],Jz=["src"],Qz=["src","alt"],eV={class:"att-lightbox-name"},tV={class:"composer-card"},nV={class:"cin-wrap"},sV={class:"input-row"},oV=["placeholder"],iV={class:"send-col"},rV=["aria-label","title"],lV={key:0,viewBox:"0 0 24 24",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},aV={key:1,viewBox:"0 0 24 24",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},cV=["aria-label","title"],uV={class:"toolbar-left"},dV=["title"],fV=["title","onKeydown"],hV=["onClick"],pV={class:"pd-check"},mV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},gV={class:"pd-info"},vV={class:"pd-desc"},yV=["title"],kV={class:"mode-label"},bV={key:0,class:"mode-tag"},_V={key:1,class:"mode-tag"},wV={key:2,class:"mode-tag"},SV={class:"mode-row-name"},CV={class:"mode-row-name"},xV={class:"mode-row-name"},TV={key:0,class:"mode-row-actions"},MV={class:"toolbar-right"},AV=["title"],EV={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},$V=["stroke-dasharray","stroke-dashoffset"],IV={class:"ctx-num"},NV=["title","onKeydown"],LV={key:0,class:"think-suffix"},OV={key:0,class:"md-section"},PV=["onClick"],RV={class:"md-check"},DV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},BV={class:"md-name"},FV={class:"md-provider"},HV={key:1,class:"md-divider"},WV={key:2,class:"md-section"},UV=["onClick"],jV={class:"md-check"},qV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},zV={class:"md-name"},VV={key:0,class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},KV={key:3,class:"md-divider"},GV=["disabled"],YV={class:"md-check"},XV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},ZV={class:"md-name"},JV={key:0,class:"md-note"},QV={key:1,class:"md-note"},eK={class:"md-name"},Zw=56,tK=Xe({__name:"Composer",props:{running:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=F(()=>s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=_t(),{text:l,textareaRef:a,autosize:c,loadForEdit:u}=Fz({sessionId:()=>s.sessionId}),d=te(!1);function f(){d.value=!d.value,ft(()=>{c(),S(),a.value?.focus()})}function h(){d.value&&(d.value=!1,ft(c))}function p(Ke){if(typeof getComputedStyle>"u")return Zw;const Ue=Number.parseFloat(getComputedStyle(Ke).minHeight);return Number.isFinite(Ue)&&Ue>0?Ue:Zw}const g=te(!1);function S(){const Ke=a.value;g.value=!!Ke&&Ke.scrollHeight>p(Ke)}Ve(l,()=>{ft(S)}),Ve(()=>s.sessionId,()=>{d.value=!1});const _=Rz({text:l,textareaRef:a,autosize:c}),{open:y,items:b,active:v,update:w,select:N}=Dz({text:l,textareaRef:a,autosize:c,skills:()=>s.skills,emitCommand:Ke=>i("command",Ke),historyPush:Ke=>_.push(Ke)}),{open:E,items:k,active:A,loading:I,update:P,select:M}=Bz({text:l,textareaRef:a,autosize:c,searchFiles:()=>s.searchFiles});function L(){_.resetBrowsing(),w(),P()}const{attachments:R,previewAttachment:B,fileInputRef:W,isDragOver:K,removeAttachment:V,openAttachmentPreview:se,closeAttachmentPreview:Y,openFilePicker:G,handleFileInputChange:ee,handleDragOver:we,handleDragLeave:de,handleDrop:Le,clearAfterSubmit:ce}=Hz({uploadImage:()=>s.uploadImage});Qt(()=>{l.value&&ft(()=>{c(),S()})}),Ht(()=>{document.removeEventListener("mousedown",En),ye()}),t({loadForEdit:u});function _e(){const Ke=l.value.trim();if(R.value.some(Mt=>Mt.uploading))return;const Ue=R.value.filter(Mt=>!Mt.uploading&&!Mt.error&&Mt.fileId);if(!Ke&&Ue.length===0)return;if(_.push(Ke),Ke){const Mt=Lz(Ke),Ne=Mt?xM(s.skills).some(ge=>ge.name===Mt.cmd):!1;if(Mt&&Ne){l.value="",y.value=!1,h(),i("command",Mt.arg?`${Mt.cmd} ${Mt.arg}`:Mt.cmd);return}}const Je={text:Ke,attachments:Ue.map(Mt=>({fileId:Mt.fileId,kind:Mt.kind}))};B.value=null,ce(),l.value="",y.value=!1,E.value=!1,h(),i("submit",Je)}function me(){if(!s.running||R.value.some(Mt=>Mt.uploading))return;const Ke=l.value.trim(),Ue=R.value.filter(Mt=>!Mt.uploading&&!Mt.error&&Mt.fileId);if(!Ke&&Ue.length===0&&s.queued.length===0)return;const Je={text:Ke,attachments:Ue.map(Mt=>({fileId:Mt.fileId,kind:Mt.kind}))};ce(),_.push(Ke),l.value="",y.value=!1,E.value=!1,h(),i("steer",Je)}let $e=!1,J=null;function ye(){J!==null&&(clearTimeout(J),J=null)}function Se(){ye(),$e=!0}function U(){ye(),J=setTimeout(()=>{J=null,$e=!1},0)}function Z(Ke){return $e||Ke.isComposing||Ke.keyCode===229}function fe(Ke){if(!Z(Ke)){if(Ke.key==="Escape"){if(H.value){Ke.preventDefault(),Me();return}if(X.value){Ke.preventDefault(),re();return}}if(y.value){if(Ke.key==="ArrowDown"){Ke.preventDefault(),v.value=(v.value+1)%b.value.length;return}if(Ke.key==="ArrowUp"){Ke.preventDefault(),v.value=(v.value-1+b.value.length)%b.value.length;return}if(Ke.key==="Enter"||Ke.key==="Tab"){Ke.preventDefault();const Ue=b.value[v.value];Ue&&N(Ue);return}if(Ke.key==="Escape"){Ke.preventDefault(),y.value=!1;return}}if(E.value&&!I.value){if(Ke.key==="ArrowDown"){Ke.preventDefault(),A.value=(A.value+1)%Math.max(1,k.value.length);return}if(Ke.key==="ArrowUp"){Ke.preventDefault(),A.value=(A.value-1+Math.max(1,k.value.length))%Math.max(1,k.value.length);return}if(Ke.key==="Enter"||Ke.key==="Tab"){Ke.preventDefault();const Ue=k.value[A.value];Ue&&M(Ue);return}if(Ke.key==="Escape"){Ke.preventDefault(),E.value=!1;return}}if(Ke.key==="s"&&(Ke.ctrlKey||Ke.metaKey)&&!Ke.shiftKey&&!Ke.altKey){s.running&&(Ke.preventDefault(),me());return}if(!y.value&&!E.value&&!Ke.shiftKey&&!Ke.altKey&&!Ke.metaKey&&!Ke.ctrlKey){const Ue=_.isBrowsing();if(Ke.key==="ArrowUp"&&_.hasHistory()&&(Ue||_.caretAtFirstLine())){Ke.preventDefault(),_.recallOlder();return}if(Ke.key==="ArrowDown"&&Ue){Ke.preventDefault(),_.recallNewer();return}}if(Ke.key==="Enter"&&!Ke.shiftKey){if(d.value&&!(Ke.metaKey||Ke.ctrlKey))return;Ke.preventDefault(),_e()}}}const oe=F(()=>s.running?r("composer.interrupt"):r("composer.send")),he=F(()=>!!s.uploadImage),H=te(!1),X=te(!1),ae=te(null);function ke(){H.value=!H.value,H.value?(X.value=!1,document.addEventListener("click",le,!0)):document.removeEventListener("click",le,!0)}function Me(){H.value=!1,X.value||document.removeEventListener("click",le,!0)}function Ie(){X.value=!X.value,X.value?(H.value=!1,document.addEventListener("click",le,!0)):document.removeEventListener("click",le,!0)}function re(){X.value=!1,H.value||document.removeEventListener("click",le,!0)}function le(Ke){ae.value&&!ae.value.contains(Ke.target)&&(Me(),re())}Ht(()=>{document.removeEventListener("click",le,!0)});const Ce=Ke=>`${Math.round(Ke/1e3)}k`,We=F(()=>{const Ke=s.status?.ctxMax??0;return Ke<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/Ke*100)))}),nt=F(()=>{const Ke=(s.status?.ctxUsed??0).toLocaleString(),Ue=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Ke,max:Ue,pct:We.value})}),lt=F(()=>We.value>=80),bt=F(()=>{const Ke=s.status?.modelId??s.status?.model??"";return s.models?.find(Ue=>Ue.id===Ke||Ue.model===Ke||Ue.displayName===s.status?.model)}),St=F(()=>TM(bt.value)),ct=F(()=>St.value==="toggle"),It=F(()=>St.value==="always-on"?!0:St.value==="unsupported"?!1:(s.thinking??"off")!=="off");function hn(){ct.value&&i("setThinking",It.value?"off":"high")}const vn=F(()=>s.planMode===!0),$t=F(()=>s.swarmMode===!0),pn=F(()=>s.activationBadges?.goal!==null),un=F(()=>pn.value||s.goalMode===!0),et=te(!1),Rn=te(null),Po=te(null),fs=te({}),Fn=F(()=>vn.value||$t.value||un.value);function sn(){et.value=!1,document.removeEventListener("mousedown",En)}function En(Ke){const Ue=Ke.target;Rn.value?.contains(Ue)||Po.value?.contains(Ue)||sn()}function Kn(){if(et.value){sn();return}const Ke=Rn.value?.getBoundingClientRect();Ke&&(fs.value={left:`${Math.round(Ke.left)}px`,bottom:`${Math.round(window.innerHeight-Ke.top+8)}px`}),et.value=!0,setTimeout(()=>document.addEventListener("mousedown",En),0)}const _n=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--warn)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--err)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}];function xs(Ke){i("setPermission",Ke),re()}const Hn=F(()=>_n.find(Ke=>Ke.mode===s.status?.permission)),hs=F(()=>Hn.value?r(Hn.value.labelKey):""),ps=F(()=>bt.value?.provider??""),ss=F(()=>!ps.value||!s.models?.length?[]:s.models.filter(Ke=>Ke.provider===ps.value)),Tt=F(()=>new Set(s.starredIds??[]));function ms(Ke){return Tt.value.has(Ke)}const qt=F(()=>s.models?.length?s.models.filter(Ke=>ms(Ke.id)&&Ke.provider!==ps.value):[]);function Ts(Ke){i("selectModel",Ke),Me()}return(Ke,Ue)=>(x(),$("div",{class:Oe(["composer",{"drag-over":C(K),expanded:d.value}]),onDragover:Ue[18]||(Ue[18]=(...Je)=>C(we)&&C(we)(...Je)),onDragleave:Ue[19]||(Ue[19]=(...Je)=>C(de)&&C(de)(...Je)),onDrop:Ue[20]||(Ue[20]=(...Je)=>C(Le)&&C(Le)(...Je))},[C(R).length>0?(x(),$("div",Wz,[(x(!0),$(Pe,null,Ye(C(R),Je=>(x(),$("div",{key:Je.localId,class:Oe(["att-chip",{"att-error":Je.error}])},[m("button",{type:"button",class:"att-preview",title:C(r)("composer.previewAttachment",{name:Je.name}),onClick:Mt=>C(se)(Je)},[Je.kind==="video"?(x(),$("video",{key:0,class:"att-thumb",src:Je.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,jz)):(x(),$("img",{key:1,class:"att-thumb",src:Je.previewUrl,alt:Je.name},null,8,qz)),Je.kind==="video"?(x(),$("span",zz,[...Ue[21]||(Ue[21]=[m("svg",{viewBox:"0 0 16 16",width:"9",height:"9",fill:"currentColor"},[m("path",{d:"M5 3.5v9l7-4.5z"})],-1)])])):ie("",!0)],8,Uz),m("span",Vz,O(Je.name),1),Je.uploading?(x(),$("span",{key:0,class:"att-spinner","aria-label":C(r)("composer.uploading")},[...Ue[22]||(Ue[22]=[m("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[m("circle",{cx:"8",cy:"8",r:"6","stroke-opacity":"0.25"}),m("path",{d:"M8 2 A6 6 0 0 1 14 8","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"0.8s",repeatCount:"indefinite"})])],-1)])],8,Kz)):Je.error?(x(),$("span",{key:1,class:"att-err-icon",title:C(r)("composer.uploadFailed")},[...Ue[23]||(Ue[23]=[m("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[m("circle",{cx:"6",cy:"6",r:"5"}),m("line",{x1:"6",y1:"3.5",x2:"6",y2:"6.5"}),m("circle",{cx:"6",cy:"8.5",r:"0.5",fill:"currentColor"})],-1)])],8,Gz)):ie("",!0),m("button",{class:"att-rm",title:C(r)("composer.removeNamed",{name:Je.name}),onClick:Mt=>C(V)(Je.localId)},[...Ue[24]||(Ue[24]=[m("svg",{viewBox:"0 0 12 12",width:"9",height:"9",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,Yz)],2))),128))])):ie("",!0),C(B)?(x(),$("div",{key:1,class:"att-lightbox",onClick:Ue[1]||(Ue[1]=Ze((...Je)=>C(Y)&&C(Y)(...Je),["self"]))},[m("div",Xz,[m("button",{type:"button",class:"att-lightbox-close",title:C(r)("model.close"),onClick:Ue[0]||(Ue[0]=(...Je)=>C(Y)&&C(Y)(...Je))},"✕",8,Zz),C(B).kind==="video"?(x(),$("video",{key:0,class:"att-lightbox-media",src:C(B).previewUrl,controls:"",playsinline:""},null,8,Jz)):(x(),$("img",{key:1,class:"att-lightbox-media",src:C(B).previewUrl,alt:C(B).name},null,8,Qz)),m("div",eV,O(C(B).name),1)])])):ie("",!0),m("div",tV,[m("div",nV,[C(y)?(x(),je(kz,{key:0,items:C(b),"active-index":C(v),onSelect:C(N),onHover:Ue[2]||(Ue[2]=Je=>v.value=Je)},null,8,["items","active-index","onSelect"])):ie("",!0),C(E)?(x(),je(Nz,{key:1,items:C(k),"active-index":C(A),loading:C(I),onSelect:C(M),onHover:Ue[3]||(Ue[3]=Je=>A.value=Je)},null,8,["items","active-index","loading","onSelect"])):ie("",!0),m("div",sV,[Ot(m("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":Ue[4]||(Ue[4]=Je=>Bn(l)?l.value=Je:null),class:"ph",placeholder:o.value,rows:"1",onKeydown:fe,onCompositionstart:Se,onCompositionend:U,onInput:L},null,40,oV),[[xn,C(l)]]),m("div",iV,[d.value||g.value?(x(),$("button",{key:0,class:"expand-btn",type:"button","aria-label":d.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),title:d.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:f},[d.value?(x(),$("svg",lV,[...Ue[25]||(Ue[25]=[m("path",{d:"M4 14h6v6"},null,-1),m("path",{d:"M20 10h-6V4"},null,-1),m("path",{d:"M14 10l7-7"},null,-1),m("path",{d:"M3 21l7-7"},null,-1)])])):(x(),$("svg",aV,[...Ue[26]||(Ue[26]=[m("path",{d:"M15 3h6v6"},null,-1),m("path",{d:"M9 21H3v-6"},null,-1),m("path",{d:"M21 3l-7 7"},null,-1),m("path",{d:"M3 21l7-7"},null,-1)])]))],8,rV)):ie("",!0),m("button",{class:Oe(["send",{aborting:e.running}]),"aria-label":oe.value,title:e.running?C(r)("composer.interruptTitle"):oe.value,onClick:Ue[5]||(Ue[5]=Je=>e.running?i("interrupt"):_e())},[(x(),$("svg",{class:Oe(["send-icon",{hidden:e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...Ue[27]||(Ue[27]=[m("path",{d:"M8 3l6 5.5M8 3L2 8.5M8 3v10"},null,-1)])],2)),(x(),$("svg",{class:Oe(["send-icon",{hidden:!e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[...Ue[28]||(Ue[28]=[m("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1.5"},null,-1)])],2))],10,cV)])])]),he.value?(x(),$("input",{key:0,ref_key:"fileInputRef",ref:W,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:Ue[6]||(Ue[6]=(...Je)=>C(ee)&&C(ee)(...Je))},null,544)):ie("",!0),m("div",{ref_key:"toolbarRef",ref:ae,class:"toolbar"},[m("div",uV,[he.value?(x(),$("button",{key:0,class:"attach-btn",title:C(r)("composer.attachImage"),type:"button",onClick:Ue[7]||(Ue[7]=(...Je)=>C(G)&&C(G)(...Je))},[...Ue[29]||(Ue[29]=[m("svg",{class:"attach-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},[m("path",{d:"M8 3v10M3 8h10"})],-1)])],8,dV)):ie("",!0),e.status?(x(),$("span",{key:1,class:Oe(["perm-pill",["perm-"+e.status.permission,{open:X.value}]]),role:"button",tabindex:"0",title:C(r)("status.permissionTooltip"),onClick:Ze(Ie,["stop"]),onKeydown:[Eo(Ie,["enter"]),Eo(Ze(Ie,["prevent"]),["space"])]},O(hs.value),43,fV)):ie("",!0),X.value&&e.status?(x(),$("div",{key:2,class:"perm-dropdown",role:"menu",onClick:Ue[8]||(Ue[8]=Ze(()=>{},["stop"]))},[(x(),$(Pe,null,Ye(_n,Je=>m("button",{key:Je.mode,class:Oe(["pd-row",{"is-current":Je.mode===e.status.permission}]),role:"menuitem",onClick:Mt=>xs(Je.mode)},[m("span",pV,[Je.mode===e.status.permission?(x(),$("svg",mV,[...Ue[30]||(Ue[30]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),m("span",gV,[m("span",{class:"pd-name",style:Ft({color:Je.color})},O(C(r)(Je.labelKey)),5),m("span",vV,O(C(r)(Je.descKey)),1)])],10,hV)),64))])):ie("",!0),e.status?(x(),$("div",{key:3,ref_key:"modesRef",ref:Rn,class:"modes"},[m("button",{type:"button",class:Oe(["mode-pill",{on:Fn.value}]),title:C(r)("status.modesTooltip"),onClick:Ze(Kn,["stop"])},[m("span",kV,O(C(r)("status.modesLabel")),1),vn.value?(x(),$("span",bV,O(C(r)("status.planLabel")),1)):ie("",!0),$t.value?(x(),$("span",_V,O(C(r)("status.swarmLabel")),1)):ie("",!0),un.value?(x(),$("span",wV,O(C(r)("status.goalLabel")),1)):ie("",!0)],10,yV),et.value?(x(),$("div",{key:0,ref_key:"modesMenuRef",ref:Po,class:"modes-menu",style:Ft(fs.value)},[m("button",{type:"button",class:Oe(["mode-row",{on:vn.value}]),onClick:Ue[9]||(Ue[9]=Je=>i("togglePlan"))},[m("span",SV,O(C(r)("status.planLabel")),1),m("span",{class:Oe(["mode-switch",{on:vn.value}])},[...Ue[31]||(Ue[31]=[m("span",{class:"mode-knob"},null,-1)])],2)],2),m("button",{type:"button",class:Oe(["mode-row",{on:$t.value}]),onClick:Ue[10]||(Ue[10]=Je=>i("toggleSwarm"))},[m("span",CV,O(C(r)("status.swarmLabel")),1),m("span",{class:Oe(["mode-switch",{on:$t.value}])},[...Ue[32]||(Ue[32]=[m("span",{class:"mode-knob"},null,-1)])],2)],2),m("div",{class:Oe(["mode-row mode-row-goal",{on:pn.value||s.goalMode}])},[m("button",{type:"button",class:"mode-row-main",onClick:Ue[11]||(Ue[11]=Je=>pn.value?i("controlGoal","cancel"):i("toggleGoal"))},[m("span",xV,O(C(r)("status.goalLabel")),1),pn.value?ie("",!0):(x(),$("span",{key:0,class:Oe(["mode-switch",{on:s.goalMode}])},[...Ue[33]||(Ue[33]=[m("span",{class:"mode-knob"},null,-1)])],2))]),pn.value?(x(),$("div",TV,[m("button",{type:"button",class:"mode-row-action",onClick:Ue[12]||(Ue[12]=Je=>i("controlGoal","pause"))},O(C(r)("status.goalPause")),1),m("button",{type:"button",class:"mode-row-action",onClick:Ue[13]||(Ue[13]=Je=>i("controlGoal","resume"))},O(C(r)("status.goalResume")),1)])):ie("",!0)],2)],4)):ie("",!0)],512)):ie("",!0)]),m("div",MV,[lt.value?(x(),$("button",{key:0,class:"compact-chip",onClick:Ue[14]||(Ue[14]=Ze(Je=>i("compact"),["stop"]))},"/compact")):ie("",!0),e.status&&!e.hideContext?(x(),$("span",{key:1,class:"ctx-group",title:nt.value},[(x(),$("svg",EV,[Ue[34]||(Ue[34]=m("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5"},null,-1)),m("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${2*Math.PI*7}`,"stroke-dashoffset":`${2*Math.PI*7*(1-We.value/100)}`},null,8,$V)])),m("span",IV,O(Ce(e.status.ctxUsed))+"/"+O(Ce(e.status.ctxMax)),1)],8,AV)):ie("",!0),e.status?(x(),$("span",{key:2,class:Oe(["model-pill",{open:H.value}]),role:"button",tabindex:"0",title:C(r)("status.modelTooltip"),onClick:Ze(ke,["stop"]),onKeydown:[Eo(ke,["enter"]),Eo(Ze(ke,["prevent"]),["space"])]},[m("b",null,O(e.status.model),1),It.value?(x(),$("span",LV,O(C(r)("composer.thinkingSuffix")),1)):ie("",!0),Ue[35]||(Ue[35]=m("svg",{class:"cv",viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M4 6l4 4 4-4"})],-1))],42,NV)):ie("",!0)]),H.value&&e.status?(x(),$("div",{key:0,class:"model-dropdown",role:"menu",onClick:Ue[17]||(Ue[17]=Ze(()=>{},["stop"]))},[qt.value.length>0?(x(),$("div",OV,O(C(r)("status.starredModels")),1)):ie("",!0),(x(!0),$(Pe,null,Ye(qt.value,Je=>(x(),$("button",{key:Je.id,class:Oe(["md-row",{"is-current":Je.id===e.status.modelId}]),role:"menuitem",onClick:Mt=>Ts(Je.id)},[m("span",RV,[Je.id===e.status.model||Je.model===e.status.model||Je.displayName===e.status.model?(x(),$("svg",DV,[...Ue[36]||(Ue[36]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),m("span",BV,O(Je.displayName??Je.model),1),m("span",FV,O(Je.provider),1),Ue[37]||(Ue[37]=m("svg",{class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},[m("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})],-1))],10,PV))),128)),qt.value.length>0?(x(),$("div",HV)):ie("",!0),ss.value.length>0?(x(),$("div",WV,O(ps.value),1)):ie("",!0),(x(!0),$(Pe,null,Ye(ss.value,Je=>(x(),$("button",{key:Je.id,class:Oe(["md-row",{"is-current":Je.id===e.status.modelId}]),role:"menuitem",onClick:Mt=>Ts(Je.id)},[m("span",jV,[Je.id===e.status.model||Je.model===e.status.model||Je.displayName===e.status.model?(x(),$("svg",qV,[...Ue[38]||(Ue[38]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),m("span",zV,O(Je.displayName??Je.model),1),ms(Je.id)?(x(),$("svg",VV,[...Ue[39]||(Ue[39]=[m("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,-1)])])):ie("",!0)],10,UV))),128)),ss.value.length>0?(x(),$("div",KV)):ie("",!0),m("button",{class:Oe(["md-row md-row-toggle",{"is-on":It.value,"is-disabled":!ct.value}]),role:"menuitem",disabled:!ct.value,onClick:Ue[15]||(Ue[15]=Je=>hn())},[m("span",YV,[It.value?(x(),$("svg",XV,[...Ue[40]||(Ue[40]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),m("span",ZV,O(C(r)("status.thinkingLabel")),1),St.value==="always-on"?(x(),$("span",JV,O(C(r)("status.planOn")),1)):St.value==="unsupported"?(x(),$("span",QV,O(C(r)("status.modeNotSupported")),1)):ie("",!0)],10,GV),Ue[41]||(Ue[41]=m("div",{class:"md-divider"},null,-1)),m("button",{class:"md-row md-row-more",role:"menuitem",onClick:Ue[16]||(Ue[16]=Je=>{Me(),i("pickModel")})},[m("span",eK,O(C(r)("status.moreModels")),1)])])):ie("",!0)],512)])],34))}}),MM=vt(tK,[["__scopeId","data-v-007ad9c8"]]),nK=["id"],sK={class:"swarm-head"},oK={class:"swarm-count"},iK={class:"swarm-grid"},rK={class:"member-top"},lK={class:"member-name"},aK={class:"member-phase"},cK={class:"member-mid"},uK={class:"member-bar"},dK={key:0,class:"member-type"},fK={key:0,class:"member-bottom"},hK=Xe({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=F(()=>t.group.members.length),s=F(()=>t.group.counts.completed+t.group.counts.failed);function o(l){switch(l){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function i(l){switch(l.phase){case"queued":return"......";case"working":return":::...";case"suspended":return"::....";case"completed":return"::::::";case"failed":return"!!...."}}function r(l){return l.outputLines?.map(a=>a.trimEnd()).filter(Boolean).at(-1)}return(l,a)=>(x(),$("section",{class:"swarm-card",id:`swarm-${e.group.id}`},[m("header",sK,[a[0]||(a[0]=m("div",{class:"swarm-title"},[m("span",{class:"swarm-mark","aria-hidden":"true"}),m("span",null,"Swarm")],-1)),m("div",oK,O(s.value)+"/"+O(n.value),1)]),m("div",iK,[(x(!0),$(Pe,null,Ye(e.group.members,c=>(x(),$("article",{key:c.id,class:Oe(["swarm-member",`phase-${c.phase}`])},[m("div",rK,[m("span",lK,O(c.name),1),m("span",aK,O(o(c.phase)),1)]),m("div",cK,[m("span",uK,O(i(c)),1),c.subagentType?(x(),$("span",dK,O(c.subagentType),1)):ie("",!0)]),c.suspendedReason||r(c)||c.summary?(x(),$("div",fK,O(c.suspendedReason||r(c)||c.summary),1)):ie("",!0)],2))),128))])],8,nK))}}),pK=vt(hK,[["__scopeId","data-v-2cfb7bcf"]]),mK={class:"goal-progress","aria-hidden":"true"},gK={key:0,class:"goal-body"},vK={class:"goal-full"},yK={key:0,class:"goal-criterion"},kK={class:"goal-stats"},bK={key:0},_K={class:"goal-actions"},wK=Xe({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=te(!1);Ve(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=F(()=>{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)=>(x(),$("section",{class:Oe(["goal-strip",{expanded:i.value}])},[m("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[5]||(c[5]=m("span",{class:"goal-kicker"},"Goal",-1)),m("span",{class:Oe(["goal-objective",{"expanded-hidden":i.value}])},O(e.goal.objective),3),m("span",{class:Oe(["goal-status",`status-${e.goal.status}`])},O(e.goal.status),3),m("span",mK,[m("span",{class:"goal-progress-fill",style:Ft({width:`${r.value}%`})},null,4)]),(x(),$("svg",{class:Oe(["goal-chevron",{open:i.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...c[4]||(c[4]=[m("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),i.value?(x(),$("div",gK,[m("div",vK,O(e.goal.objective),1),e.goal.completionCriterion?(x(),$("div",yK,[c[6]||(c[6]=m("span",null,"Done when",-1)),m("p",null,O(e.goal.completionCriterion),1)])):ie("",!0),m("div",kK,[m("span",null,O(e.goal.turnsUsed)+" turns",1),m("span",null,O(e.goal.tokensUsed.toLocaleString())+" tokens",1),m("span",null,O(l(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(x(),$("span",bK,O(r.value)+"% token budget",1)):ie("",!0)]),m("div",_K,[e.goal.status!=="paused"?(x(),$("button",{key:0,type:"button",class:"goal-action",onClick:c[1]||(c[1]=Ze(u=>s("controlGoal","pause"),["stop"]))},O(C(o)("status.goalPause")),1)):ie("",!0),e.goal.status==="paused"?(x(),$("button",{key:1,type:"button",class:"goal-action primary",onClick:c[2]||(c[2]=Ze(u=>s("controlGoal","resume"),["stop"]))},O(C(o)("status.goalResume")),1)):ie("",!0),m("button",{type:"button",class:"goal-action danger",onClick:c[3]||(c[3]=Ze(u=>s("controlGoal","cancel"),["stop"]))},O(C(o)("status.goalCancel")),1)])])):ie("",!0)],2))}}),SK=vt(wK,[["__scopeId","data-v-dcbae4b7"]]),CK={class:"qh"},xK={class:"qtitle"},TK={class:"qstep"},MK=["disabled"],AK=["disabled"],EK={key:1,class:"qmin-peek"},$K=["title","aria-label"],IK={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},NK={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},LK={key:0,class:"qbody"},OK={key:0,class:"qheader-chip"},PK={class:"qtext"},RK={class:"qopts"},DK=["onClick"],BK={class:"qopt-key"},FK={class:"qopt-glyph"},HK={key:0,class:"chk"},WK={key:1,class:"rad"},UK={class:"qopt-text"},jK={class:"qopt-label"},qK={key:0,class:"qopt-desc"},zK={class:"qopt-glyph"},VK={key:0,class:"chk"},KK={key:1,class:"rad"},GK={class:"qopt-label"},YK=["placeholder"],XK={key:1,class:"qfooter"},ZK=["disabled"],JK=Xe({__name:"QuestionCard",props:{question:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=_t(),o=t,i=te(0),r=te(!1),l=F(()=>n.question.questions[i.value]),a=F(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}const d=te({});function f(k){return k.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${k.label} ${k.description??""}`.toLowerCase())}function h(){const k={...d.value};let A=!1;for(const I of n.question.questions){if(k[I.id])continue;const P=I.options.filter(f);P.length!==0&&(k[I.id]=I.multiSelect?{kind:"multi",optionIds:P.map(M=>M.id)}:{kind:"single",optionId:P[0].id},A=!0)}A&&(d.value=k)}Ve(()=>n.question.questionId,()=>{i.value=0,r.value=!1,d.value={},S.value={}}),Ve(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),h()},{immediate:!0,deep:!0});function p(k,A){const I=d.value[k];if(I&&I.kind==="single"&&I.optionId===A){const P={...d.value};delete P[k],d.value=P}else d.value={...d.value,[k]:{kind:"single",optionId:A}}}function g(k,A){const I=d.value[k],P=I&&(I.kind==="multi"||I.kind==="multiWithOther")?I.kind==="multi"?[...I.optionIds]:[...I.optionIds]:[],M=P.indexOf(A);M>=0?P.splice(M,1):P.push(A);const L=d.value[k],R=L&&L.kind==="multiWithOther"?L.otherText:"";R?d.value={...d.value,[k]:{kind:"multiWithOther",optionIds:P,otherText:R}}:d.value={...d.value,[k]:{kind:"multi",optionIds:P}}}const S=te({});function _(k){const A=n.question.questions.find(P=>P.id===k),I=S.value[k]??"";if(A.multiSelect){const P=d.value[k],M=P&&(P.kind==="multi"||P.kind==="multiWithOther")?P.kind==="multi"?[...P.optionIds]:[...P.optionIds]:[];d.value={...d.value,[k]:{kind:"multiWithOther",optionIds:M,otherText:I}}}else d.value={...d.value,[k]:{kind:"other",text:I}}}function y(k,A){const I=d.value[k];return I?I.kind==="single"?I.optionId===A:I.kind==="multi"||I.kind==="multiWithOther"?I.optionIds.includes(A):!1:!1}function b(k){const A=d.value[k];return!!(A&&(A.kind==="other"||A.kind==="multiWithOther"))}function v(){return n.question.questions.every(k=>{const A=d.value[k.id];return A?A.kind==="multi"?A.optionIds.length>0:A.kind==="multiWithOther"?A.optionIds.length>0||A.otherText.trim().length>0:A.kind==="other"?A.text.trim().length>0:!0:!1})}function w(){if(!v())return;const k={answers:d.value,method:"click"};o("answer",n.question.questionId,k)}function N(){o("dismiss",n.question.questionId)}function E(k){const A=(document.activeElement?.tagName??"").toLowerCase();if(A==="input"||A==="textarea"||r.value&&k.key!=="Escape")return;if(k.key==="Escape"){k.preventDefault(),N();return}if(k.key==="Enter"){k.preventDefault(),w();return}const I=parseInt(k.key,10);if(!isNaN(I)&&I>=1&&I<=9){k.preventDefault();const P=l.value,M=I-1,L=P.options[M];L&&(P.multiSelect?g(P.id,L.id):p(P.id,L.id))}}return Qt(()=>document.addEventListener("keydown",E)),Ht(()=>document.removeEventListener("keydown",E)),(k,A)=>(x(),$("div",{class:Oe(["qcard",{minimized:r.value}])},[m("div",CK,[m("span",xK,O(C(s)("question.title")),1),a.value>1&&!r.value?(x(),$(Pe,{key:0},[m("span",TK,O(C(s)("question.step",{current:i.value+1,total:a.value})),1),m("button",{class:"qnav",disabled:i.value===0,onClick:c},O(C(s)("question.prev")),9,MK),m("button",{class:"qnav",disabled:i.value===a.value-1,onClick:u},O(C(s)("question.next")),9,AK)],64)):ie("",!0),r.value?(x(),$("span",EK,O(l.value.question),1)):ie("",!0),m("button",{class:"qmin",title:r.value?C(s)("question.expand"):C(s)("question.minimize"),"aria-label":r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:A[0]||(A[0]=I=>r.value=!r.value)},[r.value?(x(),$("svg",IK,[...A[4]||(A[4]=[m("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(x(),$("svg",NK,[...A[5]||(A[5]=[m("path",{d:"M3 8h10"},null,-1)])]))],8,$K)]),r.value?ie("",!0):(x(),$("div",LK,[l.value.header?(x(),$("div",OK,O(l.value.header),1)):ie("",!0),m("div",PK,O(l.value.question),1),l.value.body?(x(),je(nu,{key:1,text:l.value.body,class:"qmdbody"},null,8,["text"])):ie("",!0),m("div",RK,[(x(!0),$(Pe,null,Ye(l.value.options,(I,P)=>(x(),$("label",{key:I.id,class:Oe(["qopt",{selected:y(l.value.id,I.id)}]),onClick:Ze(M=>l.value.multiSelect?g(l.value.id,I.id):p(l.value.id,I.id),["prevent"])},[m("span",BK,O(P+1),1),m("span",FK,[l.value.multiSelect?(x(),$("span",HK,O(y(l.value.id,I.id)?"■":"□"),1)):(x(),$("span",WK,O(y(l.value.id,I.id)?"●":"○"),1))]),m("span",UK,[m("span",jK,O(I.label),1),I.description?(x(),$("span",qK,O(I.description),1)):ie("",!0)])],10,DK))),128)),l.value.allowOther?(x(),$("label",{key:0,class:Oe(["qopt",{selected:b(l.value.id)}]),onClick:Ze(()=>{},["prevent"])},[A[6]||(A[6]=m("span",{class:"qopt-key"},null,-1)),m("span",zK,[l.value.multiSelect?(x(),$("span",VK,O(b(l.value.id)?"■":"□"),1)):(x(),$("span",KK,O(b(l.value.id)?"●":"○"),1))]),m("span",GK,O(l.value.otherLabel??C(s)("question.otherDefault")),1),Ot(m("input",{"onUpdate:modelValue":A[1]||(A[1]=I=>S.value[l.value.id]=I),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(s)("question.otherDefault"),onInput:A[2]||(A[2]=I=>_(l.value.id)),onFocus:A[3]||(A[3]=I=>_(l.value.id))},null,40,YK),[[xn,S.value[l.value.id]]])],2)):ie("",!0)])])),r.value?ie("",!0):(x(),$("div",XK,[m("button",{class:"qbtn pri",disabled:!v(),onClick:w},O(C(s)("question.submit")),9,ZK),m("button",{class:"qbtn",onClick:N},O(C(s)("question.dismiss")),1)]))],2))}}),QK=vt(JK,[["__scopeId","data-v-0ac38c4b"]]),eG={class:"ah"},tG={class:"akind"},nG={class:"apath"},sG={key:0,class:"abadge"},oG={key:1,class:"aw"},iG=["title","aria-label"],rG={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},lG={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},aG=["title"],cG={key:1,class:"diff"},uG={class:"dg"},dG={class:"dc"},fG={key:2,class:"body-shell"},hG={class:"shell-cmd"},pG={key:0,class:"shell-cwd"},mG={key:1,class:"shell-danger"},gG={key:3,class:"body-file"},vG={class:"file-bar"},yG={class:"file-lang"},kG={class:"file-content"},bG={class:"file-ln"},_G={class:"file-text"},wG={key:4,class:"body-chip"},SG={class:"chip-label"},CG={class:"chip-value"},xG={key:0,class:"chip-detail"},TG={key:5,class:"body-chip"},MG={key:0,class:"chip-label"},AG={class:"chip-value"},EG={key:6,class:"body-chip"},$G={class:"chip-label"},IG={class:"chip-value"},NG={key:0,class:"chip-detail"},LG={key:7,class:"body-chip"},OG={class:"chip-label"},PG={class:"chip-value"},RG={key:0,class:"chip-detail"},DG={key:8,class:"body-todo"},BG={class:"todo-glyph"},FG={key:9,class:"body-plan"},HG={key:10,class:"body-generic"},WG={class:"gen-text"},UG={key:11,class:"feedback-wrap"},jG=["placeholder"],qG={class:"feedback-hint"},zG={key:12,class:"plan-actions"},VG=["title","onClick"],KG={class:"k"},GG={key:0,class:"k"},YG={key:0,class:"k"},XG={key:13,class:"abtn"},ZG=Xe({__name:"ApprovalCard",props:{block:{},agentName:{}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=F(()=>{const k=n.block;return k.kind!=="plan_review"?null:{plan:k.plan,path:k.path,options:k.options??[]}}),r=te(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const k=l.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${k}`)}const c=te(!1),u=te(""),d=te(null);function f(){c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0)}function h(){const k=u.value.trim();i.value?s("decide",{decision:"rejected",selectedLabel:"Revise",feedback:k||void 0}):s("decide",{decision:"rejected",feedback:k||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function g(k){k.key==="Enter"&&!k.shiftKey?(k.preventDefault(),h()):k.key==="Escape"&&(k.preventDefault(),p())}function S(){s("decide",{decision:"approved"})}function _(){s("decide",{decision:"approved",scope:"session"})}function y(){s("decide",{decision:"rejected"})}function b(){s("decide",{decision:"approved"})}function v(k){s("decide",{decision:"approved",selectedLabel:k})}function w(){f()}function N(){s("decide",{decision:"rejected",selectedLabel:"Reject and Exit"})}function E(k){const A=(document.activeElement?.tagName??"").toLowerCase();if(A==="input"||A==="textarea"||r.value)return;const I=i.value;if(I){if(I.options.length===0){k.key==="1"?(k.preventDefault(),b()):k.key==="2"?(k.preventDefault(),w()):k.key==="3"&&(k.preventDefault(),N());return}k.key==="1"&&I.options[0]?(k.preventDefault(),v(I.options[0].label)):k.key==="2"&&I.options[1]?(k.preventDefault(),v(I.options[1].label)):k.key==="3"&&I.options[2]&&(k.preventDefault(),v(I.options[2].label));return}k.key==="1"?(k.preventDefault(),S()):k.key==="2"?(k.preventDefault(),_()):k.key==="3"?(k.preventDefault(),y()):k.key==="4"&&(k.preventDefault(),f())}return Qt(()=>document.addEventListener("keydown",E)),Ht(()=>document.removeEventListener("keydown",E)),(k,A)=>(x(),$("div",{class:Oe(["appr",{minimized:r.value}])},[m("div",eG,[m("span",tG,O(a()),1),m("span",nG,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(x(),$(Pe,{key:0},[dt(O(e.block.path),1)],64)):e.block.kind==="shell"?(x(),$(Pe,{key:1},[dt(O(e.block.command),1)],64)):e.block.kind==="url"?(x(),$(Pe,{key:2},[dt(O(e.block.url),1)],64)):e.block.kind==="search"?(x(),$(Pe,{key:3},[dt(O(e.block.query),1)],64)):e.block.kind==="invocation"?(x(),$(Pe,{key:4},[dt(O(e.block.name),1)],64)):e.block.kind==="generic"?(x(),$(Pe,{key:5},[dt(O(e.block.summary),1)],64)):ie("",!0)]),e.agentName&&!r.value?(x(),$("span",sG,O(C(o)("approval.subagentBadge",{name:e.agentName})),1)):ie("",!0),r.value?ie("",!0):(x(),$("span",oG,O(C(o)("approval.required")),1)),m("button",{class:"amin",title:r.value?C(o)("question.expand"):C(o)("question.minimize"),"aria-label":r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:A[0]||(A[0]=I=>r.value=!r.value)},[r.value?(x(),$("svg",rG,[...A[2]||(A[2]=[m("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(x(),$("svg",lG,[...A[3]||(A[3]=[m("path",{d:"M3 8h10"},null,-1)])]))],8,iG)]),r.value?ie("",!0):(x(),$(Pe,{key:0},[e.block.kind==="plan_review"&&e.block.path?(x(),$("div",{key:0,class:"ah-path",title:e.block.path},O(e.block.path),9,aG)):ie("",!0),e.block.kind==="diff"?(x(),$("div",cG,[(x(!0),$(Pe,null,Ye(e.block.diff,(I,P)=>(x(),$("div",{key:P,class:Oe(["dl",I.kind==="add"?"add":I.kind==="rem"?"del":""])},[m("span",uG,O(I.gutter),1),m("span",dG,O(I.text),1)],2))),128))])):e.block.kind==="shell"?(x(),$("div",fG,[m("div",hG,[A[4]||(A[4]=m("span",{class:"shell-dollar"},"$",-1)),dt(" "+O(e.block.command),1)]),e.block.cwd?(x(),$("div",pG,"cwd: "+O(e.block.cwd),1)):ie("",!0),e.block.danger?(x(),$("div",mG,O(C(o)("approval.danger",{detail:e.block.danger})),1)):ie("",!0)])):e.block.kind==="file"?(x(),$("div",gG,[m("div",vG,[m("span",yG,O(e.block.language??""),1)]),m("div",kG,[(x(!0),$(Pe,null,Ye(e.block.content.split(`
|
|
248
|
-
`),(I,P)=>(x(),$("div",{key:P,class:"file-line"},[m("span",bG,O(P+1),1),m("span",_G,O(I),1)]))),128))])])):e.block.kind==="fileop"?(x(),$("div",wG,[m("span",SG,O(e.block.op),1),m("span",CG,O(e.block.path),1),e.block.detail?(x(),$("span",xG,O(e.block.detail),1)):ie("",!0)])):e.block.kind==="url"?(x(),$("div",TG,[e.block.method?(x(),$("span",MG,O(e.block.method),1)):ie("",!0),m("span",AG,O(e.block.url),1)])):e.block.kind==="search"?(x(),$("div",EG,[m("span",$G,O(C(o)("approval.searchQueryLabel")),1),m("span",IG,O(e.block.query),1),e.block.scope?(x(),$("span",NG,O(C(o)("approval.searchScope",{scope:e.block.scope})),1)):ie("",!0)])):e.block.kind==="invocation"?(x(),$("div",LG,[m("span",OG,O(e.block.kind2),1),m("span",PG,O(e.block.name),1),e.block.description?(x(),$("span",RG,O(e.block.description),1)):ie("",!0)])):e.block.kind==="todo"?(x(),$("div",DG,[(x(!0),$(Pe,null,Ye(e.block.items,(I,P)=>(x(),$("div",{key:P,class:"todo-item"},[m("span",BG,O(I.status==="done"||I.status==="completed"?"✓":"○"),1),m("span",{class:Oe(["todo-title",{"todo-done":I.status==="done"||I.status==="completed"}])},O(I.title),3)]))),128))])):e.block.kind==="plan_review"?(x(),$("div",FG,[gt(nu,{text:e.block.plan},null,8,["text"])])):(x(),$("div",HG,[m("span",WG,O(e.block.summary),1)])),c.value?(x(),$("div",UG,[Ot(m("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":A[1]||(A[1]=I=>u.value=I),class:"feedback-ta",placeholder:C(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:g},null,40,jG),[[xn,u.value]]),m("div",qG,O(C(o)("approval.feedbackHint")),1)])):ie("",!0),i.value?(x(),$("div",zG,[i.value.options.length>0?(x(!0),$(Pe,{key:0},Ye(i.value.options,(I,P)=>(x(),$("div",{key:P,class:"kbtn pri",title:I.description,onClick:M=>v(I.label)},[dt(O(I.label),1),m("span",KG,"["+O(P+1)+"]",1)],8,VG))),128)):(x(),$("div",{key:1,class:"kbtn pri",onClick:b},[dt(O(C(o)("approval.approvePlan")),1),A[5]||(A[5]=m("span",{class:"k"},"[1]",-1))])),m("div",{class:"kbtn",onClick:w},[dt(O(C(o)("approval.revise")),1),i.value.options.length===0?(x(),$("span",GG,"[2]")):ie("",!0)]),m("div",{class:"kbtn danger",onClick:N},[dt(O(C(o)("approval.rejectAndExit")),1),i.value.options.length===0?(x(),$("span",YG,"[3]")):ie("",!0)])])):(x(),$("div",XG,[m("div",{class:"kbtn pri",onClick:S},[dt(O(C(o)("approval.approve")),1),A[6]||(A[6]=m("span",{class:"k"},"[1]",-1))]),m("div",{class:"kbtn",onClick:_},[dt(O(C(o)("approval.approveSession")),1),A[7]||(A[7]=m("span",{class:"k"},"[2]",-1))]),m("div",{class:"kbtn",onClick:y},[dt(O(C(o)("approval.reject")),1),A[8]||(A[8]=m("span",{class:"k"},"[3]",-1))]),m("div",{class:"kbtn",onClick:f},[dt(O(C(o)("approval.feedback")),1),A[9]||(A[9]=m("span",{class:"k"},"[4]",-1))])]))],64))],2))}}),JG=vt(ZG,[["__scopeId","data-v-341cf3fd"]]),QG={class:"taskspane"},eY={class:"tp-head"},tY={class:"tp-title"},nY={class:"tp-count"},sY={class:"tp-list"},oY={key:0,class:"tp-empty"},iY=["role","onClick"],rY={class:"tp-name"},lY={class:"tp-kind"},aY={class:"tp-time"},cY=["onClick"],uY={key:0,class:"tp-detail"},dY={key:0,class:"tp-codebox"},fY=["onClick"],hY={class:"tp-pre"},pY={class:"tp-cmd"},mY={key:1,class:"tp-codebox"},gY=["onClick"],vY={class:"tp-pre"},yY=Xe({__name:"TasksPane",props:{tasks:{}},emits:["cancel"],setup(e,{emit:t}){const n=t,{t:s}=_t(),o=so(new Set),i=so(new Set),r=so(new Set);function l(p){return!!(p.output&&p.output.length>0||p.meta)}function a(p){l(p)&&(o.has(p.id)?o.delete(p.id):o.add(p.id))}function c(p){switch(p){case"run":return"●";case"done":return"✓";case"fail":return"✗";default:return"○"}}function u(p){switch(p){case"run":return"s-run";case"done":return"s-done";case"fail":return"s-fail";default:return"s-pending"}}async function d(p,g,S){await Ss(p)&&(S.add(g),setTimeout(()=>S.delete(g),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const g=p.output?.join(`
|
|
249
|
-
`)??"";g&&await d(g,p.id,r)}return(p,g)=>(x(),$("div",QG,[m("div",eY,[m("span",tY,O(C(s)("tasks.tag")),1),m("span",nY,O(e.tasks.length),1)]),m("div",sY,[e.tasks.length===0?(x(),$("div",oY,O(C(s)("tasks.emptyTasks")),1)):(x(!0),$(Pe,{key:1},Ye(e.tasks,S=>(x(),$("div",{key:S.id,class:Oe(["tp-row",{done:S.state==="done",fail:S.state==="fail",expandable:l(S)}])},[m("div",{class:"tp-main",role:l(S)?"button":void 0,onClick:_=>a(S)},[m("span",{class:Oe(["tp-glyph",u(S.state)])},O(c(S.state)),3),m("span",rY,O(S.name),1),m("span",lY,O(S.kind),1),m("span",aY,O(S.timing),1),S.state==="run"?(x(),$("button",{key:0,class:"tp-stop",onClick:Ze(_=>n("cancel",S.id),["stop"])},O(C(s)("tasks.stop")),9,cY)):ie("",!0),l(S)?(x(),$("svg",{key:1,class:Oe(["tp-chevron",{open:o.has(S.id)}]),viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...g[0]||(g[0]=[m("path",{d:"M6 4l4 4-4 4"},null,-1)])],2)):ie("",!0)],8,iY),o.has(S.id)&&l(S)?(x(),$("div",uY,[S.meta?(x(),$("div",dY,[m("button",{class:Oe(["tp-copy",{copied:i.has(S.id)}]),onClick:Ze(_=>f(S),["stop"])},O(i.has(S.id)?"已复制":"复制"),11,fY),m("pre",hY,[m("code",null,[m("span",pY,O(S.meta),1)])])])):ie("",!0),S.output&&S.output.length>0?(x(),$("div",mY,[m("button",{class:Oe(["tp-copy",{copied:r.has(S.id)}]),onClick:Ze(_=>h(S),["stop"])},O(r.has(S.id)?"已复制":"复制"),11,gY),m("pre",vY,[m("code",null,[g[1]||(g[1]=dt(`
|
|
250
|
-
`,-1)),(x(!0),$(Pe,null,Ye(S.output,(_,y)=>(x(),$("span",{key:y,class:"tp-line"},O(_),1))),128)),g[2]||(g[2]=dt(`
|
|
251
|
-
`,-1))])])])):ie("",!0)])):ie("",!0)],2))),128))])]))}}),Jw=vt(yY,[["__scopeId","data-v-bdbdc201"]]),kY={class:"tc-title"},bY={key:0,class:"tc-count"},_Y={key:0,class:"tc-list"},wY={key:0,class:"tc-empty"},SY={class:"tc-name"},CY=Xe({__name:"TodoCard",props:{todos:{},inline:{type:Boolean}},setup(e){const t=e,{t:n}=_t(),s=te(!1),o=F(()=>!t.inline),i=F(()=>t.inline||!s.value);function r(){o.value&&(s.value=!s.value)}const l=F(()=>t.todos.filter(c=>c.status==="done").length);function a(c){return c==="done"?"done":c==="in_progress"?"in_progress":"pending"}return(c,u)=>(x(),$("div",{class:Oe(["todo-card",{"tab-mode":e.inline}])},[(x(),je(_s(o.value?"button":"div"),{class:Oe(["tc-head",{static:!o.value}]),type:o.value?"button":void 0,onClick:r},{default:Ln(()=>[u[1]||(u[1]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.4","aria-hidden":"true"},[m("polyline",{points:"2,4.5 3.5,6 5.5,3"}),m("polyline",{points:"2,11 3.5,12.5 5.5,9.5"}),m("line",{x1:"8",y1:"4.5",x2:"14",y2:"4.5"}),m("line",{x1:"8",y1:"11",x2:"14",y2:"11"})],-1)),m("span",kY,O(C(n)("tasks.todoTag")),1),e.todos.length>0?(x(),$("span",bY,O(l.value)+"/"+O(e.todos.length),1)):ie("",!0),o.value&&e.todos.length>0?(x(),$("svg",{key:1,class:Oe(["tc-chev",{open:!s.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...u[0]||(u[0]=[m("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2)):ie("",!0)]),_:1},8,["class","type"])),i.value?(x(),$("div",_Y,[e.todos.length===0?(x(),$("div",wY,O(C(n)("tasks.emptyTodo")),1)):ie("",!0),(x(!0),$(Pe,null,Ye(e.todos,(d,f)=>(x(),$("div",{key:f,class:Oe(["tc-row",`s-${d.status}`])},[m("span",{class:Oe(["tc-glyph",`g-${a(d.status)}`])},null,2),m("span",SY,O(d.title),1)],2))),128))])):ie("",!0)],2))}}),xY=vt(CY,[["__scopeId","data-v-26afda08"]]),TY={key:0,class:"queue-head"},MY={class:"queue-label"},AY=["title"],EY={class:"queue-list"},$Y=["disabled","title","onClick"],IY={key:0,class:"queue-img",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},NY=["title","onClick"],LY=Xe({__name:"QueuePane",props:{queued:{},running:{type:Boolean},inline:{type:Boolean}},emits:["steer","unqueue","editQueued"],setup(e,{emit:t}){const n=t,{t:s}=_t();function o(i,r){r.attachmentCount>0||n("editQueued",i)}return(i,r)=>(x(),$("div",{class:Oe(["queue-pane",{"tab-mode":e.inline}])},[e.inline?ie("",!0):(x(),$("div",TY,[m("span",MY,O(C(s)("composer.queueLabel"))+" · "+O(e.queued.length),1),e.running?(x(),$("button",{key:0,class:"queue-steer",type:"button",title:C(s)("composer.steerTitle"),onClick:r[0]||(r[0]=l=>n("steer"))},O(C(s)("composer.steerNow")),9,AY)):ie("",!0)])),m("div",EY,[(x(!0),$(Pe,null,Ye(e.queued,(l,a)=>(x(),$("div",{key:a,class:"queue-item"},[m("button",{class:"queue-text",type:"button",disabled:l.attachmentCount>0,title:l.attachmentCount>0?C(s)("composer.queuedHasImage",{n:l.attachmentCount}):C(s)("composer.editQueued"),onClick:c=>o(a,l)},[l.attachmentCount>0?(x(),$("svg",IY,[...r[1]||(r[1]=[m("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},null,-1),m("circle",{cx:"5.5",cy:"6.5",r:"1.2"},null,-1),m("path",{d:"M2.5 12l3.5-3.5 2.5 2.5 3-3 2 2"},null,-1)])])):ie("",!0),m("span",{class:Oe(["queue-text-inner",{placeholder:!l.text}])},O(l.text||C(s)("composer.queuedImageOnly",{n:l.attachmentCount})),3)],8,$Y),m("button",{class:"queue-rm",title:C(s)("composer.remove"),onClick:c=>n("unqueue",a)},[...r[2]||(r[2]=[m("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,NY)]))),128))])],2))}}),OY=vt(LY,[["__scopeId","data-v-b5832f1f"]]),PY={class:"dock-work-head"},RY={key:0,class:"dock-work-tab static"},DY={key:1,class:"dock-work-tab static"},BY={key:2,class:"dock-work-tab static"},FY={key:3,class:"dock-work-tab static"},HY=["title"],WY={class:"dock-work-body"},UY=["aria-pressed"],jY={class:"dw-count"},qY=["aria-pressed"],zY={class:"dw-count"},VY=["aria-pressed"],KY={class:"dw-count"},GY=["aria-pressed"],YY={class:"dw-count"},XY=Xe({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},pendingApproval:{},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:i}=_t(),r=te(null),l=te(null),a=te(null);function c(f){r.value?.loadForEdit(f)}function u(f){const h=s.queued?.[f]?.text??"";h&&c(h),o("editQueued",f)}function d(f){if(!s.dockPanel)return;const h=f.target;h&&(l.value?.contains(h)||a.value?.contains(h)||o("close-dock-panel"))}return Ve(()=>s.dockPanel,f=>{typeof document>"u"||(document.removeEventListener("mousedown",d,!0),f&&document.addEventListener("mousedown",d,!0))},{immediate:!0}),Ht(()=>{typeof document<"u"&&document.removeEventListener("mousedown",d,!0)}),t({loadForEdit:c}),(f,h)=>(x(),$("div",{class:Oe(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:h[31]||(h[31]=Ze(()=>{},["stop"]))},[gt(Pi,{name:"dock-panel"},{default:Ln(()=>[e.dockPanel?(x(),$("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:h[5]||(h[5]=Ze(()=>{},["stop"]))},[m("div",PY,[e.dockPanel==="bash"?(x(),$("span",RY,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(x(),$("span",DY,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(x(),$("span",BY,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):e.dockPanel==="queue"?(x(),$("span",FY,O(C(i)("tasks.dockQueue"))+" · "+O(e.queued?.length??0),1)):ie("",!0),e.dockPanel==="queue"&&e.running?(x(),$("button",{key:4,type:"button",class:"dock-queue-steer",title:C(i)("composer.steerTitle"),onClick:h[0]||(h[0]=p=>o("steer",{text:"",attachments:[]}))},O(C(i)("composer.steerNow")),9,HY)):ie("",!0)]),m("div",WY,[e.dockPanel==="bash"?(x(),je(Jw,{key:0,tasks:e.bashTasks,onCancel:h[1]||(h[1]=p=>o("cancelTask",p))},null,8,["tasks"])):e.dockPanel==="subagent"?(x(),je(Jw,{key:1,tasks:e.subagentTasks,onCancel:h[2]||(h[2]=p=>o("cancelTask",p))},null,8,["tasks"])):e.dockPanel==="todos"?(x(),je(xY,{key:2,todos:e.todos??[],inline:""},null,8,["todos"])):(x(),je(OY,{key:3,queued:e.queued??[],running:e.running,inline:"",onSteer:h[3]||(h[3]=p=>o("steer",{text:"",attachments:[]})),onUnqueue:h[4]||(h[4]=p=>o("unqueue",p)),onEditQueued:u},null,8,["queued","running"]))])],512)):ie("",!0)]),_:1}),e.goal?(x(),je(SK,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:h[6]||(h[6]=p=>o("controlGoal",p))},null,8,["goal","force-expanded"])):ie("",!0),e.hasDockWork?(x(),$("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(x(),$("button",{key:0,type:"button",class:Oe(["dock-work-chip",{on:e.dockPanel==="bash"}]),"aria-pressed":e.dockPanel==="bash",onClick:h[7]||(h[7]=p=>o("toggle-dock-panel","bash"))},[h[34]||(h[34]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[m("circle",{cx:"8",cy:"8",r:"5.5"}),m("path",{d:"M8 4.5V8l2.5 1.5"})],-1)),m("span",null,O(C(i)("tasks.dockBash")),1),m("span",jY,[h[32]||(h[32]=dt("(",-1)),m("b",null,O(e.bashTasks.length),1),h[33]||(h[33]=dt(")",-1))])],10,UY)):ie("",!0),e.subagentTasks.length>0?(x(),$("button",{key:1,type:"button",class:Oe(["dock-work-chip",{on:e.dockPanel==="subagent"}]),"aria-pressed":e.dockPanel==="subagent",onClick:h[8]||(h[8]=p=>o("toggle-dock-panel","subagent"))},[h[37]||(h[37]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z"})],-1)),m("span",null,O(C(i)("tasks.dockSubagent")),1),m("span",zY,[h[35]||(h[35]=dt("(",-1)),m("b",null,O(e.subagentTasks.length),1),h[36]||(h[36]=dt(")",-1))])],10,qY)):ie("",!0),(e.todos?.length??0)>0?(x(),$("button",{key:2,type:"button",class:Oe(["dock-work-chip",{on:e.dockPanel==="todos"}]),"aria-pressed":e.dockPanel==="todos",onClick:h[9]||(h[9]=p=>o("toggle-dock-panel","todos"))},[h[40]||(h[40]=kr('<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" data-v-53db4e07><path d="M3 4.5l1.5 1.5L7 3.5" data-v-53db4e07></path><path d="M8.5 5h4" data-v-53db4e07></path><path d="M3 11l1.5 1.5L7 10" data-v-53db4e07></path><path d="M8.5 11.5h4" data-v-53db4e07></path></svg>',1)),m("span",null,O(C(i)("tasks.dockTodos")),1),m("span",KY,[h[38]||(h[38]=dt("(",-1)),m("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),h[39]||(h[39]=dt(")",-1))])],10,VY)):ie("",!0),(e.queued?.length??0)>0?(x(),$("button",{key:3,type:"button",class:Oe(["dock-work-chip",{on:e.dockPanel==="queue"}]),"aria-pressed":e.dockPanel==="queue",onClick:h[10]||(h[10]=p=>o("toggle-dock-panel","queue"))},[h[43]||(h[43]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[m("path",{d:"M2 4l6 4 6-4"}),m("rect",{x:"2",y:"4",width:"12",height:"8",rx:"1.5"})],-1)),m("span",null,O(C(i)("tasks.dockQueue")),1),m("span",YY,[h[41]||(h[41]=dt("(",-1)),m("b",null,O(e.queued?.length??0),1),h[42]||(h[42]=dt(")",-1))])],10,GY)):ie("",!0)],512)):ie("",!0),e.pendingQuestion?(x(),je(QK,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,onAnswer:h[11]||(h[11]=(p,g)=>o("answer",p,g)),onDismiss:h[12]||(h[12]=p=>o("dismiss",p))},null,8,["question"])):e.pendingApproval?(x(),je(JG,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,onDecide:h[13]||(h[13]=p=>o("approval",e.pendingApproval.approvalId,p))},null,8,["block","agent-name"])):(x(),je(MM,{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[14]||(h[14]=p=>o("submit",p)),onSteer:h[15]||(h[15]=p=>o("steer",p)),onCommand:h[16]||(h[16]=p=>o("command",p)),onInterrupt:h[17]||(h[17]=p=>o("interrupt")),onSetPermission:h[18]||(h[18]=p=>o("setPermission",p)),onSetThinking:h[19]||(h[19]=p=>o("setThinking",p)),onTogglePlan:h[20]||(h[20]=p=>o("togglePlan")),onToggleSwarm:h[21]||(h[21]=p=>o("toggleSwarm")),onToggleGoal:h[22]||(h[22]=p=>o("toggleGoal")),onOpenBtw:h[23]||(h[23]=p=>o("openBtw")),onCreateGoal:h[24]||(h[24]=p=>o("createGoal",p)),onControlGoal:h[25]||(h[25]=p=>o("controlGoal",p)),onFocusGoal:h[26]||(h[26]=p=>o("focusGoal")),onFocusSwarm:h[27]||(h[27]=p=>o("focusSwarm")),onCompact:h[28]||(h[28]=p=>o("compact")),onPickModel:h[29]||(h[29]=p=>o("pickModel")),onSelectModel:h[30]||(h[30]=p=>o("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))}}),ZY=vt(XY,[["__scopeId","data-v-53db4e07"]]),JY=["aria-label"],QY={class:"toc-track"},eX=["aria-label","onMouseenter","onClick"],tX={class:"toc-no"},nX=Xe({__name:"ConversationToc",props:{items:{},metrics:{},activeTurnId:{},viewport:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=F(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1),r=te({visible:!1,text:"",top:0});function l(c,u){const d=u.currentTarget;d&&(r.value={visible:!0,text:c,top:d.offsetTop})}function a(){r.value.visible=!1}return(c,u)=>i.value?(x(),$("nav",{key:0,class:"conversation-toc","aria-label":C(o)("conversation.toc")},[m("div",QY,[(x(!0),$(Pe,null,Ye(e.items,(d,f)=>(x(),$("button",{key:d.id,type:"button",class:Oe(["toc-bubble",[d.role,{active:e.activeTurnId===d.id}]]),style:Ft({height:e.metrics[f]?.height+"px"}),"aria-label":`#${d.no} ${d.title}`,onMouseenter:h=>l(d.title,h),onMouseleave:a,onClick:h=>s("select",d.id)},[m("span",tX,O(d.no),1)],46,eX))),128)),e.viewport?(x(),$("div",{key:0,class:"toc-viewport",style:Ft({top:e.viewport.top+"px",height:e.viewport.height+"px"})},null,4)):ie("",!0)]),gt(Pi,{name:"toc-tip"},{default:Ln(()=>[Ot(m("div",{class:"toc-tooltip",style:Ft({top:r.value.top+"px"})},O(r.value.text),5),[[Ho,r.value.visible]])]),_:1})],8,JY)):ie("",!0)}}),sX=vt(nX,[["__scopeId","data-v-dc54da9a"]]),oX=5;function iX(e,t,n,s=oX){if(n||e.length<=s)return e;const o=e.slice(0,s);if(t&&!o.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(o[s-1]=i)}return o}const rX={class:"chat-layout"},lX={class:"empty-hint"},aX={class:"empty-hint-title"},cX={class:"empty-hint-text"},uX={key:0,class:"ws-pick"},dX=["title"],fX={class:"ws-pick-name"},hX={key:1,class:"ws-pick-menu"},pX=["onClick"],mX={class:"ws-pick-item-name"},gX={class:"ws-pick-item-path"},vX={key:0,class:"swarm-stack"},yX=["aria-label"],kX={key:0,class:"abort-toast",role:"status","aria-live":"polite"},bX={class:"abort-toast-text"},kd=10,_X=56,wX=420,Qw=80,SX=1e3,CX=3e3,xX=Xe({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},swarms:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},modern:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},betaToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=te(!1),r=te(!1),l=F(()=>s.workspaces?.find(ge=>ge.id===s.activeWorkspaceId)?.name??s.workspaceName??""),a=F(()=>(s.workspaces?.length??0)>0),c=F(()=>iX(s.workspaces??[],s.activeWorkspaceId,r.value)),u=F(()=>(s.workspaces?.length??0)-c.value.length);Ve(i,Ne=>{Ne||(r.value=!1)});const d=F(()=>s.swarms?.filter(Ne=>Ne.members.some(ge=>ge.phase!=="completed"&&ge.phase!=="failed"))??[]);function f(Ne){i.value=!1,Ne!==s.activeWorkspaceId&&o("selectWorkspace",Ne)}const{t:h}=_t();Kc(Et.contentAlign);const p=te(null),g=te(null),S=te(null),_=te(!1),y=te(0);let b=null;function v(Ne){(S.value??g.value)?.loadForEdit(Ne)}function w(){_.value=!0,b!==null&&clearTimeout(b),b=setTimeout(()=>{b=null,_.value=!1},2e3)}function N(){y.value++}function E(){ft(()=>{$e.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const k=F(()=>s.mobile===!0||s.modern===!0),A=F(()=>s.tasks.filter(Ne=>Ne.kind!=="subagent")),I=F(()=>s.tasks.filter(Ne=>Ne.kind==="subagent")),P=F(()=>A.value.filter(Ne=>Ne.state==="run").length),M=F(()=>I.value.filter(Ne=>Ne.state==="run").length),L=F(()=>(s.todos??[]).filter(Ne=>Ne.status==="done").length),R=F(()=>s.tasks.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),B=te(null),W=F(()=>s.gitInfo?s.changes?.length??0:0);function K(Ne){B.value=B.value===Ne?null:Ne}function V(){B.value=null}Ve(R,Ne=>{Ne||V()});function se(Ne){if(Ne.role==="compaction")return h("conversation.compactedPlain");if(Ne.role==="user"){if(Ne.skillActivation)return`/${Ne.skillActivation.name}`;const He=Ne.text.trim().replaceAll(/\s+/g," ");return He.length>0?He:"user"}const ge=(Ne.text||Ne.thinking||"").trim().replaceAll(/\s+/g," ");return ge.length>0?ge:(Ne.tools?.length??0)>0?`${Ne.tools.length} tools`:"kimi"}const Y=F(()=>s.turns.map((Ne,ge)=>({id:Ne.id,role:Ne.role,no:Ne.no||ge+1,title:se(Ne)})));function G(Ne){return Ne.role==="compaction"?20:Ne.role==="user"?(Ne.text?.length??0)+(Ne.skillActivation?20:0):(Ne.text?.length??0)+(Ne.thinking?.length??0)+(Ne.tools?.reduce((ge,He)=>ge+He.name.length+(He.arg?.length??0)+(He.output?.join("").length??0),0)??0)}const ee=F(()=>{const Ne=Y.value,ge=Ne.map(zt=>{const Yt=s.turns.find(Nt=>Nt.id===zt.id);return Yt?G(Yt):kd}),He=ge.reduce((zt,Yt)=>zt+Yt,0)||Ne.length*kd;return Ne.map((zt,Yt)=>{const Nt=ge[Yt]??kd,Pt=He>0?Nt/He:0,po=Math.max(kd,Math.min(_X,Pt*wX));return{id:zt.id,height:Math.round(po)}})}),we=F(()=>ee.value.reduce((Ne,ge)=>Ne+ge.height,0)+(Y.value.length-1)*4),de=te(null),Le=te(null);function ce(){const Ne=$e.value;if(!Ne)return;const ge=Ne.querySelectorAll(".turn-anchor[data-turn-id]");if(ge.length===0)return;const He=Ne.getBoundingClientRect(),zt=He.height/2;let Yt=null,Nt=1/0;ge.forEach(Fi=>{const Vo=Fi.getBoundingClientRect(),Jn=Vo.top-He.top,Hi=Math.abs(Jn+Vo.height/2-zt);Hi<Nt&&(Nt=Hi,Yt=Fi.dataset.turnId??null)}),de.value=Yt;const Pt=Ne.scrollHeight-Ne.clientHeight,po=Pt>0?Ne.scrollTop/Pt:0,mo=we.value,Bi=po*mo,zo=Ne.scrollHeight>0?Ne.clientHeight/Ne.scrollHeight*mo:mo;Le.value={top:Math.max(0,Bi),height:Math.max(8,Math.min(zo,mo-Bi))}}const _e=F(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),me=F(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),$e=te(null),J=te(null),ye=te(0),Se=te(0),U=F(()=>({"--panes-scrollbar-width":`${ye.value}px`}));function Z(Ne){return Ne instanceof HTMLElement?Ne:Ne&&"$el"in Ne&&Ne.$el instanceof HTMLElement?Ne.$el:null}function fe(){const Ne=$e.value;ye.value=Ne?Math.max(0,Ne.offsetWidth-Ne.clientWidth):0,Se.value=J.value?.offsetHeight??0}function oe(Ne){const ge=Z(Ne);$e.value=ge,ge&&Tt()}function he(Ne){const ge=Z(Ne);J.value=ge??null,Ne&&"loadForEdit"in Ne&&typeof Ne.loadForEdit=="function"?S.value={loadForEdit:Ne.loadForEdit.bind(Ne)}:S.value=null,ss()}const H=te(!0),X=te(!1);function ae(){const Ne=$e.value;return Ne?Ne.scrollHeight-Ne.scrollTop-Ne.clientHeight:0}let ke=0,Me=0,Ie=0,re=0,le=0;function Ce(){return Date.now()<Me}function We(){const Ne=$e.value;if(!Ne)return;const ge=Ne.scrollTop;if(performance.now()-Ie<100){ke=ge;return}const He=ae();if(Ce()){H.value=!0,X.value=!1,ke=ge;return}ge<ke-1&&He>1?H.value=!1:He<=Qw&&ge>ke+1&&(H.value=!0,X.value=!1),ke=ge,ce()}function nt(Ne=!1){const ge=$e.value;ge&&(Ne&&typeof ge.scrollTo=="function"?(Ie=performance.now(),ge.scrollTo({top:ge.scrollHeight,behavior:"smooth"})):ge.scrollTop=ge.scrollHeight,ke=ge.scrollTop,H.value=!0,X.value=!1)}function lt(Ne,ge){const He=Ne.querySelectorAll(".turn-anchor");for(const zt of He)if(zt.offsetTop>=ge){const Yt=zt.dataset.turnId;if(Yt)return{id:Yt,top:zt.offsetTop}}return null}async function bt(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||!s.hasMoreMessages)return;const Ne=s.sessionId,ge=$e.value,He=ge?.scrollTop??0,zt=ge?.scrollHeight??0,Yt=ge?lt(ge,He):null;Hn.value=!0;try{await s.loadOlderMessages(Ne),await ft()}finally{Hn.value=!1}if(s.sessionId!==Ne)return;const Nt=$e.value;if(!Nt)return;let Pt=0;if(Yt){const po=Nt.querySelector(`.turn-anchor[data-turn-id="${St(Yt.id)}"]`);po&&(Pt=po.offsetTop-Yt.top)}Pt===0&&(Pt=Nt.scrollHeight-zt),Nt.scrollTop=He+Pt}function St(Ne){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ne):Ne.replaceAll(/["\\]/g,"\\$&")}function ct(Ne){const ge=$e.value;if(!ge)return;const He=ge.querySelector(`.turn-anchor[data-turn-id="${St(Ne)}"]`);He&&(H.value=!1,X.value=ae()>Qw,He.scrollIntoView({behavior:"smooth",block:"center"}))}function It(){const Ne=$e.value;if(!Ne)return"none";const ge=Ne.firstElementChild,He=ge instanceof HTMLElement?ge.offsetHeight:0,zt=J.value?.offsetHeight??0;return`${Ne.scrollHeight}:${Ne.clientHeight}:${He}:${zt}`}function hn(Ne){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ne):setTimeout(Ne,16)}function vn(Ne){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ne):clearTimeout(Ne)}function $t(Ne=36){if(!H.value&&!Ce())return;const ge=++le;let He="",zt=0,Yt=0;re&&(vn(re),re=0);const Nt=()=>{if(re=0,ge!==le||!H.value&&!Ce())return;nt(!1);const Pt=It();zt=Pt===He?zt+1:0,He=Pt,Yt++,zt<3&&Yt<Ne&&(re=hn(Nt))};re=hn(Nt)}function pn(Ne,ge){return Ne!==void 0&&Ne.length>0&&ge.length>=Ne.length&&Ne.firstId!==ge.firstId&&Ne.lastId===ge.lastId&&Ne.lastTextLen===ge.lastTextLen&&Ne.lastThinkingLen===ge.lastThinkingLen&&Ne.lastToolsLen===ge.lastToolsLen&&Ne.approvalIds===ge.approvalIds}const un=F(()=>{const Ne=(s.approvals??[]).map(Nt=>Nt.approvalId).join(","),ge=s.turns,He=ge.at(-1),zt=He?.thinking?.length??0,Yt=He?.tools?.reduce((Nt,Pt)=>Nt+Pt.name.length+(Pt.arg?.length??0)+(Pt.output?.join("").length??0),0)??0;return{length:ge.length,firstId:ge[0]?.id??"",lastId:He?.id??"",lastTextLen:He?.text.length??0,lastThinkingLen:zt,lastToolsLen:Yt,approvalIds:Ne}});Ve(un,async(Ne,ge)=>{if(Hn.value&&pn(ge,Ne)){ce();return}await ft(),H.value||Ce()?nt(!1):X.value=!0,ce()}),Ve(J,()=>{ss()}),Ve(()=>s.mobile,async()=>{await ft(),fe()}),Ve(()=>s.fileReloadKey,async()=>{H.value=!0,ke=0,await ft(),$t(),ce()}),Ve(()=>s.sessionLoading,async(Ne,ge)=>{Ne||!ge||(H.value=!0,await ft(),$t(),ce())}),Ve(()=>s.running,async(Ne,ge)=>{Ne||!ge||!H.value&&!Ce()||(await ft(),$t(48),ce())});function et(){H.value=!0,X.value=!1,Me=Date.now()+SX,ft(()=>{nt(!1),$t(16)})}function Rn(Ne){et(),o("submit",Ne)}function Po(Ne,ge){et(),o("answer",Ne,ge)}function fs(Ne,ge){!Ne||!ge||o("approval",Ne,ge)}let Fn=null,sn=null,En=null,Kn=null,_n=0,xs=!1;const Hn=te(!1);function hs(Ne){if(Hn.value||(xs=xs||Ne,_n))return;_n=(typeof requestAnimationFrame=="function"?requestAnimationFrame:He=>setTimeout(He,16))(()=>{_n=0;const He=xs;xs=!1,H.value||Ce()?nt(!1):He&&(X.value=!0)})}function ps(){if(!sn)return;const Ne=$e.value?.firstElementChild??null;Ne!==En&&(En&&sn.unobserve(En),En=Ne,Ne&&sn.observe(Ne))}function ss(){if(!sn)return;const Ne=J.value;Ne!==Kn&&(Kn&&sn.unobserve(Kn),Kn=Ne,Ne&&sn.observe(Ne))}function Tt(){const Ne=$e.value;fe(),Fn&&(Fn.disconnect(),Ne&&Fn.observe(Ne,{childList:!0,subtree:!0,characterData:!0})),sn&&(sn.disconnect(),En=null,Kn=null,Ne&&sn.observe(Ne),ps(),ss())}function ms(){ps(),hs(!0)}function qt(){typeof document>"u"||document.visibilityState==="visible"&&H.value&&$t()}const Ts=te(!1);let Ke=null;function Ue(){Ts.value=!0,Ke!==null&&clearTimeout(Ke),Ke=setTimeout(()=>{Ts.value=!1},CX)}function Je(){Ue(),o("interrupt")}function Mt(Ne){Ne.key==="Escape"&&(s.running||s.sending)&&(Ne.preventDefault(),Je())}return Qt(()=>{ft(()=>{typeof MutationObserver=="function"&&(Fn=new MutationObserver(ms)),typeof ResizeObserver=="function"&&(sn=new ResizeObserver(()=>{fe(),hs(!1)})),Tt(),$t(48),ce(),typeof document<"u"&&(document.addEventListener("visibilitychange",qt),document.addEventListener("keydown",Mt))})}),Ht(()=>{Fn&&Fn.disconnect(),sn&&sn.disconnect(),_n&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(_n),re&&vn(re),Ke!==null&&clearTimeout(Ke),b!==null&&(clearTimeout(b),b=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",qt),document.removeEventListener("keydown",Mt))}),t({loadComposerForEdit:v}),(Ne,ge)=>(x(),$("section",{class:Oe(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(x(),je(hz,{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":W.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:_.value,onOpenChanges:ge[0]||(ge[0]=He=>o("openChanges")),onCopyAll:ge[1]||(ge[1]=He=>p.value?.copyConversation()),onCopyFinalSummary:ge[2]||(ge[2]=He=>p.value?.copyFinalSummary()),onOpenPr:ge[3]||(ge[3]=He=>e.pr&&o("openPr",e.pr.url)),onRenameSession:ge[4]||(ge[4]=(He,zt)=>o("renameSession",He,zt)),onForkSession:ge[5]||(ge[5]=He=>o("forkSession",He)),onArchiveSession:ge[6]||(ge[6]=He=>o("archiveSession",He))},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.betaToc?(x(),je(sX,{key:1,items:Y.value,metrics:ee.value,"active-turn-id":de.value,viewport:Le.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:ct},null,8,["items","metrics","active-turn-id","viewport","mobile","session-loading"])):ie("",!0),m("div",rX,[m("div",{ref:oe,class:"panes chat-scroll",onScrollPassive:We},[m("div",{class:Oe(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(x(),$(Pe,{key:0},[ge[59]||(ge[59]=m("div",{class:"empty-spacer"},null,-1)),m("div",lX,[m("span",aX,O(C(h)("composer.emptyConversationTitle")),1),m("span",cX,O(C(h)("composer.emptyConversation")),1),a.value?(x(),$("div",uX,[m("button",{type:"button",class:"ws-pick-btn",title:C(h)("conversation.switchWorkspace"),onClick:ge[7]||(ge[7]=Ze(He=>i.value=!i.value,["stop"]))},[ge[55]||(ge[55]=m("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},[m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),m("path",{d:"M1 5.5h12"})],-1)),m("span",fX,O(l.value),1),(x(),$("svg",{class:Oe(["ws-pick-chev",{open:i.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...ge[54]||(ge[54]=[m("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2))],8,dX),i.value?(x(),$("div",{key:0,class:"ws-pick-backdrop",onClick:ge[8]||(ge[8]=He=>i.value=!1)})):ie("",!0),i.value?(x(),$("div",hX,[(x(!0),$(Pe,null,Ye(c.value,He=>(x(),$("button",{key:He.id,type:"button",class:Oe(["ws-pick-item",{on:He.id===e.activeWorkspaceId}]),onClick:Ze(zt=>f(He.id),["stop"])},[m("span",mX,O(He.name),1),m("span",gX,O(He.shortPath),1)],10,pX))),128)),u.value>0?(x(),$("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:ge[9]||(ge[9]=Ze(He=>r.value=!r.value,["stop"]))},[m("span",null,O(C(h)("conversation.moreWorkspaces",{count:u.value})),1)])):ie("",!0),ge[57]||(ge[57]=m("div",{class:"ws-pick-divider"},null,-1)),m("button",{type:"button",class:"ws-pick-action",onClick:ge[10]||(ge[10]=Ze(He=>{i.value=!1,o("addWorkspace")},["stop"]))},[ge[56]||(ge[56]=m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("path",{d:"M8 3v10M3 8h10"})],-1)),m("span",null,O(C(h)("conversation.addWorkspace")),1)])])):ie("",!0)])):(x(),$("button",{key:1,type:"button",class:"empty-add-workspace",onClick:ge[11]||(ge[11]=He=>o("addWorkspace"))},[ge[58]||(ge[58]=m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),m("path",{d:"M1 5.5h12"}),m("path",{d:"M8 7.25v4.5M5.75 9.5h4.5"})],-1)),m("span",null,O(C(h)("conversation.addWorkspace")),1)]))]),gt(MM,{ref_key:"emptyComposerRef",ref:g,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:Rn,onSteer:ge[12]||(ge[12]=He=>o("steer",He)),onCommand:ge[13]||(ge[13]=He=>o("command",He)),onInterrupt:Je,onUnqueue:ge[14]||(ge[14]=He=>o("unqueue",He)),onEditQueued:ge[15]||(ge[15]=He=>o("editQueued",He)),onSetPermission:ge[16]||(ge[16]=He=>o("setPermission",He)),onSetThinking:ge[17]||(ge[17]=He=>o("setThinking",He)),onTogglePlan:ge[18]||(ge[18]=He=>o("togglePlan")),onToggleSwarm:ge[19]||(ge[19]=He=>o("toggleSwarm")),onToggleGoal:ge[20]||(ge[20]=He=>o("toggleGoal")),onOpenBtw:ge[21]||(ge[21]=He=>o("command","/btw")),onCreateGoal:ge[22]||(ge[22]=He=>o("createGoal",He)),onControlGoal:ge[23]||(ge[23]=He=>o("controlGoal",He)),onFocusGoal:N,onFocusSwarm:E,onCompact:ge[24]||(ge[24]=He=>o("compact")),onPickModel:ge[25]||(ge[25]=He=>o("pickModel")),onSelectModel:ge[26]||(ge[26]=He=>o("selectModel",He))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),ge[60]||(ge[60]=m("div",{class:"empty-spacer"},null,-1))],64)):(x(),$(Pe,{key:1},[(x(),je(SM,{ref_key:"chatPaneRef",ref:p,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,bubble:k.value,mobile:e.mobile,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":H.value,"tool-diff-panel":!0,onOpenFile:ge[27]||(ge[27]=He=>o("openFile",He)),onOpenMedia:ge[28]||(ge[28]=He=>o("openMedia",He)),onCopyConversationCopied:w,onOpenThinking:ge[29]||(ge[29]=He=>o("openThinking",He)),onOpenCompaction:ge[30]||(ge[30]=He=>o("openCompaction",He)),onOpenAgent:ge[31]||(ge[31]=He=>o("openAgent",He)),onOpenToolDiff:ge[32]||(ge[32]=He=>o("openToolDiff",He)),onEditMessage:ge[33]||(ge[33]=He=>o("editMessage",He)),onLoadOlderMessages:bt},null,8,["turns","approvals","bubble","mobile","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following"])),d.value.length>0?(x(),$("div",vX,[(x(!0),$(Pe,null,Ye(d.value,He=>(x(),je(pK,{key:He.id,group:He},null,8,["group"]))),128))])):ie("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?ie("",!0):(x(),je(ZY,{key:0,ref:he,style:Ft(U.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":y.value,"dock-panel":B.value,"bash-tasks":A.value,"subagent-tasks":I.value,"bash-running":P.value,"subagent-running":M.value,"todo-done-count":L.value,"has-dock-work":R.value,todos:e.todos,"pending-question":_e.value,"pending-approval":me.value,mobile:e.mobile,onToggleDockPanel:ge[34]||(ge[34]=He=>K(He)),onCloseDockPanel:ge[35]||(ge[35]=He=>V()),onAnswer:Po,onDismiss:ge[36]||(ge[36]=He=>o("dismiss",He)),onApproval:fs,onCancelTask:ge[37]||(ge[37]=He=>o("cancelTask",He)),onControlGoal:ge[38]||(ge[38]=He=>o("controlGoal",He)),onSubmit:Rn,onSteer:ge[39]||(ge[39]=He=>o("steer",He)),onCommand:ge[40]||(ge[40]=He=>o("command",He)),onInterrupt:Je,onUnqueue:ge[41]||(ge[41]=He=>o("unqueue",He)),onEditQueued:ge[42]||(ge[42]=He=>o("editQueued",He)),onSetPermission:ge[43]||(ge[43]=He=>o("setPermission",He)),onSetThinking:ge[44]||(ge[44]=He=>o("setThinking",He)),onTogglePlan:ge[45]||(ge[45]=He=>o("togglePlan")),onToggleSwarm:ge[46]||(ge[46]=He=>o("toggleSwarm")),onToggleGoal:ge[47]||(ge[47]=He=>o("toggleGoal")),onOpenBtw:ge[48]||(ge[48]=He=>o("command","/btw")),onCreateGoal:ge[49]||(ge[49]=He=>o("createGoal",He)),onFocusGoal:N,onFocusSwarm:E,onCompact:ge[50]||(ge[50]=He=>o("compact")),onPickModel:ge[51]||(ge[51]=He=>o("pickModel")),onSelectModel:ge[52]||(ge[52]=He=>o("selectModel",He))},null,8,["style","session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","pending-approval","mobile"]))]),gt(Pi,{name:"pill"},{default:Ln(()=>[X.value?(x(),$("button",{key:0,class:"newmsg-pill",style:Ft({bottom:`${Se.value+12}px`}),"aria-label":C(h)("conversation.jumpToLatestAria"),onClick:ge[53]||(ge[53]=He=>nt(!0))},[ge[61]||(ge[61]=m("svg",{class:"pill-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("polyline",{points:"4,6 8,10 12,6"})],-1)),dt(" "+O(C(h)("conversation.newMessages")),1)],12,yX)):ie("",!0)]),_:1}),gt(Pi,{name:"abort-toast"},{default:Ln(()=>[Ts.value?(x(),$("div",kX,[m("span",bX,O(C(h)("conversation.manuallyAborted")),1)])):ie("",!0)]),_:1})],2))}}),TX=vt(xX,[["__scopeId","data-v-8a13c4fa"]]),MX={key:0,class:"fp-empty fp-error"},AX={key:1,class:"fp-empty"},EX={key:2,class:"fp-loading"},$X={class:"fp-header"},IX={class:"fp-title"},NX=["title"],LX={class:"fp-meta"},OX={key:0,class:"fp-lines"},PX={class:"fp-size"},RX=["aria-label"],DX=["aria-label"],BX=["aria-label"],FX={key:3,class:"fp-search"},HX=["placeholder"],WX={key:0,class:"fp-search-count"},UX=["disabled","title"],jX=["disabled","title"],qX=["title"],zX={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},VX={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},KX=["title"],GX=["title"],YX=["href","title"],XX=["title"],ZX={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},JX={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},QX=["title","aria-label"],eZ={key:1,class:"fp-code"},tZ={class:"fp-line-table"},nZ=["data-line"],sZ={class:"fp-gutter"},oZ=["innerHTML"],iZ={key:1,class:"fp-body fp-code"},rZ={class:"fp-line-table"},lZ=["data-line"],aZ={class:"fp-gutter"},cZ=["innerHTML"],uZ={key:2,class:"fp-body"},dZ=["srcdoc","title"],fZ={key:1,class:"fp-code"},hZ={class:"fp-line-table"},pZ=["data-line"],mZ={class:"fp-gutter"},gZ=["innerHTML"],vZ={key:3,class:"fp-body fp-pdf-wrap"},yZ=["src","title"],kZ={key:1,class:"fp-binary-card"},bZ={class:"fp-binary-label"},_Z={key:4,class:"fp-body fp-table-wrap"},wZ={class:"fp-table"},SZ=["data-line"],CZ={key:5,class:"fp-body fp-image-wrap"},xZ=["src","alt"],TZ={key:1,class:"fp-binary-card"},MZ={class:"fp-binary-label"},AZ={key:6,class:"fp-body fp-code"},EZ={class:"fp-line-table"},$Z=["data-line"],IZ={class:"fp-gutter"},NZ=["innerHTML"],LZ={key:7,class:"fp-body fp-binary-wrap"},OZ={class:"fp-binary-card"},PZ={class:"fp-binary-label"},RZ=Xe({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=_t();function s(ce,_e){const me=_e?_e.split("/").filter(Boolean):[];for(const $e of ce.split("/"))$e===""||$e==="."||($e===".."?me.pop():me.push($e));return me.join("/")}const o=Dt("resolveImage",async ce=>ce),i=F(()=>{const ce=c.file?.path??"",_e=ce.lastIndexOf("/");return _e>0?ce.slice(0,_e):""});function r(ce){if(/^(https?:|data:|blob:)/i.test(ce)||ce.startsWith("/"))return ce;const _e=i.value;return _e?s(ce,_e):ce}async function l(ce){const _e=r(ce);return o?o(_e):_e}kn("resolveImage",l);function a(ce){let _e=ce.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(_e)||_e.startsWith("/"))return ce;for(const $e of["#","?"]){const J=_e.indexOf($e);J!==-1&&(_e=_e.slice(0,J))}const me=i.value;return{...ce,path:s(_e,me)}}const c=e,u=t;function d(ce){c.openFile?.(a(ce))}const f=te(null),h=F(()=>{const ce=c.file;if(!ce)return"binary";const _e=ce.mime??"",me=ce.languageId??"",$e=ce.path.toLowerCase();return _e==="text/markdown"||me==="markdown"||me==="md"||$e.endsWith(".mdx")?"markdown":_e==="application/json"||me==="json"?"json":_e==="text/html"||me==="html"||$e.endsWith(".html")||$e.endsWith(".htm")?"html":_e==="application/pdf"||$e.endsWith(".pdf")?"pdf":_e==="text/csv"||me==="csv"||$e.endsWith(".csv")?"csv":_e.startsWith("image/")?"image":ce.isBinary?"binary":_e.startsWith("text/")||me!==""?"text":"binary"});function p(ce){const _e=atob(ce),me=Uint8Array.from(_e,$e=>$e.charCodeAt(0));return new TextDecoder().decode(me)}const g=F(()=>{const ce=c.file;if(!ce)return"";if(ce.encoding==="base64")try{return p(ce.content)}catch{return ce.content}return ce.content}),S=F(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(g.value),null,2)}catch{return g.value}}),_=F(()=>c.file?(h.value==="json"?S.value:g.value).split(`
|
|
252
|
-
`):[]),y=F(()=>c.file?h.value==="json"?S.value:g.value:""),b=te(""),v=te(0),w=F(()=>{const ce=b.value.trim().toLowerCase();if(!ce)return[];const _e=[];return _.value.forEach((me,$e)=>{me.toLowerCase().includes(ce)&&_e.push($e+1)}),_e});Ve(b,()=>{v.value=0});function N(ce,_e=!1){ce&&ft(()=>{const me=f.value?.querySelector(".fp-body"),$e=me?.querySelector(`[data-line="${ce}"]`);if(!me||!$e)return;_e&&(me.scrollTop=0);const J=me.getBoundingClientRect(),ye=$e.getBoundingClientRect(),Se=ye.top-J.top+me.scrollTop;me.scrollTop=Se-me.clientHeight/2+ye.height/2})}Ve(()=>[c.file?.path,c.line],()=>N(c.line,!0),{immediate:!0});function E(ce){const _e=w.value;_e.length!==0&&(v.value=(v.value+ce+_e.length)%_e.length,N(_e[v.value]))}function k(ce){const _e=w.value;return{target:c.line===ce,hit:_e.includes(ce),active:_e[v.value]===ce}}function A(ce){return ce<1024?`${ce} B`:ce<1024*1024?`${(ce/1024).toFixed(1)} KB`:`${(ce/(1024*1024)).toFixed(1)} MB`}const I=te(!1),P=te(!1);function M(){c.file&&Ss(y.value).then(ce=>{ce&&(I.value=!0,setTimeout(()=>{I.value=!1},1400))})}function L(){c.file&&Ss(c.file.path).then(ce=>{ce&&(P.value=!0,setTimeout(()=>{P.value=!1},1400))})}const R=te("preview"),B=te("preview"),W=te("fit");Ve(h,ce=>{R.value=ce==="html"?"preview":"source",B.value="preview",W.value="fit"});const K=F(()=>{const ce=c.file;return!ce||h.value!=="image"?null:ce.sourceUrl?ce.sourceUrl:ce.encoding==="base64"?`data:${ce.mime};base64,${ce.content}`:ce.mime==="image/svg+xml"?`data:${ce.mime};charset=utf-8,${encodeURIComponent(ce.content)}`:null}),V=F(()=>{const ce=c.file;return!ce||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ce.encoding==="base64"?`data:${ce.mime};base64,${ce.content}`:null}),se=F(()=>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:;">`,g.value].join(""):"");function Y(ce){const _e=[];let me="",$e=!1;for(let J=0;J<ce.length;J++){const ye=ce[J];ye==='"'&&ce[J+1]==='"'?(me+='"',J++):ye==='"'?$e=!$e:ye===","&&!$e?(_e.push(me),me=""):me+=ye}return _e.push(me),_e}const G=F(()=>_.value.slice(0,200).map(Y));function ee(ce){return ce.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function we(){const ce=c.file;if(!ce)return"";const _e=ce.languageId?.toLowerCase();return _e||(ce.path.split(".").pop()?.toLowerCase()??"")}function de(ce){const _e=we();let me=ee(ce);return h.value==="json"||_e==="json"||_e==="jsonc"?(me=me.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),me=me.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),me=me.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),me=me.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),me):h.value==="html"||_e==="html"||_e==="xml"||_e==="svg"?(me=me.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),me=me.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),me=me.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),me):(me=me.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>'),me=me.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),me=me.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),me)}function Le(ce,_e=55){return!ce||ce.length<=_e?ce:"…"+ce.slice(ce.length-_e+1)}return(ce,_e)=>(x(),$("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(x(),$("div",MX,[m("span",null,O(e.error),1),e.closable?(x(),$("button",{key:0,type:"button",class:"fp-action",onClick:_e[0]||(_e[0]=me=>u("close"))},O(C(n)("filePreview.close")),1)):ie("",!0)])):!e.file&&!e.loading?(x(),$("div",AX,O(C(n)("filePreview.empty")),1)):e.loading?(x(),$("div",EX,[_e[13]||(_e[13]=m("span",{class:"spinner"},null,-1)),m("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(x(),$(Pe,{key:3},[m("div",$X,[m("span",IX,O(C(n)("common.preview")),1),m("span",{class:"fp-path",title:e.file.path},O(Le(e.file.path)),9,NX),m("span",LX,[e.file.lineCount?(x(),$("span",OX,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ie("",!0),m("span",PX,O(A(e.file.size)),1)]),h.value==="html"?(x(),$("div",{key:0,class:"fp-seg",role:"group","aria-label":C(n)("filePreview.htmlMode")},[m("button",{type:"button",class:Oe(["fp-seg-btn",{on:R.value==="preview"}]),onClick:_e[1]||(_e[1]=me=>R.value="preview")},O(C(n)("filePreview.preview")),3),m("button",{type:"button",class:Oe(["fp-seg-btn",{on:R.value==="source"}]),onClick:_e[2]||(_e[2]=me=>R.value="source")},O(C(n)("filePreview.source")),3)],8,RX)):ie("",!0),h.value==="markdown"?(x(),$("div",{key:1,class:"fp-seg",role:"group","aria-label":C(n)("filePreview.markdownMode")},[m("button",{type:"button",class:Oe(["fp-seg-btn",{on:B.value==="preview"}]),onClick:_e[3]||(_e[3]=me=>B.value="preview")},O(C(n)("filePreview.preview")),3),m("button",{type:"button",class:Oe(["fp-seg-btn",{on:B.value==="source"}]),onClick:_e[4]||(_e[4]=me=>B.value="source")},O(C(n)("filePreview.source")),3)],8,DX)):ie("",!0),h.value==="image"?(x(),$("div",{key:2,class:"fp-seg",role:"group","aria-label":C(n)("filePreview.imageFit")},[m("button",{type:"button",class:Oe(["fp-seg-btn",{on:W.value==="fit"}]),onClick:_e[5]||(_e[5]=me=>W.value="fit")},O(C(n)("filePreview.fit")),3),m("button",{type:"button",class:Oe(["fp-seg-btn",{on:W.value==="actual"}]),onClick:_e[6]||(_e[6]=me=>W.value="actual")},O(C(n)("filePreview.actual")),3)],8,BX)):ie("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(x(),$("div",FX,[Ot(m("input",{"onUpdate:modelValue":_e[7]||(_e[7]=me=>b.value=me),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,HX),[[xn,b.value]]),b.value.trim()?(x(),$("span",WX,O(w.value.length),1)):ie("",!0),m("button",{type:"button",class:"fp-icon-btn",disabled:w.value.length===0,title:C(n)("filePreview.prevMatch"),onClick:_e[8]||(_e[8]=me=>E(-1))},"↑",8,UX),m("button",{type:"button",class:"fp-icon-btn",disabled:w.value.length===0,title:C(n)("filePreview.nextMatch"),onClick:_e[9]||(_e[9]=me=>E(1))},"↓",8,jX)])):ie("",!0),m("button",{type:"button",class:Oe(["fp-action fp-act-icon",{copied:P.value}]),title:P.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:L},[P.value?(x(),$("svg",VX,[..._e[15]||(_e[15]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(x(),$("svg",zX,[..._e[14]||(_e[14]=[m("path",{d:"M6.5 9.5a3 3 0 0 0 4.2.3l2-2a3 3 0 0 0-4.2-4.2l-1 1"},null,-1),m("path",{d:"M9.5 6.5a3 3 0 0 0-4.2-.3l-2 2a3 3 0 0 0 4.2 4.2l1-1"},null,-1)])]))],10,qX),e.externalActions?(x(),$("button",{key:4,type:"button",class:"fp-action fp-act-icon",title:C(n)("filePreview.openInEditor"),onClick:_e[10]||(_e[10]=me=>u("openExternal"))},[..._e[16]||(_e[16]=[m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M12 8.7V12a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 12V5.5A1.5 1.5 0 0 1 4 4h3.3"}),m("path",{d:"M9.5 2.5h4v4"}),m("path",{d:"M13.5 2.5 7.5 8.5"})],-1)])],8,KX)):ie("",!0),e.externalActions?(x(),$("button",{key:5,type:"button",class:"fp-action fp-act-icon",title:C(n)("filePreview.reveal"),onClick:_e[11]||(_e[11]=me=>u("reveal"))},[..._e[17]||(_e[17]=[m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M1.5 4.5A1.5 1.5 0 0 1 3 3h3l1.5 1.5H13A1.5 1.5 0 0 1 14.5 6v6A1.5 1.5 0 0 1 13 13.5H3A1.5 1.5 0 0 1 1.5 12z"})],-1)])],8,GX)):ie("",!0),e.downloadUrl?(x(),$("a",{key:6,class:"fp-action fp-act-icon",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"",title:C(n)("filePreview.download")},[..._e[18]||(_e[18]=[m("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M8 2v8"}),m("path",{d:"M4.5 6.5 8 10l3.5-3.5"}),m("path",{d:"M2.5 13.5h11"})],-1)])],8,YX)):ie("",!0),!e.file.isBinary&&h.value!=="image"?(x(),$("button",{key:7,type:"button",class:Oe(["fp-action fp-act-icon",{copied:I.value}]),title:I.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:M},[I.value?(x(),$("svg",JX,[..._e[20]||(_e[20]=[m("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(x(),$("svg",ZX,[..._e[19]||(_e[19]=[m("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),m("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])]))],10,XX)):ie("",!0),e.closable?(x(),$("button",{key:8,type:"button",class:"fp-close",title:C(n)("filePreview.close"),"aria-label":C(n)("filePreview.close"),onClick:_e[12]||(_e[12]=me=>u("close"))}," × ",8,QX)):ie("",!0)]),h.value==="markdown"?(x(),$("div",{key:0,class:Oe(["fp-body",{"fp-markdown":B.value==="preview"}])},[B.value==="preview"?(x(),je(nu,{key:0,text:g.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(x(),$("div",eZ,[m("div",tZ,[(x(!0),$(Pe,null,Ye(_.value,(me,$e)=>(x(),$("div",{key:$e,class:Oe(["fp-line-row",k($e+1)]),"data-line":$e+1},[m("span",sZ,O($e+1),1),m("span",{class:"fp-line-text",innerHTML:de(me)},null,8,oZ)],10,nZ))),128))])]))],2)):h.value==="json"?(x(),$("div",iZ,[m("div",rZ,[(x(!0),$(Pe,null,Ye(_.value,(me,$e)=>(x(),$("div",{key:$e,class:Oe(["fp-line-row",k($e+1)]),"data-line":$e+1},[m("span",aZ,O($e+1),1),m("span",{class:"fp-line-text",innerHTML:de(me)},null,8,cZ)],10,lZ))),128))])])):h.value==="html"?(x(),$("div",uZ,[R.value==="preview"?(x(),$("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:se.value,title:e.file.path},null,8,dZ)):(x(),$("div",fZ,[m("div",hZ,[(x(!0),$(Pe,null,Ye(_.value,(me,$e)=>(x(),$("div",{key:$e,class:Oe(["fp-line-row",k($e+1)]),"data-line":$e+1},[m("span",mZ,O($e+1),1),m("span",{class:"fp-line-text",innerHTML:de(me)},null,8,gZ)],10,pZ))),128))])]))])):h.value==="pdf"?(x(),$("div",vZ,[V.value?(x(),$("iframe",{key:0,class:"fp-pdf-frame",src:V.value,title:e.file.path},null,8,yZ)):(x(),$("div",kZ,[m("span",bZ,O(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(x(),$("div",_Z,[m("table",wZ,[m("tbody",null,[(x(!0),$(Pe,null,Ye(G.value,(me,$e)=>(x(),$("tr",{key:$e,class:Oe(k($e+1)),"data-line":$e+1},[m("th",null,O($e+1),1),(x(!0),$(Pe,null,Ye(me,(J,ye)=>(x(),$("td",{key:ye},O(J),1))),128))],10,SZ))),128))])])])):h.value==="image"?(x(),$("div",CZ,[K.value?(x(),$("img",{key:0,src:K.value,alt:e.file.path,class:Oe(["fp-image",{actual:W.value==="actual"}])},null,10,xZ)):(x(),$("div",TZ,[_e[21]||(_e[21]=m("span",{class:"fp-binary-icon"},[m("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[m("rect",{x:"2",y:"2",width:"16",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),m("path",{d:"M7 10h6M10 7v6",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),m("span",MZ,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:A(e.file.size)})),1)]))])):h.value==="text"?(x(),$("div",AZ,[m("div",EZ,[(x(!0),$(Pe,null,Ye(_.value,(me,$e)=>(x(),$("div",{key:$e,class:Oe(["fp-line-row",k($e+1)]),"data-line":$e+1},[m("span",IZ,O($e+1),1),m("span",{class:"fp-line-text",innerHTML:de(me)},null,8,NZ)],10,$Z))),128))])])):(x(),$("div",LZ,[m("div",OZ,[_e[22]||(_e[22]=m("span",{class:"fp-binary-icon"},[m("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[m("path",{d:"M5 3h7l4 4v10H5V3z",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),m("path",{d:"M12 3v4h4",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),m("span",PZ,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:A(e.file.size)})),1)])]))],64)):ie("",!0)],512))}}),DZ=vt(RZ,[["__scopeId","data-v-93380983"]]),BZ={class:"tp"},FZ={class:"tp-header"},HZ={class:"tp-title"},WZ={class:"tp-sub"},UZ=["title","aria-label"],jZ=Xe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=te(null);return Ve(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||ft(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(x(),$("div",BZ,[m("div",FZ,[m("span",HZ,O(C(o)("common.preview")),1),m("span",WZ,O(e.subtitle??C(o)("thinking.panelTitle")),1),m("button",{type:"button",class:"tp-close",title:C(o)("thinking.close"),"aria-label":C(o)("thinking.close"),onClick:l[0]||(l[0]=a=>s("close"))},[...l[1]||(l[1]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,UZ)]),m("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),e2=vt(jZ,[["__scopeId","data-v-2f5e8c0f"]]),qZ={class:"ap"},zZ={class:"ap-header"},VZ={class:"ap-title"},KZ={class:"ap-sub"},GZ=["title","aria-label"],YZ={key:0,class:"ap-type"},XZ={key:1,class:"ap-reason"},ZZ={key:2,class:"ap-field"},JZ={class:"ap-field-body"},QZ={key:3,class:"ap-field"},eJ={class:"ap-field-body ap-progress"},tJ={key:0,class:"ap-call"},nJ={key:1,class:"ap-output"},sJ=["onClick"],oJ={key:4,class:"ap-field"},iJ={class:"ap-field-body"},rJ=8,t2=5,n2=2,lJ=Xe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=F(()=>(n.member.outputLines??[]).map(p=>p.trimEnd()).filter(p=>p.length>0));function r(p){const g=[];let S=null,_=0;for(const y of p)y.startsWith("Calling ")?(S={key:`g${_++}`,call:y,output:[]},g.push(S)):S?S.output.push(y):(S={key:`g${_++}`,call:"",output:[y]},g.push(S));return g}const l=F(()=>r(i.value)),a=te(new Set);function c(p){return a.value.has(p)}function u(p){const g=new Set(a.value);g.has(p)?g.delete(p):g.add(p),a.value=g}function d(p){return p.output.length-t2-n2}function f(p){switch(p){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const h=te(null);return Ve(()=>i.value.length,()=>{const p=h.value;!p||!(p.scrollHeight-p.scrollTop-p.clientHeight<24)||ft(()=>{h.value&&(h.value.scrollTop=h.value.scrollHeight)})},{immediate:!0}),(p,g)=>(x(),$("div",qZ,[m("div",zZ,[m("span",VZ,O(C(o)("common.preview")),1),m("span",KZ,O(e.member.name),1),m("span",{class:Oe(["ap-phase",`phase-${e.member.phase}`])},O(f(e.member.phase)),3),m("button",{type:"button",class:"ap-close",title:C(o)("thinking.close"),"aria-label":C(o)("thinking.close"),onClick:g[0]||(g[0]=S=>s("close"))},[...g[1]||(g[1]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,GZ)]),m("div",{ref_key:"bodyEl",ref:h,class:"ap-body"},[e.member.subagentType?(x(),$("div",YZ,O(e.member.subagentType),1)):ie("",!0),e.member.suspendedReason?(x(),$("div",XZ,O(e.member.suspendedReason),1)):ie("",!0),e.member.prompt?(x(),$("div",ZZ,[g[2]||(g[2]=m("span",{class:"ap-field-label"},"Task",-1)),m("div",JZ,O(e.member.prompt),1)])):ie("",!0),l.value.length>0?(x(),$("div",QZ,[g[4]||(g[4]=m("span",{class:"ap-field-label"},"Progress",-1)),m("div",eJ,[(x(!0),$(Pe,null,Ye(l.value,S=>(x(),$("div",{key:S.key,class:"ap-group"},[S.call?(x(),$("div",tJ,[g[3]||(g[3]=m("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),dt(" "+O(S.call),1)])):ie("",!0),S.output.length>0?(x(),$("div",nJ,[S.output.length<=rJ||c(S.key)?(x(!0),$(Pe,{key:0},Ye(S.output,(_,y)=>(x(),$("div",{key:y,class:"ap-out-line"},O(_),1))),128)):(x(),$(Pe,{key:1},[(x(!0),$(Pe,null,Ye(S.output.slice(0,t2),(_,y)=>(x(),$("div",{key:y,class:"ap-out-line"},O(_),1))),128)),m("button",{type:"button",class:"ap-fold",onClick:_=>u(S.key)}," … ("+O(d(S))+" more) ",9,sJ),(x(!0),$(Pe,null,Ye(S.output.slice(-n2),(_,y)=>(x(),$("div",{key:"t"+y,class:"ap-out-line"},O(_),1))),128))],64))])):ie("",!0)]))),128))])])):ie("",!0),e.member.summary?(x(),$("div",oJ,[g[5]||(g[5]=m("span",{class:"ap-field-label"},"Result",-1)),m("div",iJ,O(e.member.summary),1)])):ie("",!0)],512)]))}}),aJ=vt(lJ,[["__scopeId","data-v-66bf53d2"]]),cJ={class:"diff-lines"},uJ={key:0,class:"hunk-text"},dJ={class:"dl-gutter old"},fJ={class:"dl-gutter new"},hJ={class:"dl-sign"},pJ={class:"dl-text"},mJ=Xe({__name:"DiffLines",props:{lines:{}},setup(e){function t(o){return o.oldNo!==void 0?String(o.oldNo):""}function n(o){return o.newNo!==void 0?String(o.newNo):""}function s(o){return`dl-${o.type}`}return(o,i)=>(x(),$("div",cJ,[(x(!0),$(Pe,null,Ye(e.lines,(r,l)=>(x(),$("div",{key:l,class:Oe(["dl",s(r)])},[r.type==="hunk"?(x(),$("span",uJ,O(r.text),1)):(x(),$(Pe,{key:1},[m("span",dJ,O(t(r)),1),m("span",fJ,O(n(r)),1),m("span",hJ,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),m("span",pJ,O(r.text),1)],64))],2))),128))]))}}),AM=vt(mJ,[["__scopeId","data-v-b73eaacc"]]),gJ={class:"tdp"},vJ={class:"tdp-header"},yJ={class:"tdp-title"},kJ=["title"],bJ=["title","aria-label"],_J={class:"tdp-body"},wJ={key:1,class:"tdp-output"},SJ={key:2,class:"tdp-empty"},CJ=Xe({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:s}=_t();return(o,i)=>(x(),$("div",gJ,[m("div",vJ,[m("span",yJ,O(e.target.title),1),e.target.path?(x(),$("span",{key:0,class:"tdp-sub",title:e.target.path},O(e.target.path),9,kJ)):ie("",!0),m("button",{type:"button",class:"tdp-close",title:C(s)("thinking.close"),"aria-label":C(s)("thinking.close"),onClick:i[0]||(i[0]=r=>n("close"))},[...i[1]||(i[1]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,bJ)]),m("div",_J,[e.target.lines&&e.target.lines.length>0?(x(),je(AM,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(x(),$("div",wJ,[(x(!0),$(Pe,null,Ye(e.target.output,(r,l)=>(x(),$("div",{key:l},O(r),1))),128))])):(x(),$("div",SJ,O(C(s)("diff.noDiff")),1))])]))}}),xJ=vt(CJ,[["__scopeId","data-v-9d022f5b"]]),TJ={class:"sc"},MJ={class:"sc-header"},AJ={class:"sc-title"},EJ=["title"],$J=["title","aria-label"],IJ={key:0,class:"sc-empty"},NJ={key:2,class:"sc-loading","aria-hidden":"true"},LJ={class:"sc-composer"},OJ=["placeholder"],PJ=["disabled","title"],RJ=Xe({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t(),i=F(()=>n.turns.find(y=>y.role==="user")?.text?.trim()??""),r=F(()=>n.title?.trim()||o("sideChat.title")),l=F(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=te(""),c=te(null),u=te(null);function d(){const _=a.value.trim();_&&(s("send",_),a.value="",ft(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const _=u.value;_&&(_.scrollTop=_.scrollHeight)}const h=F(()=>{const _=n.turns;if(_.length===0)return"0";const y=_.at(-1),b=y.thinking?.length??0,v=y.tools?.reduce((w,N)=>w+N.name.length+(N.arg?.length??0)+(N.output?.join("").length??0),0)??0;return`${_.length}:${y.text.length}:${b}:${v}`});Ve(h,async()=>{!n.running&&!n.sending||(await ft(),f())});const p=F(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function g(_){_.key==="Enter"&&!_.shiftKey&&!_.isComposing&&(_.preventDefault(),d())}function S(){const _=c.value;_&&(_.style.height="auto",_.style.height=`${Math.min(_.scrollHeight,160)}px`)}return(_,y)=>(x(),$("div",TJ,[m("div",MJ,[m("span",AJ,O(r.value),1),m("span",{class:"sc-subtitle",title:l.value},O(l.value),9,EJ),m("button",{type:"button",class:"sc-close",title:C(o)("thinking.close"),"aria-label":C(o)("thinking.close"),onClick:y[0]||(y[0]=b=>s("close"))},[...y[2]||(y[2]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,$J)]),m("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(x(),$("div",IJ,O(C(o)("sideChat.empty")),1)):(x(),je(SM,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending,bubble:""},null,8,["turns","running","sending"])),p.value?(x(),$("div",NJ,[gt(m1)])):ie("",!0)],512),m("div",LJ,[Ot(m("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":y[1]||(y[1]=b=>a.value=b),class:"sc-input",rows:"1",placeholder:C(o)("sideChat.placeholder"),onInput:S,onKeydown:g},null,40,OJ),[[xn,a.value]]),m("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),title:C(o)("sideChat.send"),onClick:d},[...y[3]||(y[3]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M2 8h10"}),m("path",{d:"M8 4l4 4-4 4"})],-1)])],8,PJ)])]))}}),DJ=vt(RJ,[["__scopeId","data-v-5d7c220f"]]),BJ={class:"changes-pane"},FJ={class:"dv-panel-head"},HJ={class:"dv-title"},WJ=["title"],UJ=["title","aria-label"],jJ={class:"diff-head"},qJ=["title"],zJ={class:"back-label"},VJ={key:0,class:"empty-state"},KJ={key:1,class:"dv-lines-wrap"},GJ={key:2,class:"empty-state"},YJ={class:"dv-panel-head"},XJ={class:"dv-title"},ZJ={class:"dv-change-count"},JJ=["aria-label"],QJ=["aria-pressed"],eQ=["aria-pressed"],tQ=["title","aria-label"],nQ={class:"ch-head"},sQ={class:"br-label"},oQ={class:"br-name"},iQ={key:0,class:"sync-info"},rQ=["title"],lQ=["title"],aQ={key:1,class:"empty-head"},cQ={key:0,class:"ch-list"},uQ=["title","onClick"],dQ={class:"fpath"},fQ={key:1,class:"ch-list ch-tree"},hQ={class:"tree-list"},pQ=["onClick"],mQ={class:"tree-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},gQ=["d"],vQ={class:"tree-name"},yQ=["title","onClick"],kQ={class:"tree-name"},bQ={key:2,class:"empty-state"},_Q={key:3,class:"empty-state"},wQ=Xe({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t;function i(M){const L=M.toLowerCase();return L==="modified"?"modified":L==="added"?"added":L==="deleted"?"deleted":L==="renamed"?"renamed":L==="untracked"?"untracked":L==="conflicted"?"conflicted":L==="ignored"?"ignored":L==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(M){return r[i(M)]??"?"}function a(M,L=60){return M.length<=L?M:"…"+M.slice(M.length-L+1)}const c=F(()=>s.gitInfo!==null),u=F(()=>s.changes.length>0),d=F(()=>(s.selectedDiffPath??null)!==null),f=F(()=>s.mode==="detail"||s.mode==="full"&&d.value),h=F(()=>s.fileDiff??[]),p=F(()=>s.fileDiffLoading===!0);function g(M){o("open",M)}function S(){o("back")}function _(){o("close")}const y=te("list");function b(M){y.value=M}function v(M){const L={children:[]},R=[...M].sort((B,W)=>B.path.localeCompare(W.path));for(const B of R){const W=B.path.split("/");let K=L;for(let V=0;V<W.length;V++){const se=W[V],Y=V===W.length-1,G=W.slice(0,V+1).join("/");let ee=K.children.find(we=>we.name===se&&we.kind===(Y?"file":"folder"));ee||(ee={name:se,path:G,kind:Y?"file":"folder",status:Y?B.status:void 0,children:[]},K.children.push(ee)),K=ee}}return L.children}const w=F(()=>v(s.changes)),N=te(new Set);function E(M){return!N.value.has(M)}const k=F(()=>{const M=[];function L(R,B){for(const W of R)M.push({node:W,depth:B}),W.kind==="folder"&&E(W.path)&&L(W.children,B+1)}return L(w.value,0),M});function A(M){const L=new Set(N.value);L.has(M.path)?L.delete(M.path):L.add(M.path),N.value=L}const I=M=>"M1.5 3.5h3l1.5 2h7a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1z";function P(M){return`${16+M*16}px`}return(M,L)=>(x(),$("div",BJ,[f.value?(x(),$(Pe,{key:0},[m("div",FJ,[m("span",HJ,O(C(n)("diff.title")),1),m("span",{class:"dv-path",title:e.selectedDiffPath??""},O(a(e.selectedDiffPath??"",50)),9,WJ),e.closable?(x(),$("button",{key:0,type:"button",class:"dv-close",title:C(n)("diff.close"),"aria-label":C(n)("diff.close"),onClick:_},[...L[2]||(L[2]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,UJ)):ie("",!0)]),m("div",jJ,[e.hideBack?ie("",!0):(x(),$("button",{key:0,class:"back-btn",type:"button",onClick:S,title:C(n)("diff.back")},[L[3]||(L[3]=m("span",{"aria-hidden":"true"},"←",-1)),m("span",zJ,O(C(n)("diff.back")),1)],8,qJ))]),p.value?(x(),$("div",VJ,O(C(n)("diff.loading")),1)):h.value.length>0?(x(),$("div",KJ,[gt(AM,{lines:h.value},null,8,["lines"])])):(x(),$("div",GJ,O(C(n)("diff.noDiff")),1))],64)):(x(),$(Pe,{key:1},[m("div",YJ,[m("span",XJ,O(C(n)("diff.title")),1),m("span",ZJ,O(C(n)("diff.changeCount",{count:e.changes.length})),1),m("div",{class:"dv-toggle",role:"group","aria-label":C(n)("diff.list")+" / "+C(n)("diff.tree")},[m("button",{type:"button",class:Oe(["dv-toggle-btn",{active:y.value==="list"}]),"aria-pressed":y.value==="list",onClick:L[0]||(L[0]=R=>b("list"))},O(C(n)("diff.list")),11,QJ),m("button",{type:"button",class:Oe(["dv-toggle-btn",{active:y.value==="tree"}]),"aria-pressed":y.value==="tree",onClick:L[1]||(L[1]=R=>b("tree"))},O(C(n)("diff.tree")),11,eQ)],8,JJ),e.closable?(x(),$("button",{key:0,type:"button",class:"dv-close",title:C(n)("diff.close"),"aria-label":C(n)("diff.close"),onClick:_},[...L[4]||(L[4]=[m("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[m("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),m("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,tQ)):ie("",!0)]),m("div",nQ,[c.value?(x(),$(Pe,{key:0},[m("span",sQ,O(C(n)("diff.branch")),1),m("span",oQ,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(x(),$("span",iQ,[e.gitInfo.ahead>0?(x(),$("span",{key:0,class:"ahead",title:C(n)("diff.aheadTitle")},"↑"+O(e.gitInfo.ahead),9,rQ)):ie("",!0),e.gitInfo.behind>0?(x(),$("span",{key:1,class:"behind",title:C(n)("diff.behindTitle")},"↓"+O(e.gitInfo.behind),9,lQ)):ie("",!0)])):ie("",!0)],64)):(x(),$("span",aQ,O(C(n)("diff.empty")),1))]),u.value&&y.value==="list"?(x(),$("div",cQ,[(x(!0),$(Pe,null,Ye(e.changes,R=>(x(),$("button",{key:R.path,type:"button",class:"ch-row",title:R.path,onClick:B=>g(R.path)},[m("span",{class:Oe(["badge",i(R.status)])},O(l(R.status)),3),m("span",dQ,O(a(R.path)),1)],8,uQ))),128))])):u.value&&y.value==="tree"?(x(),$("div",fQ,[m("ul",hQ,[(x(!0),$(Pe,null,Ye(k.value,({node:R,depth:B})=>(x(),$("li",{key:R.path,class:"tree-node"},[R.kind==="folder"?(x(),$("button",{key:0,type:"button",class:"tree-row tree-folder",style:Ft({paddingLeft:P(B)}),onClick:W=>A(R)},[(x(),$("svg",mQ,[m("path",{d:I(E(R.path))},null,8,gQ)])),m("span",vQ,O(R.name),1)],12,pQ)):(x(),$("button",{key:1,type:"button",class:"tree-row tree-file",style:Ft({paddingLeft:P(B)}),title:R.path,onClick:W=>g(R.path)},[m("span",{class:Oe(["badge",i(R.status)])},O(l(R.status)),3),m("span",kQ,O(R.name),1)],12,yQ))]))),128))])])):c.value?(x(),$("div",bQ,O(C(n)("diff.clean")),1)):(x(),$("div",_Q,O(C(n)("diff.empty")),1))],64))]))}}),SQ=vt(wQ,[["__scopeId","data-v-bb3f7593"]]);function Ph(e,t){let n=null;Qt(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,ft(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),Ks(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const CQ=["aria-label"],xQ={class:"dh"},TQ={class:"dtitle"},MQ=["title"],AQ={class:"search-wrap"},EQ=["placeholder"],$Q=["aria-label"],IQ=["aria-selected","onClick"],NQ={key:1,class:"loading-state"},LQ={key:2,class:"unavail-state"},OQ={key:3,class:"model-list"},PQ=["aria-selected","onClick","onMouseenter"],RQ={class:"check"},DQ={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},BQ={class:"model-main"},FQ={class:"model-name"},HQ={class:"model-id"},WQ={class:"model-provider"},UQ={class:"model-ctx"},jQ={key:0,class:"caps"},qQ=["title","onClick"],zQ={viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true"},VQ=["fill"],KQ={key:0,class:"empty"},GQ={class:"footer-hint"},YQ=Xe({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=F(()=>new Set(s.starredIds??[]));function r(b){return i.value.has(b)}const l=te(""),a=te(null),c=te(null),u=te("all");Ph(c,a);const d=F(()=>{const b=new Set,v=[{id:"all",label:n("model.allTab")}];for(const w of s.models)b.has(w.provider)||(b.add(w.provider),v.push({id:w.provider,label:w.provider}));return v}),f=F(()=>{const b=l.value.toLowerCase().trim(),v=s.models.filter(w=>{if(u.value!=="all"&&w.provider!==u.value)return!1;const N=(w.displayName??w.model).toLowerCase().includes(b),E=w.provider.toLowerCase().includes(b),k=w.id.toLowerCase().includes(b);return!b||N||E||k});return u.value!=="all"?v:v.sort((w,N)=>{const E=r(w.id)?1:0;return(r(N.id)?1:0)-E})}),h=F(()=>f.value),p=te(0);Ve([l,u],()=>{p.value=0}),Ve(d,b=>{b.some(v=>v.id===u.value)||(u.value="all")}),Ve(h,b=>{p.value=Math.min(p.value,Math.max(b.length-1,0))});function g(b){if(b.key==="Escape"){o("close");return}if(b.key==="ArrowDown")b.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(b.key==="ArrowUp")b.preventDefault(),p.value=Math.max(p.value-1,0);else if(b.key==="Enter"){const v=h.value[p.value];v&&o("select",v.id)}}Qt(()=>{document.addEventListener("keydown",g)}),Ht(()=>{document.removeEventListener("keydown",g)});function S(b){o("select",b)}function _(b){return h.value.indexOf(b)}function y(b){u.value=b}return(b,v)=>(x(),$("div",{class:"backdrop",onClick:v[3]||(v[3]=Ze(w=>o("close"),["self"]))},[m("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":C(n)("model.dialogLabel")},[m("div",xQ,[m("span",TQ,O(C(n)("model.title")),1),m("button",{class:"close-btn",title:C(n)("model.close"),onClick:v[0]||(v[0]=w=>o("close"))},"✕",8,MQ)]),m("div",AQ,[Ot(m("input",{ref_key:"searchRef",ref:a,"onUpdate:modelValue":v[1]||(v[1]=w=>l.value=w),class:"search-input",type:"text",placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,EQ),[[xn,l.value]])]),d.value.length>1?(x(),$("div",{key:0,class:"tab-strip",role:"tablist","aria-label":C(n)("model.providerTabs")},[(x(!0),$(Pe,null,Ye(d.value,w=>(x(),$("button",{key:w.id,type:"button",class:Oe(["tab-btn",{on:w.id===u.value}]),role:"tab","aria-selected":w.id===u.value,onClick:N=>y(w.id)},O(w.label),11,IQ))),128))],8,$Q)):ie("",!0),e.loading?(x(),$("div",NQ,[v[4]||(v[4]=m("svg",{class:"spin-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[m("circle",{cx:"8",cy:"8",r:"6","stroke-dasharray":"24 12","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"1s",repeatCount:"indefinite"})])],-1)),m("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(x(),$("div",LQ,[v[5]||(v[5]=m("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[m("path",{d:"M10 2 L19 18 H1 Z"}),m("line",{x1:"10",y1:"9",x2:"10",y2:"13"}),m("circle",{cx:"10",cy:"16",r:"0.8",fill:"var(--warn)"})],-1)),m("span",null,O(C(n)("model.unavailable")),1)])):(x(),$("div",OQ,[(x(!0),$(Pe,null,Ye(h.value,w=>(x(),$("div",{key:w.id,class:Oe(["model-row",{"is-current":w.id===e.current,"is-selected":_(w)===p.value}]),role:"option","aria-selected":w.id===e.current,onClick:N=>S(w.id),onMouseenter:N=>p.value=_(w)},[m("span",RQ,[w.id===e.current?(x(),$("svg",DQ,[...v[6]||(v[6]=[m("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),m("span",BQ,[m("span",FQ,O(w.displayName??w.model),1),m("span",HQ,O(w.id),1)]),m("span",WQ,O(w.provider),1),m("span",UQ,O(C(n)("model.contextSuffix",{size:Math.round(w.maxContextSize/1e3)})),1),w.capabilities&&w.capabilities.length>0?(x(),$("span",jQ,O(w.capabilities.join(", ")),1)):ie("",!0),m("button",{type:"button",class:Oe(["star-btn",{starred:r(w.id)}]),title:r(w.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:Ze(N=>o("toggle-star",w.id),["stop"]),onMouseenter:v[2]||(v[2]=Ze(()=>{},["stop"]))},[(x(),$("svg",zQ,[m("path",{fill:r(w.id)?"currentColor":"none",stroke:"currentColor","stroke-width":"1.6","stroke-linejoin":"round",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,8,VQ)]))],42,qQ)],42,PQ))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(x(),$("div",KQ,O(s.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):ie("",!0)])),m("div",GQ,O(C(n)("model.footerHint")),1)],8,CQ)]))}}),XQ=vt(YQ,[["__scopeId","data-v-34f036d8"]]),ZQ=["aria-label"],JQ={class:"dh"},QQ={class:"dtitle"},eee=["title"],tee={class:"prov-list"},nee={key:0,class:"state-row"},see={key:1,class:"state-row unavail"},oee={key:2,class:"empty"},iee=["title"],ree={key:0,width:"8",height:"8",viewBox:"0 0 8 8"},lee=["fill"],aee={key:1,width:"8",height:"8",viewBox:"0 0 8 8"},cee=["fill"],uee={key:2,width:"8",height:"8",viewBox:"0 0 8 8"},dee={class:"prov-info"},fee={class:"prov-type"},hee={key:0,class:"prov-url"},pee={class:"prov-meta"},mee={key:0},gee={key:0,class:"confirm-row"},vee={class:"confirm-text"},yee={key:1,class:"prov-actions"},kee=["title","onClick"],bee=["title","onClick"],_ee={key:0,class:"add-section"},wee={key:0,class:"add-btns"},See={key:1,class:"add-form"},Cee={class:"form-row"},xee={class:"flabel"},Tee=["value"],Mee={class:"form-row"},Aee={class:"flabel"},Eee={class:"form-row"},$ee={class:"flabel"},Iee=["placeholder"],Nee={class:"form-row"},Lee={class:"flabel"},Oee=["placeholder"],Pee={key:0,class:"add-error"},Ree={class:"form-btns"},Dee={class:"footer-hint"},Bee=Xe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=_t(),s=te(null);Ph(s);const o=t,i=te(null);function r(b){i.value=b}function l(){i.value&&(o("delete",i.value),i.value=null)}function a(){i.value=null}const c=te(!1),u=so({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),d=te(""),f=["moonshot","anthropic","openai","custom"];function h(){u.type="moonshot",u.apiKey="",u.baseUrl="",u.defaultModel="",d.value="",c.value=!0}function p(){c.value=!1}function g(){if(!u.apiKey.trim()){d.value=n("providers.apiKeyRequired");return}d.value="",o("add",{type:u.type,apiKey:u.apiKey.trim()||void 0,baseUrl:u.baseUrl.trim()||void 0,defaultModel:u.defaultModel.trim()||void 0}),c.value=!1}function S(b){if(b.key==="Escape"){if(c.value){p();return}if(i.value){a();return}o("close")}}Qt(()=>document.addEventListener("keydown",S)),Ht(()=>document.removeEventListener("keydown",S));function _(b){return b==="connected"?"var(--ok)":b==="error"?"var(--err)":"var(--faint)"}function y(b){return n(b==="connected"?"providers.status.connected":b==="error"?"providers.status.error":"providers.status.unconfigured")}return(b,v)=>(x(),$("div",{class:"backdrop",onClick:v[7]||(v[7]=Ze(w=>o("close"),["self"]))},[m("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":C(n)("providers.dialogLabel")},[m("div",JQ,[m("span",QQ,O(C(n)("providers.title")),1),m("button",{class:"close-btn",title:C(n)("providers.close"),onClick:v[0]||(v[0]=w=>o("close"))},"✕",8,eee)]),m("div",tee,[e.loading?(x(),$("div",nee,[v[8]||(v[8]=m("svg",{class:"spin-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[m("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)),m("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(x(),$("div",see,[v[9]||(v[9]=m("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[m("path",{d:"M8 1.5 L15.5 14.5 H0.5 Z"}),m("line",{x1:"8",y1:"7",x2:"8",y2:"10.5"}),m("circle",{cx:"8",cy:"12.5",r:"0.7",fill:"var(--warn)"})],-1)),m("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(x(),$("div",oee,O(C(n)("providers.empty")),1)):(x(!0),$(Pe,{key:3},Ye(e.providers,w=>(x(),$("div",{key:w.id,class:"prov-row"},[m("span",{class:"status-dot",style:Ft({color:_(w.status)}),title:y(w.status)},[w.status==="connected"?(x(),$("svg",ree,[m("circle",{cx:"4",cy:"4",r:"3.5",fill:_(w.status)},null,8,lee)])):w.status==="error"?(x(),$("svg",aee,[m("circle",{cx:"4",cy:"4",r:"3.5",fill:_(w.status)},null,8,cee)])):(x(),$("svg",uee,[...v[10]||(v[10]=[m("circle",{cx:"4",cy:"4",r:"3",fill:"none",stroke:"var(--faint)","stroke-width":"1"},null,-1)])]))],12,iee),m("div",dee,[m("span",fee,O(w.type),1),w.baseUrl?(x(),$("span",hee,O(w.baseUrl),1)):ie("",!0),m("span",pee,[m("span",{class:Oe(["prov-key-state",w.hasApiKey?"has-key":"no-key"])},O(w.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),3),w.models&&w.models.length>0?(x(),$("span",mee," · "+O(C(n)("providers.modelCount",{count:w.models.length})),1)):ie("",!0)])]),i.value===w.id?(x(),$("div",gee,[m("span",vee,O(C(n)("providers.confirmDelete")),1),m("button",{class:"act-btn danger",onClick:l},O(C(n)("providers.confirm")),1),m("button",{class:"act-btn",onClick:a},O(C(n)("providers.cancel")),1)])):(x(),$("div",yee,[m("button",{class:"act-btn",title:C(n)("providers.refreshTitle",{type:w.type}),onClick:N=>o("refresh",w.id)},O(C(n)("providers.refresh")),9,kee),m("button",{class:"act-btn danger",title:C(n)("providers.deleteTitle",{type:w.type}),onClick:N=>r(w.id)},O(C(n)("providers.delete")),9,bee)]))]))),128))]),e.unavailable?ie("",!0):(x(),$("div",_ee,[c.value?(x(),$("div",See,[m("div",Cee,[m("label",xee,O(C(n)("providers.fieldType")),1),Ot(m("select",{"onUpdate:modelValue":v[3]||(v[3]=w=>u.type=w),class:"finput fselect"},[(x(),$(Pe,null,Ye(f,w=>m("option",{key:w,value:w},O(w),9,Tee)),64))],512),[[uf,u.type]])]),m("div",Mee,[m("label",Aee,O(C(n)("providers.fieldApiKey")),1),Ot(m("input",{"onUpdate:modelValue":v[4]||(v[4]=w=>u.apiKey=w),class:"finput",type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,512),[[xn,u.apiKey]])]),m("div",Eee,[m("label",$ee,O(C(n)("providers.fieldBaseUrl")),1),Ot(m("input",{"onUpdate:modelValue":v[5]||(v[5]=w=>u.baseUrl=w),class:"finput",type:"text",placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Iee),[[xn,u.baseUrl]])]),m("div",Nee,[m("label",Lee,O(C(n)("providers.fieldDefaultModel")),1),Ot(m("input",{"onUpdate:modelValue":v[6]||(v[6]=w=>u.defaultModel=w),class:"finput",type:"text",placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,Oee),[[xn,u.defaultModel]])]),d.value?(x(),$("div",Pee,O(d.value),1)):ie("",!0),m("div",Ree,[m("button",{class:"act-btn primary",onClick:g},O(C(n)("providers.add")),1),m("button",{class:"act-btn",onClick:p},O(C(n)("providers.cancel")),1)])])):(x(),$("div",wee,[m("button",{class:"add-btn-oauth",onClick:v[1]||(v[1]=w=>o("openLogin","moonshot"))},[v[11]||(v[11]=m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("circle",{cx:"5",cy:"3",r:"2"}),m("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),dt(" "+O(C(n)("providers.loginKimi")),1)]),m("button",{class:"add-btn-oauth",onClick:v[2]||(v[2]=w=>o("openLogin","anthropic"))},[v[12]||(v[12]=m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("circle",{cx:"5",cy:"3",r:"2"}),m("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),dt(" "+O(C(n)("providers.loginAnthropic")),1)]),m("button",{class:"add-btn add-btn-key",onClick:h},[v[13]||(v[13]=m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"5",y1:"1",x2:"5",y2:"9"}),m("line",{x1:"1",y1:"5",x2:"9",y2:"5"})],-1)),dt(" "+O(C(n)("providers.enterApiKey")),1)])]))])),m("div",Dee,O(C(n)("providers.escClose")),1)],8,ZQ)]))}}),Fee=vt(Bee,[["__scopeId","data-v-28ec3774"]]),Hee={class:"backdrop"},Wee=["aria-label"],Uee={class:"dh"},jee={class:"dtitle"},qee=["title"],zee={key:0,class:"center-body"},Vee={class:"center-text"},Kee={key:1,class:"nb"},Gee={class:"nb-lead"},Yee=["href"],Xee={class:"nb-or"},Zee={class:"nb-fallback"},Jee={class:"nb-fb-text"},Qee=["href"],ete={class:"nb-code-row"},tte={class:"nb-code"},nte={class:"nb-status"},ste=["aria-label"],ote={class:"nb-status-text"},ite={class:"nb-countdown"},rte={key:2,class:"center-body"},lte={class:"center-text success-text"},ate={class:"center-hint"},cte={class:"center-body"},ute={class:"center-text err-text"},dte={class:"center-hint"},fte={class:"actions"},hte={class:"center-body"},pte={class:"center-text warn-text"},mte={class:"center-hint"},gte={class:"actions"},vte=Xe({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=_t(),s=te(null);Ph(s);const o=t,i=e,r=te("starting"),l=te(null),a=te(0),c=te(!1);let u=null,d=null;Qt(async()=>{document.addEventListener("keydown",b),await f()}),Ht(()=>{document.removeEventListener("keydown",b),g()});async function f(){g(),l.value=null,r.value="starting";const w=await i.onStartOAuthLogin();if(!w){r.value="error";return}l.value={flowId:w.flowId,verificationUri:w.verificationUri,verificationUriComplete:w.verificationUriComplete,userCode:w.userCode,expiresIn:w.expiresIn,interval:w.interval},a.value=w.expiresIn,r.value="device-code",h(),p(w.interval)}function h(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function p(w){u&&clearTimeout(u),u=setTimeout(async()=>{const N=await i.onPollOAuthLogin();N?.status==="authenticated"?(g(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):N?.status==="expired"||N?.status==="cancelled"?(g(),r.value="expired"):p(w)},w*1e3)}function g(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function S(){await f()}async function _(){!l.value||!await Ss(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function y(){g(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function b(w){w.key==="Escape"&&y()}function v(w){const N=Math.floor(w/60),E=w%60;return`${N}:${String(E).padStart(2,"0")}`}return(w,N)=>(x(),$("div",Hee,[m("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":C(n)("login.title")},[m("div",Uee,[m("span",jee,O(C(n)("login.title")),1),m("button",{class:"close-btn",title:C(n)("login.close"),onClick:y},[...N[0]||(N[0]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,qee)]),r.value==="starting"?(x(),$("div",zee,[N[1]||(N[1]=m("svg",{class:"spin-icon",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[m("circle",{cx:"11",cy:"11",r:"8","stroke-dasharray":"30 18","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 11 11",to:"360 11 11",dur:"0.9s",repeatCount:"indefinite"})])],-1)),m("span",Vee,O(C(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(x(),$("div",Kee,[m("div",Gee,O(C(n)("login.lead")),1),m("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[dt(O(C(n)("login.authorizeInBrowser"))+" ",1),N[2]||(N[2]=m("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.6"},[m("path",{d:"M6 2H2.5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8"}),m("path",{d:"M9.5 1.5h3v3M12.5 1.5 7 7"})],-1))],8,Yee),m("div",Xee,O(C(n)("login.orDivider")),1),m("div",Zee,[m("div",Jee,[dt(O(C(n)("login.fallbackPrefix")),1),m("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(l.value.verificationUri),9,Qee),dt(O(C(n)("login.fallbackSuffix")),1)]),m("div",ete,[m("span",tte,O(l.value.userCode),1),m("button",{class:Oe(["nb-copy",{"is-copied":c.value}]),onClick:_},[c.value?(x(),$(Pe,{key:0},[N[3]||(N[3]=m("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("polyline",{points:"1,6 4,9 11,2"})],-1)),dt(" "+O(C(n)("login.copied")),1)],64)):(x(),$(Pe,{key:1},[N[4]||(N[4]=m("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),m("path",{d:"M8 4V2a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h2"})],-1)),dt(" "+O(C(n)("login.copy")),1)],64))],2)])]),m("div",nte,[m("span",{class:"nb-spinner","aria-label":C(n)("login.waitingAuth")},[...N[5]||(N[5]=[m("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[m("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[m("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)])],8,ste),m("span",ote,O(C(n)("login.waitingAutoClose")),1),m("span",ite,O(v(a.value)),1)])])):r.value==="success"?(x(),$("div",rte,[N[6]||(N[6]=m("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--ok)","stroke-width":"2"},[m("circle",{cx:"18",cy:"18",r:"15"}),m("polyline",{points:"10,18 15,24 26,12"})],-1)),m("span",lte,O(C(n)("login.success")),1),m("span",ate,O(C(n)("login.successHint")),1)])):r.value==="expired"?(x(),$(Pe,{key:3},[m("div",cte,[N[7]||(N[7]=m("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--err)","stroke-width":"1.5"},[m("circle",{cx:"14",cy:"14",r:"12"}),m("line",{x1:"14",y1:"8",x2:"14",y2:"15"}),m("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--err)"})],-1)),m("span",ute,O(C(n)("login.expiredTitle")),1),m("span",dte,O(C(n)("login.expiredHint")),1)]),m("div",fte,[m("button",{class:"act-btn primary",onClick:S},O(C(n)("login.retry")),1),m("button",{class:"act-btn",onClick:y},O(C(n)("login.closeBtn")),1)])],64)):r.value==="error"?(x(),$(Pe,{key:4},[m("div",hte,[N[8]||(N[8]=m("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[m("path",{d:"M14 3 L26 24 H2 Z"}),m("line",{x1:"14",y1:"12",x2:"14",y2:"18"}),m("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--warn)"})],-1)),m("span",pte,O(C(n)("login.errorTitle")),1),m("span",mte,O(C(n)("login.errorHint")),1)]),m("div",gte,[m("button",{class:"act-btn primary",onClick:S},O(C(n)("login.retry")),1),m("button",{class:"act-btn",onClick:y},O(C(n)("login.closeBtn")),1)])],64)):ie("",!0)],8,Wee)]))}}),yte=vt(vte,[["__scopeId","data-v-98c6ec96"]]),kte=["aria-label"],bte={class:"dh"},_te={class:"dtitle"},wte=["title"],Ste={class:"form-body"},Cte={class:"form-row"},xte={class:"flabel",for:"ns-cwd"},Tte=["placeholder"],Mte={key:0,class:"recent-section"},Ate={class:"recent-label"},Ete={class:"recent-list"},$te=["title","onClick"],Ite={class:"recent-path"},Nte={class:"form-row"},Lte={class:"flabel",for:"ns-title"},Ote=["placeholder"],Pte={class:"actions"},Rte=["disabled"],Dte={class:"footer-hint"},Bte=Xe({__name:"NewSessionDialog",props:{recentCwds:{}},emits:["create","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te(""),r=te("");Ve(()=>s.recentCwds,f=>{i.value===""&&f.length>0&&(i.value=f[0])},{immediate:!0});const l=F(()=>i.value.trim()),a=F(()=>l.value.length>0);function c(){if(!a.value)return;const f={cwd:l.value},h=r.value.trim();h&&(f.title=h),o("create",f)}function u(f){i.value=f}function d(f){f.key==="Escape"?o("close"):f.key==="Enter"&&!(f.target instanceof HTMLButtonElement)&&c()}return Qt(()=>document.addEventListener("keydown",d)),Ht(()=>document.removeEventListener("keydown",d)),(f,h)=>(x(),$("div",{class:"backdrop",onClick:h[4]||(h[4]=Ze(p=>o("close"),["self"]))},[m("div",{class:"dialog",role:"dialog","aria-label":C(n)("newSession.title")},[m("div",bte,[m("span",_te,O(C(n)("newSession.title")),1),m("button",{class:"close-btn",title:C(n)("newSession.close"),onClick:h[0]||(h[0]=p=>o("close"))},[...h[5]||(h[5]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,wte)]),m("div",Ste,[m("div",Cte,[m("label",xte,O(C(n)("newSession.cwdLabel")),1),Ot(m("input",{id:"ns-cwd","onUpdate:modelValue":h[1]||(h[1]=p=>i.value=p),class:"finput",type:"text",placeholder:C(n)("newSession.cwdPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Tte),[[xn,i.value]])]),e.recentCwds.length>0?(x(),$("div",Mte,[m("div",Ate,O(C(n)("newSession.recentLabel")),1),m("div",Ete,[(x(!0),$(Pe,null,Ye(e.recentCwds,p=>(x(),$("button",{key:p,class:Oe(["recent-item",{"is-active":i.value===p}]),title:p,onClick:g=>u(p)},[h[6]||(h[6]=m("svg",{class:"dir-icon",width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[m("rect",{x:"1",y:"3",width:"9",height:"6.5",rx:"1"}),m("path",{d:"M1 4.5V3a1 1 0 0 1 1-1h2.5l1 1.5"})],-1)),m("span",Ite,O(p),1)],10,$te))),128))])])):ie("",!0),m("div",Nte,[m("label",Lte,O(C(n)("newSession.titleFieldLabel")),1),Ot(m("input",{id:"ns-title","onUpdate:modelValue":h[2]||(h[2]=p=>r.value=p),class:"finput",type:"text",placeholder:C(n)("newSession.titleFieldPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Ote),[[xn,r.value]])])]),m("div",Pte,[m("button",{class:"act-btn primary",disabled:!a.value,onClick:c},O(C(n)("newSession.create")),9,Rte),m("button",{class:"act-btn",onClick:h[3]||(h[3]=p=>o("close"))},O(C(n)("newSession.cancel")),1)]),m("div",Dte,O(C(n)("newSession.footerHint")),1)],8,kte)]))}}),Fte=vt(Bte,[["__scopeId","data-v-80a69ecb"]]),Hte={class:"lang-switch",role:"group","aria-label":"Language"},Wte=["aria-pressed","onClick"],Ute=Xe({__name:"LanguageSwitcher",setup(e){const{locale:t}=_t();function n(s){t.value!==s&&UC(s)}return(s,o)=>(x(),$("div",Hte,[(x(!0),$(Pe,null,Ye(C(WC),i=>(x(),$("button",{key:i.code,type:"button",class:Oe(["lang-opt",{on:C(t)===i.code}]),"aria-pressed":C(t)===i.code,onClick:Ze(r=>n(i.code),["stop"])},O(i.label),11,Wte))),128))]))}}),EM=vt(Ute,[["__scopeId","data-v-907613b6"]]),s2=1e3,jm=16384,qm=500,zm=50,jte=6,qte=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,zte=/^[A-Za-z0-9+/=_-]{200,}$/;let Vm=null;function ci(){if(Vm!==null)return Vm;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=An(Et.debug)==="1"),Vm=e,e}const dr=[];let Vte=1;const Kv=te(0),pc=hl(!1);function Kte(){return dr}function Gte(){dr.length=0,Kv.value++}function gl(e){pc.value||(dr.push({id:Vte++,ts:Date.now(),...e}),dr.length>s2&&dr.splice(0,dr.length-s2),Kv.value++)}function v1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return zte.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>qm?`${o.slice(0,qm)}… [+${o.length-qm} chars]`:o}if(n!=="object")return String(e);if(t>=jte)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,zm).map(i=>v1(i,t+1));return e.length>zm&&o.push(`[+${e.length-zm} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=qte.test(o)?"[redacted]":v1(i,t+1);return s}function $a(e){if(e===void 0)return;const t=v1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>jm)return{_truncated:`detail JSON was ${n.length} chars; first ${jm} kept`,preview:n.slice(0,jm)}}catch{return"[unserializable detail]"}return t}function o2(e){ci()&&gl({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:$a(e.body)}})}function i2(e){if(!ci())return;const t=e.code!==0;gl({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:$a(e.data)}})}function bd(e){ci()&&gl({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 Ul(e,t){ci()&&gl({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:$a(t)})}function Yte(e){if(!ci())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;gl({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:$a(e)})}function Xte(e){if(!ci())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);gl({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:$a(t.payload)})}const Zte={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Km(e,t,n){ci()&&gl({source:"client",kind:`client:${e}`,label:`${Zte[e]} ${t}`,detail:$a(n)})}let r2=!1;function Jte(){if(!(r2||!ci())){r2=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{Km("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;Km("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{Km(e,n.map(Qte).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function Qte(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 $M(e=dr){if(typeof document>"u")return;const t=new Blob([ene(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function ene(e=dr){return e.map(t=>JSON.stringify(t)).join(`
|
|
253
|
-
`)}const tne=["aria-label"],nne={class:"dh"},sne={class:"dtitle"},one=["title"],ine={class:"settings-layout"},rne=["aria-label"],lne=["aria-selected","aria-controls","id","onClick"],ane={class:"body"},cne={id:"settings-panel-general",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-general"},une={class:"sec"},dne={class:"sec-title"},fne={class:"row"},hne={class:"rlabel"},pne=["aria-label"],mne=["aria-pressed"],gne=["aria-pressed"],vne={class:"row"},yne={class:"rlabel"},kne=["aria-label"],bne=["aria-pressed"],_ne=["aria-pressed"],wne=["aria-pressed"],Sne={class:"row"},Cne={class:"rlabel"},xne={class:"num-field"},Tne=["value","aria-label"],Mne={class:"row"},Ane={class:"rlabel"},Ene={class:"sec"},$ne={class:"sec-title"},Ine={class:"row"},Nne={class:"rlabel"},Lne={key:0,class:"hint"},One=["aria-checked","disabled"],Pne={class:"sec"},Rne={class:"sec-title"},Dne={class:"row"},Bne={class:"rlabel"},Fne=["title"],Hne={class:"actions"},Wne={class:"sec"},Une={class:"sec-title"},jne={class:"row"},qne={class:"rlabel"},zne={class:"rvalue mono"},Vne={id:"settings-panel-agent",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-agent"},Kne={class:"sec"},Gne={class:"sec-head"},Yne={class:"sec-title"},Xne={key:0,class:"saving"},Zne={class:"row"},Jne={class:"rlabel"},Qne={class:"hint"},ese=["value","disabled","aria-label"],tse={key:0,value:"",disabled:""},nse=["label"],sse=["value"],ose={key:1,class:"rvalue mono"},ise={class:"row"},rse={class:"rlabel"},lse={class:"hint"},ase=["aria-label"],cse=["aria-pressed","disabled","onClick"],use={class:"row"},dse={class:"rlabel"},fse={class:"hint"},hse=["aria-checked","disabled"],pse={class:"row"},mse={class:"rlabel"},gse={class:"hint"},vse=["aria-checked","disabled"],yse={class:"row"},kse={class:"rlabel"},bse={class:"hint"},_se=["aria-checked","disabled"],wse={key:0,class:"row"},Sse={class:"rlabel"},Cse=["aria-checked","disabled"],xse={key:1,class:"provider-list"},Tse={class:"provider-main"},Mse={class:"provider-id"},Ase={class:"provider-type"},Ese={class:"provider-meta"},$se={key:0,class:"provider-model"},Ise={key:1,class:"empty-config"},Nse={id:"settings-panel-advanced",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-advanced"},Lse={class:"sec"},Ose={class:"sec-title"},Pse={class:"row"},Rse={class:"rlabel"},Dse={class:"rvalue mono"},Bse={class:"row"},Fse={class:"rlabel"},Hse={key:0,class:"hint"},Wse={id:"settings-panel-experimental",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-experimental"},Use={class:"sec"},jse={class:"sec-title"},qse={class:"row"},zse={class:"rlabel"},Vse={class:"hint"},Kse=["aria-checked"],Gse=Xe({__name:"SettingsDialog",props:{theme:{},colorScheme:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyPermission:{},betaToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setTheme","setColorScheme","setUiFontSize","setNotify","setBetaToc","login","logout","openOnboarding","updateConfig","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"experimental",labelKey:"settings.tabs.experimental"}],l=w6(),a=["manual","auto","yolo"],c=te(null);Ph(c);function u(E){E.key==="Escape"&&o("close")}Qt(()=>document.addEventListener("keydown",u)),Ht(()=>document.removeEventListener("keydown",u));function d(){$M()}const f=F(()=>{const E=new Map;for(const k of s.models??[])E.set(k.id,{id:k.id,label:k.displayName??k.model??k.id,provider:k.provider});for(const[k,A]of Object.entries(s.config?.models??{})){if(E.has(k))continue;const I=S(A);E.set(k,{id:k,label:_(k,A,I),provider:I??k})}return Array.from(E.values())}),h=F(()=>{const E=new Map;for(const k of f.value){const A=E.get(k.provider)??[];A.push(k),E.set(k.provider,A)}for(const k of E.values())k.sort((A,I)=>A.label.localeCompare(I.label));return Array.from(E.entries()).toSorted(([k],[A])=>k.localeCompare(A)).map(([k,A])=>({provider:k,options:A}))}),p=F(()=>Object.entries(s.config?.providers??{}).map(([E,k])=>({id:E,provider:k})).sort((E,k)=>E.id.localeCompare(k.id))),g=F(()=>{const E=s.config?.defaultPermissionMode;return E==="auto"||E==="yolo"||E==="manual"?E:"manual"});function S(E){if(!E||typeof E!="object")return;const k=E;return typeof k.provider=="string"?k.provider:void 0}function _(E,k,A){if(!k||typeof k!="object")return E;const I=k,P=typeof I.model=="string"?I.model:void 0,M=A??S(k);return P&&M?`${E} (${M}/${P})`:P?`${E} (${P})`:E}function y(E){return E===!0}function b(E){const k=E.target.value;!k||k===s.config?.defaultModel||o("updateConfig",{defaultModel:k})}function v(E){E!==g.value&&o("updateConfig",{defaultPermissionMode:E})}function w(E){const k=s.config?.[E];o("updateConfig",{[E]:!y(k)})}function N(E){i.value=E}return(E,k)=>(x(),$("div",{class:"backdrop",onClick:k[16]||(k[16]=Ze(A=>o("close"),["self"]))},[m("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":C(n)("settings.title")},[m("div",nne,[m("span",sne,O(C(n)("settings.title")),1),m("button",{class:"close-btn",title:C(n)("newSession.close"),onClick:k[0]||(k[0]=A=>o("close"))},[...k[17]||(k[17]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,one)]),m("div",ine,[m("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(x(),$(Pe,null,Ye(r,A=>m("button",{key:A.id,type:"button",class:Oe(["tab",{on:i.value===A.id}]),role:"tab","aria-selected":i.value===A.id,"aria-controls":`settings-panel-${A.id}`,id:`settings-tab-${A.id}`,onClick:I=>N(A.id)},O(C(n)(A.labelKey)),11,lne)),64))],8,rne),m("div",ane,[Ot(m("section",cne,[m("section",une,[m("h3",dne,O(C(n)("settings.appearance")),1),m("div",fne,[m("span",hne,O(C(n)("theme.label")),1),m("div",{class:"seg",role:"group","aria-label":C(n)("theme.label")},[m("button",{type:"button",class:Oe(["opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:k[1]||(k[1]=A=>o("setTheme","modern"))},O(C(n)("theme.modern")),11,mne),m("button",{type:"button",class:Oe(["opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:k[2]||(k[2]=A=>o("setTheme","kimi"))},O(C(n)("theme.kimi")),11,gne)],8,pne)]),m("div",vne,[m("span",yne,O(C(n)("theme.colorSchemeLabel")),1),m("div",{class:"seg",role:"group","aria-label":C(n)("theme.colorSchemeLabel")},[m("button",{type:"button",class:Oe(["opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:k[3]||(k[3]=A=>o("setColorScheme","light"))},O(C(n)("theme.light")),11,bne),m("button",{type:"button",class:Oe(["opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:k[4]||(k[4]=A=>o("setColorScheme","dark"))},O(C(n)("theme.dark")),11,_ne),m("button",{type:"button",class:Oe(["opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:k[5]||(k[5]=A=>o("setColorScheme","system"))},O(C(n)("theme.system")),11,wne)],8,kne)]),m("div",Sne,[m("span",Cne,O(C(n)("settings.uiFontSize")),1),m("label",xne,[m("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:k[6]||(k[6]=A=>o("setUiFontSize",Number(A.target.value)))},null,40,Tne),k[18]||(k[18]=m("span",{class:"num-unit"},"px",-1))])]),m("div",Mne,[m("span",Ane,O(C(n)("sidebar.language")),1),gt(EM)])]),m("section",Ene,[m("h3",$ne,O(C(n)("settings.notifications")),1),m("div",Ine,[m("span",Nne,[dt(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(x(),$("span",Lne,O(C(n)("settings.notifyDenied")),1)):ie("",!0)]),m("button",{type:"button",class:Oe(["switch",{on:e.notify}]),role:"switch","aria-checked":e.notify,disabled:e.notifyPermission==="denied",onClick:k[7]||(k[7]=A=>o("setNotify",!e.notify))},[...k[19]||(k[19]=[m("span",{class:"knob"},null,-1)])],10,One)])]),m("section",Pne,[m("h3",Rne,O(C(n)("settings.account")),1),m("div",Dne,[m("span",Bne,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),e.authReady&&e.accountModel?(x(),$("span",{key:0,class:"rvalue",title:e.accountModel},O(e.accountModel),9,Fne)):ie("",!0)]),m("div",Hne,[m("button",{type:"button",class:"act",onClick:k[8]||(k[8]=A=>{o("openOnboarding"),o("close")})},O(C(n)("onboarding.reopen")),1),e.authReady?(x(),$("button",{key:0,type:"button",class:"act danger",onClick:k[9]||(k[9]=A=>o("logout"))},O(C(n)("sidebar.signOut")),1)):(x(),$("button",{key:1,type:"button",class:"act signin",onClick:k[10]||(k[10]=A=>o("login"))},O(C(n)("sidebar.signIn")),1))])]),m("section",Wne,[m("h3",Une,O(C(n)("settings.build")),1),m("div",jne,[m("span",qne,O(C(n)("settings.serverVersion")),1),m("span",zne,O(e.serverVersion||"-"),1)])])],512),[[Ho,i.value==="general"]]),Ot(m("section",Vne,[m("section",Kne,[m("div",Gne,[m("h3",Yne,O(C(n)("settings.agentDefaults")),1),e.configSaving?(x(),$("span",Xne,O(C(n)("settings.saving")),1)):ie("",!0)]),e.config?(x(),$(Pe,{key:0},[m("div",Zne,[m("span",Jne,[dt(O(C(n)("settings.defaultModel"))+" ",1),m("span",Qne,O(C(n)("settings.defaultModelHint")),1)]),h.value.length>0?(x(),$("select",{key:0,class:"select-field",value:e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),onChange:b},[e.config.defaultModel?ie("",!0):(x(),$("option",tse,O(C(n)("settings.noDefaultModel")),1)),(x(!0),$(Pe,null,Ye(h.value,A=>(x(),$("optgroup",{key:A.provider,label:A.provider},[(x(!0),$(Pe,null,Ye(A.options,I=>(x(),$("option",{key:I.id,value:I.id},O(I.label),9,sse))),128))],8,nse))),128))],40,ese)):(x(),$("span",ose,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),m("div",ise,[m("span",rse,[dt(O(C(n)("settings.defaultPermission"))+" ",1),m("span",lse,O(C(n)("settings.defaultPermissionHint")),1)]),m("div",{class:"seg",role:"group","aria-label":C(n)("settings.defaultPermission")},[(x(),$(Pe,null,Ye(a,A=>m("button",{key:A,type:"button",class:Oe(["opt",{on:g.value===A}]),"aria-pressed":g.value===A,disabled:e.configSaving,onClick:I=>v(A)},O(C(n)(`settings.permission.${A}`)),11,cse)),64))],8,ase)]),m("div",use,[m("span",dse,[dt(O(C(n)("settings.defaultThinking"))+" ",1),m("span",fse,O(C(n)("settings.defaultThinkingHint")),1)]),m("button",{type:"button",class:Oe(["switch",{on:y(e.config.defaultThinking)}]),role:"switch","aria-checked":y(e.config.defaultThinking),disabled:e.configSaving,onClick:k[11]||(k[11]=A=>w("defaultThinking"))},[...k[20]||(k[20]=[m("span",{class:"knob"},null,-1)])],10,hse)]),m("div",pse,[m("span",mse,[dt(O(C(n)("settings.defaultPlanMode"))+" ",1),m("span",gse,O(C(n)("settings.defaultPlanModeHint")),1)]),m("button",{type:"button",class:Oe(["switch",{on:y(e.config.defaultPlanMode)}]),role:"switch","aria-checked":y(e.config.defaultPlanMode),disabled:e.configSaving,onClick:k[12]||(k[12]=A=>w("defaultPlanMode"))},[...k[21]||(k[21]=[m("span",{class:"knob"},null,-1)])],10,vse)]),m("div",yse,[m("span",kse,[dt(O(C(n)("settings.mergeSkills"))+" ",1),m("span",bse,O(C(n)("settings.mergeSkillsHint")),1)]),m("button",{type:"button",class:Oe(["switch",{on:y(e.config.mergeAllAvailableSkills)}]),role:"switch","aria-checked":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,onClick:k[13]||(k[13]=A=>w("mergeAllAvailableSkills"))},[...k[22]||(k[22]=[m("span",{class:"knob"},null,-1)])],10,_se)]),e.config.telemetry!==void 0?(x(),$("div",wse,[m("span",Sse,O(C(n)("settings.telemetry")),1),m("button",{type:"button",class:Oe(["switch",{on:y(e.config.telemetry)}]),role:"switch","aria-checked":y(e.config.telemetry),disabled:e.configSaving,onClick:k[14]||(k[14]=A=>w("telemetry"))},[...k[23]||(k[23]=[m("span",{class:"knob"},null,-1)])],10,Cse)])):ie("",!0),p.value.length>0?(x(),$("div",xse,[(x(!0),$(Pe,null,Ye(p.value,({id:A,provider:I})=>(x(),$("div",{key:A,class:"provider-row"},[m("div",Tse,[m("span",Mse,O(A),1),m("span",Ase,O(I.type),1)]),m("div",Ese,[m("span",{class:Oe(["provider-badge",I.hasApiKey?"ok":"warn"])},O(I.hasApiKey?C(n)("settings.credentialReady"):C(n)("settings.credentialMissing")),3),I.defaultModel?(x(),$("span",$se,O(I.defaultModel),1)):ie("",!0)])]))),128))])):ie("",!0)],64)):(x(),$("div",Ise,O(C(n)("settings.configUnavailable")),1))])],512),[[Ho,i.value==="agent"]]),Ot(m("section",Nse,[m("section",Lse,[m("h3",Ose,O(C(n)("settings.advanced")),1),m("div",Pse,[m("span",Rse,O(C(n)("sidebar.daemon")),1),m("span",Dse,O(C(l)),1)]),m("div",Bse,[m("span",Fse,[dt(O(C(n)("settings.exportLog"))+" ",1),C(ci)()?ie("",!0):(x(),$("span",Hse,O(C(n)("settings.logHint")),1))]),m("button",{type:"button",class:"act",onClick:d},O(C(n)("settings.exportLogBtn")),1)])])],512),[[Ho,i.value==="advanced"]]),Ot(m("section",Wse,[m("section",Use,[m("h3",jse,O(C(n)("settings.beta")),1),m("div",qse,[m("span",zse,[dt(O(C(n)("settings.betaToc"))+" ",1),m("span",Vse,O(C(n)("settings.betaTocHint")),1)]),m("button",{type:"button",class:Oe(["switch",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc,onClick:k[15]||(k[15]=A=>o("setBetaToc",!e.betaToc))},[...k[24]||(k[24]=[m("span",{class:"knob"},null,-1)])],10,Kse)])])],512),[[Ho,i.value==="experimental"]])])])],8,tne)]))}}),Yse=vt(Gse,[["__scopeId","data-v-2f40622b"]]),Xse=["aria-label"],Zse={class:"dh"},Jse={class:"dtitle"},Qse={class:"count"},eoe=["aria-label","title"],toe={class:"search-wrap"},noe=["placeholder"],soe={class:"session-list"},ooe=["aria-selected","onClick","onMouseenter"],ioe={class:"meta"},roe={class:"title"},loe={class:"sub"},aoe={class:"ws"},coe={class:"time"},uoe={key:0,class:"attn-badge"},doe={key:0,class:"empty"},foe={class:"footer-hint"},hoe=Xe({__name:"SessionsDialog",props:{sessions:{},workspaceGroups:{},attentionBySession:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=F(()=>{const p={};for(const g of s.workspaceGroups)for(const S of g.sessions)p[S.id]=g.workspace.name;return p}),r=te(""),l=te(null),a=F(()=>{const p=r.value.toLowerCase().trim();return p?s.sessions.filter(g=>g.title.toLowerCase().includes(p)):s.sessions}),c=te(0);Ve(r,()=>{c.value=0});function u(p){o("select",p)}function d(p){return s.attentionBySession[p]??0}function f(p){return d(p.id)>0||p.status==="awaitingApproval"||p.status==="awaitingQuestion"?"attn":p.busy?"run":p.status==="aborted"?"aborted":"idle"}function h(p){if(p.key==="Escape"){o("close");return}if(p.key==="ArrowDown")p.preventDefault(),c.value=Math.min(c.value+1,a.value.length-1);else if(p.key==="ArrowUp")p.preventDefault(),c.value=Math.max(c.value-1,0);else if(p.key==="Enter"){const g=a.value[c.value];g&&u(g.id)}}return Qt(()=>{document.addEventListener("keydown",h),ft(()=>l.value?.focus())}),Ht(()=>{document.removeEventListener("keydown",h)}),(p,g)=>(x(),$("div",{class:"backdrop",onClick:g[2]||(g[2]=Ze(S=>o("close"),["self"]))},[m("div",{class:"dialog",role:"dialog","aria-label":C(n)("sessions.title")},[m("div",Zse,[m("span",Jse,O(C(n)("sessions.title")),1),m("span",Qse,O(e.sessions.length),1),m("button",{class:"close-btn","aria-label":C(n)("sessions.close"),title:C(n)("sessions.close"),onClick:g[0]||(g[0]=S=>o("close"))},[...g[3]||(g[3]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,eoe)]),m("div",toe,[Ot(m("input",{ref_key:"searchRef",ref:l,"onUpdate:modelValue":g[1]||(g[1]=S=>r.value=S),class:"search-input",type:"text",placeholder:C(n)("sessions.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,noe),[[xn,r.value]])]),m("div",soe,[(x(!0),$(Pe,null,Ye(a.value,(S,_)=>(x(),$("div",{key:S.id,class:Oe(["session-row",{"is-active":S.id===e.activeId,"is-selected":_===c.value}]),role:"option","aria-selected":S.id===e.activeId,onClick:y=>u(S.id),onMouseenter:y=>c.value=_},[m("span",{class:Oe(["dot",f(S)])},null,2),m("div",ioe,[m("span",roe,O(S.title),1),m("span",loe,[m("span",aoe,O(i.value[S.id]??C(n)("sessions.noWorkspace")),1),g[4]||(g[4]=m("span",{class:"sep"},"·",-1)),m("span",coe,O(S.time),1)])]),d(S.id)>0?(x(),$("span",uoe,O(d(S.id)),1)):ie("",!0)],42,ooe))),128)),a.value.length===0?(x(),$("div",doe,O(e.sessions.length===0?C(n)("sessions.emptyNone"):C(n)("sessions.emptyNoMatch")),1)):ie("",!0)]),m("div",foe,O(C(n)("sessions.footerHint")),1)],8,Xse)]))}}),poe=vt(hoe,[["__scopeId","data-v-a55eac2e"]]),moe=["aria-label"],goe={class:"dh"},voe={class:"dtitle"},yoe=["aria-label"],koe={class:"crumbbar"},boe=["disabled","title","aria-label"],_oe={class:"crumbs"},woe={key:0,class:"crumb-sep"},Soe=["onClick"],Coe={key:0,class:"filterbar"},xoe=["placeholder"],Toe={key:0,class:"search-spin","aria-hidden":"true"},Moe={class:"folder-list"},Aoe={key:0,class:"fl-loading"},Eoe=["onClick"],$oe={class:"folder-name search-rel"},Ioe={key:0,class:"git-tag"},Noe={key:0,class:"git-branch"},Loe={key:0,class:"fl-empty"},Ooe={key:1,class:"fl-loading"},Poe=["onClick"],Roe={class:"folder-name"},Doe={key:0,class:"git-tag"},Boe={key:0,class:"git-branch"},Foe={key:0,class:"fl-empty"},Hoe={class:"paste-label",for:"aw-path"},Woe=["placeholder","onKeydown"],Uoe=["disabled","title"],joe={class:"actions"},qoe=["disabled","title"],zoe={class:"footer-hint"},Voe=600,Koe=6,l2=150,Goe=Xe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=te(!1),r=te(!1),l=te(""),a=te(null),c=te([]),u=te(""),d=te(!1),f=te([]),h=F(()=>u.value.trim().length>0);let p=0,g=null;function S(L,R){const B=L.toLowerCase(),W=R.toLowerCase();let K=0;for(let V=0;V<W.length&&K<B.length;V++)W[V]===B[K]&&K++;return K===B.length}async function _(L){const R=l.value,B=L.trim();if(!R||B===""){f.value=[],d.value=!1;return}const W=++p;d.value=!0;const K=[],V=[{path:R,depth:0}];let se=0;for(;V.length>0&&se<Voe&&K.length<l2;){if(W!==p)return;const Y=V.shift();se++;let G;try{G=await s.browseFs(Y.path)}catch{continue}if(W!==p)return;for(const ee of G.entries){if(!ee.isDir)continue;const we=ee.path.startsWith(R)?ee.path.slice(R.length).replace(/^\/+/,""):ee.path;if(S(B,we||ee.name)&&(K.push({path:ee.path,name:ee.name,rel:we||ee.name,isGitRepo:ee.isGitRepo,branch:ee.branch}),K.length>=l2))break;Y.depth+1<Koe&&V.push({path:ee.path,depth:Y.depth+1})}W===p&&(f.value=[...K])}W===p&&(d.value=!1)}Ve(u,L=>{if(g&&clearTimeout(g),L.trim()===""){p++,f.value=[],d.value=!1;return}g=setTimeout(()=>void _(L),220)});const y=te(!1),b=te(""),v=F(()=>b.value.trim()),w=F(()=>{const L=l.value;if(!L)return[];const R=L.split("/").filter(Boolean),B=[{label:"/",path:"/"}];let W="";for(const K of R)W+=`/${K}`,B.push({label:K,path:W});return B}),N=F(()=>l.value.length>0);async function E(L){i.value=!0;try{const R=await s.browseFs(L);if(!R.path){r.value=!0;return}l.value=R.path,a.value=R.parent,c.value=R.entries,u.value="",r.value=!1}catch{r.value=!0}finally{i.value=!1}}function k(L){L.isDir&&E(L.path)}function A(){a.value&&E(a.value)}function I(){N.value&&o("add",l.value)}function P(){v.value.length!==0&&o("add",v.value)}Qt(async()=>{i.value=!0;try{if(s.defaultPath&&(await E(s.defaultPath),!r.value))return;const L=await s.getFsHome();L.home?await E(L.home):r.value=!0}catch{r.value=!0}finally{i.value=!1}});function M(L){L.key==="Escape"&&o("close")}return Qt(()=>document.addEventListener("keydown",M)),Ht(()=>{document.removeEventListener("keydown",M),g&&clearTimeout(g)}),(L,R)=>(x(),$("div",{class:"backdrop",onClick:R[6]||(R[6]=Ze(B=>o("close"),["self"]))},[m("div",{class:"dialog",role:"dialog","aria-label":C(n)("workspace.addTitle")},[m("div",goe,[m("span",voe,O(C(n)("workspace.addTitle")),1),m("button",{class:"close-btn","aria-label":C(n)("workspace.cancel"),onClick:R[0]||(R[0]=B=>o("close"))},[...R[7]||(R[7]=[m("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[m("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),m("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,yoe)]),r.value?ie("",!0):(x(),$(Pe,{key:0},[m("div",koe,[m("button",{class:"up-btn",disabled:!a.value,title:C(n)("workspace.up"),"aria-label":C(n)("workspace.up"),onClick:A},[...R[8]||(R[8]=[m("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[m("path",{d:"M8 12V4M4 7l4-3 4 3"})],-1)])],8,boe),m("div",_oe,[(x(!0),$(Pe,null,Ye(w.value,(B,W)=>(x(),$(Pe,{key:B.path},[W>1?(x(),$("span",woe,"/")):ie("",!0),m("button",{class:Oe(["crumb",{last:W===w.value.length-1}]),onClick:K=>E(B.path)},O(B.label),11,Soe)],64))),128))])]),i.value?ie("",!0):(x(),$("div",Coe,[R[9]||(R[9]=m("svg",{class:"filter-icon",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("circle",{cx:"7",cy:"7",r:"4.5"}),m("path",{d:"M11 11l3 3"})],-1)),Ot(m("input",{"onUpdate:modelValue":R[1]||(R[1]=B=>u.value=B),class:"filter-input",type:"text",placeholder:C(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:R[2]||(R[2]=Ze(()=>{},["stop"]))},null,40,xoe),[[xn,u.value]]),d.value?(x(),$("span",Toe)):ie("",!0)])),m("div",Moe,[i.value?(x(),$("div",Aoe,O(C(n)("workspace.browsing")),1)):h.value?(x(),$(Pe,{key:1},[(x(!0),$(Pe,null,Ye(f.value,B=>(x(),$("button",{key:B.path,class:"folder-row",onClick:W=>E(B.path)},[R[10]||(R[10]=m("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[m("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),m("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),m("span",$oe,O(B.rel),1),B.isGitRepo?(x(),$("span",Ioe,[dt(O(C(n)("workspace.gitTag")),1),B.branch?(x(),$("span",Noe,O(B.branch),1)):ie("",!0)])):ie("",!0)],8,Eoe))),128)),!d.value&&f.value.length===0?(x(),$("div",Loe,O(C(n)("workspace.noFilterMatch",{q:u.value.trim()})),1)):d.value&&f.value.length===0?(x(),$("div",Ooe,O(C(n)("workspace.searching")),1)):ie("",!0)],64)):(x(),$(Pe,{key:2},[(x(!0),$(Pe,null,Ye(c.value,B=>(x(),$("button",{key:B.path,class:"folder-row",onClick:W=>k(B)},[R[11]||(R[11]=m("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[m("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),m("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),m("span",Roe,O(B.name),1),B.isGitRepo?(x(),$("span",Doe,[dt(O(C(n)("workspace.gitTag")),1),B.branch?(x(),$("span",Boe,O(B.branch),1)):ie("",!0)])):ie("",!0)],8,Poe))),128)),c.value.length===0?(x(),$("div",Foe,O(C(n)("workspace.noSubfolders")),1)):ie("",!0)],64))])],64)),m("div",{class:Oe(["paste-section",{"paste-only":r.value}])},[!r.value&&!y.value?(x(),$("button",{key:0,type:"button",class:"paste-toggle",onClick:R[3]||(R[3]=B=>y.value=!0)},O(C(n)("workspace.pasteToggle")),1)):(x(),$(Pe,{key:1},[m("label",Hoe,O(C(n)("workspace.pathLabel")),1),Ot(m("input",{id:"aw-path","onUpdate:modelValue":R[4]||(R[4]=B=>b.value=B),class:"paste-input",type:"text",placeholder:C(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:Eo(Ze(P,["stop"]),["enter"])},null,40,Woe),[[xn,b.value]]),m("button",{class:"paste-add",disabled:v.value.length===0,title:C(n)("workspace.add"),onClick:P},[...R[12]||(R[12]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M8 3v10M3 8h10"})],-1)])],8,Uoe)],64))],2),m("div",joe,[r.value?ie("",!0):(x(),$("button",{key:0,class:"act-btn primary",disabled:!N.value,title:l.value,onClick:I},O(C(n)("workspace.openThisFolder")),9,qoe)),m("button",{class:"act-btn",onClick:R[5]||(R[5]=B=>o("close"))},O(C(n)("workspace.cancel")),1)]),m("div",zoe,O(C(n)("workspace.browseHint")),1)],8,moe)]))}}),Yoe=vt(Goe,[["__scopeId","data-v-da51b020"]]),Xoe=["aria-label"],Zoe={class:"dh"},Joe={class:"dtitle"},Qoe=["title"],eie={class:"rows"},tie={class:"row"},nie={class:"row"},sie={class:"row"},oie={class:"row"},iie={class:"row"},rie={class:"row"},lie={class:"ctx-text"},aie={key:0,class:"bar"},cie={class:"row"},uie=Xe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=F(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),r=F(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:i.value}):n("status.statusNone"));function l(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const a=F(()=>{const p=s.status.permission;return p==="yolo"?"var(--err)":p==="auto"?"var(--warn)":"var(--ink)"}),c=F(()=>s.planMode?n("status.planOn"):n("status.planOff")),u=F(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),d=F(()=>typeof s.costUsd=="number"&&s.costUsd>0),f=F(()=>d.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));function h(p){p.key==="Escape"&&o("close")}return Qt(()=>document.addEventListener("keydown",h)),Ht(()=>document.removeEventListener("keydown",h)),(p,g)=>(x(),$("div",{class:"backdrop",onClick:g[1]||(g[1]=Ze(S=>o("close"),["self"]))},[m("div",{class:"dialog",role:"dialog","aria-label":C(n)("status.statusPanelTitle")},[m("div",Zoe,[m("span",Joe,O(C(n)("status.statusPanelTitle")),1),m("button",{class:"close-btn",title:C(n)("status.statusPanelClose"),onClick:g[0]||(g[0]=S=>o("close"))},"✕",8,Qoe)]),m("dl",eie,[m("div",tie,[m("dt",null,O(C(n)("status.statusModel")),1),m("dd",null,O(e.status.model),1)]),m("div",nie,[m("dt",null,O(C(n)("status.statusThinking")),1),m("dd",null,O(e.thinking),1)]),m("div",sie,[m("dt",null,O(C(n)("status.statusPermission")),1),m("dd",{style:Ft({color:a.value})},O(l(e.status.permission)),5)]),m("div",oie,[m("dt",null,O(C(n)("status.statusPlanMode")),1),m("dd",{class:Oe({"plan-on":e.planMode})},O(c.value),3)]),m("div",iie,[m("dt",null,O(C(n)("status.statusSwarmMode")),1),m("dd",{class:Oe({"swarm-on":e.swarmMode})},O(u.value),3)]),m("div",rie,[m("dt",null,O(C(n)("status.statusContext")),1),m("dd",null,[m("span",lie,O(r.value),1),e.status.ctxMax>0?(x(),$("span",aie,[m("i",{style:Ft({width:i.value+"%"})},null,4)])):ie("",!0)])]),m("div",cie,[m("dt",null,O(C(n)("status.statusCost")),1),m("dd",null,O(f.value),1)])])],8,Xoe)]))}}),die=vt(uie,[["__scopeId","data-v-230d4b38"]]),fie={key:0,class:"toasts",role:"status","aria-live":"polite"},hie=["onPointerenter","onPointerleave"],pie={class:"body"},mie={class:"title"},gie={key:0,class:"msg"},vie={key:1,class:"actions"},yie=["onClick"],kie=["onClick"],bie={key:2,class:"details"},_ie=["aria-label","onClick"],wie=Xe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=_t();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(`${o("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 A=[k.title];k.message&&A.push(k.message);const I=k.details??[];if(I.length>0){A.push("",`${o("warnings.diagnostics")}:`);for(const P of I)A.push(`${P.label}: ${P.value}`)}return A.join(`
|
|
254
|
-
`)}let f=1;const h=te([]),p=new Map,g=new Map;function S(k){const A=c(k)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?A+5e3:A}function _(k,A){const I=p.get(k)??{handle:null,deadline:0,remaining:0};I.handle=setTimeout(()=>E(k),A),I.deadline=Date.now()+A,p.set(k,I)}function y(k){const A=p.get(k);A&&A.handle!==null&&clearTimeout(A.handle),p.delete(k)}function b(k){const A=p.get(k);!A||A.handle===null||(clearTimeout(A.handle),A.handle=null,A.remaining=Math.max(0,A.deadline-Date.now()))}function v(k){if(h.value.find(P=>P.id===k)?.detailsOpen)return;const I=p.get(k);!I||I.handle!==null||_(k,I.remaining)}function w(k){k.detailsOpen=!k.detailsOpen,k.detailsOpen?b(k.id):v(k.id)}async function N(k){if(!await Ss(d(k.warning)))return;k.copied=!0;const I=g.get(k.id);I&&clearTimeout(I),g.set(k.id,setTimeout(()=>{k.copied=!1,g.delete(k.id)},1400))}function E(k){y(k);const A=g.get(k);A&&clearTimeout(A),g.delete(k);const I=h.value.findIndex(P=>P.id===k);I!==-1&&(h.value=h.value.filter(P=>P.id!==k),s("dismiss",I))}return Ve(()=>n.warnings,k=>{const A=[...h.value];h.value=k.map(I=>{const P=u(I),M=A.findIndex(B=>B.key===P),L=M===-1?void 0:A.splice(M,1)[0];if(L)return L.warning=I,L;const R={id:f++,key:P,warning:I,detailsOpen:!1,copied:!1};return _(R.id,S(I)),R});for(const I of A){y(I.id);const P=g.get(I.id);P&&clearTimeout(P),g.delete(I.id)}},{immediate:!0,flush:"post"}),Ht(()=>{p.forEach(k=>{k.handle!==null&&clearTimeout(k.handle)}),p.clear(),g.forEach(k=>clearTimeout(k)),g.clear()}),(k,A)=>h.value.length?(x(),$("div",fie,[(x(!0),$(Pe,null,Ye(h.value,I=>(x(),$("div",{key:I.id,class:Oe(["toast",{err:c(I.warning)}]),onPointerenter:P=>b(I.id),onPointerleave:P=>v(I.id)},[A[1]||(A[1]=m("span",{class:"dot","aria-hidden":"true"},null,-1)),m("div",pie,[m("div",mie,O(r(I.warning)),1),l(I.warning)?(x(),$("div",gie,O(l(I.warning)),1)):ie("",!0),a(I.warning)?.length?(x(),$("div",vie,[m("button",{class:"link",type:"button",onClick:P=>w(I)},O(I.detailsOpen?C(o)("warnings.hideDetails"):C(o)("warnings.showDetails")),9,yie),m("button",{class:"link",type:"button",onClick:P=>N(I)},O(I.copied?C(o)("warnings.copied"):C(o)("warnings.copyDetails")),9,kie)])):ie("",!0),I.detailsOpen&&a(I.warning)?.length?(x(),$("dl",bie,[(x(!0),$(Pe,null,Ye(a(I.warning),P=>(x(),$("div",{key:`${P.label}:${P.value}`,class:"detail-row"},[m("dt",null,O(P.label),1),m("dd",null,O(P.value),1)]))),128))])):ie("",!0)]),m("button",{class:"x",type:"button","aria-label":C(o)("warnings.dismiss"),onClick:P=>E(I.id)},[...A[0]||(A[0]=[m("svg",{viewBox:"0 0 16 16",width:"12",height:"12"},[m("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round"})],-1)])],8,_ie)],42,hie))),128))])):ie("",!0)}}),Sie=vt(wie,[["__scopeId","data-v-45432ab6"]]),Cie={class:"topbar"},xie={class:"wsq"},Tie=["aria-label"],Mie={class:"tb-path"},Aie={class:"ws"},Eie={class:"se"},$ie={class:"tb-sub"},Iie=["aria-label"],Nie=Xe({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=F(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=F(()=>s.workspace?.name??n("workspace.noWorkspace")),l=F(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(x(),$("div",Cie,[m("span",xie,O(i.value),1),m("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[m("span",Mie,[m("span",Aie,O(r.value),1),e.sessionTitle?(x(),$(Pe,{key:0},[c[2]||(c[2]=m("span",{class:"sl"},"/",-1)),m("span",Eie,O(e.sessionTitle),1)],64)):ie("",!0),c[3]||(c[3]=m("span",{class:"cv"},"⌄",-1))]),m("span",$ie,[m("span",{class:Oe(["rd",{on:e.running}])},null,2),m("span",null,O(l.value),1),e.branch?(x(),$(Pe,{key:0},[dt(" · "+O(e.branch),1)],64)):ie("",!0),e.sessionCount>0?(x(),$(Pe,{key:1},[dt(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ie("",!0)])],8,Tie),m("button",{type:"button",class:"tb-set","aria-label":C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},[...c[4]||(c[4]=[kr('<svg viewBox="0 0 24 24" width="21" height="21" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" aria-hidden="true" data-v-135bd6bf><line x1="4" y1="8" x2="20" y2="8" data-v-135bd6bf></line><circle cx="10" cy="8" r="2.5" fill="var(--bg)" data-v-135bd6bf></circle><line x1="4" y1="16" x2="20" y2="16" data-v-135bd6bf></line><circle cx="15" cy="16" r="2.5" fill="var(--bg)" data-v-135bd6bf></circle></svg>',1)])],8,Iie)]))}}),Lie=vt(Nie,[["__scopeId","data-v-135bd6bf"]]),Oie={key:0,class:"sheet-root"},Pie=["aria-label"],Rie=["aria-label"],Die={key:0,class:"sheet-head"},Bie={class:"sheet-title"},Fie={class:"sheet-body"},Hie=Xe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ve(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),Ht(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(x(),je(Pi,{name:"sheet"},{default:Ln(()=>[e.modelValue?(x(),$("div",Oie,[m("div",{class:"sheet-scrim",onClick:i}),m("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[m("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,Rie),e.title?(x(),$("div",Die,[m("span",Bie,O(e.title),1)])):ie("",!0),m("div",Fie,[ia(l.$slots,"default",{},void 0,!0)])],8,Pie)])):ie("",!0)]),_:3}))}}),IM=vt(Hie,[["__scopeId","data-v-aa55810a"]]),Wie={class:"mlist"},Uie={key:0,class:"mempty"},jie=["onClick"],qie={class:"mgh-folder",width:"15",height:"15",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},zie={class:"mgh-main"},Vie={class:"mgh-name"},Kie=["title"],Gie={key:0,class:"att"},Yie=["title","aria-label","onClick"],Xie=["title","aria-label","onClick"],Zie=["onClick"],Jie=["onClick"],Qie={key:0,class:"mempty small"},ere=["onClick"],tre={class:"m"},nre={class:"s"},sre={key:0,class:"att"},ore=["title","onClick"],ire=["onClick"],rre=["onClick"],lre=["disabled","onClick"],are=Xe({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t;function i(){o("update:modelValue",!1)}function r(I){o("select",I),i()}function l(I){o("createInWorkspace",I),i()}function a(){o("create"),i()}function c(){o("addWorkspace"),i()}const u=te(new Set);function d(I){return u.value.has(I)}function f(I){const P=new Set(u.value);P.has(I)?P.delete(I):P.add(I),u.value=P,p.value=null,v.value=null}function h(I){return s.attentionByWorkspace[I]??0}const p=te(null),g=te(null);let S;function _(I){p.value=p.value===I?null:I,v.value=null,clearTimeout(S),g.value=null}function y(I){p.value=null;const M=(typeof window<"u"?window.prompt(n("sidebar.rename"),I.title):null)?.trim();M&&o("rename",I.id,M)}function b(I){if(g.value===I){clearTimeout(S),g.value=null,p.value=null,o("archive",I);return}clearTimeout(S),g.value=I,S=setTimeout(()=>{g.value=null},2500)}const v=te(null),w=te(null);let N;function E(I){v.value=v.value===I?null:I,p.value=null,clearTimeout(N),w.value=null}function k(I){Ss(I.root),v.value=null}function A(I){if(w.value===I){clearTimeout(N),w.value=null,v.value=null,o("deleteWorkspace",I);return}clearTimeout(N),w.value=I,N=setTimeout(()=>{w.value=null},2500)}return Ht(()=>{clearTimeout(S),clearTimeout(N)}),(I,P)=>(x(),je(IM,{"model-value":e.modelValue,"onUpdate:modelValue":P[2]||(P[2]=M=>o("update:modelValue",M))},{default:Ln(()=>[m("button",{type:"button",class:"newrow",onClick:a},[P[3]||(P[3]=m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),dt(" "+O(C(n)("sidebar.newChat")),1)]),m("button",{type:"button",class:"newrow secondary",onClick:c},[P[4]||(P[4]=m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),m("path",{d:"M1 5.5h12"})],-1)),dt(" "+O(C(n)("sidebar.newWorkspace")),1)]),m("div",Wie,[e.groups.length===0?(x(),$("div",Uie,O(C(n)("workspace.noWorkspace")),1)):ie("",!0),(x(!0),$(Pe,null,Ye(e.groups,M=>(x(),$("div",{key:M.workspace.id,class:"mgroup"},[m("div",{class:Oe(["mgh",{on:M.workspace.id===e.activeWorkspaceId}]),onClick:L=>f(M.workspace.id)},[(x(),$("svg",qie,[d(M.workspace.id)?(x(),$(Pe,{key:0},[P[5]||(P[5]=m("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),P[6]||(P[6]=m("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(x(),$(Pe,{key:1},[P[7]||(P[7]=m("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),P[8]||(P[8]=m("path",{d:"M1 5.5h12"},null,-1))],64))])),m("div",zie,[m("span",Vie,O(M.workspace.name),1),m("span",{class:"mgh-path",title:M.workspace.root},O(M.workspace.branch||M.workspace.shortPath),9,Kie)]),d(M.workspace.id)&&h(M.workspace.id)>0?(x(),$("span",Gie,O(h(M.workspace.id)),1)):ie("",!0),m("button",{type:"button",class:"mgh-more",title:C(n)("sidebar.options"),"aria-label":C(n)("sidebar.options"),onClick:Ze(L=>E(M.workspace.id),["stop"])},[...P[9]||(P[9]=[m("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"8",cy:"3",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,Yie),m("button",{type:"button",class:"mgh-add",title:C(n)("workspace.newInGroup"),"aria-label":C(n)("workspace.newInGroup"),onClick:Ze(L=>l(M.workspace.id),["stop"])},"+",8,Xie),v.value===M.workspace.id?(x(),$("div",{key:1,class:"kmenu wsmenu",onClick:P[0]||(P[0]=Ze(()=>{},["stop"]))},[m("button",{class:"kitem",onClick:Ze(L=>k(M.workspace),["stop"])},O(C(n)("sidebar.copyPath")),9,Zie),m("button",{class:"kitem archive",onClick:Ze(L=>A(M.workspace.id),["stop"])},O(w.value===M.workspace.id?C(n)("sidebar.confirm"):C(n)("sidebar.delete")),9,Jie)])):ie("",!0)],10,jie),Ot(m("div",null,[M.sessions.length===0?(x(),$("div",Qie,O(C(n)("sidebar.noSessions")),1)):ie("",!0),(x(!0),$(Pe,null,Ye(M.sessions,L=>(x(),$("div",{key:L.id,class:Oe(["srow",{cur:L.id===e.activeId}]),onClick:R=>r(L.id)},[m("div",tre,[m("div",{class:Oe(["t",{run:L.busy,aborted:L.status==="aborted"}])},O(L.title),3),m("div",nre,O(L.time),1)]),(e.attentionBySession[L.id]??0)>0?(x(),$("span",sre,O(e.attentionBySession[L.id]),1)):ie("",!0),m("button",{type:"button",class:"kb",title:C(n)("sidebar.options"),onClick:Ze(R=>_(L.id),["stop"])},[...P[10]||(P[10]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[m("circle",{cx:"8",cy:"3",r:"1.3"}),m("circle",{cx:"8",cy:"8",r:"1.3"}),m("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,ore),p.value===L.id?(x(),$("div",{key:1,class:"kmenu",onClick:P[1]||(P[1]=Ze(()=>{},["stop"]))},[m("button",{class:"kitem",onClick:Ze(R=>y(L),["stop"])},O(C(n)("sidebar.rename")),9,ire),m("button",{class:"kitem archive",onClick:Ze(R=>b(L.id),["stop"])},O(g.value===L.id?C(n)("sidebar.archiveConfirm"):C(n)("sidebar.archive")),9,rre)])):ie("",!0)],10,ere))),128)),M.hasMore||M.loadingMore?(x(),$("button",{key:1,type:"button",class:"mshow-more",disabled:M.loadingMore,onClick:Ze(L=>o("loadMore",M.workspace.id),["stop"])},O(M.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,M.workspace.sessionCount-M.sessions.length)})),9,lre)):ie("",!0)],512),[[Ho,!d(M.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),cre=vt(are,[["__scopeId","data-v-d8b693db"]]),ure={class:"srow-main"},dre={class:"srow-label"},fre={class:"srow-sub"},hre={class:"srow-main"},pre={class:"srow-label"},mre={class:"srow-val"},gre={class:"srow-main"},vre={class:"srow-label"},yre={class:"srow-sub"},kre=["aria-checked"],bre={class:"srow-main"},_re={class:"srow-label"},wre={class:"srow-sub"},Sre=["aria-checked"],Cre={class:"srow-main"},xre={class:"srow-label"},Tre={class:"srow read-only"},Mre={class:"srow-main"},Are={class:"srow-label"},Ere={class:"srow-sub"},$re=["aria-label"],Ire={class:"srow read-only pref"},Nre={class:"srow-main"},Lre={class:"srow-label"},Ore=["aria-label"],Pre=["aria-pressed"],Rre=["aria-pressed"],Dre={class:"srow read-only pref"},Bre={class:"srow-main"},Fre={class:"srow-label"},Hre=["aria-label"],Wre=["aria-pressed"],Ure=["aria-pressed"],jre=["aria-pressed"],qre={class:"srow read-only pref"},zre={class:"srow-main"},Vre={class:"srow-label"},Kre={class:"srow read-only pref"},Gre={class:"srow-main"},Yre={class:"srow-label"},Xre={class:"num-field"},Zre=["value","aria-label"],Jre={class:"srow-main"},Qre={class:"srow-label"},ele={class:"srow-sub"},tle=["aria-checked"],nle={class:"srow-main"},sle={class:"srow-label"},ole={class:"srow-main"},ile={class:"srow-label"},rle={key:2,class:"srow read-only"},lle={class:"srow-main"},ale={class:"srow-label"},cle={class:"srow-val dim"},ule=Xe({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},theme:{default:"terminal"},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},betaToc:{type:Boolean},serverVersion:{default:""}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setTheme","setColorScheme","setUiFontSize","setBetaToc","login","logout"],setup(e,{emit:t}){const{t:n}=_t(),s=e,o=t,i=["manual","auto","yolo"],r=F(()=>s.thinking??"high"),l=F(()=>s.planMode===!0),a=F(()=>s.swarmMode===!0),c=F(()=>{const b=s.status.permission;return b==="yolo"?"var(--err)":b==="auto"?"var(--warn)":"var(--faint)"}),u=F(()=>{const b=s.status.permission,v=n(b==="yolo"?"mobile.permYoloSub":b==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${b} · ${v}`}),d=b=>`${Math.round(b/1e3)}k`,f=F(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),h=F(()=>s.status.ctxMax>0?`${d(s.status.ctxUsed)}/${d(s.status.ctxMax)}`:n("status.statusNone"));function p(){o("setThinking",r.value==="off"?"high":"off")}function g(){const b=i.indexOf(s.status.permission),v=i[(b+1)%i.length];o("setPermission",v)}function S(){o("pickModel"),o("update:modelValue",!1)}function _(){o("login"),o("update:modelValue",!1)}function y(){o("logout"),o("update:modelValue",!1)}return(b,v)=>(x(),je(IM,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":v[9]||(v[9]=w=>o("update:modelValue",w))},{default:Ln(()=>[m("button",{type:"button",class:"srow",onClick:S},[m("span",ure,[m("span",dre,O(C(n)("status.statusModel")),1),m("span",fre,O(e.status.model),1)]),v[10]||(v[10]=m("span",{class:"chev"},"›",-1))]),m("button",{type:"button",class:"srow",onClick:p},[m("span",hre,[m("span",pre,O(C(n)("status.statusThinking")),1)]),m("span",mre,O(r.value==="off"?C(n)("status.planOff"):C(n)("status.planOn")),1),v[11]||(v[11]=m("span",{class:"chev"},"›",-1))]),m("button",{type:"button",class:"srow",onClick:v[0]||(v[0]=w=>o("togglePlan"))},[m("span",gre,[m("span",vre,O(C(n)("status.statusPlanMode")),1),m("span",yre,O(C(n)("mobile.planModeSub")),1)]),m("span",{class:Oe(["toggle",{on:l.value}]),role:"switch","aria-checked":l.value},null,10,kre)]),m("button",{type:"button",class:"srow",onClick:v[1]||(v[1]=w=>o("toggleSwarm"))},[m("span",bre,[m("span",_re,O(C(n)("status.statusSwarmMode")),1),m("span",wre,O(C(n)("mobile.swarmModeSub")),1)]),m("span",{class:Oe(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,Sre)]),m("button",{type:"button",class:"srow",onClick:g},[m("span",Cre,[m("span",xre,O(C(n)("status.statusPermission")),1),m("span",{class:"srow-sub",style:Ft({color:c.value})},O(u.value),5)]),v[12]||(v[12]=m("span",{class:"chev"},"›",-1))]),m("div",Tre,[m("span",Mre,[m("span",Are,O(C(n)("status.statusContext")),1),m("span",Ere,O(h.value),1)]),m("span",{class:"ctx-meter","aria-label":h.value},[m("i",{style:Ft({width:f.value+"%"})},null,4)],8,$re)]),m("div",Ire,[m("span",Nre,[m("span",Lre,O(C(n)("theme.label")),1)]),m("div",{class:"seg",role:"group","aria-label":C(n)("theme.label")},[m("button",{type:"button",class:Oe(["seg-opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:v[2]||(v[2]=w=>o("setTheme","modern"))},O(C(n)("theme.modern")),11,Pre),m("button",{type:"button",class:Oe(["seg-opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:v[3]||(v[3]=w=>o("setTheme","kimi"))},O(C(n)("theme.kimi")),11,Rre)],8,Ore)]),m("div",Dre,[m("span",Bre,[m("span",Fre,O(C(n)("theme.colorSchemeLabel")),1)]),m("div",{class:"seg",role:"group","aria-label":C(n)("theme.colorSchemeLabel")},[m("button",{type:"button",class:Oe(["seg-opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:v[4]||(v[4]=w=>o("setColorScheme","light"))},O(C(n)("theme.light")),11,Wre),m("button",{type:"button",class:Oe(["seg-opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:v[5]||(v[5]=w=>o("setColorScheme","dark"))},O(C(n)("theme.dark")),11,Ure),m("button",{type:"button",class:Oe(["seg-opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:v[6]||(v[6]=w=>o("setColorScheme","system"))},O(C(n)("theme.system")),11,jre)],8,Hre)]),m("div",qre,[m("span",zre,[m("span",Vre,O(C(n)("sidebar.language")),1)]),gt(EM)]),m("div",Kre,[m("span",Gre,[m("span",Yre,O(C(n)("settings.uiFontSize")),1)]),m("label",Xre,[m("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:v[7]||(v[7]=w=>o("setUiFontSize",Number(w.target.value)))},null,40,Zre),v[13]||(v[13]=m("span",{class:"num-unit"},"px",-1))])]),m("button",{type:"button",class:"srow",onClick:v[8]||(v[8]=w=>o("setBetaToc",!e.betaToc))},[m("span",Jre,[m("span",Qre,O(C(n)("settings.betaToc")),1),m("span",ele,O(C(n)("settings.betaTocHint")),1)]),m("span",{class:Oe(["toggle",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc},null,10,tle)]),e.authReady?(x(),$("button",{key:0,type:"button",class:"srow acct out",onClick:y},[m("span",nle,[m("span",sle,O(C(n)("sidebar.signOut")),1)])])):(x(),$("button",{key:1,type:"button",class:"srow acct in",onClick:_},[m("span",ole,[m("span",ile,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(x(),$("div",rle,[m("span",lle,[m("span",ale,O(C(n)("settings.serverVersion")),1)]),m("span",cle,O(e.serverVersion),1)])):ie("",!0)]),_:1},8,["model-value","title"]))}}),dle=vt(ule,[["__scopeId","data-v-33721a82"]]),fle={class:"ob-backdrop"},hle=["aria-label"],ple=["aria-label"],mle={class:"ob-brand"},gle={class:"ob-title"},vle={class:"ob-sub"},yle={class:"ob-sec"},kle={class:"ob-label"},ble={class:"ob-seg",role:"group"},_le=["aria-pressed","onClick"],wle={class:"ob-sec"},Sle={class:"ob-label"},Cle={class:"ob-themes"},xle=["aria-pressed"],Tle={class:"ob-theme-name"},Mle={class:"ob-theme-desc"},Ale=["aria-pressed"],Ele={class:"ob-theme-name"},$le={class:"ob-theme-desc"},Ile=Xe({__name:"Onboarding",props:{theme:{}},emits:["setTheme","complete","skip"],setup(e,{emit:t}){const n=e,s=t,{t:o,locale:i}=_t();function r(c){i.value!==c&&UC(c)}const l=te(n.theme);function a(){l.value!==n.theme&&s("setTheme",l.value),s("complete")}return(c,u)=>(x(),$("div",fle,[m("div",{class:"ob-card",role:"dialog","aria-modal":"true","aria-label":C(o)("onboarding.title")},[m("button",{type:"button",class:"ob-close","aria-label":C(o)("onboarding.skip"),onClick:u[0]||(u[0]=d=>s("skip"))},[...u[3]||(u[3]=[m("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[m("path",{d:"M4 4l8 8M12 4l-8 8"})],-1)])],8,ple),m("div",mle,[u[4]||(u[4]=m("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[m("defs",null,[m("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[m("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),m("g",{class:"ob-eyes",fill:"#000"},[m("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),m("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),m("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--blue)",mask:"url(#obKimiEyes)"})],-1)),m("div",null,[m("div",gle,O(C(o)("onboarding.title")),1),m("div",vle,O(C(o)("onboarding.subtitle")),1)])]),m("section",yle,[m("div",kle,O(C(o)("onboarding.languageLabel")),1),m("div",ble,[(x(!0),$(Pe,null,Ye(C(WC),d=>(x(),$("button",{key:d.code,type:"button",class:Oe(["ob-seg-btn",{on:C(i)===d.code}]),"aria-pressed":C(i)===d.code,onClick:f=>r(d.code)},O(d.label),11,_le))),128))])]),m("section",wle,[m("div",Sle,O(C(o)("onboarding.themeLabel")),1),m("div",Cle,[m("button",{type:"button",class:Oe(["ob-theme",{on:l.value==="modern"}]),"aria-pressed":l.value==="modern",onClick:u[1]||(u[1]=d=>l.value="modern")},[u[5]||(u[5]=m("span",{class:"ob-theme-prev modern","aria-hidden":"true"},[m("span",{class:"bub u"}),m("span",{class:"bub a"})],-1)),m("span",Tle,O(C(o)("theme.modern")),1),m("span",Mle,O(C(o)("onboarding.modernDesc")),1)],10,xle),m("button",{type:"button",class:Oe(["ob-theme",{on:l.value==="kimi"}]),"aria-pressed":l.value==="kimi",onClick:u[2]||(u[2]=d=>l.value="kimi")},[u[6]||(u[6]=m("span",{class:"ob-theme-prev kimi","aria-hidden":"true"},[m("span",{class:"kb u"}),m("span",{class:"kb a"})],-1)),m("span",Ele,O(C(o)("theme.kimi")),1),m("span",$le,O(C(o)("onboarding.kimiDesc")),1)],10,Ale)])]),m("button",{type:"button",class:"ob-start",onClick:a},O(C(o)("onboarding.start")),1)],8,hle)]))}}),Nle=vt(Ile,[["__scopeId","data-v-0527a631"]]),Lle=["aria-label"],Ole={class:"gload-box"},Ple={class:"gload-text"},Rle=Xe({__name:"GlobalLoading",setup(e){const{t}=_t();return(n,s)=>(x(),$("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[m("div",Ole,[s[0]||(s[0]=kr('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-d8748888><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-d8748888></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-d8748888></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-d8748888></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-d8748888></path></svg><div class="gload-bar" aria-hidden="true" data-v-d8748888><span class="gload-bar-fill" data-v-d8748888></span></div>',2)),m("div",Ple,O(C(t)("app.connecting")),1)])],8,Lle))}}),Dle=vt(Rle,[["__scopeId","data-v-d8748888"]]),Ble={class:"kap-root"},Fle={class:"kap-head"},Hle={class:"kap-count"},Wle={class:"kap-head-actions"},Ule={class:"kap-filters"},jle=["value"],qle={class:"kap-check"},zle={class:"kap-check"},Vle={class:"kap-view-toggle",role:"group"},Kle={key:0,class:"kap-empty"},Gle=["onClick"],Yle={class:"kap-ts"},Xle={class:"kap-label"},Zle={key:0,class:"kap-detail"},Jle={class:"kap-detail-actions"},Qle=["onClick"],eae={key:1,class:"kap-agg"},tae={class:"mono"},nae={class:"mono"},sae={class:"num"},oae={class:"num"},iae={key:0},rae={class:"mono"},lae={class:"num"},aae={class:"num"},cae={key:0},uae=Xe({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=te("all"),o=te(""),i=te(""),r=te(!1),l=te("timeline"),a=F(()=>(Kv.value,[...Kte()])),c=F(()=>{const A=new Set;for(const I of a.value)I.sessionId&&A.add(I.sessionId);return[...A].sort()});function u(A){return A.kind==="rest:error"||A.code!==void 0&&A.code!==0||A.eventType==="error"||A.eventType==="parse-error"}const d=F(()=>{const A=o.value.trim().toLowerCase();return a.value.filter(I=>!(s.value!=="all"&&I.source!==s.value||i.value&&I.sessionId!==i.value||r.value&&!u(I)||A&&!`${I.label} ${I.kind} ${I.eventType??""} ${I.sessionId??""} ${I.requestId??""}`.toLowerCase().includes(A)))}),f=F(()=>{const A=new Map;for(const I of d.value){if(I.kind!=="ws:in"&&I.kind!=="ws:out")continue;const P=I.kind==="ws:in"?"←":"→",M=`${P} ${I.eventType??"?"} @ ${I.sessionId??"-"}`,L=A.get(M)??{key:M,sessionId:I.sessionId??"-",eventType:I.eventType??"?",dir:P,count:0};L.count++,I.seq!==void 0&&(L.lastSeq=I.seq),A.set(M,L)}return[...A.values()].sort((I,P)=>P.count-I.count)}),h=F(()=>{const A=new Map;for(const I of d.value){if(I.source!=="rest"||I.kind==="rest:request")continue;const P=`${I.method??"?"} ${I.path??"?"}`,M=A.get(P)??{count:0,errors:0,totalMs:0,timed:0};M.count++,u(I)&&M.errors++,I.durationMs!==void 0&&(M.totalMs+=I.durationMs,M.timed++),A.set(P,M)}return[...A.entries()].map(([I,P])=>({key:I,count:P.count,errors:P.errors,avgMs:P.timed>0?Math.round(P.totalMs/P.timed):0})).sort((I,P)=>P.count-I.count)}),p=te(null),g=te(!0),S=te(null),_=te(null);Ve(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await ft();const A=S.value;A&&(A.scrollTop=A.scrollHeight)});function y(A){p.value=p.value===A?null:A}function b(A){const I=new Date(A),P=(M,L=2)=>String(M).padStart(L,"0");return`${P(I.getHours())}:${P(I.getMinutes())}:${P(I.getSeconds())}.${P(I.getMilliseconds(),3)}`}function v(A){return JSON.stringify(A,null,2)}async function w(A){await Ss(v(A))&&(_.value=A.id,setTimeout(()=>{_.value===A.id&&(_.value=null)},1500))}function N(){$M(d.value)}function E(A){return u(A)||A.source==="client"?"b-err":A.source==="rest"?"b-rest":A.kind==="ws:lifecycle"?"b-life":A.kind==="ws:out"?"b-out":"b-in"}function k(A){return A.source==="rest"?"REST":A.source==="client"?"APP":"WS"}return(A,I)=>(x(),$("section",Ble,[m("header",Fle,[I[11]||(I[11]=m("strong",null,"KAP debug",-1)),m("span",Hle,O(d.value.length)+"/"+O(a.value.length),1),m("div",Wle,[m("button",{type:"button",class:Oe({on:C(pc)}),onClick:I[0]||(I[0]=P=>pc.value=!C(pc))},O(C(pc)?"resume":"pause"),3),m("button",{type:"button",onClick:I[1]||(I[1]=P=>C(Gte)())},"clear"),m("button",{type:"button",onClick:I[2]||(I[2]=P=>N())},"export jsonl"),m("button",{type:"button",title:"Close window",onClick:I[3]||(I[3]=P=>n("close"))},"✕")])]),m("div",Ule,[Ot(m("select",{"onUpdate:modelValue":I[4]||(I[4]=P=>s.value=P),"aria-label":"Source filter"},[...I[12]||(I[12]=[m("option",{value:"all"},"rest + ws + app",-1),m("option",{value:"rest"},"rest",-1),m("option",{value:"ws"},"ws",-1),m("option",{value:"client"},"app errors",-1)])],512),[[uf,s.value]]),Ot(m("select",{"onUpdate:modelValue":I[5]||(I[5]=P=>i.value=P),"aria-label":"Session filter"},[I[13]||(I[13]=m("option",{value:""},"all sessions",-1)),(x(!0),$(Pe,null,Ye(c.value,P=>(x(),$("option",{key:P,value:P},O(P),9,jle))),128))],512),[[uf,i.value]]),Ot(m("input",{"onUpdate:modelValue":I[6]||(I[6]=P=>o.value=P),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[xn,o.value]]),m("label",qle,[Ot(m("input",{"onUpdate:modelValue":I[7]||(I[7]=P=>r.value=P),type:"checkbox"},null,512),[[cf,r.value]]),I[14]||(I[14]=dt(" errors",-1))]),m("label",zle,[Ot(m("input",{"onUpdate:modelValue":I[8]||(I[8]=P=>g.value=P),type:"checkbox"},null,512),[[cf,g.value]]),I[15]||(I[15]=dt(" follow",-1))]),m("div",Vle,[m("button",{type:"button",class:Oe({on:l.value==="timeline"}),onClick:I[9]||(I[9]=P=>l.value="timeline")},"timeline",2),m("button",{type:"button",class:Oe({on:l.value==="aggregate"}),onClick:I[10]||(I[10]=P=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(x(),$("div",{key:0,ref_key:"listRef",ref:S,class:"kap-list"},[d.value.length===0?(x(),$("div",Kle," No trace entries yet. REST calls and WS frames will appear here. ")):ie("",!0),(x(!0),$(Pe,null,Ye(d.value,P=>(x(),$("div",{key:P.id,class:"kap-row-wrap"},[m("button",{type:"button",class:Oe(["kap-row",{expanded:p.value===P.id}]),onClick:M=>y(P.id)},[m("span",Yle,O(b(P.ts)),1),m("span",{class:Oe(["kap-badge",E(P)])},O(k(P)),3),m("span",Xle,O(P.label),1)],10,Gle),p.value===P.id?(x(),$("div",Zle,[m("div",Jle,[m("button",{type:"button",onClick:M=>w(P)},O(_.value===P.id?"copied ✓":"copy json"),9,Qle)]),m("pre",null,O(v(P)),1)])):ie("",!0)]))),128))],512)):(x(),$("div",eae,[I[20]||(I[20]=m("h4",null,"WS frames by session / type",-1)),m("table",null,[I[17]||(I[17]=m("thead",null,[m("tr",null,[m("th",null,"dir"),m("th",null,"type"),m("th",null,"session"),m("th",null,"count"),m("th",null,"last seq")])],-1)),m("tbody",null,[(x(!0),$(Pe,null,Ye(f.value,P=>(x(),$("tr",{key:P.key},[m("td",null,O(P.dir),1),m("td",tae,O(P.eventType),1),m("td",nae,O(P.sessionId),1),m("td",sae,O(P.count),1),m("td",oae,O(P.lastSeq??"—"),1)]))),128)),f.value.length===0?(x(),$("tr",iae,[...I[16]||(I[16]=[m("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ie("",!0)])]),I[21]||(I[21]=m("h4",null,"REST by endpoint",-1)),m("table",null,[I[19]||(I[19]=m("thead",null,[m("tr",null,[m("th",null,"endpoint"),m("th",null,"count"),m("th",null,"errors"),m("th",null,"avg ms")])],-1)),m("tbody",null,[(x(!0),$(Pe,null,Ye(h.value,P=>(x(),$("tr",{key:P.key},[m("td",rae,O(P.key),1),m("td",lae,O(P.count),1),m("td",{class:Oe(["num",{err:P.errors>0}])},O(P.errors),3),m("td",aae,O(P.avgMs),1)]))),128)),h.value.length===0?(x(),$("tr",cae,[...I[18]||(I[18]=[m("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ie("",!0)])])]))]))}}),dae=vt(uae,[["__scopeId","data-v-79eb55ae"]]),fae=["title"],hae=Xe({__name:"DebugPanel",setup(e){const t=te(!1);let n=null,s=null,o=null;const i=["data-theme","data-color-scheme","data-accent"];function r(u){const d=document.documentElement,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(){o?.disconnect(),o=null;try{s?.unmount()}catch{}s=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=df(dae,{onClose:()=>u.close()});f.mount(d),s=f,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return Qt(()=>{c()}),Ks(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(x(),$("button",{class:"kap-fab",type:"button",title:t.value?"Focus KAP debug window":"Open KAP debug window",onClick:c}," KAP ",8,fae))}}),pae=vt(hae,[["__scopeId","data-v-0a50ee88"]]);function NM(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 y1(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 mae(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 ni(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:y1(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:NM(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function Wf(e){return{id:e.id,root:e.root,name:e.name,isGitRepo:e.is_git_repo,branch:e.branch??void 0,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function a2(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 Gv(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:a2(e.source)};case"video":return{type:"video",source:a2(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 k1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Gv),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function gae(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 vae(e){return{content:e.content.map(gae),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 yae(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function LM(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 kae(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function bae(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(kae),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function OM(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(bae),createdAt:e.created_at}}function _ae(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 wae(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=_ae(s);return{answers:t,method:e.method,note:e.note}}function b1(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index}}function c2(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 tr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function jl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function wo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Sae(e){if(!e||typeof e!="object")return null;const t=e,n=tr(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:tr(t,"goalId")??tr(t,"goal_id")??"goal",objective:tr(t,"objective")??"",completionCriterion:tr(t,"completionCriterion")??tr(t,"completion_criterion"),status:n,turnsUsed:jl(t,"turnsUsed")??jl(t,"turns_used")??0,tokensUsed:jl(t,"tokensUsed")??jl(t,"tokens_used")??0,wallClockMs:jl(t,"wallClockMs")??jl(t,"wall_clock_ms")??0,terminalReason:tr(t,"terminalReason")??tr(t,"terminal_reason"),budget:{tokenBudget:wo(o,"tokenBudget")??wo(o,"token_budget"),remainingTokens:wo(o,"remainingTokens")??wo(o,"remaining_tokens"),turnBudget:wo(o,"turnBudget")??wo(o,"turn_budget"),remainingTurns:wo(o,"remainingTurns")??wo(o,"remaining_turns"),wallClockBudgetMs:wo(o,"wallClockBudgetMs")??wo(o,"wall_clock_budget_ms"),remainingWallClockMs:wo(o,"remainingWallClockMs")??wo(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Cae(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:ni(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:ni(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:Wf(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Wf(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.status_changed":return{type:"sessionStatusChanged",sessionId:t.session_id,status:y1(t.payload.status),previousStatus:y1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:NM(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=Sae(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:k1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Gv),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:LM(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:OM(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:b1(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:_1(t.payload.config)};default:return{type:"unknown",raw:e}}}function xae(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function Gm(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 _1(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultThinking:e.default_thinking,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function Tae(e){return e.session_id}function Mae(e){return e.seq}const Aae="main",Eae=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 rr(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 $ae(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 u2(){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 eo(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Xr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function So(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Iae(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=eo(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=eo(t,"goalId")??eo(t,"goal_id")??"goal",r=eo(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:eo(t,"completionCriterion")??eo(t,"completion_criterion"),status:o,turnsUsed:Xr(t,"turnsUsed")??Xr(t,"turns_used")??0,tokensUsed:Xr(t,"tokensUsed")??Xr(t,"tokens_used")??0,wallClockMs:Xr(t,"wallClockMs")??Xr(t,"wall_clock_ms")??0,terminalReason:eo(t,"terminalReason")??eo(t,"terminal_reason"),budget:{tokenBudget:So(s,"tokenBudget")??So(s,"token_budget"),remainingTokens:So(s,"remainingTokens")??So(s,"remaining_tokens"),turnBudget:So(s,"turnBudget")??So(s,"turn_budget"),remainingTurns:So(s,"remainingTurns")??So(s,"remaining_turns"),wallClockBudgetMs:So(s,"wallClockBudgetMs")??So(s,"wall_clock_budget_ms"),remainingWallClockMs:So(s,"remainingWallClockMs")??So(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function mc(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function Nae(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=eo(t,"name")??eo(t,"toolName")??"tool",s=gf(Lae(n)),o=Oae(n,t.args??t.input);return o?`Calling ${s}: ${o}`:`Calling ${s}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=eo(n,"text");if(o)return Ym(o);const i=eo(n,"message");if(i)return Ym(i)}const s=eo(t,"message");if(s)return Ym(s)}return null}function Lae(e){return e.replace(/_\d+$/,"")}const d2=2e3;function Ym(e){return e.length>d2?`${e.slice(0,d2)}…`:e}function Oae(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Ag(e,n)}function Pae(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];const r=Nae(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=mc(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 _d(e){return{...e,content:e.content.map(t=>({...t}))}}function f2(e,t,n){const s={id:rr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function Rae(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function Dae(e){return Array.isArray(e)?e.map(t=>Gv(t)):[]}function h2(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function Bae(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function Fae(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:o}:null}function p2(e,t){e.messages.find(n=>n.id===t)}function Hae(e,t,n,s,o,i){const r={id:rr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function Xm(e,t){return e.messages.find(n=>n.id===t)}function m2(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 Wae(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=u2(),e.set(u,d)),d}function s(u){e.set(u,u2())}function o(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){s(u);const f=n(u),h=d.promptId??rr("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=f2(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 g of d.runningTools){const S=typeof g.lastProgress?.text=="string"&&g.lastProgress.text.length>0?[g.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:g.toolCallId,toolName:g.name,input:g.args??{},outputLines:S}),f.toolStartTimes.set(g.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:_d(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),g=d,S=[],_=g?.agentId;if(typeof _=="string"&&_!==Aae){const y=t.has(_);if(y&&(u==="thinking.delta"||u==="assistant.delta")){const b=g?.delta??"";return b?[{type:"agentDelta",sessionId:f,agentId:_,delta:{[u==="thinking.delta"?"thinking":"text"]:b}}]:[]}if(y&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:_,reason:g?.reason}];if(Eae.has(u))return Pae(p,f,_,u,g??{},t)}switch(u){case"session.meta.updated":{const y=g?.patch?.title??g?.title,b=g?.patch?.lastPrompt,v={};typeof y=="string"&&y.length>0&&(v.title=y),typeof b=="string"&&(v.lastPrompt=b),(v.title!==void 0||v.lastPrompt!==void 0)&&S.push({type:"sessionMetaUpdated",sessionId:f,...v});break}case"prompt.submitted":{const y=g?.promptId,b=g?.userMessageId;if(!y||!b)break;const v=Dae(g?.content);if(v.length===0)break;p.currentPromptId=y;const w=Rae(p,f,y,b,v,typeof g?.createdAt=="string"?g.createdAt:new Date().toISOString());S.push({type:"messageCreated",message:_d(w)});break}case"turn.started":{const y=g?.turnId,b=p.currentPromptId??rr("pr_");p.currentPromptId=b,y!==void 0&&p.turnPromptId.set(y,b),p.turnTextLen=0,p.turnThinkLen=0,S.push({type:"sessionStatusChanged",sessionId:f,status:"running",previousStatus:"idle",currentPromptId:b});break}case"turn.step.started":{const y=g?.turnId;let b=p.turnPromptId.get(y)??p.currentPromptId;b||(b=rr("pr_"),p.currentPromptId=b,y!==void 0&&p.turnPromptId.set(y,b));const v=f2(p,f,b);p.currentAssistantMsgId=v.id,S.push({type:"messageCreated",message:_d(v)});break}case"thinking.delta":{const y=p.currentAssistantMsgId;if(!y)break;const b=g?.delta??"";if(!b)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const v=a(p.turnThinkLen,h?.offset);if(v==="skip")break;if(v==="gap"){S.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const w=h2(p,y,"thinking",b);if(w<0)break;p.turnThinkLen+=b.length,S.push({type:"assistantDelta",sessionId:f,messageId:y,contentIndex:w,delta:{thinking:b}});break}case"assistant.delta":{const y=p.currentAssistantMsgId;if(!y)break;const b=g?.delta??"";if(!b)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const v=a(p.turnTextLen,h?.offset);if(v==="skip")break;if(v==="gap"){S.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const w=h2(p,y,"text",b);if(w<0)break;p.turnTextLen+=b.length,S.push({type:"assistantDelta",sessionId:f,messageId:y,contentIndex:w,delta:{text:b}});break}case"tool.use":case"tool.call.started":{const y=p.currentAssistantMsgId,b=g?.turnId,v=p.turnPromptId.get(b)??p.currentPromptId;if(!y||!v)break;const w=g?.toolCallId,N=g?.name??g?.toolName??"",E=g?.args??g?.input??{};Bae(p,y,w,N,E);const k=Xm(p,y);k&&k.content.length-1,p.toolStartTimes.set(w,Date.now()),k&&S.push({type:"messageUpdated",sessionId:f,messageId:y,content:k.content.map(A=>({...A})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const y=g?.toolCallId,b=Fae(g??{});y&&b&&S.push({type:"toolOutput",sessionId:f,toolCallId:y,outputChunk:b.outputChunk,stream:b.stream});break}case"tool.result":{const y=g?.turnId;let b=p.turnPromptId.get(y)??p.currentPromptId;b||(b=rr("pr_"),p.currentPromptId=b,y!==void 0&&p.turnPromptId.set(y,b));const v=g?.toolCallId,w=g?.output,N=g?.isError??!1;p.toolStartTimes.get(v)??Date.now(),p.toolStartTimes.delete(v);const E=Hae(p,f,v,w,N,b);S.push({type:"messageCreated",message:_d(E)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const y=p.currentAssistantMsgId,b=$ae(g?.usage);if(p.totalInput+=b.input,p.totalOutput+=b.output,p.totalCacheRead+=b.cacheRead,p.totalCacheCreate+=b.cacheCreate,y){p2(p,y);const v=Xm(p,y);v&&S.push({type:"messageUpdated",sessionId:f,messageId:y,content:v.content.map(w=>({...w})),status:"completed"})}break}case"agent.status.updated":{g?.model&&(p.model=g.model),g?.contextTokens!==void 0&&(p.contextTokens=g.contextTokens),g?.maxContextTokens!==void 0&&(p.contextLimit=g.maxContextTokens),S.push({type:"sessionUsageUpdated",sessionId:f,usage:m2(p),model:p.model||void 0,swarmMode:g?.swarmMode===!0?!0:g?.swarmMode===!1?!1:void 0,planMode:g?.planMode===!0?!0:g?.planMode===!1?!1:void 0});break}case"turn.ended":{const y=p.currentAssistantMsgId,b=g?.reason??"completed",v=Xr(g??{},"durationMs");if(y){p2(p,y);const E=Xm(p,y);E&&S.push({type:"messageUpdated",sessionId:f,messageId:y,content:E.content.map(k=>({...k})),status:b==="failed"||b==="filtered"?"error":"completed",durationMs:v})}p.turnCount++;const w=m2(p);S.push({type:"sessionUsageUpdated",sessionId:f,usage:w});const N=b==="cancelled"||b==="failed"||b==="filtered"?"aborted":"idle";S.push({type:"sessionStatusChanged",sessionId:f,status:N,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 b={id:typeof g?.subagentId=="string"&&g.subagentId.length>0?g.subagentId:rr("task_"),sessionId:f,kind:"subagent",description:typeof g?.description=="string"?g.description:g?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof g?.subagentName=="string"?g.subagentName:void 0,parentToolCallId:typeof g?.parentToolCallId=="string"?g.parentToolCallId:void 0,swarmIndex:typeof g?.swarmIndex=="number"?g.swarmIndex:void 0};p.subagentMeta.set(b.id,b),S.push({type:"taskCreated",sessionId:f,task:b});break}case"subagent.started":{const y=mc(p,f,g?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});y&&S.push({type:"taskCreated",sessionId:f,task:y});break}case"subagent.suspended":{const y=mc(p,f,g?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof g?.reason=="string"?g.reason:void 0});y&&S.push({type:"taskCreated",sessionId:f,task:y});break}case"subagent.completed":{const y=typeof g?.resultSummary=="string"?g.resultSummary:void 0,b=mc(p,f,g?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:y});b&&S.push({type:"taskCreated",sessionId:f,task:b}),S.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"completed",outputPreview:y});break}case"subagent.failed":{const y=typeof g?.error=="string"?g.error:void 0,b=mc(p,f,g?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:y});b&&S.push({type:"taskCreated",sessionId:f,task:b}),S.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"failed",outputPreview:y});break}case"error":{S.push({type:"unknown",raw:{_agentError:!0,code:g?.code,message:g?.message}});break}case"warning":{S.push({type:"unknown",raw:{_agentWarning:!0,message:g?.message}});break}case"background.task.started":{const y=g?.info??{},b=typeof y.startedAt=="number"?new Date(y.startedAt).toISOString():void 0,v=typeof y.taskId=="string"?y.taskId:typeof y.taskId=="number"?String(y.taskId):rr("task_"),w=typeof y.description=="string"?y.description:typeof y.command=="string"?y.command:Nn.global.t("tasks.defaultDescription"),N=typeof y.command=="string"?y.command:void 0;S.push({type:"taskCreated",sessionId:f,task:{id:v,sessionId:f,kind:"bash",description:w,command:N,status:"running",createdAt:b??new Date().toISOString(),startedAt:b,outputPreview:N!==void 0?`$ ${N}`:void 0}});break}case"background.task.terminated":{const y=g?.info??{},b=y.status==="failed"||typeof y.exitCode=="number"&&y.exitCode!==0;S.push({type:"taskCompleted",sessionId:f,taskId:typeof y.taskId=="string"?y.taskId:typeof y.taskId=="number"?String(y.taskId):"",status:b?"failed":"completed"});break}case"compaction.completed":{const y=g?.result??{};S.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof y.tokensBefore=="number"?y.tokensBefore:void 0,tokensAfter:typeof y.tokensAfter=="number"?y.tokensAfter:void 0,summary:typeof y.summary=="string"?y.summary:void 0}),S.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{S.push({type:"compactionStarted",sessionId:f,trigger:g?.trigger==="manual"?"manual":"auto",instruction:typeof g?.instruction=="string"?g.instruction:void 0});break}case"compaction.cancelled":{S.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const y=Iae(g?.snapshot??null);S.push({type:"goalUpdated",sessionId:f,goal:y?.status==="complete"?null:y});break}}return S}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const Uae=new Set(["server_hello","ack","ping","resync_required","error","pong"]),g2=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"]),jae=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"]),qae=new Set(["assistant.delta","thinking.delta"]);function zae(e,t){if(Uae.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return qae.has(s)?Vae(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?jae.has(s)?{route:"protocol"}:g2.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:g2.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function Vae(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 w1 extends Error{code;requestId;details;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details}}class gc extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview}}function yu(e){return e instanceof w1||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function PM(e){return e instanceof gc||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const Yv="kimi-web.server-credential",Kae="token";let su;const S1=new Set;function Gae(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Kae);if(!n)return;const s=new URL(window.location.href);return s.hash="",window.history.replaceState(window.history.state,"",`${s.pathname}${s.search}`),n}function Yae(){try{return globalThis.sessionStorage?.getItem(Yv)??void 0}catch{return}}function Xae(){const e=Gae();return e?(DM(e),!0):(su=Yae(),su!==void 0)}function RM(){return su}function DM(e){su=e;try{globalThis.sessionStorage?.setItem(Yv,e)}catch{}}function Zae(){su=void 0;try{globalThis.sessionStorage?.removeItem(Yv)}catch{}}function Jae(e){return S1.add(e),()=>{S1.delete(e)}}function Qae(){Zae();for(const e of S1)try{e()}catch{}}const vc=3e4,BM="0123456789ABCDEFGHJKMNPQRSTVWXYZ",v2=500,ece=40101;function y2(){try{return AbortSignal.timeout(vc)}catch{return}}function tce(e,t){let n="",s=e;for(let o=0;o<t;o++)n=BM[s%32]+n,s=Math.floor(s/32);return n}function nce(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=>BM[n%32]).join("")}function k2(){return`${tce(Date.now(),10)}${nce(16)}`}function sce(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function b2(e){try{const t=await e.text();return t?t.length>v2?`${t.slice(0,v2)}...`:t:void 0}catch{return}}class oce{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=mf(this.origin,t),o=k2(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();o2({method:"POST",path:t,url:s,requestId:o,body:sce(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:y2()})}catch(u){throw bd({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new gc({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:vc})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw bd({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new gc({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:vc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await b2(c)})}if(i2({method:"POST",path:t,requestId:o,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new w1({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,s,o,i=[]){let r=mf(this.origin,n);if(o){const h=new URLSearchParams;for(const[g,S]of Object.entries(o))S!==void 0&&h.set(g,String(S));const p=h.toString();p&&(r=`${r}?${p}`)}const l=k2(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();o2({method:t,path:n,url:r,requestId:l,body:s});let u;try{u=await fetch(r,{method:t,headers:a,body:s!==void 0?JSON.stringify(s):void 0,signal:y2()})}catch(h){throw bd({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new gc({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:vc})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw bd({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new gc({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:vc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await b2(f)})}if(i2({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 w1({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details});return d.data}addClientHeaders(t){const n=RM();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===ece)&&Qae()}}const ice="kimi-code.bearer.";class rce{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;Ul("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=RM(),n=t!==void 0?[`${ice}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{Ul("open")},s.onmessage=o=>{try{const i=JSON.parse(String(o.data));Xte(i),this.handleFrame(i)}catch(i){Ul("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{Ul("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{Ul("close",o?{code:o.code,reason:o.reason,wasClean:o.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,Ul("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(s=>s.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,s){const o=wd(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(wd(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(wd(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}handleFrame(t){const n=t;switch(t.type){case"server_hello":this.onServerHello();break;case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,o=n.terminal_id,i=n.seq,r=wd(s,o),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=zae(s,n.payload);if(o.route==="protocol"){this.handlers.onWireEvent(n);break}if(o.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:o.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const s of this.pendingSubscriptions)this.subscriptions.set(s.sessionId,s.cursor),t.includes(s.sessionId)||t.push(s.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[s,o]of this.subscriptions.entries())n[s]=o;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const s of this.terminalAttachments.values())this.sendTerminalAttach(s.sessionId,s.terminalId,s.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,s){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:s>0?s:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,s=t.seq;if(typeof n!="string"||typeof s!="number")return;const o=this.subscriptions.get(n);if(!o||s<=o.seq&&o.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(s,o.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Yte(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function wd(e,t){return`${e}\0${t}`}function Zm(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 _2(e){return e==="auto_compact"||e==="manual_compact"}class lce{http;config;constructor(t){this.config=t,this.http=new oce(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?mae(t.status):void 0,include_archive:t?.includeArchive,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(ni),hasMore:s.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const s=await this.http.post("/sessions",n);return ni(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return ni(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return ni(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingLevel:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async 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 s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(k1),hasMore:o.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:ni(n.session),messages:n.messages.items.map(k1),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(LM),pendingQuestions:n.pending_questions.map(OM)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,vae(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return ni(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return ni(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(ni)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,yae(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,wae(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const s={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,s)).items.map(b1)}async getTask(t,n,s){const o={with_output:s?.withOutput,output_bytes:s?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return b1(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(Zm)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return Zm(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Zm(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(c2)])):void 0;return{items:o.items.map(c2),childrenByPath:i,truncated:o.truncated}}async readFile(t,n){const s={path:n.path};n.offset!==void 0&&(s.offset=n.offset),n.length!==void 0&&(s.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,s);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const s={query:n.query};n.limit!==void 0&&(s.limit=n.limit);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,s);return{items:o.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const s={pattern:n.pattern};n.regex!==void 0&&(s.regex=n.regex),n.caseSensitive!==void 0&&(s.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,s);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const s={};n!==void 0&&(s.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,s);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:s.path,diff:s.diff}}getFileDownloadUrl(t,n){const s=n.split("/").map(o=>encodeURIComponent(o)).join("/");return mf(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${s}:download`)}async openFile(t,n){const s={path:n.path};return n.line!==void 0&&(s.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,s)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,s,o){const i={app_id:n,path:s};o!==void 0&&(i.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Wf)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const s=await this.http.post("/workspaces",n);return Wf(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(xae)}async listProviders(){return(await this.http.get("/providers")).items.map(Gm)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const s=await this.http.post("/providers",n);return Gm(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return Gm(n)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return{changed:t.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.unchanged,failed:t.failed}}async getConfig(){const t=await this.http.get("/config");return _1(t)}async setConfig(t){const n={},s={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultThinking:"default_thinking",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return _1(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return mf(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=S6(this.config.serverHttpUrl,this.config.clientId),s=Wae(),o=new rce(n,this.config.clientId,{onWireEvent:i=>{const r=Tae(i),l=Mae(i),a=Cae(i);a.type==="historyCompacted"&&!_2(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const f of d)f.type==="historyCompacted"&&!_2(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},close(){o.close()}}}}let w2;function rt(){return w2??=new lce(y6()),w2}function ace(e){const t=new Map,n=new Set;function s(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&s(i)});return t.set(i,l),l}function o(i){if(t.has(i)){n.add(i);return}s(i)}return{run:s,request:o}}const cce=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function uce(e){return cce.has(e.type)}function dce(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function fce(e,t,n=dce){let s=[],o=null;const i=()=>{if(o=null,s.length===0)return;const l=s;s=[];for(const a of l)e(a)},r=(l=>{if(t(l)){s.push(l),o===null&&(o=n(i));return}i(),e(l)});return r.flush=i,r}const FM=["blue","mono"],HM=["light","dark","system"],WM=15,hce=12,pce=20;function mce(){const e=An(Et.accent);return e&&FM.includes(e)?e:"blue"}function gce(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function vce(){const e=An(Et.colorScheme);return e&&HM.includes(e)?e:"system"}function yce(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(s=>{const i=(s.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";s.setAttribute("content",n??i)})}function kce(){const e=An(Et.theme);return e==="terminal"||e==="modern"||e==="kimi"?e:"modern"}function bce(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.theme=e)}function Xv(e){return Number.isFinite(e)?Math.min(pce,Math.max(hce,Math.round(e))):WM}function _ce(){const e=An(Et.uiFontSize);return e===null?WM:Xv(Number(e))}function wce(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${Xv(e)}px`)}const Rh=te(kce()),Zv=te(vce()),Jv=te(mce()),Qv=te(_ce());Ve(Rh,bce,{immediate:!0});Ve(Zv,yce,{immediate:!0});Ve(Jv,gce,{immediate:!0});Ve(Qv,wce,{immediate:!0});function UM(e){e!=="terminal"&&e!=="modern"&&e!=="kimi"||(Rh.value=e,Pn(Et.theme,e))}function Sce(){UM(Rh.value==="modern"?"terminal":"modern")}function Cce(e){HM.includes(e)&&(Zv.value=e,Pn(Et.colorScheme,e))}function xce(e){FM.includes(e)&&(Jv.value=e,Pn(Et.accent,e))}function Tce(e){const t=Xv(e);Qv.value=t,Pn(Et.uiFontSize,String(t))}const Mce=600,Ace=250,Dh=250,Ece=1e3,$ce=160,Uf=te(!1);let el=[],sl=null,jf=-Dh;function Ice(){el=[],jf=-Dh,Uf.value=!1,sl!==null&&(clearTimeout(sl),sl=null)}function Nce(){Uf.value=!0,sl!==null&&clearTimeout(sl),sl=setTimeout(()=>{sl=null,el=[],jf=-Dh,Uf.value=!1},Ece)}function Lce(e){if(e<=0)return;const t=Date.now();el.push({time:t,chars:e});const n=t-Mce;if(el=el.filter(l=>l.time>=n),t-jf<Dh)return;jf=t;const s=el[0]?.time??t,o=Math.max(t-s,Ace);el.reduce((l,a)=>l+a.chars,0)/o*1e3>=$ce&&Nce()}function Oce(){return{theme:Rh,colorScheme:Zv,accent:Jv,uiFontSize:Qv,fastMoon:Uf,setTheme:UM,toggleTheme:Sce,setColorScheme:Cce,setAccent:xce,setUiFontSize:Tce,resetFastMoon:Ice,recordMoonDelta:Lce}}function Pce(){const e=An(Et.notifyOnComplete);return e===null?!0:e==="1"}const qf=te(Pce()),e0=te(typeof Notification<"u"?Notification.permission:"denied");async function Rce(e){if(!e){qf.value=!1,Pn(Et.notifyOnComplete,"0");return}if(typeof Notification>"u")return;let t=Notification.permission;if(t==="default")try{t=await Notification.requestPermission()}catch{}e0.value=t,t==="granted"&&(qf.value=!0,Pn(Et.notifyOnComplete,"1"))}function Dce(e,t){if(!qf.value||typeof Notification>"u")return;const n=Notification.permission;if(n!=="denied"){if(n==="default"){Notification.requestPermission().then(s=>{e0.value=s,s==="granted"&&S2(e,t)});return}S2(e,t)}}function S2(e,t){if(t.isActiveAndVisible)return;const n=t.sessionTitle.trim()||"Kimi Code";try{const s=new Notification(n,{body:Nn.global.t("settings.notifyBody"),tag:`kimi-complete-${e}`});s.onclick=()=>{try{window.focus()}catch{}t.onClick(),s.close()}}catch{}}function Bce(){return{notifyOnComplete:qf,notifyPermission:e0,setNotifyOnComplete:Rce,maybeNotifyCompletion:Dce}}function C2(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const Fce=1e3,Hce=4096,x2=32*1024;function Wce(e,t){let n=null,s;const o=new Set;async function i(f){try{const p=await rt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:C2(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]??[],g=rt(),S=new Map;if(await Promise.all(p.map(async y=>{if((y.status==="completed"||y.status==="failed"||y.status==="cancelled")&&!o.has(y.id)&&!((y.outputLines?.length??0)>0))try{const v=await g.getTask(f,y.id,{withOutput:!0,outputBytes:x2});v.outputPreview!==void 0&&S.set(y.id,{preview:v.outputPreview,bytes:v.outputBytes})}catch{}finally{o.add(y.id)}})),S.size===0)return;const _=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:_.map(y=>{const b=S.get(y.id);return b?{...y,outputPreview:b.preview,outputBytes:b.bytes}:y})}}async function l(f){if(e.activeSessionId!==f)return;const h=rt();let p;try{p=await h.listTasks(f)}catch{return}const g=new Map;await Promise.all(p.map(async b=>{const v=b.status==="running",w=b.status==="completed"||b.status==="failed"||b.status==="cancelled";if(!(!v&&!w)&&!(w&&(o.has(b.id)||(b.outputLines?.length??0)>0)))try{const N=await h.getTask(f,b.id,{withOutput:!0,outputBytes:v?Hce:x2});N.outputPreview!==void 0&&g.set(b.id,{preview:N.outputPreview,bytes:N.outputBytes})}catch{}finally{w&&o.add(b.id)}}));const S=e.tasksBySession[f]??[],_=new Map(S.map(b=>[b.id,b])),y=p.map(b=>{const v=_.get(b.id),w=g.get(b.id);return{...b,outputLines:v?.outputLines,outputPreview:w?.preview??v?.outputPreview,outputBytes:w?.bytes??v?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:C2(y,S)}}function a(f){n!==null&&s===f||(c(),s=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},Fce))}function c(){n!==null&&(clearInterval(n),n=null),s=void 0,o.clear()}const u=te(0);let d=null;return Ve(()=>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}),Ve(()=>{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,g)=>{let S;h&&f!==void 0?a(f):f!==void 0?S=setTimeout(()=>{(e.tasksBySession[f]??[]).some(y=>y.status==="running")||c()},1500):c(),g(()=>{S!==void 0&&clearTimeout(S)})},{deep:!0,immediate:!0}),{taskClock:F(()=>u.value),loadTasksForSession:i}}const jM=Et.starredModels;function Uce(){try{const e=An(jM);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function jce(e){try{Pn(jM,JSON.stringify(e))}catch{}}function qce(e,t){const{pushOperationFailure:n,refreshSessionStatus:s,persistSessionProfile:o,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=te([]),d=te(Uce()),f=te({}),h=te([]),p=te(null);function g(W){if(!(W==null||W.length===0))return u.value.find(K=>K.id===W||K.model===W)}function S(){const W=e.activeSessionId?e.sessions.find(K=>K.id===e.activeSessionId):void 0;return g(W?.model??p.value??e.defaultModel)}function _(W){const K=Yw(S(),W);return e.thinking=K,l(K),K}async function y(W){try{const V=await rt().listSkills(W);f.value={...f.value,[W]:V}}catch{}}async function b(){try{const W=rt();u.value=await W.listModels(),_(e.thinking)}catch(W){n("loadModels",W)}}async function v(){try{const W=await rt().refreshOAuthProviderModels();for(const K of W.failed)n("refreshOAuthProviderModels",new Error(K.reason),{message:K.provider})}catch{}}async function w(){try{const W=rt();h.value=await W.listProviders()}catch(W){n("loadProviders",W)}}async function N(W){const K=e.activeSessionId,V=Yw(g(W),e.thinking),se=e.thinking;if(!K){p.value=W,_(V);return}const Y=e.sessions.find(G=>G.id===K)?.model;a(K,G=>({...G,model:W})),V!==se&&(e.thinking=V,l(V));try{await rt().updateSession(K,{model:W,thinking:V!==se?V:void 0})}catch(G){a(K,ee=>({...ee,model:Y??ee.model})),V!==se&&(e.thinking=se,l(se)),n("setModel",G,{sessionId:K});return}await s(K)}function E(W){const K=new Set(d.value);K.has(W)?K.delete(W):K.add(W),d.value=Array.from(K),jce(d.value)}async function k(W,K){const V=e.activeSessionId;if(!V)return;const se=i.value==="idle"&&!r.has(V),Y=`msg_skill_opt_${Date.now().toString(36)}`;if(se){r.add(V),e.sendingBySession={...e.sendingBySession,[V]:!0};const G={id:Y,sessionId:V,role:"user",content:[{type:"text",text:`/${W}${K?` ${K}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:W,skillArgs:K}}};c(V,ee=>[...ee,G])}try{await rt().activateSkill(V,W,K)}catch(G){se&&(r.delete(V),e.sendingBySession={...e.sendingBySession,[V]:!1},c(V,ee=>ee.filter(we=>we.id!==Y))),n("activateSkill",G,{sessionId:V})}}async function A(W){try{await rt().addProvider(W),await Promise.all([w(),b()])}catch(K){n("addProvider",K)}}async function I(W){try{await rt().deleteProvider(W),await Promise.all([w(),b()])}catch(K){n("deleteProvider",K)}}async function P(W){try{const V=await rt().refreshProvider(W);h.value=h.value.map(se=>se.id===W?V:se)}catch(K){n("refreshProvider",K)}}async function M(){try{return await rt().startOAuthLogin()}catch{return null}}async function L(){try{return await rt().pollOAuthLogin()}catch{return null}}async function R(){try{await rt().cancelOAuthLogin()}catch{}}function B(W){const K=_(W);o({thinking:K})}return{models:u,starredModelIds:d,providers:h,draftModel:p,skillsBySession:f,loadSkillsForSession:y,loadModels:b,refreshOAuthProviderModels:v,loadProviders:w,setModel:N,toggleStarModel:E,activateSkill:k,addProvider:A,deleteProvider:I,refreshProvider:P,startOAuthLogin:M,pollOAuthLogin:L,cancelOAuthLogin:R,setThinking:B}}const qM="kimiWeb.compaction",zce=/^read[_-]?media(?:file)?$/i,Vce=/^agent$/i,Kce=/^data:([^;]+);base64,(.*)$/s,Gce=/^<(image|video|audio)\s+path="([^"]+)">$/,Yce=/Mime type:\s*([^.\s]+)/i,Xce=/Size:\s*(\d+)\s*bytes/i,Zce=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Jce(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 Qce(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 eue(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const o=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof o!="object"||o===null)return null;const i=o.url;return typeof i=="string"?{kind:n,url:i}:null}function tue(e,t){if(!zce.test(e))return;const n=Qce(t);if(n===null)return;let s,o,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const h=d.text,p=Gce.exec(h);p&&(o=p[1],s=p[2]);const g=Yce.exec(h);g?.[1]&&(i=g[1]);const S=Xce.exec(h);S?.[1]&&(r=Number(S[1]));const _=Zce.exec(h);_?.[1]&&_[2]&&(l=`${_[1]}x${_[2]}`);continue}const f=eue(d);f&&(a=f)}if(a===null)return;const c=Kce.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Jce(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function zM(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
255
|
-
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
256
|
-
`));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
|
|
257
|
-
`)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
|
|
258
|
-
`)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function nue(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function sue(e){let t=null;if(typeof e=="string")try{const n=JSON.parse(e);n&&typeof n=="object"&&(t=n)}catch{t=null}else e&&typeof e=="object"&&(t=e);return t?{description:typeof t.description=="string"?t.description:void 0,subagentType:typeof t.subagent_type=="string"?t.subagent_type:void 0,prompt:typeof t.prompt=="string"?t.prompt:void 0}:{}}function oue(e,t,n,s){const o=sue(t),i=n?n.isError?"failed":"completed":s?"working":"completed",r=n?zM(n.output):void 0;return{id:e,toolCallId:e,name:o.description&&o.description.length>0?o.description:"Sub Agent",subagentType:o.subagentType,prompt:o.prompt,phase:i,status:n?n.isError?"failed":"completed":s?"running":"completed",summary:r&&r.length>0?r.join(`
|
|
259
|
-
`):void 0}}function iue(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,s=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==s?n-s:e.createdAt.localeCompare(t.createdAt)}function rue(e,t){const n=e.split(`
|
|
260
|
-
`),s=t.split(`
|
|
261
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function lue(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:rue(t.old_text,t.new_text)}:{kind:"diff",path:s,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 s=typeof t.plan=="string"?t.plan:"",o=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:s,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function aue(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"?t?.trigger==="user-slash":!1}function cue(e){return e.metadata?.origin?.kind==="compaction_summary"}function uue(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function due(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 VM(e,t,n,s=!0,o=[],i={}){const r=[];let l=1;const a=new Map;for(const g of t)a.set(g.toolCallId,g);const c=new Map;for(const g of o){if(g.kind!=="subagent")continue;const S=[g.parentToolCallId,g.id].filter(_=>typeof _=="string"&&_.length>0);for(const _ of S){const y=c.get(_)??[];y.push(g),c.set(_,y)}}for(const[g,S]of c.entries())c.set(g,S.toSorted(iue));const u=new Map;for(const g of e)for(const S of g.content)S.type==="toolResult"&&u.set(S.toolCallId,{output:S.output,isError:!!S.isError});let d=null;function f(g=!1){if(!d)return;const S=d;if(d=null,!g||!s)for(let _=0;_<S.tools.length;_++){const y=S.tools[_];if(y.status!=="running")continue;const b={...y,status:"ok"};S.tools[_]=b;const v=S.blocks.find(w=>w.kind==="tool"&&w.tool.id===b.id);v&&v.kind==="tool"&&(v.tool=b)}r.push({id:S.id,role:"assistant",no:l++,text:S.textParts.join(`
|
|
262
|
-
`),thinking:S.thinkingParts.length>0?S.thinkingParts.join(`
|
|
263
|
-
`):void 0,tools:S.tools.length>0?S.tools:void 0,blocks:S.blocks.length>0?S.blocks:void 0,approval:S.approval,approvalId:S.approvalId,durationMs:S.durationMs})}function h(g,S){for(const _ of S)if(_.type==="text"){if(_.text){g.textParts.push(_.text);const y=g.blocks.at(-1);y&&y.kind==="text"?y.text+=`
|
|
264
|
-
`+_.text:g.blocks.push({kind:"text",text:_.text})}}else if(_.type==="thinking"){if(_.thinking){g.thinkingParts.push(_.thinking);const y=g.blocks.at(-1);y&&y.kind==="thinking"?y.thinking+=`
|
|
265
|
-
`+_.thinking:g.blocks.push({kind:"thinking",thinking:_.thinking})}}else if(_.type==="toolUse"){const y=c.get(_.toolCallId);if(y&&y.length>0){if(y.filter(E=>E.swarmIndex!==void 0).length>1)continue;const N=y.map(nue);N.length===1?g.blocks.push({kind:"agent",member:N[0]}):g.blocks.push({kind:"agentGroup",members:N});continue}if(Vce.test(_.toolName)){const w=oue(_.toolCallId,_.input,u.get(_.toolCallId),s);g.blocks.push({kind:"agent",member:w});continue}const b=a.get(_.toolCallId),v={id:_.toolCallId,name:_.toolName,arg:typeof _.input=="string"?_.input:JSON.stringify(_.input),status:"running",output:_.outputLines,planPath:_.toolName==="ExitPlanMode"?i[_.toolCallId]?.path:void 0};g.tools.push(v),g.blocks.push({kind:"tool",tool:v}),b&&(g.approval=lue(b),g.approvalId=b.approvalId)}else if(_.type==="toolResult"){const y=g.tools.findIndex(b=>b.id===_.toolCallId);if(y!==-1){const b=g.tools[y],v={...b,status:_.isError?"error":"ok",output:zM(_.output),media:_.isError?void 0:tue(b.name,_.output)};v.name==="ExitPlanMode"&&!v.planPath&&(v.planPath=due(v.output)),g.tools[y]=v;const w=g.blocks.find(N=>N.kind==="tool"&&N.tool.id===_.toolCallId);w&&w.kind==="tool"&&(w.tool=v)}}}function p(g){if(g.type==="image"||g.type==="video"){const S=g.type,_=g.source;if(_.kind==="url")return{url:_.url,kind:S};if(_.kind==="base64")return{url:`data:${_.mediaType};base64,${_.data}`,kind:S};if(_.kind==="file"&&n)return{url:n(_.fileId),kind:S}}if(g.type==="file"&&n){if(g.mediaType.startsWith("image/"))return{url:n(g.fileId),kind:"image"};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video"}}}for(const g of e){if(g.role==="system")continue;if(cue(g)){f();const v=g.metadata?.[qM];r.push({id:g.id,role:"compaction",no:l,text:g.content.filter(w=>w.type==="text").map(w=>w.text).join(`
|
|
266
|
-
`),compaction:{trigger:v?.trigger,tokensBefore:v?.tokensBefore,tokensAfter:v?.tokensAfter}});continue}if(g.role==="user"){if(f(),!aue(g))continue;const v=g.metadata?.origin,w=v?.kind==="skill_activation"&&v?.trigger==="user-slash",N=[],E=[];for(const k of g.content){k.type==="text"&&(w?N.push(v.skillArgs??""):N.push(k.text));const A=p(k);A&&E.push({url:A.url,kind:A.kind,alt:k.type==="file"?k.name:void 0})}r.push({id:g.id,role:"user",no:l++,text:N.join(`
|
|
267
|
-
`),images:E.length>0?E:void 0,skillActivation:w?{name:v.skillName,args:v.skillArgs}:void 0,createdAt:g.createdAt});continue}if(g.role==="tool"){d&&h(d,g.content);continue}const S=g.promptId;uue(d,S)?d!==null&&d.promptId===void 0&&S!==void 0&&(d.promptId=S):(f(),d={id:g.id,promptId:S,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:g.durationMs});const y=d;if(y===null)continue;const b=JSON.stringify(g.content);y.promptId!==void 0&&y.seenSigs.has(b)||(y.seenSigs.add(b),h(y,g.content))}return f(!0),r}function fue(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:s,connectEventsIfNeeded:o,getEventConn:i}=t,r=te({}),l=F(()=>{const E=e.activeSessionId;if(!E)return null;const k=r.value[E];return k?{parentId:E,agentId:k.agentId}:null}),a=F(()=>l.value?.parentId??null),c=F(()=>l.value!==null),u=F(()=>{const E=l.value;return E?!!e.sideChatSendingByAgent[E.agentId]:!1}),d=F(()=>{const E=l.value;return E?e.sideChatSendingByAgent[E.agentId]?!0:(e.tasksBySession[E.parentId]??[]).some(k=>k.id===E.agentId&&k.status==="running"):!1}),f=F(()=>{const E=l.value;if(!E)return[];const k=e.sideChatMessagesByAgent[E.agentId]??[];return VM(k,[],A=>rt().getFileUrl(A),d.value,[])});function h(E,k){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:k(e.sideChatMessagesByAgent[E]??[])}}function p(E,k){h(E,A=>[...A,k])}function g(E){h(E,k=>{const A=[...k].reverse().findIndex(P=>P.role==="user");if(A===-1)return k;const I=k.length-1-A;return k.filter((P,M)=>M!==I)})}function S(E,k){h(E,A=>{const I=[...A];for(let P=I.length-1;P>=0;P-=1){const M=I[P];if(M.role==="user")return I[P]={...M,promptId:M.promptId??k},I}return A})}function _(E,k,A){A&&h(E,I=>{const P=I.at(-1);if(P?.role==="assistant"){const M=P.content[0],L=M?.type==="text"?M.text:"";return[...I.slice(0,-1),{...P,content:[{type:"text",text:`${L}${A}`}]}]}return[...I,{id:s(),sessionId:k,role:"assistant",content:[{type:"text",text:A}],createdAt:new Date().toISOString()}]})}function y(E,k,A){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!A)return;const P=(e.sideChatMessagesByAgent[E]??[]).at(-1);(P?.role==="assistant"&&P.content[0]?.type==="text"?P.content[0].text:"").trim().length>0||_(E,k,A)}async function b(E){const k=e.activeSessionId;if(k){if(!r.value[k]){let A;try{({agentId:A}=await rt().startBtw(k))}catch(I){n("openSideChat",I,{sessionId:k});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[A]:e.sideChatMessagesByAgent[A]??[]},r.value={...r.value,[k]:{agentId:A}},o(),i()?.markSideChannelAgent(A)}E&&E.trim()&&await w(E.trim())}}function v(){const E=e.activeSessionId;if(!E)return;const{[E]:k,...A}=r.value;r.value=A}async function w(E){const k=l.value,A=E.trim();if(!k||!A)return;const I=k.parentId,P=k.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!0};const M={id:s(),sessionId:I,role:"user",content:[{type:"text",text:A}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};p(P,M);try{const L=await rt().submitPrompt(I,{content:[{type:"text",text:A}],agentId:P});S(P,L.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[I]:[...e.sideChatUserMessageIdsBySession[I]??[],L.userMessageId]}}catch(L){n("sendSideChatPrompt",L,{sessionId:I}),g(P),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[P]:!1}}}function N(E){if(!r.value[E])return;const{[E]:k,...A}=r.value;r.value=A}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:_,finishSideChatAgent:y,openSideChat:b,closeSideChat:v,sendSideChatPrompt:w,clearSideChatForSession:N}}function hue(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 pue(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
|
|
268
|
-
`)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&hue(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),s=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:i});continue}if(!o||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:s}),s+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:s}),n+=1,s+=1)}return t}const C1="/sessions/";function T2(e){const{pathname:t}=e;if(!t.startsWith(C1))return;const n=t.slice(C1.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function mue(e){return e===void 0||e.length===0?"/":`${C1}${encodeURIComponent(e)}`}const gue=50,vue=40402;function yue(e,t){const{taskPoller:n,sideChat:s,modelProvider:o,pushOperationFailure:i,activity:r,inFlightPromptSessions:l,sessionsKnownEmpty:a,setSessions:c,updateSession:u,upsertSessionFront:d,appendSession:f,forgetSession:h,setActiveSessionId:p,updateSessionMessages:g,nextOptimisticMsgId:S,getEventConn:_,syncSessionFromSnapshot:y,subscribeToSessionEvents:b,hasLoadedMessages:v,refreshSessionStatus:w,persistSessionProfile:N,mergedWorkspaces:E,workspacesView:k,status:A,workspaceIdForSession:I,savePermissionToStorage:P,savePlanModeToStorage:M,saveSwarmModeToStorage:L,saveGoalModeToStorage:R,saveUnread:B,saveActiveWorkspaceToStorage:W,saveHiddenWorkspacesToStorage:K,goalErrorMessage:V,basename:se,resetFastMoon:Y,initialized:G,selectedDiffPath:ee,fileDiffLines:we,fileDiffLoading:de}=t;async function Le(ue){if(e.messagesLoadingMoreBySession[ue])return;const pe=e.messagesBySession[ue];if(!pe||pe.length===0)return;const z=pe[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ue]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ue]:!1};try{const ne=await rt().listMessages(ue,{beforeId:z,pageSize:gue}),Ge=[...ne.items].reverse();g(ue,tt=>[...Ge,...tt]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[ue]:ne.hasMore}}catch(ne){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ue]:!0},i("loadOlderMessages",ne,{sessionId:ue})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ue]:!1}}}function ce(ue){n.loadTasksForSession(ue),$e(ue),w(ue),Object.prototype.hasOwnProperty.call(o.skillsBySession.value,ue)||o.loadSkillsForSession(ue)}async function _e(ue){const pe=e.activeSessionId;if(pe){ee.value=ue,we.value=[],de.value=!0;try{const ne=await rt().getFileDiff(pe,ue);if(ee.value!==ue)return;we.value=pue(ne.diff)}catch(z){ee.value===ue&&(we.value=[]),console.warn("[loadFileDiff] diff unavailable for",ue,z)}finally{ee.value===ue&&(de.value=!1)}}}function me(){ee.value=null,we.value=[],de.value=!1}async function $e(ue){try{const z=await rt().getGitStatus(ue);e.gitStatusBySession={...e.gitStatusBySession,[ue]:z}}catch{}}async function J(){try{const pe=await rt().getAuth();e.authReady=pe.ready,e.defaultModel=pe.defaultModel,e.managedProviderStatus=pe.managedProvider?.status??null}catch{}}async function ye(){try{const ue=rt();e.config=await ue.getConfig()}catch{}}async function Se(ue){try{const z=await rt().setConfig(ue);return e.config=z,e.defaultModel=z.defaultModel??null,!0}catch(pe){return i("setConfig",pe),!1}}const U=100,Z=10,fe=30;async function oe(){const ue=rt(),pe=[];let z;for(;;){const ne=await ue.listSessions({pageSize:U,beforeId:z});if(pe.push(...ne.items),!ne.hasMore||ne.items.length===0)break;z=ne.items[ne.items.length-1].id}return pe}async function he(){const ue=rt(),pe=e.workspaces;if(pe.length===0){const Ct=await oe().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsFullyLoaded=!0,Ct}const z=await Promise.all(pe.map(Ct=>ue.listSessions({workspaceId:Ct.id,pageSize:Z}).then(mn=>({workspaceId:Ct.id,page:mn})).catch(()=>({workspaceId:Ct.id,page:{items:[],hasMore:!1}})))),ne=[],Ge={},tt={};for(const{workspaceId:Ct,page:mn}of z)ne.push(...mn.items),Ge[Ct]=mn.hasMore,tt[Ct]=mn.items.length>0?mn.items[mn.items.length-1].id:void 0;return e.sessionsHasMoreByWorkspace=Ge,e.sessionsCursorByWorkspace=tt,e.sessionsFullyLoaded=!1,ne.sort((Ct,mn)=>new Date(mn.updatedAt).getTime()-new Date(Ct.updatedAt).getTime()),ne}async function H(ue){if(e.sessionsLoadingMoreByWorkspace[ue]||e.sessionsHasMoreByWorkspace[ue]===!1)return;const pe=e.sessionsCursorByWorkspace[ue];if(pe!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ue]:!0};try{const z=await rt().listSessions({workspaceId:ue,pageSize:fe,beforeId:pe}),ne=new Set(e.sessions.map(tt=>tt.id)),Ge=z.items.filter(tt=>!ne.has(tt.id));Ge.length>0&&c([...e.sessions,...Ge]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[ue]:z.items.length>0?z.items[z.items.length-1].id:pe},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[ue]:z.hasMore}}catch(z){i("loadMoreSessions",z)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ue]:!1}}}}async function X(){if(e.sessionsFullyLoaded)return;const ue=await oe().catch(()=>null);if(ue===null)return;c(ue),e.sessionsFullyLoaded=!0;const pe={};for(const z of e.workspaces)pe[z.id]=!1;e.sessionsHasMoreByWorkspace=pe}async function ae(){e.loading=!0;try{const ue=rt();await Promise.all([ue.getHealth().catch(()=>null),ue.getMeta().then(Ct=>{e.serverVersion=Ct.serverVersion,e.availableOpenInApps=Ct.openInApps}).catch(()=>null),o.loadModels()]),await J(),await ye(),await ke();const pe=await he();c(pe);const z=pe[0],ne=e.activeWorkspaceId;!(ne!==null&&E.value.some(Ct=>Ct.id===ne))&&z&&Me(I(z)),pn();const tt=typeof window<"u"?T2(window.location):void 0;!e.activeSessionId&&tt!==void 0&&(e.sessions.some(mn=>mn.id===tt)||await hn(tt))&&await un(tt,{urlMode:"replace"}),!e.activeSessionId&&pe.length>0&&await un(pe[0].id,{urlMode:"replace"})}catch(ue){i("load",ue)}finally{e.loading=!1,G.value=!0}}async function ke(){try{const ue=rt(),[pe,z]=await Promise.all([ue.listWorkspaces().catch(()=>[]),ue.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=pe,e.fsHome=z.home||null,e.recentRoots=z.recentRoots}catch{}}function Me(ue){e.activeWorkspaceId=ue,W(ue)}function Ie(ue){Me(ue);const pe=e.sessions.filter(z=>I(z)===ue);if(pe.length>0){const z=pe[0];z&&z.id!==e.activeSessionId&&un(z.id)}else p(void 0),It(void 0,"push")}function re(ue){e.hiddenWorkspaceRoots.includes(ue.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(ne=>ne!==ue.root),K(e.hiddenWorkspaceRoots));const pe=e.workspaces.findIndex(ne=>ne.id===ue.id||ne.root===ue.root);if(pe===-1){e.workspaces=[ue,...e.workspaces];return}const z=[...e.workspaces];z[pe]=ue,e.workspaces=z}function le(ue){if(ue.type==="workspaceCreated"||ue.type==="workspaceUpdated"){re(ue.workspace);return}const pe=e.workspaces.find(ne=>ne.id===ue.workspaceId)?.root??ue.root;if(pe&&!e.hiddenWorkspaceRoots.includes(pe)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,pe],K(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(ne=>ne.id!==ue.workspaceId&&ne.root!==pe),e.activeWorkspaceId===ue.workspaceId||e.activeWorkspaceId===pe){const ne=k.value[0]?.id??null;if(e.activeWorkspaceId=ne,ne)W(ne);else try{Kc(Et.activeWorkspace)}catch{}p(void 0),e.sessionLoading=!1,me(),It(void 0,"replace")}}function Ce(){p(void 0),It(void 0,"push")}function We(ue){Me(ue),Ce(),me()}async function nt(ue){const pe=E.value.find(z=>z.id===ue);if(pe)try{const z=rt();let ne,Ge=pe.root;try{const Ct=await z.addWorkspace({root:pe.root});ne=Ct.id,Ge=Ct.root,re(Ct)}catch{}const tt=await z.createSession({workspaceId:ne,cwd:Ge});return d(tt),Me(tt.workspaceId??ne??ue),a.add(tt.id),await un(tt.id),tt}catch(z){i("createSessionInWorkspace",z);return}}async function lt(ue,pe,z){const ne=E.value.find(Ge=>Ge.id===ue);if(ne)try{const Ge=rt();let tt,Ct=ne.root;try{const ln=await Ge.addWorkspace({root:ne.root});tt=ln.id,Ct=ln.root,re(ln)}catch{}const mn=o.draftModel.value??void 0,Dn=await Ge.createSession({workspaceId:tt,cwd:Ct,model:mn});o.draftModel.value=null;const wn=mn!==void 0&&(!Dn.model||Dn.model.length===0)?{...Dn,model:mn}:Dn;d(wn),Me(Dn.workspaceId??tt??ue),await un(Dn.id),await Rn(Dn.id,pe,z)}catch(Ge){i("startSessionAndSendPrompt",Ge)}}async function bt(ue){const pe=ue.trim();if(!pe)return;const z=rt();try{const ne=await z.addWorkspace({root:pe});re(ne),We(ne.id)}catch{e.workspaces.find(Ge=>Ge.root===pe)||(e.workspaces=[{id:pe,root:pe,name:se(pe),isGitRepo:!1,sessionCount:0},...e.workspaces]),We(pe)}}async function St(ue){try{return await rt().browseFs(ue)}catch{return{path:"",parent:null,entries:[]}}}async function ct(){try{return await rt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function It(ue,pe){if(pe==="none"||typeof window>"u"||!window.history)return;const z=mue(ue);if(window.location.pathname!==z)try{pe==="push"?window.history.pushState(null,"",z):window.history.replaceState(null,"",z)}catch{}}async function hn(ue){try{const pe=await rt().getSession(ue);return e.sessions.some(z=>z.id===pe.id)||f(pe),!0}catch{return!1}}function vn(){const ue=T2(window.location);if(ue===void 0){p(void 0);return}if(ue!==e.activeSessionId){if(e.sessions.some(pe=>pe.id===ue)){un(ue,{urlMode:"none"});return}(async()=>{if(await hn(ue)){await un(ue,{urlMode:"none"});return}const pe=e.sessions[0];pe?await un(pe.id,{urlMode:"replace"}):(p(void 0),It(void 0,"replace"))})()}}let $t=!1;function pn(){$t||typeof window>"u"||($t=!0,window.addEventListener("popstate",vn))}async function un(ue,pe){const z=v(ue),ne=!z&&a.has(ue);a.delete(ue);try{It(ue,pe?.urlMode??"push"),e.sessionLoading=!z&&!ne,p(ue),Y(),e.unreadBySession[ue]&&(e.unreadBySession={...e.unreadBySession,[ue]:!1},B({[ue]:!1})),me();const Ge=e.sessions.find(tt=>tt.id===ue);if(Ge){const tt=I(Ge);e.activeWorkspaceId!==tt&&Me(tt)}if(z)b(ue);else if(await y(ue)==="not-found")return;ce(ue)}catch(Ge){i("selectSession",Ge,{sessionId:ue})}finally{e.activeSessionId===ue&&(e.sessionLoading=!1)}}async function et(ue,pe){try{const ne=await rt().createSession({cwd:ue,title:pe?.title,model:pe?.model});d(ne),a.add(ne.id),await un(ne.id)}catch(z){i("createSession",z)}}async function Rn(ue,pe,z){l.add(ue),e.sendingBySession={...e.sendingBySession,[ue]:!0};const ne=S();try{const Ge=rt(),tt=[];pe&&tt.push({type:"text",text:pe});for(const ln of z??[])ln.kind==="video"?tt.push({type:"video",source:{kind:"file",fileId:ln.fileId}}):tt.push({type:"image",source:{kind:"file",fileId:ln.fileId}});if(tt.length===0)return l.delete(ue),e.sendingBySession={...e.sendingBySession,[ue]:!1},!1;const Ct={id:ne,sessionId:ue,role:"user",content:tt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};g(ue,ln=>[...ln,Ct]);const mn=e.sessions.find(ln=>ln.id===ue),Dn=(mn?.model&&mn.model.length>0?mn.model:e.defaultModel)??void 0;if(e.goalMode&&pe)try{await Ge.updateSession(ue,{goalObjective:pe.trim()})}catch(ln){return i("createGoal",ln,{sessionId:ue}),l.delete(ue),e.sendingBySession={...e.sendingBySession,[ue]:!1},g(ue,an=>an.some(Sn=>Sn.id===ne)?an.filter(Sn=>Sn.id!==ne):an),!1}const wn=await Ge.submitPrompt(ue,{content:tt,model:Dn,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});return e.goalMode&&(e.goalMode=!1,R(!1)),e.promptIdBySession={...e.promptIdBySession,[ue]:wn.promptId},g(ue,ln=>{const an=ln.findIndex(go=>go.id===ne);if(an===-1)return ln;const Sn=[...ln];return Sn[an]={...Sn[an],promptId:Sn[an].promptId??wn.promptId},Sn}),_()?.bindNextPromptId(ue,wn.promptId),!0}catch(Ge){return l.delete(ue),e.sendingBySession={...e.sendingBySession,[ue]:!1},g(ue,tt=>tt.some(Ct=>Ct.id===ne)?tt.filter(Ct=>Ct.id!==ne):tt),i("sendPrompt",Ge,{sessionId:ue}),!1}}async function Po(ue,pe){const z=e.activeSessionId;if(z){if(r.value!=="idle"||l.has(z)){sn(ue,pe);return}await Rn(z,ue,pe)}}async function fs(ue,pe){const z=e.activeSessionId;if(!z)return;const ne=e.queuedBySession[z]??[],Ge=[],tt=[];for(const an of ne){const Sn=an.text.trim();Sn&&Ge.push(Sn),an.attachments?.length&&tt.push(...an.attachments)}const Ct=ue.trim();if(Ct&&Ge.push(Ct),pe?.length&&tt.push(...pe),Ge.length===0&&tt.length===0)return;ne.length>0&&(e.queuedBySession={...e.queuedBySession,[z]:[]});const mn=Ge.join(`
|
|
269
|
-
|
|
270
|
-
`);if(r.value==="idle"&&!l.has(z)){await Rn(z,mn,tt);return}const Dn=[];mn&&Dn.push({type:"text",text:mn});for(const an of tt)an.kind==="video"?Dn.push({type:"video",source:{kind:"file",fileId:an.fileId}}):Dn.push({type:"image",source:{kind:"file",fileId:an.fileId}});const wn=S(),ln={id:wn,sessionId:z,role:"user",content:Dn,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};g(z,an=>[...an,ln]);try{const an=rt(),Sn=e.sessions.find(Ir=>Ir.id===z),go=(Sn?.model&&Sn.model.length>0?Sn.model:e.defaultModel)??void 0,$r=await an.submitPrompt(z,{content:Dn,model:go,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});if(g(z,Ir=>{const yl=Ir.findIndex(Nr=>Nr.id===wn);if(yl===-1)return Ir;const ui=[...Ir];return ui[yl]={...ui[yl],promptId:ui[yl].promptId??$r.promptId},ui}),$r.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[z]:$r.promptId},_()?.bindNextPromptId(z,$r.promptId);return}try{await an.steerPrompts(z,[$r.promptId])}catch{}}catch(an){g(z,Sn=>Sn.filter(go=>go.id!==wn)),i("steer",an,{sessionId:z})}}async function Fn(ue,pe){try{const ne=await rt().uploadFile({file:ue,name:pe});return{fileId:ne.id,name:ne.name,mediaType:ne.mediaType}}catch(z){return i("uploadImage",z),null}}function sn(ue,pe){const z=e.activeSessionId;if(!z)return;const ne=e.queuedBySession[z]??[];e.queuedBySession={...e.queuedBySession,[z]:[...ne,{text:ue,attachments:pe}]}}async function En(){const ue=e.activeSessionId;if(!ue)return;const pe=e.sessions.find(Ge=>Ge.id===ue);let z=e.promptIdBySession[ue];if(z===void 0){const Ge=pe?.currentPromptId;Ge?.startsWith("prompt_")&&(z=Ge)}const ne=rt();if(z!==void 0)try{if((await ne.abortPrompt(ue,z)).aborted)return;const tt={...e.promptIdBySession};delete tt[ue],e.promptIdBySession=tt}catch(Ge){if(yu(Ge)&&Ge.code===vue){const tt={...e.promptIdBySession};delete tt[ue],e.promptIdBySession=tt}else{i("abortCurrentPrompt",Ge,{sessionId:ue});return}}try{await ne.abortSession(ue)}catch(Ge){i("abortCurrentPrompt",Ge,{sessionId:ue})}}async function Kn(ue,pe){const z=e.activeSessionId;if(z)try{const ne=rt(),Ge={decision:pe.decision,scope:pe.scope,feedback:pe.feedback,selectedLabel:pe.selectedLabel};await ne.respondApproval(z,ue,Ge);const tt=e.approvalsBySession[z]??[];e.approvalsBySession={...e.approvalsBySession,[z]:tt.filter(Ct=>Ct.approvalId!==ue)}}catch(ne){i("respondApproval",ne,{sessionId:z})}}async function _n(ue,pe){const z=e.activeSessionId;if(z)try{await rt().respondQuestion(z,ue,pe);const Ge=e.questionsBySession[z]??[];e.questionsBySession={...e.questionsBySession,[z]:Ge.filter(tt=>tt.questionId!==ue)}}catch(ne){i("respondQuestion",ne,{sessionId:z})}}async function xs(ue){const pe=e.activeSessionId;if(pe)try{await rt().dismissQuestion(pe,ue);const ne=e.questionsBySession[pe]??[];e.questionsBySession={...e.questionsBySession,[pe]:ne.filter(Ge=>Ge.questionId!==ue)}}catch(z){i("dismissQuestion",z,{sessionId:pe})}}async function Hn(ue){const pe=e.activeSessionId;if(pe)try{await rt().cancelTask(pe,ue);const ne=e.tasksBySession[pe]??[];e.tasksBySession={...e.tasksBySession,[pe]:ne.map(Ge=>Ge.id===ue?{...Ge,status:"cancelled"}:Ge)}}catch(z){i("cancelTask",z,{sessionId:pe})}}function hs(ue){e.planMode=ue,M(ue),N({planMode:ue})}function ps(){hs(!e.planMode)}function ss(ue){e.swarmMode=ue,L(ue),N({swarmMode:ue})}function Tt(){const ue=!e.swarmMode;ue&&e.permission==="manual"&&!confirm("Enable swarm mode? The agent will run multiple sub agents in parallel.")||ss(ue)}function ms(ue){e.goalMode=ue,R(ue)}function qt(){ms(!e.goalMode)}async function Ts(ue){const pe=ue.trim();if(!pe||e.permission==="manual"&&!confirm(`Start goal: "${pe}"? The agent will run autonomously toward this objective.`))return;const z=e.activeSessionId;if(z){try{await rt().updateSession(z,{goalObjective:pe})}catch(ne){i("createGoal",ne,{sessionId:z,message:V(ne)});return}await Po(pe)}}function Ke(ue){const pe=e.activeSessionId;pe&&Promise.resolve(rt().updateSession(pe,{goalControl:ue})).catch(z=>{i("controlGoal",z,{sessionId:pe,message:V(z)})})}function Ue(ue){e.permission=ue,P(ue),N({permissionMode:ue})}function Je(ue){const pe=[...e.warnings];pe.splice(ue,1),e.warnings=pe}async function Mt(ue,pe){try{await rt().updateSession(ue,{title:pe}),u(ue,ne=>({...ne,title:pe}))}catch(z){i("renameSession",z,{sessionId:ue})}}function Ne(ue,pe){e.workspaces=e.workspaces.map(z=>z.id===ue?{...z,name:pe}:z)}async function ge(ue){const pe=e.workspaces.find(tt=>tt.id===ue)?.root??E.value.find(tt=>tt.id===ue)?.root??ue,z=e.activeSessionId?e.sessions.find(tt=>tt.id===e.activeSessionId):void 0,ne=e.activeWorkspaceId===ue||e.activeWorkspaceId===pe,Ge=!!(z&&(z.cwd===pe||z.workspaceId===ue||I(z)===ue));pe&&!e.hiddenWorkspaceRoots.includes(pe)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,pe],K(e.hiddenWorkspaceRoots));try{await rt().deleteWorkspace(ue)}catch{}if(e.workspaces=e.workspaces.filter(tt=>tt.id!==ue&&tt.root!==pe),ne||Ge){const tt=k.value[0]?.id??null;if(e.activeWorkspaceId=tt,tt)W(tt);else try{Kc(Et.activeWorkspace)}catch{}}(ne||Ge)&&(p(void 0),e.sessionLoading=!1,me(),It(void 0,"replace"))}async function He(ue){try{await rt().archiveSession(ue),h(ue),s.clearSideChatForSession(ue);const{[ue]:z,...ne}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=ne,e.activeSessionId===ue){const Ge=e.sessions[0];Ge?await un(Ge.id,{urlMode:"replace"}):(p(void 0),It(void 0,"replace"))}}catch(pe){i("archiveSession",pe,{sessionId:ue})}}async function zt(){try{await rt().logout(),await J(),await ae()}catch(ue){i("logout",ue)}}function Yt(ue){const pe=e.activeSessionId;pe&&rt().compactSession(pe,ue).catch(z=>{i("compact",z,{sessionId:pe})})}async function Nt(ue){const pe=ue??e.activeSessionId;if(pe)try{const z=await rt().forkSession(pe);d(z),await un(z.id)}catch(z){i("fork",z,{sessionId:pe})}}async function Pt(ue=1){const pe=e.activeSessionId;if(!pe)return null;const z=(()=>{const ne=e.messagesBySession[pe]??[];for(let Ge=ne.length-1;Ge>=0;Ge--){const tt=ne[Ge];if(tt.role==="user"&&!(tt.metadata?.origin&&tt.metadata.origin.kind!=="user"))return tt.content.filter(Ct=>Ct.type==="text").map(Ct=>Ct.text).join(`
|
|
271
|
-
`)}return null})();try{return await rt().undoSession(pe,ue),await y(pe),z}catch(ne){return i("undo",ne,{sessionId:pe}),null}}function po(ue){const pe=e.activeSessionId;if(!pe)return;const z=e.queuedBySession[pe]??[];if(ue<0||ue>=z.length)return;const ne=[...z];ne.splice(ue,1),e.queuedBySession={...e.queuedBySession,[pe]:ne}}async function mo(ue){const pe=e.activeSessionId;if(!pe)return[];try{return(await rt().listDirectory(pe,{path:ue,includeGitStatus:!0})).items}catch{return[]}}async function Bi(ue){const pe=e.activeSessionId;if(!pe)return null;try{const ne=await rt().readFile(pe,{path:ue});return{path:ne.path,content:ne.content,encoding:ne.encoding,mime:ne.mime,languageId:ne.languageId,isBinary:ne.isBinary,size:ne.size,lineCount:ne.lineCount}}catch{return null}}const zo=10485760;function Fi(ue){const pe=e.activeSessionId;return pe?rt().getFileDownloadUrl(pe,ue):null}async function Vo(ue,pe){const z=e.activeSessionId;if(!z)return!1;try{return await rt().openFile(z,{path:ue,line:pe}),!0}catch(ne){return i("openFile",ne,{sessionId:z}),!1}}async function Jn(ue){const pe=e.activeSessionId;if(!pe)return;const z=A.value.cwd||".";try{await rt().openInApp(pe,ue,z)}catch(ne){i("openInApp",ne,{sessionId:pe})}}async function Hi(ue){const pe=e.activeSessionId;if(!pe)return!1;try{return await rt().revealFile(pe,{path:ue}),!0}catch(z){return i("revealFile",z,{sessionId:pe}),!1}}async function vl(ue){if(/^(https?:|data:|blob:)/i.test(ue))return ue;const pe=e.activeSessionId;if(!pe)return ue;let z=ue;if(z.startsWith("/")){const ne=e.sessions.find(Ge=>Ge.id===pe)?.cwd;if(ne&&(z===ne||z.startsWith(ne.endsWith("/")?ne:`${ne}/`))){if(z=z.slice(ne.length).replace(/^\//,""),!z)return ue}else return ue}try{const Ge=await rt().readFile(pe,{path:z,length:zo});return!Ge.isBinary||Ge.encoding!=="base64"||Ge.truncated?ue:`data:${Ge.mime};base64,${Ge.content}`}catch{return ue}}async function Er(ue){const pe=e.activeSessionId;if(!pe)return[];try{return(await rt().searchFiles(pe,{query:ue,limit:20})).items.map(Ge=>({path:Ge.path,name:Ge.name}))}catch{return[]}}return{loadFileDiff:_e,clearFileDiff:me,loadGitStatus:$e,checkAuth:J,loadConfig:ye,updateConfig:Se,listAllSessionsGlobal:oe,load:ae,loadWorkspaces:ke,loadMoreSessions:H,loadAllSessions:X,selectWorkspace:Me,openWorkspace:Ie,upsertWorkspacePreserveOrder:re,applyWorkspaceEvent:le,clearActiveSession:Ce,openWorkspaceDraft:We,createSessionInWorkspace:nt,startSessionAndSendPrompt:lt,addWorkspaceByPath:bt,browseFs:St,getFsHome:ct,writeSessionUrl:It,fetchSessionIntoList:hn,onSessionRoutePopState:vn,bindSessionRoute:pn,selectSession:un,createSession:et,submitPromptInternal:Rn,sendPrompt:Po,steerPrompt:fs,uploadImage:Fn,enqueue:sn,unqueue:po,abortCurrentPrompt:En,respondApproval:Kn,respondQuestion:_n,dismissQuestion:xs,cancelTask:Hn,setPlanMode:hs,togglePlanMode:ps,setSwarmMode:ss,toggleSwarmMode:Tt,setGoalMode:ms,toggleGoalMode:qt,createGoal:Ts,controlGoal:Ke,setPermission:Ue,dismissWarning:Je,renameSession:Mt,renameWorkspace:Ne,deleteWorkspace:ge,archiveSession:He,logout:zt,compact:Yt,forkSession:Nt,undo:Pt,listDir:mo,readFileContent:Bi,getFileDownloadUrl:Fi,openWorkspaceFile:Vo,openInApp:Jn,revealWorkspaceFile:Hi,resolveImageUrl:vl,searchFiles:Er,loadOlderMessages:Le,refreshSessionSidecars:ce}}const kue="kimiWeb.optimisticUserMessage";function bue(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function _ue(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 wue(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function Jm(e){return e.role==="user"&&e.metadata?.[kue]===!0}function Sue(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function M2(e){let t="",n=0;for(const s of e.content)s.type==="text"?t+=s.text:(s.type==="image"||s.type==="file")&&(n+=1);return{text:t,media:n}}function Cue(e,t){const n=M2(e),s=M2(t);return n.text===s.text&&n.media===s.media}function xue(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(Jm(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(Jm(o)&&Sue(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(Jm(o)&&Cue(o,t))return s}return-1}function Tue(e,t,n){let s=!1;const o=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(s=!0,{...i,content:l}):i});return s?o:e}function Mue(e,t,n){const s=_ue(e);switch(wue(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title??o.title,lastPrompt:t.lastPrompt??o.lastPrompt}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[qM]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=t.message.createdAt;s.sessions=s.sessions.map(a=>a.id===o&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=s.messagesBySession[o]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"){const a=xue(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}},s.messagesBySession[o]=c;break}}s.messagesBySession[o]=[...r,t.message]}break}case"messageUpdated":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=Tue(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(s.planReviewByToolCallId={...s.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i];l[r]={...t.task,outputLines:i[r].outputLines},s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;const l=r.outputLines??[];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 o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?Nn.global.t("warnings.errorLabel"):Nn.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}function Aue(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function Eue(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let s=n.content.length-1;s>=0;s--){const o=n.content[s];if(o.type!=="toolUse"||pl(o.toolName)!=="todo")continue;let i=o.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:Aue(a.status)}]:[]})}}return[]}const $ue=["queued","working","suspended","completed","failed"];function Iue(e){return e.subagentPhase?e.subagentPhase:e.status==="completed"?"completed":e.status==="failed"?"failed":"working"}function Nue(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Lue(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const s=n.parentToolCallId??"swarm",o=t.get(s)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:Iue(n),summary:n.outputPreview,outputLines:n.outputLines,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=Nue();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function Oue(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of $ue)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}const Js=Oce(),jd=Bce(),KM=Et.permission,GM=Et.activeWorkspace,YM=Et.thinking,XM=Et.planMode,ZM=Et.swarmMode,JM=Et.goalMode,A2=40401,QM=Et.onboarded,Pue=["off","low","medium","high","xhigh","max"];Kc(Et.codeFont);function Rue(){try{const e=An(KM);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Due(e){try{Pn(KM,e)}catch{}}function Bue(){try{const e=An(YM);if(e&&Pue.includes(e))return e}catch{}return"high"}function Fue(e){try{Pn(YM,e)}catch{}}function Hue(){try{return An(XM)==="true"}catch{return!1}}function Wue(e){try{Pn(XM,e?"true":"false")}catch{}}function Uue(){try{return An(ZM)==="true"}catch{return!1}}function jue(e){try{Pn(ZM,e?"true":"false")}catch{}}function que(){try{return An(JM)==="true"}catch{return!1}}function zue(e){try{Pn(JM,e?"true":"false")}catch{}}function Vue(){try{return An(GM)}catch{return null}}const e3=Et.hiddenWorkspaces;function Kue(){try{const e=An(e3);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Gue(e){try{Pn(e3,JSON.stringify(e))}catch{}}function Yue(e){try{Pn(GM,e)}catch{}}function t3(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Xue(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Te=so({...bue(),connected:!1,serverVersion:"",workspaceName:"kimi-web",connection:"disconnected",permission:Rue(),thinking:Bue(),planMode:Hue(),swarmMode:Uue(),goalMode:que(),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:ov(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Vue(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Kue(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsFullyLoaded:!1});function n3(e){Te.sessions=e}function Bh(e,t){Te.sessions=Te.sessions.map(n=>n.id===e?t(n):n)}function Zue(e){Te.sessions=[e,...Te.sessions.filter(t=>t.id!==e.id)]}function Jue(e){Te.sessions=[...Te.sessions,e]}function Que(e){Te.sessions=Te.sessions.filter(t=>t.id!==e)}function s3(){const e=Te.activeSessionId;e&&Te.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Te.unreadBySession={...Te.unreadBySession,[e]:!1},iv({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Et.unread&&(Te.unreadBySession=ov(),s3())});typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&s3()});function t0(e){Te.activeSessionId=e}function ede(e){Te.messagesBySession=e}function tde(e,t){Te.messagesBySession={...Te.messagesBySession,[e]:t}}function o3(e,t){Te.messagesBySession={...Te.messagesBySession,[e]:t(Te.messagesBySession[e]??[])}}function nde(e){const{[e]:t,...n}=Te.messagesBySession;Te.messagesBySession=n}function i3(e){li?.unsubscribe(e),ou.flush(),Que(e),nde(e),delete Te.approvalsBySession[e],delete Te.questionsBySession[e],delete Te.tasksBySession[e],delete Te.goalBySession[e],delete Te.gitStatusBySession[e],delete Te.lastSeqBySession[e],delete Te.compactionBySession[e],delete Te.messagesLoadingMoreBySession[e],delete Te.messagesHasMoreBySession[e],delete Te.messagesLoadMoreErrorBySession[e],delete Wh[e],m3.delete(e),Hh.delete(e),delete Te.queuedBySession[e],delete Te.promptIdBySession[e],delete Te.sendingBySession[e]}const r3=te(null),l3=te([]),a3=te(!1),c3=te(!1);async function Fh(e){let t;try{t=await rt().getSessionStatus(e)}catch{return}Bh(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Te.swarmMode=t.swarmMode,Te.planMode=t.planMode}function u3(e){const t=Te.activeSessionId;t&&Promise.resolve(rt().updateSession(t,e)).then(()=>Fh(t)).catch(()=>{})}const d3=Et.betaToc;function sde(){try{return An(d3)==="true"}catch{return!1}}function ode(e){try{Pn(d3,e?"true":"false")}catch{}}const f3=te(sde());function ide(e){f3.value=e,ode(e)}function rde(e){try{return An(e)??""}catch{return""}}const h3=te(rde(QM)==="1");function lde(e){h3.value=e;try{Pn(QM,e?"1":"0")}catch{}}let li=null,E2=0;function p3(){return E2+=1,`msg_opt_${Date.now().toString(36)}_${E2}`}const Hh=new Set;function ade(e,t,n){const s={sessions:Te.sessions,activeSessionId:Te.activeSessionId,messagesBySession:Te.messagesBySession,approvalsBySession:Te.approvalsBySession,planReviewByToolCallId:Te.planReviewByToolCallId,questionsBySession:Te.questionsBySession,tasksBySession:Te.tasksBySession,goalBySession:Te.goalBySession,lastSeqBySession:Te.lastSeqBySession,compactionBySession:Te.compactionBySession,config:Te.config,warnings:Te.warnings},o=Mue(s,e,{sessionId:t,seq:n});n3(o.sessions),t0(o.activeSessionId),ede(o.messagesBySession),Te.approvalsBySession=o.approvalsBySession,Te.planReviewByToolCallId=o.planReviewByToolCallId,Te.questionsBySession=o.questionsBySession,Te.tasksBySession=o.tasksBySession,Te.goalBySession=o.goalBySession,Te.lastSeqBySession=o.lastSeqBySession,Te.compactionBySession=o.compactionBySession,Te.config=o.config??null,Te.warnings=o.warnings,e.type==="configChanged"&&(Te.defaultModel=e.config.defaultModel??null),e.type==="sessionUsageUpdated"&&e.sessionId===Te.activeSessionId&&e.swarmMode!==void 0&&(Te.swarmMode=e.swarmMode),e.type==="sessionUsageUpdated"&&e.sessionId===Te.activeSessionId&&e.planMode!==void 0&&(Te.planMode=e.planMode)}function cde(e,t){ade(e,t.sessionId,t.seq);const n=ks.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:s}=n,o=t.sessionId;e.type==="agentDelta"&&e.agentId===s?e.delta.text&&ks.appendSideChatAssistantText(s,o,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===s?ks.finishSideChatAgent(s,o):e.type==="taskProgress"&&e.taskId===s?ks.appendSideChatAssistantText(s,o,e.outputChunk):e.type==="taskCompleted"&&e.taskId===s&&ks.finishSideChatAgent(s,o,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const s=e.message.sessionId;Te.promptIdBySession[s]!==e.message.promptId&&(Te.promptIdBySession={...Te.promptIdBySession,[s]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Te.activeSessionId&&Js.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&_fe(e.sessionId,e.status)}const ou=fce(({appEvent:e,meta:t})=>cde(e,t),({appEvent:e})=>uce(e));function n0(){if(li!==null||typeof WebSocket>"u")return;Te.connection="connecting",li=rt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ut.applyWorkspaceEvent(t);return}ou({appEvent:t,meta:n})},onResync(t,n,s){ou.flush(),s!==void 0&&(Wh[t]=s),kde.request(t)},onError(t,n,s){s0({severity:"error",title:Nn.global.t("warnings.wsTitle"),message:n,details:[es("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){Te.connected=t,Te.connection=t?"connected":"disconnected"}})}const Wh={},m3=new Set;function ude(e){return yu(e)&&e.code===A2?!0:typeof e=="object"&&e!==null&&e.code===A2}function es(e,t){if(!(t==null||t===""))return{label:Nn.global.t(`warnings.details.${e}`),value:g3(t)}}function g3(e){if(e instanceof Error)return e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function dde(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function fde(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function hde(e,t,n){const s=[es("operation",e),es("sessionId",n)];return PM(t)?s.push(es("request",`${t.method} ${t.path}`),es("endpoint",t.url),es("requestId",t.requestId),es("phase",t.phase),es("timeout",`${t.timeoutMs}ms`),es("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),es("contentType",t.contentType),es("responsePreview",t.bodyPreview),es("cause",t.cause)):yu(t)?s.push(es("code",t.code),es("requestId",t.requestId),es("message",t.message),es("details",t.details)):s.push(es("errorName",dde(t)),es("message",fde(t)??g3(t))),s.filter(o=>o!==void 0)}function pde(e,t,n={}){const s=PM(t),o=yu(t),i=n.title??(s?Nn.global.t("warnings.daemonNetworkTitle"):o?Nn.global.t("warnings.daemonApiTitle"):Nn.global.t("warnings.operationFailedTitle")),r=n.message??(s?Nn.global.t("warnings.daemonNetworkMessage"):o?t.message:Nn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:hde(e,t,n.sessionId)}}function s0(e){Te.warnings=[...Te.warnings,e]}function Uh(e,t,n){s0(pde(e,t,n))}const mde={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function gde(e){if(!yu(e))return;const t=mde[e.code];return t?Nn.global.t(t):void 0}async function vde(e){if(i3(e),Te.activeSessionId!==e)return;const t=Te.sessions[0];t?await ut.selectSession(t.id,{urlMode:"replace"}):(t0(void 0),Te.sessionLoading=!1,ut.writeSessionUrl(void 0,"replace"))}const $2=new Set;async function yde(e){if(!$2.has(e)){$2.add(e);try{const t=await rt().getSessionWarnings(e),n=Nn.global.t("warnings.noteLabel");for(const s of t)s0(`${n}: ${s.message}`)}catch{}}}async function v3(e){try{const n=await rt().getSessionSnapshot(e);ou.flush(),Bh(e,s=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model})),tde(e,n.messages),Te.messagesHasMoreBySession={...Te.messagesHasMoreBySession,[e]:n.hasMoreMessages},Te.approvalsBySession={...Te.approvalsBySession,[e]:n.pendingApprovals};for(const s of n.pendingApprovals){const o=s.display;o?.kind==="plan_review"&&typeof o.plan=="string"&&o.plan.length>0&&(Te.planReviewByToolCallId={...Te.planReviewByToolCallId,[s.toolCallId]:{plan:o.plan,path:typeof o.path=="string"?o.path:void 0}})}return Te.questionsBySession={...Te.questionsBySession,[e]:n.pendingQuestions},Te.lastSeqBySession={...Te.lastSeqBySession,[e]:n.asOfSeq},Wh[e]=n.epoch,n0(),li&&(li.seedSnapshot(e,n),li.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch})),yde(e),"ok"}catch(t){return ude(t)?(await vde(e),"not-found"):(Uh("getSessionSnapshot",t,{title:Nn.global.t("warnings.sessionSnapshotTitle"),message:Nn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const kde=ace(v3);function bde(e){return Object.prototype.hasOwnProperty.call(Te.messagesBySession,e)}function _de(e){if(n0(),li){ou.flush();const t=Te.lastSeqBySession[e]??0,n=Wh[e];li.subscribe(e,{seq:t,epoch:n})}}function jh(e){const t=Te.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=ks.sideChatTargetBySession.value[e]?.agentId,o=(Te.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&Te.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function o0(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;return o<6e4?Nn.global.t("sessions.justNow"):i<1?`${Math.round(o/6e4)}m`:i<24?`${Math.round(i)}h`:n.toLocaleDateString(Nn.global.locale.value,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}const wde=3e4,iu=te(0);let Qm=null;function Sde(){Qm===null&&(Qm=setInterval(()=>{iu.value=(iu.value+1)%Number.MAX_SAFE_INTEGER},wde),Qm.unref?.())}function Cde(e,t){const n=e.split(`
|
|
272
|
-
`),s=t.split(`
|
|
273
|
-
`),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function xde(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:Cde(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command"){const s=typeof t.command=="string"?t.command:e.action,o=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:s,cwd:o,danger:i}}if(n==="file_content"||n==="file"){const s=typeof t.path=="string"?t.path:"",o=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:s,content:o,language:i}}if(n==="file_op"||n==="fileop"){const s=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,o=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s,path:o,detail:i}}if(n==="url_fetch"||n==="url"){const s=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:s}}if(n==="search"){const s=typeof t.query=="string"?t.query:e.action,o=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:s,scope:o}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const s=typeof t.kind=="string"?t.kind:n,o=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:s,name:o,description:i}}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 s=typeof t.plan=="string"?t.plan:"",o=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:s,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Tde(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 Mde(e){const t=Te.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function Ade(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=Nn.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=Nn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??Mde(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s}}const Ede=F(()=>{const e=Te.sessions.find(n=>n.id===Te.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Te.workspaceName,branch:t}}),$de=F(()=>(iu.value,Te.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:o0(e.updatedAt,e.status),status:e.status,busy:jh(e.id)})))),Ide=F(()=>Te.activeSessionId??""),Nde=F(()=>{const e=Te.activeSessionId;return e?Wn.skillsBySession.value[e]??[]:[]}),Lde=F(()=>{const e=Te.activeSessionId;return e?Te.sendingBySession[e]??!1:!1}),ks=fue(Te,{pushOperationFailure:Uh,nextOptimisticMsgId:p3,connectEventsIfNeeded:n0,getEventConn:()=>li}),qh=F(()=>{const e=Te.activeSessionId;if(!e)return[];const t=ks.sideChatTargetBySession.value[e]?.agentId;return(Te.tasksBySession[e]??[]).filter(n=>n.id!==t)}),y3=Wce(Te,qh),Ode=F(()=>{const e=Te.activeSessionId;if(!e)return[];const t=new Set(Te.sideChatUserMessageIdsBySession[e]??[]),n=(Te.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=Te.approvalsBySession[e]??[];return VM(n,s,o=>rt().getFileUrl(o),zh.value!=="idle",qh.value,Te.planReviewByToolCallId)}),Pde=F(()=>(y3.taskClock.value,qh.value.map(Ade))),k3=F(()=>Lue(qh.value)),Kl=F(()=>{const e=Te.activeSessionId;return e?Te.goalBySession[e]??null:null}),Rde=F(()=>{const e=Te.activeSessionId;return e?Eue(Te.messagesBySession[e]??[]):[]}),Dde=F(()=>{const e=Te.activeSessionId;return e?Te.compactionBySession[e]??null:null}),Bde=F(()=>Te.connection),Fde=F(()=>Te.loading),Hde=F(()=>Te.sessionLoading),Wde=F(()=>{const e=Te.activeSessionId;return e?Te.messagesLoadingMoreBySession[e]??!1:!1}),Ude=F(()=>{const e=Te.activeSessionId;return e?Te.messagesHasMoreBySession[e]??!1:!1}),jde=F(()=>{const e=Te.activeSessionId;return e?Te.messagesLoadMoreErrorBySession[e]??!1:!1}),qde=F(()=>Te.serverVersion),zde=F(()=>Te.permission),Vde=F(()=>Te.thinking),Kde=F(()=>Te.planMode),Gde=F(()=>Te.swarmMode),Yde=F(()=>Te.goalMode),Xde=F(()=>{const e=Oue(k3.value);return{plan:Te.planMode,goal:Kl.value&&Kl.value.status!=="complete"?{status:Kl.value.status,turnsUsed:Kl.value.turnsUsed,elapsedMs:Kl.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Zde=F(()=>{const e=Te.activeSessionId;return e?(Te.queuedBySession[e]??[]).map(t=>({text:t.text,attachmentCount:t.attachments?.length??0})):[]}),Jde=F(()=>Te.warnings),Qde=F(()=>{const e=Te.activeSessionId;return e?(Te.questionsBySession[e]??[]).map(Tde):[]}),efe=F(()=>{const e=Te.activeSessionId;return e?(Te.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:xde(t),agentName:t.agentName})):[]}),zh=F(()=>{const e=Te.activeSessionId;return e?(Te.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Te.questionsBySession[e]??[]).length>0?"awaiting-question":jh(e)?"running":"idle":"idle"}),Wn=qce(Te,{pushOperationFailure:Uh,refreshSessionStatus:Fh,persistSessionProfile:u3,activity:zh,inFlightPromptSessions:Hh,saveThinkingToStorage:Fue,updateSession:Bh,updateSessionMessages:o3}),zf=F(()=>{const e=Te.activeSessionId;if(!e)return null;const t=Te.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),tfe=F(()=>{const e=Te.activeSessionId;return e?Te.gitStatusBySession[e]?.pullRequest??null:null}),nfe=F(()=>{const e=Te.activeSessionId;if(!e)return[];const t=Te.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),sfe=F(()=>{const e=Te.activeSessionId;if(!e)return null;const t=Te.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),b3=F(()=>{const e=Te.sessions.find(r=>r.id===Te.activeSessionId),t=zf.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Wn.draftModel.value:null,s=(e?.model&&e.model.length>0?e.model:n??Te.defaultModel)??"—",o=Wn.models.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Te.permission,branch:t,cwd:e?.cwd??"",isGitRepo:zf.value!==null}}),ofe=F(()=>l3.value),ife=F(()=>Te.sessions.find(t=>t.id===Te.activeSessionId)?.usage.totalCostUsd??0),rfe=F(()=>Te.authReady),lfe=F(()=>Te.defaultModel),afe=F(()=>Te.managedProviderStatus),cfe=F(()=>Te.config),ufe=F(()=>{const e=Te.activeSessionId;if(!e)return{};const t=Te.gitStatusBySession[e];return t?{...t.entries}:{}});function ku(e){return Te.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const i0=F(()=>{const e=new Set(Te.hiddenWorkspaceRoots),t=new Map;for(const a of Te.workspaces)e.has(a.root)||t.set(a.root,{...a});for(const a of Te.sessions){const c=a.cwd;c&&(e.has(c)||t.has(c)||t.set(c,{id:a.workspaceId??c,root:c,name:t3(c),isGitRepo:!1,sessionCount:0}))}const n=new Map;for(const a of Te.sessions){const c=ku(a);n.set(c,(n.get(c)??0)+1)}const s=zf.value,o=Te.sessions.find(a=>a.id===Te.activeSessionId)?.cwd,i=Te.workspaces.filter(a=>!e.has(a.root)).map(a=>a.root),r=[...t.keys()].filter(a=>!i.includes(a));r.sort((a,c)=>a.localeCompare(c));const l=[];for(const a of[...i,...r]){const c=t.get(a),u=n.get(c.id)??n.get(c.root)??0,d=Te.sessionsHasMoreByWorkspace[c.id]===!1?u:Math.max(c.sessionCount,u);let f=c.branch;!f&&s&&o===c.root&&(f=s.branch),l.push({...c,sessionCount:d,branch:f})}return l}),Vf=te(m6());Ve(()=>[i0.value.map(e=>e.id).join("\0"),Te.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],s=M6(n,Vf.value);s!==null&&(Vf.value=s,FC(s))});const Ia=F(()=>{const e=i0.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Xue(t.root,Te.fsHome),branch:t.branch,sessionCount:t.sessionCount}));return A6(e,Vf.value)}),_3=F(()=>{const e=Te.activeWorkspaceId,t=Ia.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),dfe=F(()=>{const e=_3.value;return e?Ia.value.find(t=>t.id===e)??null:null}),ffe=F(()=>{iu.value;const e=new Set(Ia.value.map(t=>t.id));return Te.sessions.filter(t=>!t.parentSessionId&&e.has(ku(t))).map(t=>({id:t.id,title:t.title,time:o0(t.updatedAt,t.status),status:t.status,busy:jh(t.id),lastPrompt:t.lastPrompt}))}),hfe=F(()=>{iu.value;const e=new Map;for(const t of Te.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=ku(t),s={id:t.id,title:t.title,time:o0(t.updatedAt,t.status),status:t.status,busy:jh(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Ia.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Te.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Te.sessionsLoadingMoreByWorkspace[t.id]??!1}))});function pfe(e){Vf.value=e,FC(e)}const w3=F(()=>{const e={};for(const[t,n]of Object.entries(Te.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Te.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),mfe=F(()=>{const e={};for(const[t,n]of Object.entries(Te.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Te.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),gfe=F(()=>{const e={};for(const[t,n]of Object.entries(Te.unreadBySession))n&&(e[t]=!0);return e}),vfe=F(()=>{const e={},t=w3.value;for(const n of Te.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=ku(n);e[o]=(e[o]??0)+s}return e}),yfe=F(()=>Te.recentRoots),kfe=F(()=>{const e=new Set,t=[];for(const n of Te.sessions){const s=n.cwd;if(s&&!e.has(s)&&(e.add(s),t.push(s),t.length>=8))break}return t}),bfe=F(()=>Te.availableOpenInApps),ut=yue(Te,{taskPoller:y3,sideChat:ks,modelProvider:Wn,pushOperationFailure:Uh,activity:zh,inFlightPromptSessions:Hh,sessionsKnownEmpty:m3,setSessions:n3,updateSession:Bh,upsertSessionFront:Zue,appendSession:Jue,forgetSession:i3,setActiveSessionId:t0,updateSessionMessages:o3,nextOptimisticMsgId:p3,getEventConn:()=>li,syncSessionFromSnapshot:v3,subscribeToSessionEvents:_de,hasLoadedMessages:bde,refreshSessionStatus:Fh,persistSessionProfile:u3,mergedWorkspaces:i0,workspacesView:Ia,status:b3,workspaceIdForSession:ku,savePermissionToStorage:Due,savePlanModeToStorage:Wue,saveSwarmModeToStorage:jue,saveGoalModeToStorage:zue,saveUnread:iv,saveActiveWorkspaceToStorage:Yue,saveHiddenWorkspacesToStorage:Gue,goalErrorMessage:gde,basename:t3,resetFastMoon:Js.resetFastMoon,initialized:c3,selectedDiffPath:r3,fileDiffLines:l3,fileDiffLoading:a3});function _fe(e,t){if(Hh.delete(e),Te.sendingBySession={...Te.sendingBySession,[e]:!1},Te.promptIdBySession[e]!==void 0){const i={...Te.promptIdBySession};delete i[e],Te.promptIdBySession=i}e===Te.activeSessionId?(Js.resetFastMoon(),ut.loadGitStatus(e),Fh(e)):t==="idle"&&(Te.unreadBySession={...Te.unreadBySession,[e]:!0},iv({[e]:!0})),jd.maybeNotifyCompletion(e,{isActiveAndVisible:e===Te.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:Te.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{ut.selectSession(e)}});const n=Te.queuedBySession[e]??[];if(n.length===0)return;const[s,...o]=n;Te.queuedBySession={...Te.queuedBySession,[e]:o},s!==void 0&&ut.submitPromptInternal(e,s.text,s.attachments).then(i=>{if(!i){const r=Te.queuedBySession[e]??[];Te.queuedBySession={...Te.queuedBySession,[e]:[s,...r]}}})}function wfe(){return Sde(),{workspace:Ede,sessions:$de,activeSessionId:Ide,workspacesView:Ia,visibleWorkspace:dfe,activeWorkspaceId:_3,sessionsForView:ffe,workspaceGroups:hfe,attentionBySession:w3,pendingBySession:mfe,attentionByWorkspace:vfe,unreadBySession:gfe,recentRoots:yfe,turns:Ode,tasks:Pde,todos:Rde,goal:Kl,swarms:k3,activationBadges:Xde,compaction:Dde,status:b3,sessionCost:ife,fileDiff:ofe,selectedDiffPath:r3,fileDiffLoading:a3,changes:nfe,gitInfo:zf,gitDiffStats:sfe,activePullRequest:tfe,changesByPath:ufe,pendingApprovals:efe,recentCwds:kfe,availableOpenInApps:bfe,connection:Bde,loading:Fde,sessionLoading:Hde,loadingMoreMessages:Wde,hasMoreMessages:Ude,loadMoreMessagesError:jde,serverVersion:qde,initialized:c3,permission:zde,thinking:Vde,planMode:Kde,swarmMode:Gde,goalMode:Yde,queued:Zde,warnings:Jde,questions:Qde,activity:zh,isSending:Lde,fastMoon:Js.fastMoon,models:Wn.models,starredModelIds:Wn.starredModelIds,providers:Wn.providers,theme:Js.theme,setTheme:Js.setTheme,toggleTheme:Js.toggleTheme,uiFontSize:Js.uiFontSize,setUiFontSize:Js.setUiFontSize,betaToc:f3,setBetaToc:ide,colorScheme:Js.colorScheme,setColorScheme:Js.setColorScheme,accent:Js.accent,setAccent:Js.setAccent,notifyOnComplete:jd.notifyOnComplete,notifyPermission:jd.notifyPermission,setNotifyOnComplete:jd.setNotifyOnComplete,onboarded:h3,setOnboarded:lde,load:ut.load,selectSession:ut.selectSession,createSession:ut.createSession,loadOlderMessages:ut.loadOlderMessages,loadWorkspaces:ut.loadWorkspaces,loadMoreSessions:ut.loadMoreSessions,loadAllSessions:ut.loadAllSessions,selectWorkspace:ut.selectWorkspace,openWorkspace:ut.openWorkspace,openWorkspaceDraft:ut.openWorkspaceDraft,createSessionInWorkspace:ut.createSessionInWorkspace,startSessionAndSendPrompt:ut.startSessionAndSendPrompt,addWorkspaceByPath:ut.addWorkspaceByPath,browseFs:ut.browseFs,getFsHome:ut.getFsHome,sendPrompt:ut.sendPrompt,steerPrompt:ut.steerPrompt,sideChatVisible:ks.sideChatVisible,sideChatSessionId:ks.sideChatSessionId,sideChatTurns:ks.sideChatTurns,sideChatRunning:ks.sideChatRunning,sideChatSending:ks.sideChatSending,openSideChat:ks.openSideChat,closeSideChat:ks.closeSideChat,sendSideChatPrompt:ks.sendSideChatPrompt,uploadImage:ut.uploadImage,abortCurrentPrompt:ut.abortCurrentPrompt,respondApproval:ut.respondApproval,respondQuestion:ut.respondQuestion,dismissQuestion:ut.dismissQuestion,cancelTask:ut.cancelTask,setPermission:ut.setPermission,setThinking:Wn.setThinking,setPlanMode:ut.setPlanMode,togglePlanMode:ut.togglePlanMode,setSwarmMode:ut.setSwarmMode,toggleSwarmMode:ut.toggleSwarmMode,setGoalMode:ut.setGoalMode,toggleGoalMode:ut.toggleGoalMode,createGoal:ut.createGoal,controlGoal:ut.controlGoal,enqueue:ut.enqueue,dismissWarning:ut.dismissWarning,renameSession:ut.renameSession,renameWorkspace:ut.renameWorkspace,deleteWorkspace:ut.deleteWorkspace,reorderWorkspaces:pfe,archiveSession:ut.archiveSession,compact:ut.compact,forkSession:ut.forkSession,undo:ut.undo,unqueue:ut.unqueue,searchFiles:ut.searchFiles,loadGitStatus:ut.loadGitStatus,loadFileDiff:ut.loadFileDiff,clearFileDiff:ut.clearFileDiff,listDir:ut.listDir,readFileContent:ut.readFileContent,getFileDownloadUrl:ut.getFileDownloadUrl,openWorkspaceFile:ut.openWorkspaceFile,openInApp:ut.openInApp,revealWorkspaceFile:ut.revealWorkspaceFile,resolveImageUrl:ut.resolveImageUrl,refreshOAuthProviderModels:Wn.refreshOAuthProviderModels,loadModels:Wn.loadModels,loadProviders:Wn.loadProviders,skills:Nde,activateSkill:Wn.activateSkill,setModel:Wn.setModel,toggleStarModel:Wn.toggleStarModel,addProvider:Wn.addProvider,deleteProvider:Wn.deleteProvider,refreshProvider:Wn.refreshProvider,authReady:rfe,defaultModel:lfe,managedProviderStatus:afe,config:cfe,updateConfig:ut.updateConfig,checkAuth:ut.checkAuth,startOAuthLogin:Wn.startOAuthLogin,pollOAuthLogin:Wn.pollOAuthLogin,cancelOAuthLogin:Wn.cancelOAuthLogin,logout:ut.logout}}function Sfe({client:e,authLogoRef:t}){const n=F(()=>e.authReady.value),s=F(()=>e.initialized.value&&!n.value),o="/login",i=te(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)}Ve(s,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==o&&(i.value=l(),a(o));return}window.location.pathname===o&&(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 Ht(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:s,blinkAuthLogo:c}}function Cfe({running:e,showAuthGate:t}){const{t:n}=_t(),s=["◐","◓","◑","◒"],o=te(0);let i=null;function r(){i===null&&(o.value=0,i=setInterval(()=>{o.value=(o.value+1)%s.length},250))}function l(){i!==null&&(clearInterval(i),i=null),o.value=0}Ve(e,c=>{c?r():l()},{immediate:!0});const a=F(()=>{const c=e.value?`${s[o.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});pE(()=>{typeof document<"u"&&(document.title=a.value)}),Ht(()=>{l()})}const S3=te(typeof window>"u"?0:window.innerWidth);let Sd=0,Kf=!1;function x1(){S3.value=window.innerWidth}function xfe(){Kf||typeof window>"u"||(window.addEventListener("resize",x1),Kf=!0,x1())}function Tfe(){!Kf||typeof window>"u"||(window.removeEventListener("resize",x1),Kf=!1)}function C3(e,t,n){return Math.max(t,e-n)}function T1(e,t,n){return Math.min(n,Math.max(t,e))}function x3(){return Qt(()=>{Sd+=1,xfe()}),Ks(()=>{Sd=Math.max(0,Sd-1),Sd===0&&Tfe()}),{viewportWidth:S3}}const Mfe="kimi-web.file-preview-width",Gl=320;function Afe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:s}){const{viewportWidth:o}=x3(),i=F(()=>Math.max(0,o.value-t.value)),r=F(()=>C3(i.value,Gl,Gl));function l(me){return T1(Math.round(me),Gl,r.value)}function a(){return l(i.value/2)}const c=F(()=>a()),u=te(c.value),d=F(()=>T1(u.value,Gl,r.value)),f=te(null),h=F(()=>{const me=f.value;if(!me)return null;const J=e.turns.value.find(ye=>ye.id===me.turnId)?.blocks?.[me.blockIndex];return J?.kind==="thinking"?J.thinking:null}),p=F(()=>h.value!==null);function g(me){const $e=f.value;if($e&&$e.turnId===me.turnId&&$e.blockIndex===me.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=me}function S(){f.value=null,n.value==="thinking"&&(n.value=null)}const _=te(null),y=F(()=>{const me=_.value;if(!me)return null;const $e=e.turns.value.find(J=>J.id===me.turnId);return $e?.role==="compaction"&&$e.text?$e.text:null}),b=F(()=>y.value!==null);function v(me){if(_.value?.turnId===me.turnId){_.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",_.value=me}function w(){_.value=null,n.value==="compaction"&&(n.value=null)}const N=te(null),E=F(()=>{const me=N.value;if(!me)return null;const J=e.turns.value.find(ye=>ye.id===me.turnId)?.blocks?.[me.blockIndex];return J?J.kind==="agent"?J.member.id===me.memberId?J.member:null:J.kind==="agentGroup"?J.members.find(ye=>ye.id===me.memberId)??null:null:null}),k=F(()=>E.value!==null);function A(me){const $e=N.value;if($e&&$e.turnId===me.turnId&&$e.memberId===me.memberId){N.value=null,n.value==="agent"&&(n.value=null);return}n.value="agent",N.value=me}function I(){N.value=null,n.value==="agent"&&(n.value=null)}const P=te(null),M=F(()=>{const me=P.value;if(!me)return null;const $e=t8(e.turns.value,me);return $e?{id:me,title:gf($e.name),path:e8($e.arg),lines:$e.status==="error"?null:zC($e),output:$e.output}:null}),L=F(()=>M.value!==null);function R(me){if(n.value==="toolDiff"&&P.value===me){B();return}n.value="toolDiff",P.value=me}function B(){P.value=null,n.value==="toolDiff"&&(n.value=null)}const W=te("list"),K=te(null);function V(){if(n.value==="diff"){se();return}n.value="diff",W.value="list",K.value=null,e.loadGitStatus(e.activeSessionId.value)}function se(){n.value==="diff"&&(n.value=null),W.value="list",K.value=null,e.clearFileDiff()}async function Y(me){W.value="detail",K.value=me,await e.loadFileDiff(me)}async function G(me){await e.openSideChat(me),n.value="btw"}function ee(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function we(){n.value==="btw"&&(n.value=null)}const de=F(()=>e.sideChatVisible.value),Le=F(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||b.value)&&(n.value!=="agent"||k.value)&&(n.value!=="toolDiff"||L.value)&&(n.value!=="btw"||de.value)),ce=te(!1);function _e(){return n.value==="thinking"&&p.value?(S(),!0):n.value==="compaction"&&b.value?(w(),!0):n.value==="agent"&&k.value?(I(),!0):n.value==="toolDiff"&&L.value?(B(),!0):n.value==="file"?(s(),!0):n.value==="diff"?(se(),!0):n.value==="btw"?(ee(),!0):!1}return Ve(e.activeSessionId,()=>{s(),S(),w(),I(),B(),se(),we()}),{PREVIEW_WIDTH_KEY:Mfe,PREVIEW_MIN:Gl,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:g,closeThinkingPanel:S,compactionPanelText:y,compactionPanelVisible:b,openCompactionPanel:v,closeCompactionPanel:w,agentPanelMember:E,agentPanelVisible:k,openAgentPanel:A,closeAgentPanel:I,toolDiffTarget:M,toolDiffVisible:L,openToolDiff:R,closeToolDiff:B,detailDiffMode:W,detailDiffPath:K,openDiffDetail:V,closeDiffDetail:se,selectDiffFile:Y,btwVisible:de,openSideChatTab:G,closeSideChat:ee,hideSideChatPanel:we,sidePanelVisible:Le,panelDragging:ce,closeOpenSidePanel:_e}}const Efe=Et.sidebarWidth,I2=Et.sidebarCollapsed,N2=270,eg=170,$fe=36,Ife=320;function Nfe(e={}){const{viewportWidth:t}=x3(),n=te(N2),s=te(!1),o=F(()=>{const c=Ife+(nS(e.previewOpen)?Gl:0);return C3(t.value,eg,c)}),i=F(()=>s.value?$fe:T1(n.value,eg,o.value));function r(){try{s.value=An(I2)==="true"}catch{s.value=!1}}function l(){try{Pn(I2,String(s.value))}catch{}}function a(){s.value=!s.value,l()}return{SIDEBAR_WIDTH_KEY:Efe,SIDEBAR_DEFAULT:N2,SIDEBAR_MIN:eg,sidebarMax:o,sessionColWidth:n,sidebarCollapsed:s,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function Lfe({client:e,detailTarget:t}){const{t:n}=_t(),s=te(null),o=te(null),i=te(!1),r=te(null),l=te(null);let a=0;const c=F(()=>{const v=l.value;return v?e.getFileDownloadUrl(v):null}),u=F(()=>s.value!==null);function d(v){return v.length>1?v.replace(/\/+$/,""):v}function f(v){const w=[];for(const N of v.split(/[\\/]+/))if(!(!N||N===".")){if(N===".."){w.pop();continue}w.push(N)}return w.join("/")}function h(v){const w=v.trim();if(!w)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(w))return{error:n("filePreview.errors.unsupportedPath")};if(w.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const N=d(e.status.value.cwd);if(w.startsWith("/")){if(!N||w!==N&&!w.startsWith(`${N}/`))return{error:n("filePreview.errors.outsideWorkspace")};const k=w===N?"":w.slice(N.length+1);if(k.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const A=f(k);return A?{path:A}:{error:n("filePreview.errors.isDirectory")}}if(w.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const E=f(w);return E?{path:E}:{error:n("filePreview.errors.emptyPath")}}async function p(v){const w=s.value;if(t.value==="file"&&w&&w.path===v.path&&w.line===v.line){_();return}const N=++a;t.value="file",o.value=null,r.value=null,i.value=!0,s.value=v,l.value=null;const E=h(v.path);if("error"in E){i.value=!1,r.value=E.error;return}l.value=E.path;try{const k=await e.readFileContent(E.path);if(N!==a)return;k?o.value={...k,path:k.path||E.path}:o.value={path:E.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(k){if(N!==a)return;r.value=k instanceof Error?k.message:n("filePreview.errors.loadFailed")}finally{N===a&&(i.value=!1)}}function g(v){return/^data:([^;,]+)/i.exec(v)?.[1]}function S(v){v.kind==="image"&&(t.value="file",s.value=null,l.value=null,r.value=null,i.value=!1,o.value={path:v.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:v.mimeType??g(v.url)??"image/*",sourceUrl:v.url,isBinary:!0,size:v.bytes??0})}function _(){s.value=null,l.value=null,o.value=null,r.value=null,i.value=!1,t.value==="file"&&(t.value=null)}function y(){const v=o.value?.path??s.value?.path;v&&e.openWorkspaceFile(v,s.value?.line)}function b(){const v=o.value?.path??s.value?.path;v&&e.revealWorkspaceFile(v)}return{previewTarget:s,previewFile:o,previewLoading:i,previewError:r,previewDownloadUrl:c,previewExternalActions:u,openFilePreview:p,openMediaPreview:S,closeFilePreview:_,openPreviewInEditor:y,revealPreviewFile:b}}const Ofe=640,Pfe=`(max-width: ${Ofe}px)`;function Rfe(){const e=te(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Pfe);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),Ht(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),Ht(()=>t.removeListener(n))),e}const Dfe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Bfe={class:"server-auth-card"},Ffe=["disabled"],Hfe=["disabled"],Wfe=Xe({__name:"ServerAuthDialog",setup(e){const t=te(""),n=te(null),s=te(!1);Qt(()=>{ft(()=>n.value?.focus())});function o(){const r=t.value;!r||s.value||(s.value=!0,DM(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),o())}return(r,l)=>(x(),$("div",Dfe,[m("div",Bfe,[l[1]||(l[1]=m("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required",-1)),l[2]||(l[2]=m("p",{class:"server-auth-hint"},[dt(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),m("code",null,"KIMI_CODE_PASSWORD"),dt("). ")],-1)),Ot(m("input",{ref_key:"inputRef",ref:n,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",class:"server-auth-input",autocomplete:"current-password",placeholder:"Token",disabled:s.value,onKeydown:i},null,40,Ffe),[[xn,t.value]]),m("button",{type:"button",class:"server-auth-button",disabled:!t.value||s.value,onClick:o},O(s.value?"Connecting…":"Connect"),9,Hfe)])]))}}),Ufe=vt(Wfe,[["__scopeId","data-v-fb2ac094"]]),jfe={class:"app-shell"},qfe={key:1,class:"auth-page"},zfe={class:"auth-page-inner"},Vfe={class:"auth-page-copy"},Kfe={key:0,class:"sidebar-rail"},Gfe=["title","aria-label"],Yfe={key:3,class:"coming-soon"},Xfe={class:"cs-text"},Zfe=["aria-label","aria-hidden"],Jfe=Xe({__name:"App",setup(e){const t=Xae(),n=te(!t);let s=null;const o=wfe();kn("resolveImage",o.resolveImageUrl);const{t:i}=_t(),r=ci(),l=Rfe(),a=te(!1),c=te(!1),u=F(()=>{const pe=o.activeSessionId.value;return o.sessions.value.find(z=>z.id===pe)?.title??""}),d=F(()=>o.visibleWorkspace.value?.sessionCount??0),f=F(()=>o.activity.value!=="idle"),h=te(null),{showAuthGate:p,blinkAuthLogo:g}=Sfe({client:o,authLogoRef:h});Cfe({running:f,showAuthGate:p});function S(pe){return pe==="off"?"high":"off"}const _=te(!o.onboarded.value);function y(){o.setOnboarded(!0),_.value=!1}function b(){_.value=!0}Qt(()=>{o.load(),Le(),document.addEventListener("keydown",v,!0),s=Jae(()=>{n.value=!0})}),Ht(()=>{document.removeEventListener("keydown",v,!0),s!==null&&(s(),s=null)});function v(pe){pe.key==="Escape"&&(ps.value||pn()&&(pe.stopPropagation(),pe.preventDefault()))}const w=te(null),{previewTarget:N,previewFile:E,previewLoading:k,previewError:A,previewDownloadUrl:I,previewExternalActions:P,openFilePreview:M,openMediaPreview:L,closeFilePreview:R,openPreviewInEditor:B,revealPreviewFile:W}=Lfe({client:o,detailTarget:w}),K=F(()=>w.value!==null),{SIDEBAR_WIDTH_KEY:V,SIDEBAR_DEFAULT:se,SIDEBAR_MIN:Y,sidebarMax:G,sessionColWidth:ee,sidebarCollapsed:we,sideWidth:de,loadSidebarCollapsed:Le,toggleSidebarCollapse:ce}=Nfe({previewOpen:K}),{PREVIEW_WIDTH_KEY:_e,PREVIEW_MIN:me,previewDefaultWidth:$e,previewMax:J,previewWidth:ye,previewPanelWidth:Se,thinkingPanelText:U,thinkingVisible:Z,openThinkingPanel:fe,closeThinkingPanel:oe,compactionPanelText:he,compactionPanelVisible:H,openCompactionPanel:X,closeCompactionPanel:ae,agentPanelMember:ke,openAgentPanel:Me,closeAgentPanel:Ie,toolDiffTarget:re,openToolDiff:le,closeToolDiff:Ce,detailDiffMode:We,detailDiffPath:nt,openDiffDetail:lt,closeDiffDetail:bt,selectDiffFile:St,btwVisible:ct,openSideChatTab:It,closeSideChat:hn,sidePanelVisible:vn,panelDragging:$t,closeOpenSidePanel:pn}=Afe({client:o,sideWidth:de,detailTarget:w,closeFilePreview:R}),un=te(null),et=te([]),Rn=F(()=>et.value.length>1);function Po(pe){et.value=pe}const fs=te(!1),Fn=te(!1),sn=te(!1),En=te(!1),Kn=te(!1),_n=te(!1),xs=te(!1),Hn=te(!1),hs=te(null),ps=F(()=>fs.value||Fn.value||sn.value||En.value||Kn.value||_n.value||xs.value||Hn.value||_.value||a.value||c.value),ss=te(!1),Tt=te(!1),ms=te(!1),qt=te(!1),Ts=te(!1);async function Ke(){ss.value=!0,Tt.value=!1,fs.value=!0;try{await o.refreshOAuthProviderModels(),await o.loadModels()}catch{Tt.value=!0}finally{ss.value=!1}}async function Ue(){ms.value=!0,qt.value=!1,Fn.value=!0;try{await o.loadProviders()}catch{qt.value=!0}finally{ms.value=!1}}function Je(){sn.value=!0}async function Mt(pe){fs.value=!1,await o.setModel(pe)}async function Ne(pe){await o.addProvider(pe)}async function ge(pe){await o.deleteProvider(pe)}async function He(pe){await o.refreshProvider(pe)}async function zt(pe){Ts.value=!0;try{await o.updateConfig(pe)&&await o.checkAuth()}finally{Ts.value=!1}}async function Yt(){return o.startOAuthLogin()}async function Nt(){return o.pollOAuthLogin()}async function Pt(){return o.cancelOAuthLogin()}async function po(){sn.value=!1,await o.checkAuth(),await o.load()}async function mo(pe){await o.undo(1),await ft(),un.value?.loadComposerForEdit(pe)}function Bi(pe){if(pe==="/compact"||pe.startsWith("/compact ")){o.compact(pe.slice(8).trim()||void 0);return}if(pe==="/swarm"||pe.startsWith("/swarm ")){const z=pe.slice(6).trim();z==="on"?o.setSwarmMode(!0):z==="off"?o.setSwarmMode(!1):z?(o.setSwarmMode(!0),o.sendPrompt(z)):o.toggleSwarmMode();return}if(pe==="/goal"||pe.startsWith("/goal ")){const z=pe.slice(5).trim();z==="pause"||z==="resume"||z==="cancel"?o.controlGoal(z):z?o.createGoal(z):o.toggleGoalMode();return}if(pe==="/btw"||pe.startsWith("/btw ")){const z=pe.slice(4).trim();!z&&o.sideChatVisible.value?hn():It(z||void 0);return}switch(pe){case"/new":case"/clear":En.value=!0;break;case"/sessions":Kn.value=!0;break;case"/fork":o.forkSession();break;case"/undo":o.undo();break;case"/permission":{const z=o.permission.value,ne=z==="manual"?"auto":z==="auto"?"yolo":"manual";o.setPermission(ne);break}case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(S(o.thinking.value));break;case"/help":o.dismissWarning(-1);break;case"/status":xs.value=!0;break;case"/model":Ke();break;case"/provider":Ue();break;case"/login":Je();break;default:{const z=pe.indexOf(" "),ne=(z===-1?pe:pe.slice(0,z)).slice(1),Ge=z===-1?void 0:pe.slice(z+1).trim()||void 0;ne&&o.activateSkill(ne,Ge);break}}}function zo(pe){o.unqueue(pe)}function Fi(pe){o.unqueue(pe)}async function Vo(pe){const z=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&z){await o.startSessionAndSendPrompt(z,pe.text,pe.attachments);return}if(!o.activeSessionId.value&&!z){hs.value=pe,_n.value=!0;return}o.sendPrompt(pe.text,pe.attachments)}async function Jn(pe){_n.value=!1,await o.addWorkspaceByPath(pe);const z=hs.value;hs.value=null;const ne=o.activeWorkspaceId.value;z&&ne&&await o.startSessionAndSendPrompt(ne,z.text,z.attachments)}function Hi(){hs.value=null,_n.value=!1}function vl(){const pe=o.activeWorkspaceId.value;pe?o.openWorkspaceDraft(pe):En.value=!0}function Er(pe){o.openWorkspaceDraft(pe)}function ue(pe){pe&&window.open(pe,"_blank","noopener")}return(pe,z)=>(x(),$("div",jfe,[n.value?(x(),je(Ufe,{key:0})):ie("",!0),C(p)?(x(),$("section",qfe,[m("div",zfe,[(x(),$("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:z[0]||(z[0]=Ze(()=>{},["prevent"])),onClick:z[1]||(z[1]=(...ne)=>C(g)&&C(g)(...ne))},[...z[97]||(z[97]=[kr('<defs data-v-f77bc585><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-f77bc585><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-f77bc585></rect><g class="ch-eyes" fill="#000" data-v-f77bc585><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-f77bc585></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-f77bc585></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-f77bc585></rect>',2)])],544)),m("div",Vfe,[m("h1",null,O(C(i)("app.authPageTitle")),1),m("p",null,O(C(i)("app.authPageMessage")),1)]),m("button",{type:"button",class:"auth-page-btn",onClick:Je},[z[98]||(z[98]=m("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M6 3h5a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6"}),m("path",{d:"M9 8H2"}),m("path",{d:"M5 5l3 3-3 3"})],-1)),m("span",null,O(C(i)("app.authPageLogin")),1)])])])):(x(),$("div",{key:2,class:Oe(["app",{mobile:C(l),"sidebar-collapsed":C(we)&&!C(l)}]),style:Ft({"--side-w":C(de)+"px","--preview-w":C(Se)+"px"})},[C(l)?(x(),je(Lie,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":u.value,running:f.value,branch:C(o).status.value.branch,"session-count":d.value,onOpenSwitcher:z[17]||(z[17]=ne=>a.value=!0),onOpenSettings:z[18]||(z[18]=ne=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(x(),$(Pe,{key:0},[Ot(gt(b5,{"col-width":C(de),"active-workspace":C(o).visibleWorkspace.value,"active-workspace-id":C(o).activeWorkspaceId.value,sessions:C(o).sessionsForView.value,groups:C(o).workspaceGroups.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"pending-by-session":C(o).pendingBySession.value,"unread-by-session":C(o).unreadBySession.value,onSelect:z[2]||(z[2]=ne=>C(o).selectSession(ne)),onCreate:vl,onCreateInWorkspace:z[3]||(z[3]=ne=>Er(ne)),onSelectWorkspace:z[4]||(z[4]=ne=>C(o).openWorkspace(ne)),onAddWorkspace:z[5]||(z[5]=ne=>_n.value=!0),onRename:z[6]||(z[6]=(ne,Ge)=>C(o).renameSession(ne,Ge)),onArchive:z[7]||(z[7]=ne=>C(o).archiveSession(ne)),onFork:z[8]||(z[8]=ne=>C(o).forkSession(ne)),onRenameWorkspace:z[9]||(z[9]=(ne,Ge)=>C(o).renameWorkspace(ne,Ge)),onDeleteWorkspace:z[10]||(z[10]=ne=>C(o).deleteWorkspace(ne)),onReorderWorkspaces:z[11]||(z[11]=ne=>C(o).reorderWorkspaces(ne)),onLoadMoreSessions:z[12]||(z[12]=ne=>void C(o).loadMoreSessions(ne)),onLoadAllSessions:z[13]||(z[13]=ne=>void C(o).loadAllSessions()),onSelectWorkspaces:Po,onOpenSettings:z[14]||(z[14]=ne=>Hn.value=!0),onCollapse:C(ce)},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","onCollapse"]),[[Ho,!C(we)]]),Ot(gt(Xk,{"storage-key":C(V),"default-width":C(se),min:C(Y),max:C(G),"onUpdate:width":z[15]||(z[15]=ne=>ee.value=ne)},null,8,["storage-key","default-width","min","max"]),[[Ho,!C(we)]]),C(we)?(x(),$("div",Kfe,[m("button",{type:"button",class:"sidebar-expand-btn",title:C(i)("sidebar.expandSidebar"),"aria-label":C(i)("sidebar.expandSidebar"),onClick:z[16]||(z[16]=(...ne)=>C(ce)&&C(ce)(...ne))},[...z[99]||(z[99]=[kr('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-f77bc585><path d="M4 6h9" data-v-f77bc585></path><path d="M4 12h9" data-v-f77bc585></path><path d="M4 18h9" data-v-f77bc585></path><path d="M17 9l3 3-3 3" data-v-f77bc585></path></svg>',1)])],8,Gfe)])):ie("",!0)],64)),Rn.value?(x(),$("div",Yfe,[z[100]||(z[100]=m("span",{class:"cs-icon"},"🚧",-1)),m("span",Xfe,O(C(i)("app.comingSoon")),1)])):(x(),je(TX,{key:2,ref_key:"conversationPaneRef",ref:un,mobile:C(l),modern:C(o).theme.value==="modern"||C(o).theme.value==="kimi",turns:C(o).turns.value,"session-id":C(o).activeSessionId.value,approvals:C(o).pendingApprovals.value,changes:C(o).changes.value,"git-info":C(o).gitInfo.value,tasks:C(o).tasks.value,todos:C(o).todos.value,goal:C(o).goal.value,swarms:C(o).swarms.value,"activation-badges":C(o).activationBadges.value,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"goal-mode":C(o).goalMode.value,models:C(o).models.value,"starred-ids":C(o).starredModelIds.value,skills:C(o).skills.value,questions:C(o).questions.value,running:f.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,sending:C(o).isSending.value,"fast-moon":C(o).fastMoon.value,"file-reload-key":C(o).activeSessionId.value,"session-loading":C(o).sessionLoading.value,compaction:C(o).compaction.value,"has-more-messages":C(o).hasMoreMessages.value,"loading-more":C(o).loadingMoreMessages.value,"loading-more-error":C(o).loadMoreMessagesError.value,"load-older-messages":C(o).loadOlderMessages,"workspace-name":C(o).visibleWorkspace.value?.name,"workspace-root":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,"git-diff-stats":C(o).gitDiffStats.value,workspaces:C(o).workspacesView.value,"active-workspace-id":C(o).activeWorkspaceId.value,"session-title":u.value,pr:C(o).activePullRequest.value,"beta-toc":C(o).betaToc.value,onOpenChanges:z[19]||(z[19]=ne=>C(lt)()),onSelectWorkspace:z[20]||(z[20]=ne=>Er(ne)),onAddWorkspace:z[21]||(z[21]=ne=>_n.value=!0),onOpenPr:ue,onSubmit:z[22]||(z[22]=ne=>Vo(ne)),onSteer:z[23]||(z[23]=ne=>C(o).steerPrompt(ne.text,ne.attachments)),onApproval:z[24]||(z[24]=(ne,Ge)=>C(o).respondApproval(ne,Ge)),onCancelTask:z[25]||(z[25]=ne=>C(o).cancelTask(ne)),onAnswer:z[26]||(z[26]=(ne,Ge)=>C(o).respondQuestion(ne,Ge)),onDismiss:z[27]||(z[27]=ne=>C(o).dismissQuestion(ne)),onCommand:Bi,onInterrupt:z[28]||(z[28]=ne=>C(o).abortCurrentPrompt()),onUnqueue:zo,onEditQueued:Fi,onSetPermission:z[29]||(z[29]=ne=>C(o).setPermission(ne)),onSetThinking:z[30]||(z[30]=ne=>C(o).setThinking(ne)),onTogglePlan:z[31]||(z[31]=ne=>C(o).togglePlanMode()),onToggleSwarm:z[32]||(z[32]=ne=>C(o).toggleSwarmMode()),onToggleGoal:z[33]||(z[33]=ne=>C(o).toggleGoalMode()),onCreateGoal:z[34]||(z[34]=ne=>C(o).createGoal(ne)),onControlGoal:z[35]||(z[35]=ne=>C(o).controlGoal(ne)),onRefreshGitStatus:z[36]||(z[36]=ne=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:z[37]||(z[37]=(ne,Ge)=>C(o).renameSession(ne,Ge)),onForkSession:z[38]||(z[38]=ne=>C(o).forkSession(ne)),onArchiveSession:z[39]||(z[39]=ne=>C(o).archiveSession(ne)),onCompact:z[40]||(z[40]=ne=>C(o).compact()),onPickModel:z[41]||(z[41]=ne=>Ke()),onSelectModel:z[42]||(z[42]=ne=>C(o).setModel(ne)),onOpenFile:z[43]||(z[43]=ne=>C(M)(ne)),onOpenMedia:z[44]||(z[44]=ne=>C(L)(ne)),onOpenThinking:z[45]||(z[45]=ne=>C(fe)(ne)),onOpenCompaction:z[46]||(z[46]=ne=>C(X)(ne)),onOpenAgent:z[47]||(z[47]=ne=>C(Me)(ne)),onOpenToolDiff:z[48]||(z[48]=ne=>C(le)(ne)),onEditMessage:mo},null,8,["mobile","modern","turns","session-id","approvals","changes","git-info","tasks","todos","goal","swarms","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","running","queued","search-files","upload-image","sending","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","beta-toc"])),C(vn)&&!C(l)?(x(),je(Xk,{key:4,"storage-key":C(_e),"default-width":C($e),min:C(me),max:C(J),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":z[49]||(z[49]=ne=>ye.value=ne),"onUpdate:dragging":z[50]||(z[50]=ne=>$t.value=ne)},null,8,["storage-key","default-width","min","max","aria-label"])):ie("",!0),!C(l)||C(vn)?(x(),$("aside",{key:5,class:Oe(["global-preview",{open:C(vn),mobile:C(l),"no-anim":C($t)}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(vn)},[w.value==="thinking"&&C(Z)?(x(),je(e2,{key:0,text:C(U)??"",onClose:C(oe)},null,8,["text","onClose"])):w.value==="compaction"&&C(H)?(x(),je(e2,{key:1,text:C(he)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(ae)},null,8,["text","subtitle","onClose"])):w.value==="agent"&&C(ke)?(x(),je(aJ,{key:2,member:C(ke),onClose:C(Ie)},null,8,["member","onClose"])):w.value==="btw"&&C(ct)?(x(),je(DJ,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:z[51]||(z[51]=ne=>C(o).sendSideChatPrompt(ne)),onClose:C(hn)},null,8,["turns","running","sending","onClose"])):w.value==="diff"?(x(),je(SQ,{key:4,mode:C(We),changes:C(o).changes.value,"git-info":C(o).gitInfo.value,"file-diff":C(o).fileDiff.value,"selected-diff-path":C(o).selectedDiffPath.value,"file-diff-loading":C(o).fileDiffLoading.value,closable:"",onOpen:C(St),onBack:z[52]||(z[52]=ne=>{We.value="list",nt.value=null,C(o).clearFileDiff()}),onClose:C(bt)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):w.value==="toolDiff"&&C(re)?(x(),je(xJ,{key:5,target:C(re),onClose:C(Ce)},null,8,["target","onClose"])):w.value==="file"?(x(),je(DZ,{key:6,file:C(E),loading:C(k),error:C(A),line:C(N)?.line,"download-url":C(I),closable:"","external-actions":C(P),"open-file":C(M),onClose:C(R),onOpenExternal:C(B),onReveal:C(W)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ie("",!0)],10,Zfe)):ie("",!0),fs.value?(x(),je(XQ,{key:6,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:ss.value,unavailable:Tt.value,onSelect:z[53]||(z[53]=ne=>Mt(ne)),onToggleStar:z[54]||(z[54]=ne=>C(o).toggleStarModel(ne)),onClose:z[55]||(z[55]=ne=>fs.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ie("",!0),Hn.value?(x(),je(Yse,{key:7,theme:C(o).theme.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"account-model":C(o).defaultModel.value,notify:C(o).notifyOnComplete.value,"notify-permission":C(o).notifyPermission.value,"beta-toc":C(o).betaToc.value,config:C(o).config.value,models:C(o).models.value,"config-saving":Ts.value,"server-version":C(o).serverVersion.value,onSetTheme:z[56]||(z[56]=ne=>C(o).setTheme(ne)),onSetColorScheme:z[57]||(z[57]=ne=>C(o).setColorScheme(ne)),onSetUiFontSize:z[58]||(z[58]=ne=>C(o).setUiFontSize(ne)),onSetNotify:z[59]||(z[59]=ne=>C(o).setNotifyOnComplete(ne)),onSetBetaToc:z[60]||(z[60]=ne=>C(o).setBetaToc(ne)),onUpdateConfig:z[61]||(z[61]=ne=>zt(ne)),onLogin:z[62]||(z[62]=()=>{Hn.value=!1,Je()}),onLogout:C(o).logout,onOpenOnboarding:z[63]||(z[63]=()=>{Hn.value=!1,b()}),onClose:z[64]||(z[64]=ne=>Hn.value=!1)},null,8,["theme","color-scheme","ui-font-size","auth-ready","account-model","notify","notify-permission","beta-toc","config","models","config-saving","server-version","onLogout"])):ie("",!0),Fn.value?(x(),je(Fee,{key:8,providers:C(o).providers.value,loading:ms.value,unavailable:qt.value,onAdd:z[65]||(z[65]=ne=>Ne(ne)),onRefresh:z[66]||(z[66]=ne=>He(ne)),onDelete:z[67]||(z[67]=ne=>ge(ne)),onOpenLogin:z[68]||(z[68]=()=>{Fn.value=!1,Je()}),onClose:z[69]||(z[69]=ne=>Fn.value=!1)},null,8,["providers","loading","unavailable"])):ie("",!0),En.value?(x(),je(Fte,{key:9,"recent-cwds":C(o).recentCwds.value,onCreate:z[70]||(z[70]=({cwd:ne,title:Ge})=>{En.value=!1,C(o).createSession(ne,{title:Ge})}),onClose:z[71]||(z[71]=ne=>En.value=!1)},null,8,["recent-cwds"])):ie("",!0),Kn.value?(x(),je(poe,{key:10,sessions:C(o).sessions.value,"workspace-groups":C(o).workspaceGroups.value,"attention-by-session":C(o).attentionBySession.value,"active-id":C(o).activeSessionId.value,onSelect:z[72]||(z[72]=ne=>{C(o).selectSession(ne),Kn.value=!1}),onClose:z[73]||(z[73]=ne=>Kn.value=!1)},null,8,["sessions","workspace-groups","attention-by-session","active-id"])):ie("",!0),xs.value?(x(),je(die,{key:11,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:z[74]||(z[74]=ne=>xs.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ie("",!0),_n.value?(x(),je(Yoe,{key:12,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,onAdd:z[75]||(z[75]=ne=>Jn(ne)),onClose:Hi},null,8,["browse-fs","get-fs-home","default-path"])):ie("",!0),gt(Pi,{name:"gload-fade"},{default:Ln(()=>[C(o).initialized.value?ie("",!0):(x(),je(Dle,{key:0}))]),_:1}),_.value&&!C(p)?(x(),je(Nle,{key:13,theme:C(o).theme.value,onSetTheme:z[76]||(z[76]=ne=>C(o).setTheme(ne)),onComplete:y,onSkip:y},null,8,["theme"])):ie("",!0),gt(Sie,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(r)?(x(),je(pae,{key:14})):ie("",!0),C(l)?(x(),je(cre,{key:15,modelValue:a.value,"onUpdate:modelValue":z[77]||(z[77]=ne=>a.value=ne),groups:C(o).workspaceGroups.value,"active-workspace-id":C(o).activeWorkspaceId.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"attention-by-workspace":C(o).attentionByWorkspace.value,onSelect:z[78]||(z[78]=ne=>C(o).selectSession(ne)),onCreate:vl,onCreateInWorkspace:z[79]||(z[79]=ne=>Er(ne)),onAddWorkspace:z[80]||(z[80]=ne=>_n.value=!0),onRename:z[81]||(z[81]=(ne,Ge)=>C(o).renameSession(ne,Ge)),onArchive:z[82]||(z[82]=ne=>C(o).archiveSession(ne)),onDeleteWorkspace:z[83]||(z[83]=ne=>C(o).deleteWorkspace(ne)),onLoadMore:z[84]||(z[84]=ne=>void C(o).loadMoreSessions(ne))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ie("",!0),C(l)?(x(),je(dle,{key:16,modelValue:c.value,"onUpdate:modelValue":z[85]||(z[85]=ne=>c.value=ne),status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,theme:C(o).theme.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"beta-toc":C(o).betaToc.value,"server-version":C(o).serverVersion.value,onPickModel:z[86]||(z[86]=ne=>Ke()),onSetThinking:z[87]||(z[87]=ne=>C(o).setThinking(ne)),onTogglePlan:z[88]||(z[88]=ne=>C(o).togglePlanMode()),onToggleSwarm:z[89]||(z[89]=ne=>C(o).toggleSwarmMode()),onSetPermission:z[90]||(z[90]=ne=>C(o).setPermission(ne)),onSetTheme:z[91]||(z[91]=ne=>C(o).setTheme(ne)),onSetColorScheme:z[92]||(z[92]=ne=>C(o).setColorScheme(ne)),onSetUiFontSize:z[93]||(z[93]=ne=>C(o).setUiFontSize(ne)),onSetBetaToc:z[94]||(z[94]=ne=>C(o).setBetaToc(ne)),onLogin:z[95]||(z[95]=()=>{c.value=!1,Je()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","theme","color-scheme","ui-font-size","auth-ready","beta-toc","server-version","onLogout"])):ie("",!0)],6)),sn.value?(x(),je(yte,{key:3,"on-start-o-auth-login":Yt,"on-poll-o-auth-login":Nt,"on-cancel-o-auth-login":Pt,onSuccess:po,onClose:z[96]||(z[96]=ne=>sn.value=!1)})):ie("",!0)]))}}),Qfe=vt(Jfe,[["__scopeId","data-v-f77bc585"]]);Jte();df(Qfe).use(Nn).mount("#app");export{IA as $,The as A,_E as B,jn as C,epe as D,F2 as E,Pe as F,kr as G,dt as H,gt as I,eE as J,Che as K,ii as L,Xe as M,K4 as N,Ehe as O,$he as P,Lhe as Q,zd as R,la as S,vhe as T,Ihe as U,V1 as V,Ahe as W,npe as X,Nhe as Y,Yhe as Z,the as _,pS as a,_s as a$,ds as a0,E1 as a1,che as a2,P1 as a3,v4 as a4,Jt as a5,xa as a6,mhe as a7,rpe as a8,bhe as a9,kS as aA,NE as aB,BE as aC,Qt as aD,DE as aE,RE as aF,$1 as aG,PE as aH,Ht as aI,D1 as aJ,iE as aK,x as aL,q4 as aM,hhe as aN,kn as aO,sS as aP,fhe as aQ,Xd as aR,so as aS,Kd as aT,te as aU,jhe as aV,a$ as aW,Ye as aX,ia as aY,HE as aZ,xhe as a_,She as aa,whe as ab,_he as ac,zhe as ad,lpe as ae,Dt as af,S4 as ag,lh as ah,fr as ai,Li as aj,Bn as ak,qhe as al,io as am,yr as an,cr as ao,Rhe as ap,Dhe as aq,tn as ar,ft as as,A4 as at,Oe as au,ehe as av,Ft as aw,IE as ax,OE as ay,Ks as az,dhe as b,AH as b$,Jhe as b0,Bc as b1,nf as b2,Xhe as b3,vr as b4,XA as b5,she as b6,hl as b7,fE as b8,Zhe as b9,xn as bA,Ho as bB,C4 as bC,Khe as bD,Ve as bE,pE as bF,ghe as bG,mE as bH,Fhe as bI,Ln as bJ,Ohe as bK,Ot as bL,Eo as bM,Vhe as bN,Ze as bO,phe as bP,en as bQ,oo as bR,gpe as bS,vW as bT,ZT as bU,ype as bV,oH as bW,Bv as bX,vpe as bY,Vg as bZ,bpe as b_,nhe as ba,O as bb,Cd as bc,Mhe as bd,Bt as be,rhe as bf,ihe as bg,nS as bh,Uhe as bi,ohe as bj,C as bk,uu as bl,ope as bm,tpe as bn,Y4 as bo,yhe as bp,Hhe as bq,hE as br,spe as bs,Phe as bt,khe as bu,hS as bv,cf as bw,s$ as bx,iC as by,uf as bz,Ghe as c,MH as c0,Pv as c1,TH as c2,hpe as c3,J9 as c4,fpe as c5,Pf as c6,xH as c7,cpe as c8,kpe as c9,zT as ca,upe as cb,wpe as cc,Jg as cd,Ql as ce,Xg as cf,Spe as cg,_pe as ch,mpe as ci,Qs as cj,dpe as ck,ppe as cl,rH as cm,Zg as cn,Yg as co,ape as cp,Whe as d,hr as e,lhe as f,Pi as g,ipe as h,ahe as i,uhe as j,Lo as k,lu as l,Zn as m,Qf as n,Oi as o,Qhe as p,F as q,df as r,je as s,ie as t,$ as u,m as v,a4 as w,Bhe as x,l4 as y,c$ as z};
|