@moonshot-ai/kimi-code 0.21.1 → 0.22.1
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 +47455 -4202
- package/dist-web/assets/{CodeBlockNode-j7RGe-Ru.js → CodeBlockNode-BeQAAdW3.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-D274ciOI.js → CodeBlockShell.vue_vue_type_style_index_0_lang-D-VEP4Fn.js} +1 -1
- package/dist-web/assets/{Tooltip-DtxNXMAM.js → Tooltip-ChsJyhEI.js} +1 -1
- package/dist-web/assets/{arc-DQs9uADf.js → arc-DrGcGe6d.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-BlG2tTPz.js → architectureDiagram-3BPJPVTR-iQ9G25kx.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-nkQI5ZZa.js → blockDiagram-GPEHLZMM-CuzX8waX.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-DZN5-qYv.js → c4Diagram-AAUBKEIU-lWe0pssH.js} +1 -1
- package/dist-web/assets/channel-BbUnBXY4.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-ByD5PYWi.js → chunk-2J33WTMH-BcD2luAP.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-DPyg-S27.js → chunk-4BX2VUAB-ZTdMsiUw.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-CH4yuhZ8.js → chunk-55IACEB6-JOHB87lb.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-DGgZVtcA.js → chunk-727SXJPM-BKcvO8HJ.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-hJPUZ-_O.js → chunk-AQP2D5EJ-pRCfr-UT.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-Barfn9Db.js → chunk-FMBD7UC4-Dwc_LTGi.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-ByZWAnct.js → chunk-ND2GUHAM-BXa5VPW8.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-i-qEmEeB.js → chunk-QZHKN3VN-DImyhT7B.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-C-JqfdmA.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-C-JqfdmA.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-Cb-FqQcD.js → cose-bilkent-S5V4N54A-CmvBDyEQ.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-vKebiMPC.js → dagre-BM42HDAG-BLlVemY_.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-DkhIWqYP.js → diagram-2AECGRRQ-S_ZOnEGh.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-DN4cTkR0.js → diagram-5GNKFQAL-VWugledA.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-DI-TheQb.js → diagram-KO2AKTUF-BqrJi52N.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-D39qCe0X.js → diagram-LMA3HP47-BRwG6VJ2.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-ChLxsS1Q.js → diagram-OG6HWLK6-B4h3lC_6.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-qvX9VJtw.js → erDiagram-TEJ5UH35-CoynqafK.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-DYLFBHuf.js → flowDiagram-I6XJVG4X-mSrbhP6V.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-tnxpnL8N.js → ganttDiagram-6RSMTGT7-DB1PpBk0.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-D8AoA9Eo.js → gitGraphDiagram-PVQCEYII-DAFYaHhJ.js} +1 -1
- package/dist-web/assets/index-BQvC0kGr.css +1 -0
- package/dist-web/assets/{index-16wIPHON.js → index-C8mys0NG.js} +2 -2
- package/dist-web/assets/index-DZSqyBof.js +279 -0
- package/dist-web/assets/{index-CfoTgIKh.js → index-DlpeCxLp.js} +1 -1
- package/dist-web/assets/{index10-ChP4b_K8.js → index10-DRCxutuy.js} +1 -1
- package/dist-web/assets/{index11-D6-PIcGb.js → index11-tnZiF2AO.js} +1 -1
- package/dist-web/assets/{index5-C_gkYwVK.js → index5-D2oq_xzS.js} +1 -1
- package/dist-web/assets/{index6-fL_9Ohtp.js → index6-1drcChs1.js} +1 -1
- package/dist-web/assets/{index7-DX_J7I3Z.js → index7-aHTOwsn3.js} +1 -1
- package/dist-web/assets/{index8-D_LvlNqi.js → index8-Dirigide.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-REaaEnj0.js → infoDiagram-5YYISTIA-Baaxoh0q.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-BiPRDWgG.js → ishikawaDiagram-YF4QCWOH-B8gKWcN0.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-DrZSDIQL.js → journeyDiagram-JHISSGLW-BFLRc4vu.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-BQZXHq9-.js → kanban-definition-UN3LZRKU-DMx7OMEF.js} +1 -1
- package/dist-web/assets/{linear-DqGsUakD.js → linear-BEozvq1i.js} +1 -1
- package/dist-web/assets/{mermaid.core-DYzdrsrJ.js → mermaid.core-WmeW05Ym.js} +66 -66
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-D69QyDIc.js → mindmap-definition-RKZ34NQL-4lvrad5M.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-CQwY5Xfh.js → pieDiagram-4H26LBE5-CMLLNBXh.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-CLVmtX4l.js → quadrantDiagram-W4KKPZXB-CqO6IFQw.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-8ptI5UBX.js → requirementDiagram-4Y6WPE33-BSLBSfd0.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-CZjapjER.js → sankeyDiagram-5OEKKPKP-Wkno3RO7.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-CWHjmftc.js → sequenceDiagram-3UESZ5HK-BGHwV3az.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-D2xCeXSD.js → stateDiagram-AJRCARHV-CCyVLSRK.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BiqQXX0_.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-CRlejYtd.js → timeline-definition-PNZ67QCA-CUeXNWjD.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-CTv_68HS.js → vennDiagram-CIIHVFJN-xk-ZH7as.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-CQbR9uOv.js → vue.runtime.esm-bundler-Cka7aKLe.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-0vHHFPAt.js → wardley-L42UT6IY-DgiOtIwh.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-CpO8VbUu.js → wardleyDiagram-YWT4CUSO-BAVBFC-Y.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-ClTcdHp2.js → xychartDiagram-2RQKCTM6-C3IYtAxp.js} +1 -1
- package/dist-web/design-system.html +2360 -0
- package/dist-web/index.html +4 -7
- package/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/package.json +10 -9
- package/dist-web/assets/channel-EUwKK__D.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DugUof1s.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DugUof1s.js +0 -1
- package/dist-web/assets/index-DFqBlS-2.css +0 -1
- package/dist-web/assets/index-DTBMRzx_.js +0 -284
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Dn6bAjEF.js +0 -1
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-j7RGe-Ru.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-D274ciOI.js","assets/index8-D_LvlNqi.js","assets/index11-D6-PIcGb.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
|
|
3
|
-
* @vue/shared v3.5.35
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function ph(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ot={},da=[],Ds=()=>{},MC=()=>!1,bu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),mh=e=>e.startsWith("onUpdate:"),tn=Object.assign,nv=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},bE=Object.prototype.hasOwnProperty,Kt=(e,t)=>bE.call(e,t),dt=Array.isArray,fa=e=>Oa(e)==="[object Map]",Cl=e=>Oa(e)==="[object Set]",lk=e=>Oa(e)==="[object Date]",wE=e=>Oa(e)==="[object RegExp]",wt=e=>typeof e=="function",on=e=>typeof e=="string",ys=e=>typeof e=="symbol",Gt=e=>e!==null&&typeof e=="object",ov=e=>(Gt(e)||wt(e))&&wt(e.then)&&wt(e.catch),EC=Object.prototype.toString,Oa=e=>EC.call(e),_E=e=>Oa(e).slice(8,-1),gh=e=>Oa(e)==="[object Object]",vh=e=>on(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,pl=ph(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),yh=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},CE=/-\w/g,Xn=yh(e=>e.replace(CE,t=>t.slice(1).toUpperCase())),SE=/\B([A-Z])/g,zo=yh(e=>e.replace(SE,"-$1").toLowerCase()),kh=yh(e=>e.charAt(0).toUpperCase()+e.slice(1)),Wd=yh(e=>e?`on${kh(e)}`:""),co=(e,t)=>!Object.is(e,t),ha=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},IC=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},bh=e=>{const t=parseFloat(e);return isNaN(t)?e:t},af=e=>{const t=on(e)?Number(e):NaN;return isNaN(t)?e:t};let ak;const wh=()=>ak||(ak=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),xE="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",TE=ph(xE);function Wt(e){if(dt(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=on(o)?IE(o):Wt(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(on(e)||Gt(e))return e}const AE=/;(?![^(]*\))/g,ME=/:([^]+)/,EE=/\/\*[^]*?\*\//g;function IE(e){const t={};return e.replace(EE,"").split(AE).forEach(n=>{if(n){const o=n.split(ME);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Le(e){let t="";if(on(e))t=e;else if(dt(e))for(let n=0;n<e.length;n++){const o=Le(e[n]);o&&(t+=o+" ")}else if(Gt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Fpe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!on(t)&&(e.class=Le(t)),n&&(e.style=Wt(n)),e}const $E="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",NE=ph($E);function $C(e){return!!e||e===""}function LE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Fi(e[o],t[o]);return n}function Fi(e,t){if(e===t)return!0;let n=lk(e),o=lk(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=ys(e),o=ys(t),n||o)return e===t;if(n=dt(e),o=dt(t),n||o)return n&&o?LE(e,t):!1;if(n=Gt(e),o=Gt(t),n||o){if(!n||!o)return!1;const s=Object.keys(e).length,i=Object.keys(t).length;if(s!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Fi(e[r],t[r]))return!1}}return String(e)===String(t)}function _h(e,t){return e.findIndex(n=>Fi(n,t))}const NC=e=>!!(e&&e.__v_isRef===!0),P=e=>on(e)?e:e==null?"":dt(e)||Gt(e)&&(e.toString===EC||!wt(e.toString))?NC(e)?P(e.value):JSON.stringify(e,LC,2):String(e),LC=(e,t)=>NC(t)?LC(e,t.value):fa(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[fm(o,i)+" =>"]=s,n),{})}:Cl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>fm(n))}:ys(t)?fm(t):Gt(t)&&!dt(t)&&!gh(t)?String(t):t,fm=(e,t="")=>{var n;return ys(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function PE(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 Yn;class PC{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&&Yn&&(Yn.active?(this.parent=Yn,this.index=(Yn.scopes||(Yn.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=Yn;try{return Yn=this,t()}finally{Yn=n}}}on(){++this._on===1&&(this.prevScope=Yn,Yn=this)}off(){if(this._on>0&&--this._on===0){if(Yn===this)Yn=this.prevScope;else{let t=Yn;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function OE(e){return new PC(e)}function sv(){return Yn}function iv(e,t=!1){Yn&&Yn.cleanups.push(e)}let dn;const hm=new WeakSet;class cf{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,Yn&&(Yn.active?Yn.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,hm.has(this)&&(hm.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||RC(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ck(this),DC(this);const t=dn,n=Ys;dn=this,Ys=!0;try{return this.fn()}finally{BC(this),dn=t,Ys=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)av(t);this.deps=this.depsTail=void 0,ck(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?hm.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ig(this)&&this.run()}get dirty(){return Ig(this)}}let OC=0,Mc,Ec;function RC(e,t=!1){if(e.flags|=8,t){e.next=Ec,Ec=e;return}e.next=Mc,Mc=e}function rv(){OC++}function lv(){if(--OC>0)return;if(Ec){let t=Ec;for(Ec=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Mc;){let t=Mc;for(Mc=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function DC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function BC(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),av(o),RE(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function Ig(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(FC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function FC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Kc)||(e.globalVersion=Kc,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ig(e))))return;e.flags|=2;const t=e.dep,n=dn,o=Ys;dn=e,Ys=!0;try{DC(e);const s=e.fn(e._value);(t.version===0||co(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{dn=n,Ys=o,BC(e),e.flags&=-3}}function av(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)av(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function RE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Hpe(e,t){e.effect instanceof cf&&(e=e.effect.fn);const n=new cf(e);t&&tn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function Wpe(e){e.effect.stop()}let Ys=!0;const HC=[];function Hi(){HC.push(Ys),Ys=!1}function Wi(){const e=HC.pop();Ys=e===void 0?!0:e}function ck(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=dn;dn=void 0;try{t()}finally{dn=n}}}let Kc=0;class DE{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 Ch{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(!dn||!Ys||dn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==dn)n=this.activeLink=new DE(dn,this),dn.deps?(n.prevDep=dn.depsTail,dn.depsTail.nextDep=n,dn.depsTail=n):dn.deps=dn.depsTail=n,WC(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=dn.depsTail,n.nextDep=void 0,dn.depsTail.nextDep=n,dn.depsTail=n,dn.deps===n&&(dn.deps=o)}return n}trigger(t){this.version++,Kc++,this.notify(t)}notify(t){rv();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{lv()}}}function WC(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)WC(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const uf=new WeakMap,ml=Symbol(""),$g=Symbol(""),Gc=Symbol("");function yo(e,t,n){if(Ys&&dn){let o=uf.get(e);o||uf.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new Ch),s.map=o,s.key=n),s.track()}}function $i(e,t,n,o,s,i){const r=uf.get(e);if(!r){Kc++;return}const l=a=>{a&&a.trigger()};if(rv(),t==="clear")r.forEach(l);else{const a=dt(e),c=a&&vh(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,h)=>{(h==="length"||h===Gc||!ys(h)&&h>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Gc)),t){case"add":a?c&&l(r.get("length")):(l(r.get(ml)),fa(e)&&l(r.get($g)));break;case"delete":a||(l(r.get(ml)),fa(e)&&l(r.get($g)));break;case"set":fa(e)&&l(r.get(ml));break}}lv()}function BE(e,t){const n=uf.get(e);return n&&n.get(t)}function Vl(e){const t=Ht(e);return t===e?t:(yo(t,"iterate",Gc),fs(e)?t:t.map(Xs))}function Sh(e){return yo(e=Ht(e),"iterate",Gc),e}function ui(e,t){return Ui(e)?Aa(Cr(e)?Xs(t):t):Xs(t)}const FE={__proto__:null,[Symbol.iterator](){return pm(this,Symbol.iterator,e=>ui(this,e))},concat(...e){return Vl(this).concat(...e.map(t=>dt(t)?Vl(t):t))},entries(){return pm(this,"entries",e=>(e[1]=ui(this,e[1]),e))},every(e,t){return xi(this,"every",e,t,void 0,arguments)},filter(e,t){return xi(this,"filter",e,t,n=>n.map(o=>ui(this,o)),arguments)},find(e,t){return xi(this,"find",e,t,n=>ui(this,n),arguments)},findIndex(e,t){return xi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return xi(this,"findLast",e,t,n=>ui(this,n),arguments)},findLastIndex(e,t){return xi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return xi(this,"forEach",e,t,void 0,arguments)},includes(...e){return mm(this,"includes",e)},indexOf(...e){return mm(this,"indexOf",e)},join(e){return Vl(this).join(e)},lastIndexOf(...e){return mm(this,"lastIndexOf",e)},map(e,t){return xi(this,"map",e,t,void 0,arguments)},pop(){return cc(this,"pop")},push(...e){return cc(this,"push",e)},reduce(e,...t){return uk(this,"reduce",e,t)},reduceRight(e,...t){return uk(this,"reduceRight",e,t)},shift(){return cc(this,"shift")},some(e,t){return xi(this,"some",e,t,void 0,arguments)},splice(...e){return cc(this,"splice",e)},toReversed(){return Vl(this).toReversed()},toSorted(e){return Vl(this).toSorted(e)},toSpliced(...e){return Vl(this).toSpliced(...e)},unshift(...e){return cc(this,"unshift",e)},values(){return pm(this,"values",e=>ui(this,e))}};function pm(e,t,n){const o=Sh(e),s=o[t]();return o!==e&&!fs(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const HE=Array.prototype;function xi(e,t,n,o,s,i){const r=Sh(e),l=r!==e&&!fs(e),a=r[t];if(a!==HE[t]){const d=a.apply(e,i);return l?Xs(d):d}let c=n;r!==e&&(l?c=function(d,h){return n.call(this,ui(e,d),h,e)}:n.length>2&&(c=function(d,h){return n.call(this,d,h,e)}));const u=a.call(r,c,o);return l&&s?s(u):u}function uk(e,t,n,o){const s=Sh(e),i=s!==e&&!fs(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=ui(e,c)),n.call(this,c,ui(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](r,...o);return l?ui(e,a):a}function mm(e,t,n){const o=Ht(e);yo(o,"iterate",Gc);const s=o[t](...n);return(s===-1||s===!1)&&Ah(n[0])?(n[0]=Ht(n[0]),o[t](...n)):s}function cc(e,t,n=[]){Hi(),rv();const o=Ht(e)[t].apply(e,n);return lv(),Wi(),o}const WE=ph("__proto__,__v_isRef,__isVue"),UC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ys));function UE(e){ys(e)||(e=String(e));const t=Ht(this);return yo(t,"has",e),t.hasOwnProperty(e)}class jC{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(s?i?YC:GC:i?KC:VC).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=dt(t);if(!s){let a;if(r&&(a=FE[n]))return a;if(n==="hasOwnProperty")return UE}const l=Reflect.get(t,n,Ln(t)?t:o);if((ys(n)?UC.has(n):WE(n))||(s||yo(t,"get",n),i))return l;if(Ln(l)){const a=r&&vh(n)?l:l.value;return s&&Gt(a)?df(a):a}return Gt(l)?s?df(l):ds(l):l}}class qC extends jC{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=dt(t)&&vh(n);if(!this._isShallow){const c=Ui(i);if(!fs(o)&&!Ui(o)&&(i=Ht(i),o=Ht(o)),!r&&Ln(i)&&!Ln(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:Kt(t,n),a=Reflect.set(t,n,o,Ln(t)?t:s);return t===Ht(s)&&(l?co(o,i)&&$i(t,"set",n,o):$i(t,"add",n,o)),a}deleteProperty(t,n){const o=Kt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&$i(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!ys(n)||!UC.has(n))&&yo(t,"has",n),o}ownKeys(t){return yo(t,"iterate",dt(t)?"length":ml),Reflect.ownKeys(t)}}class zC extends jC{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const jE=new qC,qE=new zC,zE=new qC(!0),VE=new zC(!0),Ng=e=>e,id=e=>Reflect.getPrototypeOf(e);function KE(e,t,n){return function(...o){const s=this.__v_raw,i=Ht(s),r=fa(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?Ng:t?Aa:Xs;return!t&&yo(i,"iterate",a?$g:ml),tn(Object.create(c),{next(){const{value:d,done:h}=c.next();return h?{value:d,done:h}:{value:l?[u(d[0]),u(d[1])]:u(d),done:h}}})}}function rd(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function GE(e,t){const n={get(s){const i=this.__v_raw,r=Ht(i),l=Ht(s);e||(co(s,l)&&yo(r,"get",s),yo(r,"get",l));const{has:a}=id(r),c=t?Ng:e?Aa:Xs;if(a.call(r,s))return c(i.get(s));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(s)},get size(){const s=this.__v_raw;return!e&&yo(Ht(s),"iterate",ml),s.size},has(s){const i=this.__v_raw,r=Ht(i),l=Ht(s);return e||(co(s,l)&&yo(r,"has",s),yo(r,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const r=this,l=r.__v_raw,a=Ht(l),c=t?Ng:e?Aa:Xs;return!e&&yo(a,"iterate",ml),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return tn(n,e?{add:rd("add"),set:rd("set"),delete:rd("delete"),clear:rd("clear")}:{add(s){const i=Ht(this),r=id(i),l=Ht(s),a=!t&&!fs(s)&&!Ui(s)?l:s;return r.has.call(i,a)||co(s,a)&&r.has.call(i,s)||co(l,a)&&r.has.call(i,l)||(i.add(a),$i(i,"add",a,a)),this},set(s,i){!t&&!fs(i)&&!Ui(i)&&(i=Ht(i));const r=Ht(this),{has:l,get:a}=id(r);let c=l.call(r,s);c||(s=Ht(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?co(i,u)&&$i(r,"set",s,i):$i(r,"add",s,i),this},delete(s){const i=Ht(this),{has:r,get:l}=id(i);let a=r.call(i,s);a||(s=Ht(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&$i(i,"delete",s,void 0),c},clear(){const s=Ht(this),i=s.size!==0,r=s.clear();return i&&$i(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=KE(s,e,t)}),n}function xh(e,t){const n=GE(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(Kt(n,s)&&s in o?n:o,s,i)}const YE={get:xh(!1,!1)},XE={get:xh(!1,!0)},QE={get:xh(!0,!1)},ZE={get:xh(!0,!0)},VC=new WeakMap,KC=new WeakMap,GC=new WeakMap,YC=new WeakMap;function JE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ds(e){return Ui(e)?e:Th(e,!1,jE,YE,VC)}function eI(e){return Th(e,!1,zE,XE,KC)}function df(e){return Th(e,!0,qE,QE,GC)}function Upe(e){return Th(e,!0,VE,ZE,YC)}function Th(e,t,n,o,s){if(!Gt(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=s.get(e);if(i)return i;const r=JE(_E(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function Cr(e){return Ui(e)?Cr(e.__v_raw):!!(e&&e.__v_isReactive)}function Ui(e){return!!(e&&e.__v_isReadonly)}function fs(e){return!!(e&&e.__v_isShallow)}function Ah(e){return e?!!e.__v_raw:!1}function Ht(e){const t=e&&e.__v_raw;return t?Ht(t):e}function kr(e){return!Kt(e,"__v_skip")&&Object.isExtensible(e)&&IC(e,"__v_skip",!0),e}const Xs=e=>Gt(e)?ds(e):e,Aa=e=>Gt(e)?df(e):e;function Ln(e){return e?e.__v_isRef===!0:!1}function ne(e){return XC(e,!1)}function Sl(e){return XC(e,!0)}function XC(e,t){return Ln(e)?e:new tI(e,t)}class tI{constructor(t,n){this.dep=new Ch,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ht(t),this._value=n?t:Xs(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||fs(t)||Ui(t);t=o?t:Ht(t),co(t,n)&&(this._rawValue=t,this._value=o?t:Xs(t),this.dep.trigger())}}function jpe(e){e.dep&&e.dep.trigger()}function S(e){return Ln(e)?e.value:e}function QC(e){return wt(e)?e():S(e)}const nI={get:(e,t,n)=>t==="__v_raw"?e:S(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return Ln(s)&&!Ln(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function ZC(e){return Cr(e)?e:new Proxy(e,nI)}class oI{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Ch,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function sI(e){return new oI(e)}function qpe(e){const t=dt(e)?new Array(e.length):{};for(const n in e)t[n]=JC(e,n);return t}class iI{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=ys(n)?n:String(n),this._raw=Ht(t);let s=!0,i=t;if(!dt(t)||ys(this._key)||!vh(this._key))do s=!Ah(i)||fs(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=S(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Ln(this._raw[this._key])){const n=this._object[this._key];if(Ln(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return BE(this._raw,this._key)}}class rI{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 zpe(e,t,n){return Ln(e)?e:wt(e)?new rI(e):Gt(e)&&arguments.length>1?JC(e,t,n):ne(e)}function JC(e,t,n){return new iI(e,t,n)}class lI{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ch(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Kc-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&dn!==this)return RC(this,!0),!0}get value(){const t=this.dep.track();return FC(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function aI(e,t,n=!1){let o,s;return wt(e)?o=e:(o=e.get,s=e.set),new lI(o,s,n)}const Vpe={GET:"get",HAS:"has",ITERATE:"iterate"},Kpe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},ld={},ff=new WeakMap;let dr;function Gpe(){return dr}function cI(e,t=!1,n=dr){if(n){let o=ff.get(n);o||ff.set(n,o=[]),o.push(e)}}function uI(e,t,n=Ot){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=v=>s?v:fs(v)||s===!1||s===0?Ni(v,1):Ni(v);let u,d,h,m,f=!1,g=!1;if(Ln(e)?(d=()=>e.value,f=fs(e)):Cr(e)?(d=()=>c(e),f=!0):dt(e)?(g=!0,f=e.some(v=>Cr(v)||fs(v)),d=()=>e.map(v=>{if(Ln(v))return v.value;if(Cr(v))return c(v);if(wt(v))return a?a(v,2):v()})):wt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(h){Hi();try{h()}finally{Wi()}}const v=dr;dr=u;try{return a?a(e,3,[m]):e(m)}finally{dr=v}}:d=Ds,t&&s){const v=d,x=s===!0?1/0:s;d=()=>Ni(v(),x)}const _=sv(),w=()=>{u.stop(),_&&_.active&&nv(_.effects,u)};if(i&&t){const v=t;t=(...x)=>{v(...x),w()}}let y=g?new Array(e.length).fill(ld):ld;const b=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(t){const x=u.run();if(s||f||(g?x.some((L,N)=>co(L,y[N])):co(x,y))){h&&h();const L=dr;dr=u;try{const N=[x,y===ld?void 0:g&&y[0]===ld?[]:y,m];y=x,a?a(t,3,N):t(...N)}finally{dr=L}}}else u.run()};return l&&l(b),u=new cf(d),u.scheduler=r?()=>r(b,!1):b,m=v=>cI(v,!1,u),h=u.onStop=()=>{const v=ff.get(u);if(v){if(a)a(v,4);else for(const x of v)x();ff.delete(u)}},t?o?b(!0):y=u.run():r?r(b.bind(null,!0),!0):u.run(),w.pause=u.pause.bind(u),w.resume=u.resume.bind(u),w.stop=w,w}function Ni(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--,Ln(e))Ni(e.value,t,n);else if(dt(e))for(let o=0;o<e.length;o++)Ni(e[o],t,n);else if(Cl(e)||fa(e))e.forEach(o=>{Ni(o,t,n)});else if(gh(e)){for(const o in e)Ni(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Ni(e[o],t,n)}return e}/**
|
|
11
|
-
* @vue/runtime-core v3.5.35
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/const eS=[];function dI(e){eS.push(e)}function fI(){eS.pop()}function Ype(e,t){}const Xpe={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"},hI={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 wu(e,t,n,o){try{return o?e(...o):e()}catch(s){Ra(s,t,n)}}function Fs(e,t,n,o){if(wt(e)){const s=wu(e,t,n,o);return s&&ov(s)&&s.catch(i=>{Ra(i,t,n)}),s}if(dt(e)){const s=[];for(let i=0;i<e.length;i++)s.push(Fs(e[i],t,n,o));return s}}function Ra(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Ot;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){Hi(),wu(i,null,10,[e,a,c]),Wi();return}}pI(e,n,s,o,r)}function pI(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const Eo=[];let li=-1;const pa=[];let fr=null,ea=0;const tS=Promise.resolve();let hf=null;function ht(e){const t=hf||tS;return e?t.then(this?e.bind(this):e):t}function mI(e){let t=li+1,n=Eo.length;for(;t<n;){const o=t+n>>>1,s=Eo[o],i=Yc(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function cv(e){if(!(e.flags&1)){const t=Yc(e),n=Eo[Eo.length-1];!n||!(e.flags&2)&&t>=Yc(n)?Eo.push(e):Eo.splice(mI(t),0,e),e.flags|=1,nS()}}function nS(){hf||(hf=tS.then(oS))}function pf(e){dt(e)?pa.push(...e):fr&&e.id===-1?fr.splice(ea+1,0,e):e.flags&1||(pa.push(e),e.flags|=1),nS()}function dk(e,t,n=li+1){for(;n<Eo.length;n++){const o=Eo[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;Eo.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function mf(e){if(pa.length){const t=[...new Set(pa)].sort((n,o)=>Yc(n)-Yc(o));if(pa.length=0,fr){fr.push(...t);return}for(fr=t,ea=0;ea<fr.length;ea++){const n=fr[ea];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}fr=null,ea=0}}const Yc=e=>e.id==null?e.flags&2?-1:1/0:e.id;function oS(e){try{for(li=0;li<Eo.length;li++){const t=Eo[li];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),wu(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;li<Eo.length;li++){const t=Eo[li];t&&(t.flags&=-2)}li=-1,Eo.length=0,mf(),hf=null,(Eo.length||pa.length)&&oS()}}let ta,ad=[];function sS(e,t){var n,o;ta=e,ta?(ta.enabled=!0,ad.forEach(({event:s,args:i})=>ta.emit(s,...i)),ad=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{sS(i,t)}),setTimeout(()=>{ta||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ad=[])},3e3)):ad=[]}let fo=null,Mh=null;function Xc(e){const t=fo;return fo=e,Mh=e&&e.type.__scopeId||null,t}function Qpe(e){Mh=e}function Zpe(){Mh=null}const Jpe=e=>$n;function $n(e,t=fo,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&bf(-1);const i=Xc(t);let r;try{r=e(...s)}finally{Xc(i),o._d&&bf(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function qt(e,t){if(fo===null)return e;const n=xu(fo),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=Ot]=t[s];i&&(wt(i)&&(i={mounted:i,updated:i}),i.deep&&Ni(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function ci(e,t,n,o){const s=e.dirs,i=t&&t.dirs;for(let r=0;r<s.length;r++){const l=s[r];i&&(l.oldValue=i[r].value);let a=l.dir[o];a&&(Hi(),Fs(a,n,8,[e.el,l,e,t]),Wi())}}function yn(e,t){if(uo){let n=uo.provides;const o=uo.parent&&uo.parent.provides;o===n&&(n=uo.provides=Object.create(o)),n[e]=t}}function Bt(e,t,n=!1){const o=ho();if(o||gl){let s=gl?gl._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&wt(t)?t.call(o&&o.proxy):t}}function eme(){return!!(ho()||gl)}const gI=Symbol.for("v-scx"),vI=()=>Bt(gI);function yI(e,t){return _u(e,null,t)}function tme(e,t){return _u(e,null,{flush:"post"})}function kI(e,t){return _u(e,null,{flush:"sync"})}function ze(e,t,n){return _u(e,t,n)}function _u(e,t,n=Ot){const{immediate:o,deep:s,flush:i,once:r}=n,l=tn({},n),a=t&&o||!t&&i!=="post";let c;if(wl){if(i==="sync"){const m=vI();c=m.__watcherHandles||(m.__watcherHandles=[])}else if(!a){const m=()=>{};return m.stop=Ds,m.resume=Ds,m.pause=Ds,m}}const u=uo;l.call=(m,f,g)=>Fs(m,u,f,g);let d=!1;i==="post"?l.scheduler=m=>{Rn(m,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(m,f)=>{f?m():cv(m)}),l.augmentJob=m=>{t&&(m.flags|=4),d&&(m.flags|=2,u&&(m.id=u.uid,m.i=u))};const h=uI(e,t,l);return wl&&(c?c.push(h):a&&h()),h}function bI(e,t,n){const o=this.proxy,s=on(e)?e.includes(".")?iS(o,e):()=>o[e]:e.bind(o,o);let i;wt(t)?i=t:(i=t.handler,n=t);const r=Da(this),l=_u(s,i.bind(o),n);return r(),l}function iS(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}const cr=new WeakMap,rS=Symbol("_vte"),lS=e=>e.__isTeleport,rl=e=>e&&(e.disabled||e.disabled===""),wI=e=>e&&(e.defer||e.defer===""),fk=e=>typeof SVGElement<"u"&&e instanceof SVGElement,hk=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Lg=(e,t)=>{const n=e&&e.to;return on(n)?t?t(n):null:n},_I={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:h,o:{insert:m,querySelector:f,createText:g,createComment:_,parentNode:w}}=c,y=rl(t.props);let{dynamicChildren:b}=t;const v=(N,k,T)=>{N.shapeFlag&16&&u(N.children,k,T,s,i,r,l,a)},x=(N=t)=>{const k=rl(N.props),T=N.target=Lg(N.props,f),E=Pg(T,N,g,m);T&&(r!=="svg"&&fk(T)?r="svg":r!=="mathml"&&hk(T)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(T),k||(v(N,T,E),yc(N,!1)))},L=N=>{const k=()=>{if(cr.get(N)===k){if(cr.delete(N),rl(N.props)){const T=w(N.el)||n;v(N,T,N.anchor),yc(N,!0)}x(N)}};cr.set(N,k),Rn(k,i)};if(e==null){const N=t.el=g(""),k=t.anchor=g("");if(m(N,n,o),m(k,n,o),wI(t.props)||i&&i.pendingBranch){L(t);return}y&&(v(t,n,k),yc(t,!0)),x()}else{t.el=e.el;const N=t.anchor=e.anchor,k=cr.get(e);if(k){k.flags|=8,cr.delete(e),L(t);return}t.targetStart=e.targetStart;const T=t.target=e.target,E=t.targetAnchor=e.targetAnchor,O=rl(e.props),A=O?n:T,$=O?N:E;if(r==="svg"||fk(T)?r="svg":(r==="mathml"||hk(T))&&(r="mathml"),b?(h(e.dynamicChildren,b,A,s,i,r,l),kv(e,t,!0)):a||d(e,t,A,$,s,i,r,l,!1),y)O?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):cd(t,n,N,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=Lg(t.props,f);R&&cd(t,R,null,c,0)}else O&&cd(t,T,E,c,1);yc(t,y)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:h}=e,m=i||!rl(h),f=cr.get(e);if(f&&(f.flags|=8,cr.delete(e)),d&&(s(c),s(u)),i&&s(a),!f&&r&16)for(let g=0;g<l.length;g++){const _=l[g];o(_,t,n,m,!!_.dynamicChildren)}},move:cd,hydrate:CI};function cd(e,t,n,{o:{insert:o},m:s},i=2){i===0&&o(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&o(r,t,n),!cr.has(e)&&(!d||rl(u))&&a&16)for(let h=0;h<c.length;h++)s(c[h],t,n,2);d&&o(l,t,n)}function CI(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function h(_,w){let y=w;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,_._lpa=t.targetAnchor&&r(t.targetAnchor);break}}y=r(y)}}function m(_,w){w.anchor=d(r(_),w,l(_),n,o,s,i)}const f=t.target=Lg(t.props,a),g=rl(t.props);if(f){const _=f._lpa||f.firstChild;t.shapeFlag&16&&(g?(m(e,t),h(f,_),t.targetAnchor||Pg(f,t,u,c,l(e)===f?e:null)):(t.anchor=r(e),h(f,_),t.targetAnchor||Pg(f,t,u,c),d(_&&r(_),t,f,n,o,s,i))),yc(t,g)}else g&&t.shapeFlag&16&&(m(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const nme=_I;function yc(e,t){const n=e.ctx;if(n&&n.ut){let o,s;for(t?(o=e.el,s=e.anchor):(o=e.targetStart,s=e.targetAnchor);o&&o!==s;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function Pg(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[rS]=r,e&&(o(i,e,s),o(r,e,s)),r}const $s=Symbol("_leaveCb"),uc=Symbol("_enterCb");function aS(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return sn(()=>{e.isMounted=!0}),Jo(()=>{e.isUnmounting=!0}),e}const Ts=[Function,Array],cS={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ts,onEnter:Ts,onAfterEnter:Ts,onEnterCancelled:Ts,onBeforeLeave:Ts,onLeave:Ts,onAfterLeave:Ts,onLeaveCancelled:Ts,onBeforeAppear:Ts,onAppear:Ts,onAfterAppear:Ts,onAppearCancelled:Ts},uS=e=>{const t=e.subTree;return t.component?uS(t.component):t},SI={name:"BaseTransition",props:cS,setup(e,{slots:t}){const n=ho(),o=aS();return()=>{const s=t.default&&uv(t.default(),!0),i=s&&s.length?dS(s):n.subTree?se():void 0;if(!i)return;const r=Ht(e),{mode:l}=r;if(o.isLeaving)return gm(i);const a=pk(i);if(!a)return gm(i);let c=Qc(a,r,o,n,d=>c=d);a.type!==Bn&&Mr(a,c);let u=n.subTree&&pk(n.subTree);if(u&&u.type!==Bn&&!Vs(u,a)&&uS(n).type!==Bn){let d=Qc(u,r,o,n);if(Mr(u,d),l==="out-in"&&a.type!==Bn)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},gm(i);l==="in-out"&&a.type!==Bn?d.delayLeave=(h,m,f)=>{const g=fS(o,u);g[String(u.key)]=u,h[$s]=()=>{m(),h[$s]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{f(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function dS(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Bn){t=n;break}}return t}const xI=SI;function fS(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function Qc(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:m,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:_,onAppear:w,onAfterAppear:y,onAppearCancelled:b}=t,v=String(e.key),x=fS(n,e),L=(T,E)=>{T&&Fs(T,o,9,E)},N=(T,E)=>{const O=E[1];L(T,E),dt(T)?T.every(A=>A.length<=1)&&O():T.length<=1&&O()},k={mode:r,persisted:l,beforeEnter(T){let E=a;if(!n.isMounted)if(i)E=_||a;else return;T[$s]&&T[$s](!0);const O=x[v];O&&Vs(e,O)&&O.el[$s]&&O.el[$s](),L(E,[T])},enter(T){if(x[v]===e)return;let E=c,O=u,A=d;if(!n.isMounted)if(i)E=w||c,O=y||u,A=b||d;else return;let $=!1;T[uc]=D=>{$||($=!0,D?L(A,[T]):L(O,[T]),k.delayedLeave&&k.delayedLeave(),T[uc]=void 0)};const R=T[uc].bind(null,!1);E?N(E,[T,R]):R()},leave(T,E){const O=String(e.key);if(T[uc]&&T[uc](!0),n.isUnmounting)return E();L(h,[T]);let A=!1;T[$s]=R=>{A||(A=!0,E(),R?L(g,[T]):L(f,[T]),T[$s]=void 0,x[O]===e&&delete x[O])};const $=T[$s].bind(null,!1);x[O]=e,m?N(m,[T,$]):$()},clone(T){const E=Qc(T,t,n,o,s);return s&&s(E),E}};return k}function gm(e){if(Cu(e))return e=ji(e),e.children=null,e}function pk(e){if(!Cu(e))return lS(e.type)&&e.children?dS(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&&wt(n.default))return n.default()}}function Mr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Mr(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 uv(e,t=!1,n){let o=[],s=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Oe?(r.patchFlag&128&&s++,o=o.concat(uv(r.children,t,l))):(t||r.type!==Bn)&&o.push(l!=null?ji(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function Qe(e,t){return wt(e)?tn({name:e.name},t,{setup:e}):e}function ome(){const e=ho();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function dv(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function sme(e){const t=ho(),n=Sl(null);if(t){const s=t.refs===Ot?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function mk(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const gf=new WeakMap;function ma(e,t,n,o,s=!1){if(dt(e)){e.forEach((g,_)=>ma(g,t&&(dt(t)?t[_]:t),n,o,s));return}if(Di(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&ma(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?xu(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Ot?l.refs={}:l.refs,d=l.setupState,h=Ht(d),m=d===Ot?MC:g=>mk(u,g)?!1:Kt(h,g),f=(g,_)=>!(_&&mk(u,_));if(c!=null&&c!==a){if(gk(t),on(c))u[c]=null,m(c)&&(d[c]=null);else if(Ln(c)){const g=t;f(c,g.k)&&(c.value=null),g.k&&(u[g.k]=null)}}if(wt(a))wu(a,l,12,[r,u]);else{const g=on(a),_=Ln(a);if(g||_){const w=()=>{if(e.f){const y=g?m(a)?d[a]:u[a]:f()||!e.k?a.value:u[e.k];if(s)dt(y)&&nv(y,i);else if(dt(y))y.includes(i)||y.push(i);else if(g)u[a]=[i],m(a)&&(d[a]=u[a]);else{const b=[i];f(a,e.k)&&(a.value=b),e.k&&(u[e.k]=b)}}else g?(u[a]=r,m(a)&&(d[a]=r)):_&&(f(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const y=()=>{w(),gf.delete(e)};y.id=-1,gf.set(e,y),Rn(y,n)}else gk(e),w()}}}function gk(e){const t=gf.get(e);t&&(t.flags|=8,gf.delete(e))}let vk=!1;const Kl=()=>{vk||(console.error("Hydration completed but contains mismatches."),vk=!0)},TI=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",AI=e=>e.namespaceURI.includes("MathML"),ud=e=>{if(e.nodeType===1){if(TI(e))return"svg";if(AI(e))return"mathml"}},ia=e=>e.nodeType===8;function MI(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(b,v)=>{if(!v.hasChildNodes()){n(null,b,v),mf(),v._vnode=b;return}d(v.firstChild,b,null,null,null),mf(),v._vnode=b},d=(b,v,x,L,N,k=!1)=>{k=k||!!v.dynamicChildren;const T=ia(b)&&b.data==="[",E=()=>g(b,v,x,L,N,T),{type:O,ref:A,shapeFlag:$,patchFlag:R}=v;let D=b.nodeType;v.el=b,R===-2&&(k=!1,v.dynamicChildren=null);let W=null;switch(O){case Sr:D!==3?v.children===""?(a(v.el=s(""),r(b),b),W=b):W=E():(b.data!==v.children&&(Kl(),b.data=v.children),W=i(b));break;case Bn:y(b)?(W=i(b),w(v.el=b.content.firstChild,b,x)):D!==8||T?W=E():W=i(b);break;case ya:if(T&&(b=i(b),D=b.nodeType),D===1||D===3){W=b;const V=!v.children.length;for(let U=0;U<v.staticCount;U++)V&&(v.children+=W.nodeType===1?W.outerHTML:W.data),U===v.staticCount-1&&(v.anchor=W),W=i(W);return T?i(W):W}else E();break;case Oe:T?W=f(b,v,x,L,N,k):W=E();break;default:if($&1)(D!==1||v.type.toLowerCase()!==b.tagName.toLowerCase())&&!y(b)?W=E():W=h(b,v,x,L,N,k);else if($&6){v.slotScopeIds=N;const V=r(b);if(T?W=_(b):ia(b)&&b.data==="teleport start"?W=_(b,b.data,"teleport end"):W=i(b),t(v,V,null,x,L,ud(V),k),Di(v)&&!v.type.__asyncResolved){let U;T?(U=vt(Oe),U.anchor=W?W.previousSibling:V.lastChild):U=b.nodeType===3?ut(""):vt("div"),U.el=b,v.component.subTree=U}}else $&64?D!==8?W=E():W=v.type.hydrate(b,v,x,L,N,k,e,m):$&128&&(W=v.type.hydrate(b,v,x,L,ud(r(b)),N,k,e,d))}return A!=null&&ma(A,null,L,v),W},h=(b,v,x,L,N,k)=>{k=k||!!v.dynamicChildren;const{type:T,props:E,patchFlag:O,shapeFlag:A,dirs:$,transition:R}=v,D=T==="input"||T==="option";if(D||O!==-1){$&&ci(v,null,x,"created");let W=!1;if(y(b)){W=$S(null,R)&&x&&x.vnode.props&&x.vnode.props.appear;const U=b.content.firstChild;if(W){const ee=U.getAttribute("class");ee&&(U.$cls=ee),R.beforeEnter(U)}w(U,b,x),v.el=b=U}if(A&16&&!(E&&(E.innerHTML||E.textContent))){let U=m(b.firstChild,v,b,x,L,N,k);for(U&&!dd(b,1)&&Kl();U;){const ee=U;U=U.nextSibling,l(ee)}}else if(A&8){let U=v.children;U[0]===`
|
|
15
|
-
`&&(b.tagName==="PRE"||b.tagName==="TEXTAREA")&&(U=U.slice(1));const{textContent:ee}=b;ee!==U&&ee!==U.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(dd(b,0)||Kl(),b.textContent=v.children)}if(E){if(D||!k||O&48){const U=b.tagName.includes("-");for(const ee in E)(D&&(ee.endsWith("value")||ee==="indeterminate")||bu(ee)&&!pl(ee)||ee[0]==="."||U&&!pl(ee))&&o(b,ee,null,E[ee],void 0,x)}else if(E.onClick)o(b,"onClick",null,E.onClick,void 0,x);else if(O&4&&Cr(E.style))for(const U in E.style)E.style[U]}let V;(V=E&&E.onVnodeBeforeMount)&&Uo(V,x,v),$&&ci(v,null,x,"beforeMount"),((V=E&&E.onVnodeMounted)||$||W)&&OS(()=>{V&&Uo(V,x,v),W&&R.enter(b),$&&ci(v,null,x,"mounted")},L)}return b.nextSibling},m=(b,v,x,L,N,k,T)=>{T=T||!!v.dynamicChildren;const E=v.children,O=E.length;let A=!1;for(let $=0;$<O;$++){const R=T?E[$]:E[$]=qo(E[$]),D=R.type===Sr;b?(D&&!T&&$+1<O&&qo(E[$+1]).type===Sr&&(a(s(b.data.slice(R.children.length)),x,i(b)),b.data=R.children),b=d(b,R,L,N,k,T)):D&&!R.children?a(R.el=s(""),x):(A||(A=!0,dd(x,1)||Kl()),n(null,R,x,null,L,N,ud(x),k))}return b},f=(b,v,x,L,N,k)=>{const{slotScopeIds:T}=v;T&&(N=N?N.concat(T):T);const E=r(b),O=m(i(b),v,E,x,L,N,k);return O&&ia(O)&&O.data==="]"?i(v.anchor=O):(Kl(),a(v.anchor=c("]"),E,O),O)},g=(b,v,x,L,N,k)=>{if(dd(b.parentElement,1)||Kl(),v.el=null,k){const O=_(b);for(;;){const A=i(b);if(A&&A!==O)l(A);else break}}const T=i(b),E=r(b);return l(b),n(null,v,E,T,x,L,ud(E),N),x&&(x.vnode.el=v.el,$h(x,v.el)),T},_=(b,v="[",x="]")=>{let L=0;for(;b;)if(b=i(b),b&&ia(b)&&(b.data===v&&L++,b.data===x)){if(L===0)return i(b);L--}return b},w=(b,v,x)=>{const L=v.parentNode;L&&L.replaceChild(b,v);let N=x;for(;N;)N.vnode.el===v&&(N.vnode.el=N.subTree.el=b),N=N.parent},y=b=>b.nodeType===1&&b.tagName==="TEMPLATE";return[u,d]}const yk="data-allow-mismatch",EI={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function dd(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(yk);)e=e.parentElement;const n=e&&e.getAttribute(yk);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(EI[t])}}const II=wh().requestIdleCallback||(e=>setTimeout(e,1)),$I=wh().cancelIdleCallback||(e=>clearTimeout(e)),ime=(e=1e4)=>t=>{const n=II(t,{timeout:e});return()=>$I(n)};function NI(e){const{top:t,left:n,bottom:o,right:s}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||o>0&&o<i)&&(n>0&&n<r||s>0&&s<r)}const rme=e=>(t,n)=>{const o=new IntersectionObserver(s=>{for(const i of s)if(i.isIntersecting){o.disconnect(),t();break}},e);return n(s=>{if(s instanceof Element){if(NI(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},lme=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},ame=(e=[])=>(t,n)=>{on(e)&&(e=[e]);let o=!1;const s=r=>{o||(o=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,s)})};return n(r=>{for(const l of e)r.addEventListener(l,s,{once:!0})}),i};function LI(e,t){if(ia(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(ia(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const Di=e=>!!e.type.__asyncLoader;function di(e){wt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const h=()=>(d++,c=null,m()),m=()=>{let f;return c||(f=c=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((_,w)=>{a(g,()=>_(h()),()=>w(g),d+1)});throw g}).then(g=>f!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return Qe({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(f,g,_){let w=!1;(g.bu||(g.bu=[])).push(()=>w=!0);const y=()=>{w||_()},b=i?()=>{const v=i(y,x=>LI(f,x));v&&(g.bum||(g.bum=[])).push(v)}:y;u?b():m().then(()=>!g.isUnmounted&&b())},get __asyncResolved(){return u},setup(){const f=uo;if(dv(f),u)return()=>fd(u,f);const g=b=>{c=null,Ra(b,f,13,!o)};if(l&&f.suspense||wl)return m().then(b=>()=>fd(b,f)).catch(b=>(g(b),()=>o?vt(o,{error:b}):null));const _=ne(!1),w=ne(),y=ne(!!s);return s&&setTimeout(()=>{y.value=!1},s),r!=null&&setTimeout(()=>{if(!_.value&&!w.value){const b=new Error(`Async component timed out after ${r}ms.`);g(b),w.value=b}},r),m().then(()=>{_.value=!0,f.parent&&Cu(f.parent.vnode)&&f.parent.update()}).catch(b=>{g(b),w.value=b}),()=>{if(_.value&&u)return fd(u,f);if(w.value&&o)return vt(o,{error:w.value});if(n&&!y.value)return fd(n,f)}}})}function fd(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=vt(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Cu=e=>e.type.__isKeepAlive,PI={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=ho(),o=n.ctx;if(!o.renderer)return()=>{const y=t.default&&t.default();return y&&y.length===1?y[0]:y};const s=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,h=d("div");o.activate=(y,b,v,x,L)=>{const N=y.component;c(y,b,v,0,l),a(N.vnode,y,b,v,N,l,x,y.slotScopeIds,L),Rn(()=>{N.isDeactivated=!1,N.a&&ha(N.a);const k=y.props&&y.props.onVnodeMounted;k&&Uo(k,N.parent,y)},l)},o.deactivate=y=>{const b=y.component;yf(b.m),yf(b.a),c(y,h,null,1,l),Rn(()=>{b.da&&ha(b.da);const v=y.props&&y.props.onVnodeUnmounted;v&&Uo(v,b.parent,y),b.isDeactivated=!0},l)};function m(y){vm(y),u(y,n,l,!0)}function f(y){s.forEach((b,v)=>{const x=jg(Di(b)?b.type.__asyncResolved||{}:b.type);x&&!y(x)&&g(v)})}function g(y){const b=s.get(y);b&&(!r||!Vs(b,r))?m(b):r&&vm(r),s.delete(y),i.delete(y)}ze(()=>[e.include,e.exclude],([y,b])=>{y&&f(v=>kc(y,v)),b&&f(v=>!kc(b,v))},{flush:"post",deep:!0});let _=null;const w=()=>{_!=null&&(kf(n.subTree.type)?Rn(()=>{s.set(_,hd(n.subTree))},n.subTree.suspense):s.set(_,hd(n.subTree)))};return sn(w),fv(w),Jo(()=>{s.forEach(y=>{const{subTree:b,suspense:v}=n,x=hd(b);if(y.type===x.type&&y.key===x.key){vm(x);const L=x.component.da;L&&Rn(L,v);return}m(y)})}),()=>{if(_=null,!t.default)return r=null;const y=t.default(),b=y[0];if(y.length>1)return r=null,y;if(!Er(b)||!(b.shapeFlag&4)&&!(b.shapeFlag&128))return r=null,b;let v=hd(b);if(v.type===Bn)return r=null,v;const x=v.type,L=jg(Di(v)?v.type.__asyncResolved||{}:x),{include:N,exclude:k,max:T}=e;if(N&&(!L||!kc(N,L))||k&&L&&kc(k,L))return v.shapeFlag&=-257,r=v,b;const E=v.key==null?x:v.key,O=s.get(E);return v.el&&(v=ji(v),b.shapeFlag&128&&(b.ssContent=v)),_=E,O?(v.el=O.el,v.component=O.component,v.transition&&Mr(v,v.transition),v.shapeFlag|=512,i.delete(E),i.add(E)):(i.add(E),T&&i.size>parseInt(T,10)&&g(i.values().next().value)),v.shapeFlag|=256,r=v,kf(b.type)?b:v}}},cme=PI;function kc(e,t){return dt(e)?e.some(n=>kc(n,t)):on(e)?e.split(",").includes(t):wE(e)?(e.lastIndex=0,e.test(t)):!1}function OI(e,t){hS(e,"a",t)}function RI(e,t){hS(e,"da",t)}function hS(e,t,n=uo){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Eh(t,o,n),n){let s=n.parent;for(;s&&s.parent;)Cu(s.parent.vnode)&&DI(o,t,n,s),s=s.parent}}function DI(e,t,n,o){const s=Eh(t,e,o,!0);Yt(()=>{nv(o[t],s)},n)}function vm(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function hd(e){return e.shapeFlag&128?e.ssContent:e}function Eh(e,t,n=uo,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Hi();const l=Da(n),a=Fs(t,n,e,r);return l(),Wi(),a});return o?s.unshift(i):s.push(i),i}}const Vi=e=>(t,n=uo)=>{(!wl||e==="sp")&&Eh(e,(...o)=>t(...o),n)},BI=Vi("bm"),sn=Vi("m"),pS=Vi("bu"),fv=Vi("u"),Jo=Vi("bum"),Yt=Vi("um"),FI=Vi("sp"),HI=Vi("rtg"),WI=Vi("rtc");function UI(e,t=uo){Eh("ec",e,t)}const hv="components",jI="directives";function qI(e,t){return pv(hv,e,!0,t)||e}const mS=Symbol.for("v-ndc");function ko(e){return on(e)?pv(hv,e,!1)||e:e||mS}function ume(e){return pv(jI,e)}function pv(e,t,n=!0,o=!1){const s=fo||uo;if(s){const i=s.type;if(e===hv){const l=jg(i,!1);if(l&&(l===t||l===Xn(t)||l===kh(Xn(t))))return i}const r=kk(s[e]||i[e],t)||kk(s.appContext[e],t);return!r&&o?i:r}}function kk(e,t){return e&&(e[t]||e[Xn(t)]||e[kh(Xn(t))])}function Xe(e,t,n,o){let s;const i=n&&n[o],r=dt(e);if(r||on(e)){const l=r&&Cr(e);let a=!1,c=!1;l&&(a=!fs(e),c=Ui(e),e=Sh(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?Aa(Xs(e[u])):Xs(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){s=new Array(e);for(let l=0;l<e;l++)s[l]=t(l+1,l,void 0,i&&i[l])}else if(Gt(e))if(e[Symbol.iterator])s=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];s[a]=t(e[u],u,a,i&&i[a])}}else s=[];return n&&(n[o]=s),s}function dme(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(dt(o))for(let s=0;s<o.length;s++)e[o[s].name]=o[s].fn;else o&&(e[o.name]=o.key?(...s)=>{const i=o.fn(...s);return i&&(i.key=o.key),i}:o.fn)}return e}function ga(e,t,n={},o,s){if(fo.ce||fo.parent&&Di(fo.parent)&&fo.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),C(),Ve(Oe,null,[vt("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),C();const r=i&&mv(i(n)),l=n.key||r&&r.key,a=Ve(Oe,{key:(l&&!ys(l)?l:`_${t}`)+(!r&&o?"_fb":"")},r||(o?o():[]),r&&e._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function mv(e){return e.some(t=>Er(t)?!(t.type===Bn||t.type===Oe&&!mv(t.children)):!0)?e:null}function fme(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:Wd(o)]=e[o];return n}const Og=e=>e?HS(e)?xu(e):Og(e.parent):null,Ic=tn(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=>Og(e.parent),$root:e=>Og(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>gv(e),$forceUpdate:e=>e.f||(e.f=()=>{cv(e.update)}),$nextTick:e=>e.n||(e.n=ht.bind(e.proxy)),$watch:e=>bI.bind(e)}),ym=(e,t)=>e!==Ot&&!e.__isScriptSetup&&Kt(e,t),Rg={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const h=r[t];if(h!==void 0)switch(h){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(ym(o,t))return r[t]=1,o[t];if(s!==Ot&&Kt(s,t))return r[t]=2,s[t];if(Kt(i,t))return r[t]=3,i[t];if(n!==Ot&&Kt(n,t))return r[t]=4,n[t];Dg&&(r[t]=0)}}const c=Ic[t];let u,d;if(c)return t==="$attrs"&&yo(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Ot&&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:o,setupState:s,ctx:i}=e;return ym(s,t)?(s[t]=n,!0):o!==Ot&&Kt(o,t)?(o[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:o,appContext:s,props:i,type:r}},l){let a;return!!(n[l]||e!==Ot&&l[0]!=="$"&&Kt(e,l)||ym(t,l)||Kt(i,l)||Kt(o,l)||Kt(Ic,l)||Kt(s.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)}},zI=tn({},Rg,{get(e,t){if(t!==Symbol.unscopables)return Rg.get(e,t,e)},has(e,t){return t[0]!=="_"&&!TE(t)}});function hme(){return null}function pme(){return null}function mme(e){}function gme(e){}function vme(){return null}function yme(){}function kme(e,t){return null}function bme(){return gS().slots}function Su(){return gS().attrs}function gS(e){const t=ho();return t.setupContext||(t.setupContext=jS(t))}function Zc(e){return dt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function wme(e,t){const n=Zc(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?dt(s)||wt(s)?s=n[o]={type:s,default:t[o]}:s.default=t[o]:s===null&&(s=n[o]={default:t[o]}),s&&t[`__skip_${o}`]&&(s.skipFactory=!0)}return n}function _me(e,t){return!e||!t?e||t:dt(e)&&dt(t)?e.concat(t):tn({},Zc(e),Zc(t))}function Cme(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function Sme(e){const t=ho(),n=wl;let o=e();eu(),n&&ka(!1);const s=()=>{Da(t),n&&ka(!0)},i=()=>{ho()!==t&&t.scope.off(),eu(),n&&ka(!1)};return ov(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Dg=!0;function VI(e){const t=gv(e),n=e.proxy,o=e.ctx;Dg=!1,t.beforeCreate&&bk(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:m,updated:f,activated:g,deactivated:_,beforeDestroy:w,beforeUnmount:y,destroyed:b,unmounted:v,render:x,renderTracked:L,renderTriggered:N,errorCaptured:k,serverPrefetch:T,expose:E,inheritAttrs:O,components:A,directives:$,filters:R}=t;if(c&&KI(c,o,null),r)for(const V in r){const U=r[V];wt(U)&&(o[V]=U.bind(n))}if(s){const V=s.call(n,n);Gt(V)&&(e.data=ds(V))}if(Dg=!0,i)for(const V in i){const U=i[V],ee=wt(U)?U.bind(n,n):wt(U.get)?U.get.bind(n,n):Ds,K=!wt(U)&&wt(U.set)?U.set.bind(n):Ds,G=F({get:ee,set:K});Object.defineProperty(o,V,{enumerable:!0,configurable:!0,get:()=>G.value,set:X=>G.value=X})}if(l)for(const V in l)vS(l[V],o,n,V);if(a){const V=wt(a)?a.call(n):a;Reflect.ownKeys(V).forEach(U=>{yn(U,V[U])})}u&&bk(u,e,"c");function W(V,U){dt(U)?U.forEach(ee=>V(ee.bind(n))):U&&V(U.bind(n))}if(W(BI,d),W(sn,h),W(pS,m),W(fv,f),W(OI,g),W(RI,_),W(UI,k),W(WI,L),W(HI,N),W(Jo,y),W(Yt,v),W(FI,T),dt(E))if(E.length){const V=e.exposed||(e.exposed={});E.forEach(U=>{Object.defineProperty(V,U,{get:()=>n[U],set:ee=>n[U]=ee,enumerable:!0})})}else e.exposed||(e.exposed={});x&&e.render===Ds&&(e.render=x),O!=null&&(e.inheritAttrs=O),A&&(e.components=A),$&&(e.directives=$),T&&dv(e)}function KI(e,t,n=Ds){dt(e)&&(e=Bg(e));for(const o in e){const s=e[o];let i;Gt(s)?"default"in s?i=Bt(s.from||o,s.default,!0):i=Bt(s.from||o):i=Bt(s),Ln(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function bk(e,t,n){Fs(dt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function vS(e,t,n,o){let s=o.includes(".")?iS(n,o):()=>n[o];if(on(e)){const i=t[e];wt(i)&&ze(s,i)}else if(wt(e))ze(s,e.bind(n));else if(Gt(e))if(dt(e))e.forEach(i=>vS(i,t,n,o));else{const i=wt(e.handler)?e.handler.bind(n):t[e.handler];wt(i)&&ze(s,i,e)}}function gv(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!o?a=t:(a={},s.length&&s.forEach(c=>vf(a,c,r,!0)),vf(a,t,r)),Gt(t)&&i.set(t,a),a}function vf(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&vf(e,i,n,!0),s&&s.forEach(r=>vf(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=GI[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const GI={data:wk,props:_k,emits:_k,methods:bc,computed:bc,beforeCreate:To,created:To,beforeMount:To,mounted:To,beforeUpdate:To,updated:To,beforeDestroy:To,beforeUnmount:To,destroyed:To,unmounted:To,activated:To,deactivated:To,errorCaptured:To,serverPrefetch:To,components:bc,directives:bc,watch:XI,provide:wk,inject:YI};function wk(e,t){return t?e?function(){return tn(wt(e)?e.call(this,this):e,wt(t)?t.call(this,this):t)}:t:e}function YI(e,t){return bc(Bg(e),Bg(t))}function Bg(e){if(dt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function To(e,t){return e?[...new Set([].concat(e,t))]:t}function bc(e,t){return e?tn(Object.create(null),e,t):t}function _k(e,t){return e?dt(e)&&dt(t)?[...new Set([...e,...t])]:tn(Object.create(null),Zc(e),Zc(t??{})):t}function XI(e,t){if(!e)return t;if(!t)return e;const n=tn(Object.create(null),e);for(const o in t)n[o]=To(e[o],t[o]);return n}function yS(){return{app:null,config:{isNativeTag:MC,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 QI=0;function ZI(e,t){return function(o,s=null){wt(o)||(o=tn({},o)),s!=null&&!Gt(s)&&(s=null);const i=yS(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:QI++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:M$,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&wt(u.install)?(r.add(u),u.install(c,...d)):wt(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,h){if(!a){const m=c._ceVNode||vt(o,s);return m.appContext=i,h===!0?h="svg":h===!1&&(h=void 0),d&&t?t(m,u):e(m,u,h),a=!0,c._container=u,u.__vue_app__=c,xu(m.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Fs(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=gl;gl=c;try{return u()}finally{gl=d}}};return c}}let gl=null;function xme(e,t,n=Ot){const o=ho(),s=Xn(t),i=zo(t),r=kS(e,s),l=sI((a,c)=>{let u,d=Ot,h;return kI(()=>{const m=e[s];co(u,m)&&(u=m,c())}),{get(){return a(),n.get?n.get(u):u},set(m){const f=n.set?n.set(m):m;if(!co(f,u)&&!(d!==Ot&&co(m,d)))return;const g=o.vnode.props;g&&(t in g||s in g||i in g)&&(`onUpdate:${t}`in g||`onUpdate:${s}`in g||`onUpdate:${i}`in g)||(u=m,c()),o.emit(`update:${t}`,f),co(m,f)&&co(m,d)&&!co(f,h)&&c(),d=m,h=f}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Ot:l,done:!1}:{done:!0}}}},l}const kS=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Xn(t)}Modifiers`]||e[`${zo(t)}Modifiers`];function JI(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Ot;let s=n;const i=t.startsWith("update:"),r=i&&kS(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>on(u)?u.trim():u)),r.number&&(s=n.map(bh)));let l,a=o[l=Wd(t)]||o[l=Wd(Xn(t))];!a&&i&&(a=o[l=Wd(zo(t))]),a&&Fs(a,e,6,s);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Fs(c,e,6,s)}}const e$=new WeakMap;function bS(e,t,n=!1){const o=n?e$:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!wt(e)){const a=c=>{const u=bS(c,t,!0);u&&(l=!0,tn(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)&&o.set(e,null),null):(dt(i)?i.forEach(a=>r[a]=null):tn(r,i),Gt(e)&&o.set(e,r),r)}function Ih(e,t){return!e||!bu(t)?!1:(t=t.slice(2).replace(/Once$/,""),Kt(e,t[0].toLowerCase()+t.slice(1))||Kt(e,zo(t))||Kt(e,t))}function Ud(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:h,setupState:m,ctx:f,inheritAttrs:g}=e,_=Xc(e);let w,y;try{if(n.shapeFlag&4){const v=s||o,x=v;w=qo(c.call(x,v,u,d,m,h,f)),y=l}else{const v=t;w=qo(v.length>1?v(d,{attrs:l,slots:r,emit:a}):v(d,null)),y=t.props?l:n$(l)}}catch(v){$c.length=0,Ra(v,e,1),w=vt(Bn)}let b=w;if(y&&g!==!1){const v=Object.keys(y),{shapeFlag:x}=b;v.length&&x&7&&(i&&v.some(mh)&&(y=o$(y,i)),b=ji(b,y,!1,!0))}return n.dirs&&(b=ji(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&Mr(b,n.transition),w=b,Xc(_),w}function t$(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(Er(s)){if(s.type!==Bn||s.children==="v-if"){if(n)return;n=s}}else return}return n}const n$=e=>{let t;for(const n in e)(n==="class"||n==="style"||bu(n))&&((t||(t={}))[n]=e[n]);return t},o$=(e,t)=>{const n={};for(const o in e)(!mh(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function s$(e,t,n){const{props:o,children:s,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return o?Ck(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const h=u[d];if(wS(r,o,h)&&!Ih(c,h))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?Ck(o,r,c):!0:!!r;return!1}function Ck(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){const i=o[s];if(wS(t,e,i)&&!Ih(n,i))return!0}return!1}function wS(e,t,n){const o=e[n],s=t[n];return n==="style"&&Gt(o)&&Gt(s)?!Fi(o,s):o!==s}function $h({vnode:e,parent:t,suspense:n},o){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=o,e=s),s===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}const _S={},CS=()=>Object.create(_S),SS=e=>Object.getPrototypeOf(e)===_S;function i$(e,t,n,o=!1){const s={},i=CS();e.propsDefaults=Object.create(null),xS(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:eI(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function r$(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=Ht(s),[a]=e.propsOptions;let c=!1;if((o||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let h=u[d];if(Ih(e.emitsOptions,h))continue;const m=t[h];if(a)if(Kt(i,h))m!==i[h]&&(i[h]=m,c=!0);else{const f=Xn(h);s[f]=Fg(a,l,f,m,e,!1)}else m!==i[h]&&(i[h]=m,c=!0)}}}else{xS(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!Kt(t,d)&&((u=zo(d))===d||!Kt(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=Fg(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!Kt(t,d))&&(delete i[d],c=!0)}c&&$i(e.attrs,"set","")}function xS(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(pl(a))continue;const c=t[a];let u;s&&Kt(s,u=Xn(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:Ih(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=Ht(n),c=l||Ot;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Fg(s,a,d,c[d],e,!Kt(c,d))}}return r}function Fg(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=Kt(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&wt(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=Da(s);o=c[n]=a.call(null,t),u()}}else o=a;s.ce&&s.ce._setProp(n,o)}r[0]&&(i&&!l?o=!1:r[1]&&(o===""||o===zo(n))&&(o=!0))}return o}const l$=new WeakMap;function TS(e,t,n=!1){const o=n?l$:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!wt(e)){const u=d=>{a=!0;const[h,m]=TS(d,t,!0);tn(r,h),m&&l.push(...m)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return Gt(e)&&o.set(e,da),da;if(dt(i))for(let u=0;u<i.length;u++){const d=Xn(i[u]);Sk(d)&&(r[d]=Ot)}else if(i)for(const u in i){const d=Xn(u);if(Sk(d)){const h=i[u],m=r[d]=dt(h)||wt(h)?{type:h}:tn({},h),f=m.type;let g=!1,_=!0;if(dt(f))for(let w=0;w<f.length;++w){const y=f[w],b=wt(y)&&y.name;if(b==="Boolean"){g=!0;break}else b==="String"&&(_=!1)}else g=wt(f)&&f.name==="Boolean";m[0]=g,m[1]=_,(g||Kt(m,"default"))&&l.push(d)}}const c=[r,l];return Gt(e)&&o.set(e,c),c}function Sk(e){return e[0]!=="$"&&!pl(e)}const vv=e=>e==="_"||e==="_ctx"||e==="$stable",yv=e=>dt(e)?e.map(qo):[qo(e)],a$=(e,t,n)=>{if(t._n)return t;const o=$n((...s)=>yv(t(...s)),n);return o._c=!1,o},AS=(e,t,n)=>{const o=e._ctx;for(const s in e){if(vv(s))continue;const i=e[s];if(wt(i))t[s]=a$(s,i,o);else if(i!=null){const r=yv(i);t[s]=()=>r}}},MS=(e,t)=>{const n=yv(t);e.slots.default=()=>n},ES=(e,t,n)=>{for(const o in t)(n||!vv(o))&&(e[o]=t[o])},c$=(e,t,n)=>{const o=e.slots=CS();if(e.vnode.shapeFlag&32){const s=t._;s?(ES(o,t,n),n&&IC(o,"_",s,!0)):AS(t,o)}else t&&MS(e,t)},u$=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=Ot;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:ES(s,t,n):(i=!t.$stable,AS(t,s)),r=t}else t&&(MS(e,t),r={default:1});if(i)for(const l in s)!vv(l)&&r[l]==null&&delete s[l]},Rn=OS;function d$(e){return IS(e)}function f$(e){return IS(e,MI)}function IS(e,t){const n=wh();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:m=Ds,insertStaticContent:f}=e,g=(q,te,pe,oe=null,fe=null,H=null,Y=void 0,re=null,ge=!!te.dynamicChildren)=>{if(q===te)return;q&&!Vs(q,te)&&(oe=ve(q),X(q,fe,H,!0),q=null),te.patchFlag===-2&&(ge=!1,te.dynamicChildren=null);const{type:xe,ref:Ne,shapeFlag:ie}=te;switch(xe){case Sr:_(q,te,pe,oe);break;case Bn:w(q,te,pe,oe);break;case ya:q==null&&y(te,pe,oe,Y);break;case Oe:A(q,te,pe,oe,fe,H,Y,re,ge);break;default:ie&1?x(q,te,pe,oe,fe,H,Y,re,ge):ie&6?$(q,te,pe,oe,fe,H,Y,re,ge):(ie&64||ie&128)&&xe.process(q,te,pe,oe,fe,H,Y,re,ge,Q)}Ne!=null&&fe?ma(Ne,q&&q.ref,H,te||q,!te):Ne==null&&q&&q.ref!=null&&ma(q.ref,null,H,q,!0)},_=(q,te,pe,oe)=>{if(q==null)o(te.el=l(te.children),pe,oe);else{const fe=te.el=q.el;te.children!==q.children&&c(fe,te.children)}},w=(q,te,pe,oe)=>{q==null?o(te.el=a(te.children||""),pe,oe):te.el=q.el},y=(q,te,pe,oe)=>{[q.el,q.anchor]=f(q.children,te,pe,oe,q.el,q.anchor)},b=({el:q,anchor:te},pe,oe)=>{let fe;for(;q&&q!==te;)fe=h(q),o(q,pe,oe),q=fe;o(te,pe,oe)},v=({el:q,anchor:te})=>{let pe;for(;q&&q!==te;)pe=h(q),s(q),q=pe;s(te)},x=(q,te,pe,oe,fe,H,Y,re,ge)=>{if(te.type==="svg"?Y="svg":te.type==="math"&&(Y="mathml"),q==null)L(te,pe,oe,fe,H,Y,re,ge);else{const xe=q.el&&q.el._isVueCE?q.el:null;try{xe&&xe._beginPatch(),T(q,te,fe,H,Y,re,ge)}finally{xe&&xe._endPatch()}}},L=(q,te,pe,oe,fe,H,Y,re)=>{let ge,xe;const{props:Ne,shapeFlag:ie,transition:ae,dirs:we}=q;if(ge=q.el=r(q.type,H,Ne&&Ne.is,Ne),ie&8?u(ge,q.children):ie&16&&k(q.children,ge,null,oe,fe,km(q,H),Y,re),we&&ci(q,null,oe,"created"),N(ge,q,q.scopeId,Y,oe),Ne){for(const nt in Ne)nt!=="value"&&!pl(nt)&&i(ge,nt,null,Ne[nt],H,oe);"value"in Ne&&i(ge,"value",null,Ne.value,H),(xe=Ne.onVnodeBeforeMount)&&Uo(xe,oe,q)}we&&ci(q,null,oe,"beforeMount");const je=$S(fe,ae);je&&ae.beforeEnter(ge),o(ge,te,pe),((xe=Ne&&Ne.onVnodeMounted)||je||we)&&Rn(()=>{try{xe&&Uo(xe,oe,q),je&&ae.enter(ge),we&&ci(q,null,oe,"mounted")}finally{}},fe)},N=(q,te,pe,oe,fe)=>{if(pe&&m(q,pe),oe)for(let H=0;H<oe.length;H++)m(q,oe[H]);if(fe){let H=fe.subTree;if(te===H||kf(H.type)&&(H.ssContent===te||H.ssFallback===te)){const Y=fe.vnode;N(q,Y,Y.scopeId,Y.slotScopeIds,fe.parent)}}},k=(q,te,pe,oe,fe,H,Y,re,ge=0)=>{for(let xe=ge;xe<q.length;xe++){const Ne=q[xe]=re?Ii(q[xe]):qo(q[xe]);g(null,Ne,te,pe,oe,fe,H,Y,re)}},T=(q,te,pe,oe,fe,H,Y)=>{const re=te.el=q.el;let{patchFlag:ge,dynamicChildren:xe,dirs:Ne}=te;ge|=q.patchFlag&16;const ie=q.props||Ot,ae=te.props||Ot;let we;if(pe&&Zr(pe,!1),(we=ae.onVnodeBeforeUpdate)&&Uo(we,pe,te,q),Ne&&ci(te,q,pe,"beforeUpdate"),pe&&Zr(pe,!0),(ie.innerHTML&&ae.innerHTML==null||ie.textContent&&ae.textContent==null)&&u(re,""),xe?E(q.dynamicChildren,xe,re,pe,oe,km(te,fe),H):Y||U(q,te,re,null,pe,oe,km(te,fe),H,!1),ge>0){if(ge&16)O(re,ie,ae,pe,fe);else if(ge&2&&ie.class!==ae.class&&i(re,"class",null,ae.class,fe),ge&4&&i(re,"style",ie.style,ae.style,fe),ge&8){const je=te.dynamicProps;for(let nt=0;nt<je.length;nt++){const ct=je[nt],_t=ie[ct],$t=ae[ct];($t!==_t||ct==="value")&&i(re,ct,_t,$t,fe,pe)}}ge&1&&q.children!==te.children&&u(re,te.children)}else!Y&&xe==null&&O(re,ie,ae,pe,fe);((we=ae.onVnodeUpdated)||Ne)&&Rn(()=>{we&&Uo(we,pe,te,q),Ne&&ci(te,q,pe,"updated")},oe)},E=(q,te,pe,oe,fe,H,Y)=>{for(let re=0;re<te.length;re++){const ge=q[re],xe=te[re],Ne=ge.el&&(ge.type===Oe||!Vs(ge,xe)||ge.shapeFlag&198)?d(ge.el):pe;g(ge,xe,Ne,null,oe,fe,H,Y,!0)}},O=(q,te,pe,oe,fe)=>{if(te!==pe){if(te!==Ot)for(const H in te)!pl(H)&&!(H in pe)&&i(q,H,te[H],null,fe,oe);for(const H in pe){if(pl(H))continue;const Y=pe[H],re=te[H];Y!==re&&H!=="value"&&i(q,H,re,Y,fe,oe)}"value"in pe&&i(q,"value",te.value,pe.value,fe)}},A=(q,te,pe,oe,fe,H,Y,re,ge)=>{const xe=te.el=q?q.el:l(""),Ne=te.anchor=q?q.anchor:l("");let{patchFlag:ie,dynamicChildren:ae,slotScopeIds:we}=te;we&&(re=re?re.concat(we):we),q==null?(o(xe,pe,oe),o(Ne,pe,oe),k(te.children||[],pe,Ne,fe,H,Y,re,ge)):ie>0&&ie&64&&ae&&q.dynamicChildren&&q.dynamicChildren.length===ae.length?(E(q.dynamicChildren,ae,pe,fe,H,Y,re),(te.key!=null||fe&&te===fe.subTree)&&kv(q,te,!0)):U(q,te,pe,Ne,fe,H,Y,re,ge)},$=(q,te,pe,oe,fe,H,Y,re,ge)=>{te.slotScopeIds=re,q==null?te.shapeFlag&512?fe.ctx.activate(te,pe,oe,Y,ge):R(te,pe,oe,fe,H,Y,ge):D(q,te,ge)},R=(q,te,pe,oe,fe,H,Y)=>{const re=q.component=FS(q,oe,fe);if(Cu(q)&&(re.ctx.renderer=Q),WS(re,!1,Y),re.asyncDep){if(fe&&fe.registerDep(re,W,Y),!q.el){const ge=re.subTree=vt(Bn);w(null,ge,te,pe),q.placeholder=ge.el}}else W(re,q,te,pe,fe,H,Y)},D=(q,te,pe)=>{const oe=te.component=q.component;if(s$(q,te,pe))if(oe.asyncDep&&!oe.asyncResolved){V(oe,te,pe);return}else oe.next=te,oe.update();else te.el=q.el,oe.vnode=te},W=(q,te,pe,oe,fe,H,Y)=>{const re=()=>{if(q.isMounted){let{next:ie,bu:ae,u:we,parent:je,vnode:nt}=q;{const Rt=NS(q);if(Rt){ie&&(ie.el=nt.el,V(q,ie,Y)),Rt.asyncDep.then(()=>{Rn(()=>{q.isUnmounted||xe()},fe)});return}}let ct=ie,_t;Zr(q,!1),ie?(ie.el=nt.el,V(q,ie,Y)):ie=nt,ae&&ha(ae),(_t=ie.props&&ie.props.onVnodeBeforeUpdate)&&Uo(_t,je,ie,nt),Zr(q,!0);const $t=Ud(q),lt=q.subTree;q.subTree=$t,g(lt,$t,d(lt.el),ve(lt),q,fe,H),ie.el=$t.el,ct===null&&$h(q,$t.el),we&&Rn(we,fe),(_t=ie.props&&ie.props.onVnodeUpdated)&&Rn(()=>Uo(_t,je,ie,nt),fe)}else{let ie;const{el:ae,props:we}=te,{bm:je,m:nt,parent:ct,root:_t,type:$t}=q,lt=Di(te);if(Zr(q,!1),je&&ha(je),!lt&&(ie=we&&we.onVnodeBeforeMount)&&Uo(ie,ct,te),Zr(q,!0),ae&&Ce){const Rt=()=>{q.subTree=Ud(q),Ce(ae,q.subTree,q,fe,null)};lt&&$t.__asyncHydrate?$t.__asyncHydrate(ae,q,Rt):Rt()}else{_t.ce&&_t.ce._hasShadowRoot()&&_t.ce._injectChildStyle($t,q.parent?q.parent.type:void 0);const Rt=q.subTree=Ud(q);g(null,Rt,pe,oe,q,fe,H),te.el=Rt.el}if(nt&&Rn(nt,fe),!lt&&(ie=we&&we.onVnodeMounted)){const Rt=te;Rn(()=>Uo(ie,ct,Rt),fe)}(te.shapeFlag&256||ct&&Di(ct.vnode)&&ct.vnode.shapeFlag&256)&&q.a&&Rn(q.a,fe),q.isMounted=!0,te=pe=oe=null}};q.scope.on();const ge=q.effect=new cf(re);q.scope.off();const xe=q.update=ge.run.bind(ge),Ne=q.job=ge.runIfDirty.bind(ge);Ne.i=q,Ne.id=q.uid,ge.scheduler=()=>cv(Ne),Zr(q,!0),xe()},V=(q,te,pe)=>{te.component=q;const oe=q.vnode.props;q.vnode=te,q.next=null,r$(q,te.props,oe,pe),u$(q,te.children,pe),Hi(),dk(q),Wi()},U=(q,te,pe,oe,fe,H,Y,re,ge=!1)=>{const xe=q&&q.children,Ne=q?q.shapeFlag:0,ie=te.children,{patchFlag:ae,shapeFlag:we}=te;if(ae>0){if(ae&128){K(xe,ie,pe,oe,fe,H,Y,re,ge);return}else if(ae&256){ee(xe,ie,pe,oe,fe,H,Y,re,ge);return}}we&8?(Ne&16&&ue(xe,fe,H),ie!==xe&&u(pe,ie)):Ne&16?we&16?K(xe,ie,pe,oe,fe,H,Y,re,ge):ue(xe,fe,H,!0):(Ne&8&&u(pe,""),we&16&&k(ie,pe,oe,fe,H,Y,re,ge))},ee=(q,te,pe,oe,fe,H,Y,re,ge)=>{q=q||da,te=te||da;const xe=q.length,Ne=te.length,ie=Math.min(xe,Ne);let ae;for(ae=0;ae<ie;ae++){const we=te[ae]=ge?Ii(te[ae]):qo(te[ae]);g(q[ae],we,pe,null,fe,H,Y,re,ge)}xe>Ne?ue(q,fe,H,!0,!1,ie):k(te,pe,oe,fe,H,Y,re,ge,ie)},K=(q,te,pe,oe,fe,H,Y,re,ge)=>{let xe=0;const Ne=te.length;let ie=q.length-1,ae=Ne-1;for(;xe<=ie&&xe<=ae;){const we=q[xe],je=te[xe]=ge?Ii(te[xe]):qo(te[xe]);if(Vs(we,je))g(we,je,pe,null,fe,H,Y,re,ge);else break;xe++}for(;xe<=ie&&xe<=ae;){const we=q[ie],je=te[ae]=ge?Ii(te[ae]):qo(te[ae]);if(Vs(we,je))g(we,je,pe,null,fe,H,Y,re,ge);else break;ie--,ae--}if(xe>ie){if(xe<=ae){const we=ae+1,je=we<Ne?te[we].el:oe;for(;xe<=ae;)g(null,te[xe]=ge?Ii(te[xe]):qo(te[xe]),pe,je,fe,H,Y,re,ge),xe++}}else if(xe>ae)for(;xe<=ie;)X(q[xe],fe,H,!0),xe++;else{const we=xe,je=xe,nt=new Map;for(xe=je;xe<=ae;xe++){const Nt=te[xe]=ge?Ii(te[xe]):qo(te[xe]);Nt.key!=null&&nt.set(Nt.key,xe)}let ct,_t=0;const $t=ae-je+1;let lt=!1,Rt=0;const fn=new Array($t);for(xe=0;xe<$t;xe++)fn[xe]=0;for(xe=we;xe<=ie;xe++){const Nt=q[xe];if(_t>=$t){X(Nt,fe,H,!0);continue}let Ft;if(Nt.key!=null)Ft=nt.get(Nt.key);else for(ct=je;ct<=ae;ct++)if(fn[ct-je]===0&&Vs(Nt,te[ct])){Ft=ct;break}Ft===void 0?X(Nt,fe,H,!0):(fn[Ft-je]=xe+1,Ft>=Rt?Rt=Ft:lt=!0,g(Nt,te[Ft],pe,null,fe,H,Y,re,ge),_t++)}const Mn=lt?h$(fn):da;for(ct=Mn.length-1,xe=$t-1;xe>=0;xe--){const Nt=je+xe,Ft=te[Nt],qn=te[Nt+1],Je=Nt+1<Ne?qn.el||LS(qn):oe;fn[xe]===0?g(null,Ft,pe,Je,fe,H,Y,re,ge):lt&&(ct<0||xe!==Mn[ct]?G(Ft,pe,Je,2):ct--)}}},G=(q,te,pe,oe,fe=null)=>{const{el:H,type:Y,transition:re,children:ge,shapeFlag:xe}=q;if(xe&6){G(q.component.subTree,te,pe,oe);return}if(xe&128){q.suspense.move(te,pe,oe);return}if(xe&64){Y.move(q,te,pe,Q);return}if(Y===Oe){o(H,te,pe);for(let ie=0;ie<ge.length;ie++)G(ge[ie],te,pe,oe);o(q.anchor,te,pe);return}if(Y===ya){b(q,te,pe);return}if(oe!==2&&xe&1&&re)if(oe===0)re.persisted&&!H[$s]?o(H,te,pe):(re.beforeEnter(H),o(H,te,pe),Rn(()=>re.enter(H),fe));else{const{leave:ie,delayLeave:ae,afterLeave:we}=re,je=()=>{q.ctx.isUnmounted?s(H):o(H,te,pe)},nt=()=>{const ct=H._isLeaving||!!H[$s];H._isLeaving&&H[$s](!0),re.persisted&&!ct?je():ie(H,()=>{je(),we&&we()})};ae?ae(H,je,nt):nt()}else o(H,te,pe)},X=(q,te,pe,oe=!1,fe=!1)=>{const{type:H,props:Y,ref:re,children:ge,dynamicChildren:xe,shapeFlag:Ne,patchFlag:ie,dirs:ae,cacheIndex:we,memo:je}=q;if(ie===-2&&(fe=!1),re!=null&&(Hi(),ma(re,null,pe,q,!0),Wi()),we!=null&&(te.renderCache[we]=void 0),Ne&256){te.ctx.deactivate(q);return}const nt=Ne&1&&ae,ct=!Di(q);let _t;if(ct&&(_t=Y&&Y.onVnodeBeforeUnmount)&&Uo(_t,te,q),Ne&6)He(q.component,pe,oe);else{if(Ne&128){q.suspense.unmount(pe,oe);return}nt&&ci(q,null,te,"beforeUnmount"),Ne&64?q.type.remove(q,te,pe,Q,oe):xe&&!xe.hasOnce&&(H!==Oe||ie>0&&ie&64)?ue(xe,te,pe,!1,!0):(H===Oe&&ie&384||!fe&&Ne&16)&&ue(ge,te,pe),oe&&ke(q)}const $t=je!=null&&we==null;(ct&&(_t=Y&&Y.onVnodeUnmounted)||nt||$t)&&Rn(()=>{_t&&Uo(_t,te,q),nt&&ci(q,null,te,"unmounted"),$t&&(q.el=null)},pe)},ke=q=>{const{type:te,el:pe,anchor:oe,transition:fe}=q;if(te===Oe){le(pe,oe);return}if(te===ya){v(q);return}const H=()=>{s(pe),fe&&!fe.persisted&&fe.afterLeave&&fe.afterLeave()};if(q.shapeFlag&1&&fe&&!fe.persisted){const{leave:Y,delayLeave:re}=fe,ge=()=>Y(pe,H);re?re(q.el,H,ge):ge()}else H()},le=(q,te)=>{let pe;for(;q!==te;)pe=h(q),s(q),q=pe;s(te)},He=(q,te,pe)=>{const{bum:oe,scope:fe,job:H,subTree:Y,um:re,m:ge,a:xe}=q;yf(ge),yf(xe),oe&&ha(oe),fe.stop(),H&&(H.flags|=8,X(Y,q,te,pe)),re&&Rn(re,te),Rn(()=>{q.isUnmounted=!0},te)},ue=(q,te,pe,oe=!1,fe=!1,H=0)=>{for(let Y=H;Y<q.length;Y++)X(q[Y],te,pe,oe,fe)},ve=q=>{if(q.shapeFlag&6)return ve(q.component.subTree);if(q.shapeFlag&128)return q.suspense.next();const te=h(q.anchor||q.el),pe=te&&te[rS];return pe?h(pe):te};let Pe=!1;const Re=(q,te,pe)=>{let oe;q==null?te._vnode&&(X(te._vnode,null,null,!0),oe=te._vnode.component):g(te._vnode||null,q,te,null,null,null,pe),te._vnode=q,Pe||(Pe=!0,dk(oe),mf(),Pe=!1)},Q={p:g,um:X,m:G,r:ke,mt:R,mc:k,pc:U,pbc:E,n:ve,o:e};let ce,Ce;return t&&([ce,Ce]=t(Q)),{render:Re,hydrate:ce,createApp:ZI(Re,ce)}}function km({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 Zr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function $S(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function kv(e,t,n=!1){const o=e.children,s=t.children;if(dt(o)&&dt(s))for(let i=0;i<o.length;i++){const r=o[i];let l=s[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=s[i]=Ii(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&kv(r,l)),l.type===Sr&&(l.patchFlag===-1&&(l=s[i]=Ii(l)),l.el=r.el),l.type===Bn&&!l.el&&(l.el=r.el)}}function h$(e){const t=e.slice(),n=[0];let o,s,i,r,l;const a=e.length;for(o=0;o<a;o++){const c=e[o];if(c!==0){if(s=n[n.length-1],e[s]<c){t[o]=s,n.push(o);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function NS(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:NS(t)}function yf(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function LS(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?LS(t.subTree):null}const kf=e=>e.__isSuspense;let Hg=0;const p$={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)m$(t,n,o,s,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}g$(e,t,n,o,s,r,l,a,c)}},hydrate:v$,normalize:y$},Tme=p$;function Jc(e,t){const n=e.props&&e.props[t];wt(n)&&n()}function m$(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),h=e.suspense=PS(e,s,o,t,d,n,i,r,l,a);c(null,h.pendingBranch=e.ssContent,d,null,o,h,i,r),h.deps>0?(Jc(e,"onPending"),Jc(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),va(h,e.ssFallback)):h.resolve(!1,!0)}function g$(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const h=t.ssContent,m=t.ssFallback,{activeBranch:f,pendingBranch:g,isInFallback:_,isHydrating:w}=d;if(g)d.pendingBranch=h,Vs(g,h)?(a(g,h,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():_&&(w||(a(f,m,n,o,s,null,i,r,l),va(d,m)))):(d.pendingId=Hg++,w?(d.isHydrating=!1,d.activeBranch=g):c(g,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),_?(a(null,h,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(f,m,n,o,s,null,i,r,l),va(d,m))):f&&Vs(f,h)?(a(f,h,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,h,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(f&&Vs(f,h))a(f,h,n,o,s,d,i,r,l),va(d,h);else if(Jc(t,"onPending"),d.pendingBranch=h,h.shapeFlag&512?d.pendingId=h.component.suspenseId:d.pendingId=Hg++,a(null,h,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:y,pendingId:b}=d;y>0?setTimeout(()=>{d.pendingId===b&&d.fallback(m)},y):y===0&&d.fallback(m)}}function PS(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:h,um:m,n:f,o:{parentNode:g,remove:_}}=c;let w;const y=k$(e);y&&t&&t.pendingBranch&&(w=t.pendingId,t.deps++);const b=e.props?af(e.props.timeout):void 0,v=i,x={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:Hg++,timeout:typeof b=="number"?b:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(L=!1,N=!1){const{vnode:k,activeBranch:T,pendingBranch:E,pendingId:O,effects:A,parentComponent:$,container:R,isInFallback:D}=x;let W=!1;if(x.isHydrating)x.isHydrating=!1;else if(!L){W=T&&E.transition&&E.transition.mode==="out-in";let ee=!1;W&&(T.transition.afterLeave=()=>{O===x.pendingId&&(h(E,R,i===v&&!ee?f(T):i,0),pf(A),D&&k.ssFallback&&(k.ssFallback.el=null))}),T&&!x.isFallbackMountPending&&(g(T.el)===R&&(i=f(T),ee=!0),m(T,$,x,!0),!W&&D&&k.ssFallback&&Rn(()=>k.ssFallback.el=null,x)),W||h(E,R,i,0)}x.isFallbackMountPending=!1,va(x,E),x.pendingBranch=null,x.isInFallback=!1;let V=x.parent,U=!1;for(;V;){if(V.pendingBranch){V.effects.push(...A),U=!0;break}V=V.parent}!U&&!W&&pf(A),x.effects=[],y&&t&&t.pendingBranch&&w===t.pendingId&&(t.deps--,t.deps===0&&!N&&t.resolve()),Jc(k,"onResolve")},fallback(L){if(!x.pendingBranch)return;const{vnode:N,activeBranch:k,parentComponent:T,container:E,namespace:O}=x;Jc(N,"onFallback");const A=f(k),$=()=>{x.isFallbackMountPending=!1,x.isInFallback&&(d(null,L,E,A,T,null,O,l,a),va(x,L))},R=L.transition&&L.transition.mode==="out-in";R&&(x.isFallbackMountPending=!0,k.transition.afterLeave=$),x.isInFallback=!0,m(k,T,null,!0),R||$()},move(L,N,k){x.activeBranch&&h(x.activeBranch,L,N,k),x.container=L},next(){return x.activeBranch&&f(x.activeBranch)},registerDep(L,N,k){const T=!!x.pendingBranch;T&&x.deps++;const E=L.vnode.el;L.asyncDep.catch(O=>{Ra(O,L,0)}).then(O=>{if(L.isUnmounted||x.isUnmounted||x.pendingId!==L.suspenseId)return;eu(),L.asyncResolved=!0;const{vnode:A}=L;Wg(L,O,!1),E&&(A.el=E);const $=!E&&L.subTree.el;N(L,A,g(E||L.subTree.el),E?null:f(L.subTree),x,r,k),$&&(A.placeholder=null,_($)),$h(L,A.el),T&&--x.deps===0&&x.resolve()})},unmount(L,N){x.isUnmounted=!0,x.activeBranch&&m(x.activeBranch,n,L,N),x.pendingBranch&&m(x.pendingBranch,n,L,N)}};return x}function v$(e,t,n,o,s,i,r,l,a){const c=t.suspense=PS(t,o,n,e.parentNode,document.createElement("div"),null,s,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function y$(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=xk(o?n.default:n),e.ssFallback=o?xk(n.fallback):vt(Bn)}function xk(e){let t;if(wt(e)){const n=bl&&e._c;n&&(e._d=!1,C()),e=e(),n&&(e._d=!0,t=bo,RS())}return dt(e)&&(e=t$(e)),e=qo(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function OS(e,t){t&&t.pendingBranch?dt(e)?t.effects.push(...e):t.effects.push(e):pf(e)}function va(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let s=t.el;for(;!s&&t.component;)t=t.component.subTree,s=t.el;n.el=s,o&&o.subTree===n&&(o.vnode.el=s,$h(o,s))}function k$(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Oe=Symbol.for("v-fgt"),Sr=Symbol.for("v-txt"),Bn=Symbol.for("v-cmt"),ya=Symbol.for("v-stc"),$c=[];let bo=null;function C(e=!1){$c.push(bo=e?null:[])}function RS(){$c.pop(),bo=$c[$c.length-1]||null}let bl=1;function bf(e,t=!1){bl+=e,e<0&&bo&&t&&(bo.hasOnce=!0)}function DS(e){return e.dynamicChildren=bl>0?bo||da:null,RS(),bl>0&&bo&&bo.push(e),e}function I(e,t,n,o,s,i){return DS(p(e,t,n,o,s,i,!0))}function Ve(e,t,n,o,s){return DS(vt(e,t,n,o,s,!0))}function Er(e){return e?e.__v_isVNode===!0:!1}function Vs(e,t){return e.type===t.type&&e.key===t.key}function Ame(e){}const BS=({key:e})=>e??null,jd=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?on(e)||Ln(e)||wt(e)?{i:fo,r:e,k:t,f:!!n}:e:null);function p(e,t=null,n=null,o=0,s=null,i=e===Oe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&BS(t),ref:t&&jd(t),scopeId:Mh,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:fo};return l?(bv(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=on(n)?8:16),bl>0&&!r&&bo&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&bo.push(a),a}const vt=b$;function b$(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===mS)&&(e=Bn),Er(e)){const l=ji(e,t,!0);return n&&bv(l,n),bl>0&&!i&&bo&&(l.shapeFlag&6?bo[bo.indexOf(e)]=l:bo.push(l)),l.patchFlag=-2,l}if(T$(e)&&(e=e.__vccOpts),t){t=w$(t);let{class:l,style:a}=t;l&&!on(l)&&(t.class=Le(l)),Gt(a)&&(Ah(a)&&!dt(a)&&(a=tn({},a)),t.style=Wt(a))}const r=on(e)?1:kf(e)?128:lS(e)?64:Gt(e)?4:wt(e)?2:0;return p(e,t,n,o,s,r,i,!0)}function w$(e){return e?Ah(e)||SS(e)?tn({},e):e:null}function ji(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?en(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&BS(c),ref:t&&t.ref?n&&i?dt(i)?i.concat(jd(t)):[i,jd(t)]:jd(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Oe?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ji(e.ssContent),ssFallback:e.ssFallback&&ji(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Mr(u,a.clone(u)),u}function ut(e=" ",t=0){return vt(Sr,null,e,t)}function Ir(e,t){const n=vt(ya,null,e);return n.staticCount=t,n}function se(e="",t=!1){return t?(C(),Ve(Bn,null,e)):vt(Bn,null,e)}function qo(e){return e==null||typeof e=="boolean"?vt(Bn):dt(e)?vt(Oe,null,e.slice()):Er(e)?Ii(e):vt(Sr,null,String(e))}function Ii(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ji(e)}function bv(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(dt(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),bv(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!SS(t)?t._ctx=fo:s===3&&fo&&(fo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else wt(t)?(t={default:t,_ctx:fo},n=32):(t=String(t),o&64?(n=16,t=[ut(t)]):n=8);e.children=t,e.shapeFlag|=n}function en(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=Le([t.class,o.class]));else if(s==="style")t.style=Wt([t.style,o.style]);else if(bu(s)){const i=t[s],r=o[s];r&&i!==r&&!(dt(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!mh(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function Uo(e,t,n,o=null){Fs(e,t,7,[n,o])}const _$=yS();let C$=0;function FS(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||_$,i={uid:C$++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new PC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:TS(o,s),emitsOptions:bS(o,s),emit:null,emitted:null,propsDefaults:Ot,inheritAttrs:o.inheritAttrs,ctx:Ot,data:Ot,props:Ot,attrs:Ot,slots:Ot,refs:Ot,setupState:Ot,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=JI.bind(null,i),e.ce&&e.ce(i),i}let uo=null;const ho=()=>uo||fo;let wf,ka;{const e=wh(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),i=>{s.length>1?s.forEach(r=>r(i)):s[0](i)}};wf=t("__VUE_INSTANCE_SETTERS__",n=>uo=n),ka=t("__VUE_SSR_SETTERS__",n=>wl=n)}const Da=e=>{const t=uo;return wf(e),e.scope.on(),()=>{e.scope.off(),wf(t)}},eu=()=>{uo&&uo.scope.off(),wf(null)};function HS(e){return e.vnode.shapeFlag&4}let wl=!1;function WS(e,t=!1,n=!1){t&&ka(t);const{props:o,children:s}=e.vnode,i=HS(e);i$(e,o,i,t),c$(e,s,n||t);const r=i?S$(e,t):void 0;return t&&ka(!1),r}function S$(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Rg);const{setup:o}=n;if(o){Hi();const s=e.setupContext=o.length>1?jS(e):null,i=Da(e),r=wu(o,e,0,[e.props,s]),l=ov(r);if(Wi(),i(),(l||e.sp)&&!Di(e)&&dv(e),l){if(r.then(eu,eu),t)return r.then(a=>{Wg(e,a,t)}).catch(a=>{Ra(a,e,0)});e.asyncDep=r}else Wg(e,r,t)}else US(e,t)}function Wg(e,t,n){wt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Gt(t)&&(e.setupState=ZC(t)),US(e,n)}let _f,Ug;function Mme(e){_f=e,Ug=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,zI))}}const Eme=()=>!_f;function US(e,t,n){const o=e.type;if(!e.render){if(!t&&_f&&!o.render){const s=o.template||gv(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=tn(tn({isCustomElement:i,delimiters:l},r),a);o.render=_f(s,c)}}e.render=o.render||Ds,Ug&&Ug(e)}{const s=Da(e);Hi();try{VI(e)}finally{Wi(),s()}}}const x$={get(e,t){return yo(e,"get",""),e[t]}};function jS(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,x$),slots:e.slots,emit:e.emit,expose:t}}function xu(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ZC(kr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ic)return Ic[n](e)},has(t,n){return n in t||n in Ic}})):e.proxy}function jg(e,t=!0){return wt(e)?e.displayName||e.name:e.name||t&&e.__name}function T$(e){return wt(e)&&"__vccOpts"in e}const F=(e,t)=>aI(e,t,wl);function Zt(e,t,n){try{bf(-1);const o=arguments.length;return o===2?Gt(t)&&!dt(t)?Er(t)?vt(e,null,[t]):vt(e,t):vt(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Er(n)&&(n=[n]),vt(e,t,n))}finally{bf(1)}}function Ime(){}function $me(e,t,n,o){const s=n[o];if(s&&A$(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function A$(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(co(n[o],t[o]))return!1;return bl>0&&bo&&bo.push(e),!0}const M$="3.5.35",Nme=Ds,Lme=hI,Pme=ta,Ome=sS,E$={createComponentInstance:FS,setupComponent:WS,renderComponentRoot:Ud,setCurrentRenderingInstance:Xc,isVNode:Er,normalizeVNode:qo,getComponentPublicInstance:xu,ensureValidVNode:mv,pushWarningContext:dI,popWarningContext:fI},Rme=E$,Dme=null,Bme=null,Fme=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let qg;const Tk=typeof window<"u"&&window.trustedTypes;if(Tk)try{qg=Tk.createPolicy("vue",{createHTML:e=>e})}catch{}const qS=qg?e=>qg.createHTML(e):e=>e,I$="http://www.w3.org/2000/svg",$$="http://www.w3.org/1998/Math/MathML",Mi=typeof document<"u"?document:null,Ak=Mi&&Mi.createElement("template"),N$={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?Mi.createElementNS(I$,e):t==="mathml"?Mi.createElementNS($$,e):n?Mi.createElement(e,{is:n}):Mi.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>Mi.createTextNode(e),createComment:e=>Mi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Mi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,i){const r=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{Ak.innerHTML=qS(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Ak.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},or="transition",dc="animation",Ma=Symbol("_vtc"),zS={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},VS=tn({},cS,zS),L$=e=>(e.displayName="Transition",e.props=VS,e),qi=L$((e,{slots:t})=>Zt(xI,KS(e),t)),Jr=(e,t=[])=>{dt(e)?e.forEach(n=>n(...t)):e&&e(...t)},Mk=e=>e?dt(e)?e.some(t=>t.length>1):e.length>1:!1;function KS(e){const t={};for(const A in e)A in zS||(t[A]=e[A]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,f=P$(s),g=f&&f[0],_=f&&f[1],{onBeforeEnter:w,onEnter:y,onEnterCancelled:b,onLeave:v,onLeaveCancelled:x,onBeforeAppear:L=w,onAppear:N=y,onAppearCancelled:k=b}=t,T=(A,$,R,D)=>{A._enterCancelled=D,ur(A,$?u:l),ur(A,$?c:r),R&&R()},E=(A,$)=>{A._isLeaving=!1,ur(A,d),ur(A,m),ur(A,h),$&&$()},O=A=>($,R)=>{const D=A?N:y,W=()=>T($,A,R);Jr(D,[$,W]),Ek(()=>{ur($,A?a:i),ri($,A?u:l),Mk(D)||Ik($,o,g,W)})};return tn(t,{onBeforeEnter(A){Jr(w,[A]),ri(A,i),ri(A,r)},onBeforeAppear(A){Jr(L,[A]),ri(A,a),ri(A,c)},onEnter:O(!1),onAppear:O(!0),onLeave(A,$){A._isLeaving=!0;const R=()=>E(A,$);ri(A,d),A._enterCancelled?(ri(A,h),zg(A)):(zg(A),ri(A,h)),Ek(()=>{A._isLeaving&&(ur(A,d),ri(A,m),Mk(v)||Ik(A,o,_,R))}),Jr(v,[A,R])},onEnterCancelled(A){T(A,!1,void 0,!0),Jr(b,[A])},onAppearCancelled(A){T(A,!0,void 0,!0),Jr(k,[A])},onLeaveCancelled(A){E(A),Jr(x,[A])}})}function P$(e){if(e==null)return null;if(Gt(e))return[bm(e.enter),bm(e.leave)];{const t=bm(e);return[t,t]}}function bm(e){return af(e)}function ri(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Ma]||(e[Ma]=new Set)).add(t)}function ur(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[Ma];n&&(n.delete(t),n.size||(e[Ma]=void 0))}function Ek(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let O$=0;function Ik(e,t,n,o){const s=e._endId=++O$,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=GS(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,h),i()},h=m=>{m.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,h)}function GS(e,t){const n=window.getComputedStyle(e),o=f=>(n[f]||"").split(", "),s=o(`${or}Delay`),i=o(`${or}Duration`),r=$k(s,i),l=o(`${dc}Delay`),a=o(`${dc}Duration`),c=$k(l,a);let u=null,d=0,h=0;t===or?r>0&&(u=or,d=r,h=i.length):t===dc?c>0&&(u=dc,d=c,h=a.length):(d=Math.max(r,c),u=d>0?r>c?or:dc:null,h=u?u===or?i.length:a.length:0);const m=u===or&&/\b(?:transform|all)(?:,|$)/.test(o(`${or}Property`).toString());return{type:u,timeout:d,propCount:h,hasTransform:m}}function $k(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>Nk(n)+Nk(e[o])))}function Nk(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function zg(e){return(e?e.ownerDocument:document).body.offsetHeight}function R$(e,t,n){const o=e[Ma];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Cf=Symbol("_vod"),YS=Symbol("_vsh"),Ks={name:"show",beforeMount(e,{value:t},{transition:n}){e[Cf]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):fc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),fc(e,!0),o.enter(e)):o.leave(e,()=>{fc(e,!1)}):fc(e,t))},beforeUnmount(e,{value:t}){fc(e,t)}};function fc(e,t){e.style.display=t?e[Cf]:"none",e[YS]=!t}function D$(){Ks.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const XS=Symbol("");function Hme(e){const t=ho();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>Sf(i,s))},o=()=>{const s=e(t.proxy);t.ce?Sf(t.ce,s):Vg(t.subTree,s),n(s)};pS(()=>{pf(o)}),sn(()=>{ze(o,Ds,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),Yt(()=>s.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)Sf(e.el,t);else if(e.type===Oe)e.children.forEach(n=>Vg(n,t));else if(e.type===ya){let{el:n,anchor:o}=e;for(;n&&(Sf(n,t),n!==o);)n=n.nextSibling}}function Sf(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=PE(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[XS]=o}}const B$=/(?:^|;)\s*display\s*:/;function F$(e,t,n){const o=e.style,s=on(n);let i=!1;if(n&&!s){if(t)if(on(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&wc(o,l,"")}else for(const r in t)n[r]==null&&wc(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?W$(e,r,!on(t)&&t?t[r]:void 0,l)||wc(o,r,l):wc(o,r,"")}}else if(s){if(t!==n){const r=o[XS];r&&(n+=";"+r),o.cssText=n,i=B$.test(n)}}else t&&e.removeAttribute("style");Cf in e&&(e[Cf]=i?o.display:"",e[YS]&&(o.display="none"))}const Lk=/\s*!important$/;function wc(e,t,n){if(dt(n))n.forEach(o=>wc(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=H$(e,t);Lk.test(n)?e.setProperty(zo(o),n.replace(Lk,""),"important"):e[o]=n}}const Pk=["Webkit","Moz","ms"],wm={};function H$(e,t){const n=wm[t];if(n)return n;let o=Xn(t);if(o!=="filter"&&o in e)return wm[t]=o;o=kh(o);for(let s=0;s<Pk.length;s++){const i=Pk[s]+o;if(i in e)return wm[t]=i}return t}function W$(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&on(o)&&n===o}const Ok="http://www.w3.org/1999/xlink";function Rk(e,t,n,o,s,i=NE(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Ok,t.slice(6,t.length)):e.setAttributeNS(Ok,t,n):n==null||i&&!$C(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ys(n)?String(n):n)}function Dk(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?qS(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=$C(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(s||t)}function Li(e,t,n,o){e.addEventListener(t,n,o)}function U$(e,t,n,o){e.removeEventListener(t,n,o)}const Bk=Symbol("_vei");function j$(e,t,n,o,s=null){const i=e[Bk]||(e[Bk]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=q$(t);if(o){const c=i[t]=K$(o,s);Li(e,l,c,a)}else r&&(U$(e,l,r,a),i[t]=void 0)}}const Fk=/(?:Once|Passive|Capture)$/;function q$(e){let t;if(Fk.test(e)){t={};let o;for(;o=e.match(Fk);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):zo(e.slice(2)),t]}let _m=0;const z$=Promise.resolve(),V$=()=>_m||(z$.then(()=>_m=0),_m=Date.now());function K$(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(dt(s)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const r=s.slice(),l=[o];for(let a=0;a<r.length&&!o._stopped;a++){const c=r[a];c&&Fs(c,t,5,l)}}else Fs(s,t,5,[o])};return n.value=e,n.attached=V$(),n}const Hk=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,G$=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?R$(e,o,r):t==="style"?F$(e,n,o):bu(t)?mh(t)||j$(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Y$(e,t,o,r))?(Dk(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Rk(e,t,o,r,i,t!=="value")):e._isVueCE&&(X$(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!on(o)))?Dk(e,Xn(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Rk(e,t,o,r))};function Y$(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Hk(t)&&wt(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Hk(t)&&on(n)?!1:t in e}function X$(e,t){const n=e._def.props;if(!n)return!1;const o=Xn(t);return Array.isArray(n)?n.some(s=>Xn(s)===o):Object.keys(n).some(s=>Xn(s)===o)}const Wk={};function Q$(e,t,n){let o=Qe(e,t);gh(o)&&(o=tn({},o,t));class s extends wv{constructor(r){super(o,r,n)}}return s.def=o,s}const Wme=((e,t)=>Q$(e,t,h4)),Z$=typeof HTMLElement<"u"?HTMLElement:class{};class wv extends Z${constructor(t,n={},o=Mf){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&o!==Mf?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(tn({},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 wv){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,ht(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=o;let l;if(i&&!dt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=af(this._props[a])),(l||(l=Object.create(null)))[Xn(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(r),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)Kt(this,o)||Object.defineProperty(this,o,{get:()=>S(n[o])})}_resolveProps(t){const{props:n}=t,o=dt(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&o.includes(s)&&this._setProp(s,this[s]);for(const s of o.map(Xn))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(i){this._setProp(s,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):Wk;const s=Xn(t);n&&this._numberProps&&this._numberProps[s]&&(o=af(o)),this._setProp(s,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,s=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Wk?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),o)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(zo(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(zo(t),n+""):n||this.removeAttribute(zo(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),f4(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=vt(this._def,tn(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const s=(i,r)=>{this.dispatchEvent(new CustomEvent(i,gh(r[0])?tn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),zo(i)!==i&&s(zo(i),r)},this._setParent()}),n}_applyStyles(t,n,o){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,i=this.shadowRoot,r=o?this._getStyleAnchor(o)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");s&&c.setAttribute("nonce",s),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(o||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const o=t.childNodes[n];if(!(o instanceof HTMLStyleElement))return o}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const s=t[o],i=s.getAttribute("name")||"default",r=this._slots[i],l=s.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,s)}else for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const s=o.querySelectorAll("slot");for(let i=0;i<s.length;i++)n.add(s[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function J$(e){const t=ho(),n=t&&t.ce;return n||null}function Ume(){const e=J$();return e&&e.shadowRoot}function jme(e="$style"){{const t=ho();if(!t)return Ot;const n=t.type.__cssModules;if(!n)return Ot;const o=n[e];return o||Ot}}const QS=new WeakMap,ZS=new WeakMap,xf=Symbol("_moveCb"),Uk=Symbol("_enterCb"),e4=e=>(delete e.props.mode,e),t4=e4({name:"TransitionGroup",props:tn({},VS,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ho(),o=aS();let s,i;return fv(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!i4(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(n4),s.forEach(o4);const l=s.filter(s4);zg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;ri(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[xf]=h=>{h&&h.target!==c||(!h||h.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[xf]=null,ur(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=Ht(e),l=KS(r);let a=r.tag||Oe;if(s=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(s.push(u),Mr(u,Qc(u,l,o,n)),QS.set(u,JS(u.el)))}i=t.default?uv(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Mr(u,Qc(u,l,o,n))}return vt(a,null,i)}}}),qme=t4;function n4(e){const t=e.el;t[xf]&&t[xf](),t[Uk]&&t[Uk]()}function o4(e){ZS.set(e,JS(e.el))}function s4(e){const t=QS.get(e),n=ZS.get(e),o=t.left-n.left,s=t.top-n.top;if(o||s){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${o/a}px,${s/c}px)`,r.transitionDuration="0s",e}}function JS(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function i4(e,t,n){const o=e.cloneNode(),s=e[Ma];s&&s.forEach(l=>{l.split(/\s+/).forEach(a=>a&&o.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:r}=GS(o);return i.removeChild(o),r}const $r=e=>{const t=e.props["onUpdate:modelValue"]||!1;return dt(t)?n=>ha(t,n):t};function r4(e){e.target.composing=!0}function jk(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Bs=Symbol("_assign");function qk(e,t,n){return t&&(e=e.trim()),n&&(e=bh(e)),e}const Wn={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[Bs]=$r(s);const i=o||s.props&&s.props.type==="number";Li(e,t?"change":"input",r=>{r.target.composing||e[Bs](qk(e.value,n,i))}),(n||i)&&Li(e,"change",()=>{e.value=qk(e.value,n,i)}),t||(Li(e,"compositionstart",r4),Li(e,"compositionend",jk),Li(e,"change",jk))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[Bs]=$r(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?bh(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(o&&t===n||s&&e.value.trim()===a)||(e.value=a)}},Tf={deep:!0,created(e,t,n){e[Bs]=$r(n),Li(e,"change",()=>{const o=e._modelValue,s=Ea(e),i=e.checked,r=e[Bs];if(dt(o)){const l=_h(o,s),a=l!==-1;if(i&&!a)r(o.concat(s));else if(!i&&a){const c=[...o];c.splice(l,1),r(c)}}else if(Cl(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(tx(e,i))})},mounted:zk,beforeUpdate(e,t,n){e[Bs]=$r(n),zk(e,t,n)}};function zk(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(dt(t))s=_h(t,o.props.value)>-1;else if(Cl(t))s=t.has(o.props.value);else{if(t===n)return;s=Fi(t,tx(e,!0))}e.checked!==s&&(e.checked=s)}const ex={created(e,{value:t},n){e.checked=Fi(t,n.props.value),e[Bs]=$r(n),Li(e,"change",()=>{e[Bs](Ea(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[Bs]=$r(o),t!==n&&(e.checked=Fi(t,o.props.value))}},Af={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=Cl(t);Li(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?bh(Ea(r)):Ea(r));e[Bs](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,ht(()=>{e._assigning=!1})}),e[Bs]=$r(o)},mounted(e,{value:t}){Vk(e,t)},beforeUpdate(e,t,n){e[Bs]=$r(n)},updated(e,{value:t}){e._assigning||Vk(e,t)}};function Vk(e,t){const n=e.multiple,o=dt(t);if(!(n&&!o&&!Cl(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=Ea(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=_h(t,l)>-1}else r.selected=t.has(l);else if(Fi(Ea(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ea(e){return"_value"in e?e._value:e.value}function tx(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const l4={created(e,t,n){pd(e,t,n,null,"created")},mounted(e,t,n){pd(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){pd(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){pd(e,t,n,o,"updated")}};function nx(e,t){switch(e){case"SELECT":return Af;case"TEXTAREA":return Wn;default:switch(t){case"checkbox":return Tf;case"radio":return ex;default:return Wn}}}function pd(e,t,n,o,s){const r=nx(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function a4(){Wn.getSSRProps=({value:e})=>({value:e}),ex.getSSRProps=({value:e},t)=>{if(t.props&&Fi(t.props.value,e))return{checked:!0}},Tf.getSSRProps=({value:e},t)=>{if(dt(e)){if(t.props&&_h(e,t.props.value)>-1)return{checked:!0}}else if(Cl(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},l4.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=nx(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const c4=["ctrl","shift","alt","meta"],u4={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)=>c4.some(n=>e[`${n}Key`]&&!t.includes(n))},Ze=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...i)=>{for(let r=0;r<t.length;r++){const l=u4[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},d4={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Os=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=zo(s.key);if(t.some(r=>r===i||d4[r]===i))return e(s)}))},ox=tn({patchProp:G$},N$);let Nc,Kk=!1;function sx(){return Nc||(Nc=d$(ox))}function ix(){return Nc=Kk?Nc:f$(ox),Kk=!0,Nc}const f4=((...e)=>{sx().render(...e)}),zme=((...e)=>{ix().hydrate(...e)}),Mf=((...e)=>{const t=sx().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=lx(o);if(!s)return;const i=t._component;!wt(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,rx(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),h4=((...e)=>{const t=ix().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=lx(o);if(s)return n(s,!0,rx(s))},t});function rx(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function lx(e){return on(e)?document.querySelector(e):e}let Gk=!1;const Vme=()=>{Gk||(Gk=!0,a4(),D$())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function p4(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Ef=typeof window<"u",Rr=(e,t=!1)=>t?Symbol.for(e):Symbol(e),m4=(e,t,n)=>g4({l:e,k:t,s:n}),g4=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Hn=e=>typeof e=="number"&&isFinite(e),ax=e=>Cv(e)==="[object Date]",Ia=e=>Cv(e)==="[object RegExp]",Nh=e=>Dt(e)&&Object.keys(e).length===0,Un=Object.assign,v4=Object.create,nn=(e=null)=>v4(e);let Yk;const dl=()=>Yk||(Yk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:nn());function Xk(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function y4(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const k4=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,b4=/^(?:href|src|action|formaction)$/i;function _v(e){return k4.test(e)}function w4(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const i=s.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const h=e[l];if(c){h===c&&(c=null);continue}if(h==='"'||h==="'")c=h;else if(h==="(")a++;else if(h===")"&&(a--,a===0))break}if(a!==0)break;const u=e.slice(r+1,l).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=e.slice(o,i),n+=_v(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function Qk(e,t){if(b4.test(e)&&_v(t))return"about:blank";const n=e.toLowerCase()==="style"?w4(t):t;return y4(n)}function _4(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${Qk(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${Qk(o,s)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,o,s)=>_v(s)?`${o}about:blank`:n),e}const C4=Object.prototype.hasOwnProperty;function Rs(e,t){return C4.call(e,t)}const In=Array.isArray,kn=e=>typeof e=="function",rt=e=>typeof e=="string",jt=e=>typeof e=="boolean",zt=e=>e!==null&&typeof e=="object",S4=e=>zt(e)&&kn(e.then)&&kn(e.catch),cx=Object.prototype.toString,Cv=e=>cx.call(e),Dt=e=>Cv(e)==="[object Object]",x4=e=>e==null?"":In(e)||Dt(e)&&e.toString===cx?JSON.stringify(e,null,2):String(e);function Sv(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const md=e=>!zt(e)||In(e);function qd(e,t){if(md(e)||md(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:s}=n.pop();Object.keys(o).forEach(i=>{i!=="__proto__"&&(zt(o[i])&&!zt(s[i])&&(s[i]=Array.isArray(o[i])?[]:nn()),md(s[i])||md(o[i])?s[i]=o[i]:n.push({src:o[i],des:s[i]}))})}}/*!
|
|
25
|
-
* message-compiler v11.4.5
|
|
26
|
-
* (c) 2026 kazuya kawaguchi
|
|
27
|
-
* Released under the MIT License.
|
|
28
|
-
*/function T4(e,t,n){return{line:e,column:t,offset:n}}function Kg(e,t,n){return{start:e,end:t}}const Qt={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},A4=17;function Lh(e,t,n={}){const{domain:o,messages:s,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=o,l}function M4(e){throw e}const si=" ",E4="\r",go=`
|
|
29
|
-
`,I4="\u2028",$4="\u2029";function N4(e){const t=e;let n=0,o=1,s=1,i=0;const r=N=>t[N]===E4&&t[N+1]===go,l=N=>t[N]===go,a=N=>t[N]===$4,c=N=>t[N]===I4,u=N=>r(N)||l(N)||a(N)||c(N),d=()=>n,h=()=>o,m=()=>s,f=()=>i,g=N=>r(N)||a(N)||c(N)?go:t[N],_=()=>g(n),w=()=>g(n+i);function y(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function b(){return r(n+i)&&i++,i++,t[n+i]}function v(){n=0,o=1,s=1,i=0}function x(N=0){i=N}function L(){const N=n+i;for(;N!==n;)y();i=0}return{index:d,line:h,column:m,peekOffset:f,charAt:g,currentChar:_,currentPeek:w,next:y,peek:b,reset:v,resetPeek:x,skipToPeek:L}}const Ti=void 0,L4=".",Zk="'",P4="tokenizer";function O4(e,t={}){const n=t.location!==!1,o=N4(e),s=()=>o.index(),i=()=>T4(o.line(),o.column(),o.index()),r=i(),l=s(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(H,Y,re,...ge){const xe=c();if(Y.column+=re,Y.offset+=re,u){const Ne=n?Kg(xe.startLoc,Y):null,ie=Lh(H,Ne,{domain:P4,args:ge});u(ie)}}function h(H,Y,re){H.endLoc=i(),H.currentType=Y;const ge={type:Y};return n&&(ge.loc=Kg(H.startLoc,H.endLoc)),re!=null&&(ge.value=re),ge}const m=H=>h(H,13);function f(H,Y){return H.currentChar()===Y?(H.next(),Y):(d(Qt.EXPECTED_TOKEN,i(),0,Y),"")}function g(H){let Y="";for(;H.currentPeek()===si||H.currentPeek()===go;)Y+=H.currentPeek(),H.peek();return Y}function _(H){const Y=g(H);return H.skipToPeek(),Y}function w(H){if(H===Ti)return!1;const Y=H.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y===95}function y(H){if(H===Ti)return!1;const Y=H.charCodeAt(0);return Y>=48&&Y<=57}function b(H,Y){const{currentType:re}=Y;if(re!==2)return!1;g(H);const ge=w(H.currentPeek());return H.resetPeek(),ge}function v(H,Y){const{currentType:re}=Y;if(re!==2)return!1;g(H);const ge=H.currentPeek()==="-"?H.peek():H.currentPeek(),xe=y(ge);return H.resetPeek(),xe}function x(H,Y){const{currentType:re}=Y;if(re!==2)return!1;g(H);const ge=H.currentPeek()===Zk;return H.resetPeek(),ge}function L(H,Y){const{currentType:re}=Y;if(re!==7)return!1;g(H);const ge=H.currentPeek()===".";return H.resetPeek(),ge}function N(H,Y){const{currentType:re}=Y;if(re!==8)return!1;g(H);const ge=w(H.currentPeek());return H.resetPeek(),ge}function k(H,Y){const{currentType:re}=Y;if(!(re===7||re===11))return!1;g(H);const ge=H.currentPeek()===":";return H.resetPeek(),ge}function T(H,Y){const{currentType:re}=Y;if(re!==9)return!1;const ge=()=>{const Ne=H.currentPeek();return Ne==="{"?w(H.peek()):Ne==="@"||Ne==="|"||Ne===":"||Ne==="."||Ne===si||!Ne?!1:Ne===go?(H.peek(),ge()):O(H,!1)},xe=ge();return H.resetPeek(),xe}function E(H){g(H);const Y=H.currentPeek()==="|";return H.resetPeek(),Y}function O(H,Y=!0){const re=(xe=!1,Ne="")=>{const ie=H.currentPeek();return ie==="{"||ie==="@"||!ie?xe:ie==="|"?!(Ne===si||Ne===go):ie===si?(H.peek(),re(!0,si)):ie===go?(H.peek(),re(!0,go)):!0},ge=re();return Y&&H.resetPeek(),ge}function A(H,Y){const re=H.currentChar();return re===Ti?Ti:Y(re)?(H.next(),re):null}function $(H){const Y=H.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36}function R(H){return A(H,$)}function D(H){const Y=H.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36||Y===45}function W(H){return A(H,D)}function V(H){const Y=H.charCodeAt(0);return Y>=48&&Y<=57}function U(H){return A(H,V)}function ee(H){const Y=H.charCodeAt(0);return Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102}function K(H){return A(H,ee)}function G(H){let Y="",re="";for(;Y=U(H);)re+=Y;return re}function X(H){let Y="";for(;;){const re=H.currentChar();if(re==="\\"){const ge=H.peek();ge==="{"||ge==="}"||ge==="@"||ge==="|"||ge==="\\"?(Y+=re+ge,H.next(),H.next()):(H.resetPeek(),Y+=re,H.next())}else{if(re==="{"||re==="}"||re==="@"||re==="|"||!re)break;if(re===si||re===go)if(O(H))Y+=re,H.next();else{if(E(H))break;Y+=re,H.next()}else Y+=re,H.next()}}return Y}function ke(H){_(H);let Y="",re="";for(;Y=W(H);)re+=Y;const ge=H.currentChar();if(ge&&ge!=="}"&&ge!==Ti&&ge!==si&&ge!==go&&ge!==" "){const xe=Q(H);return d(Qt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re+xe),re+xe}return H.currentChar()===Ti&&d(Qt.UNTERMINATED_CLOSING_BRACE,i(),0),re}function le(H){_(H);let Y="";return H.currentChar()==="-"?(H.next(),Y+=`-${G(H)}`):Y+=G(H),H.currentChar()===Ti&&d(Qt.UNTERMINATED_CLOSING_BRACE,i(),0),Y}function He(H){return H!==Zk&&H!==go}function ue(H){_(H),f(H,"'");let Y="",re="";for(;Y=A(H,He);)Y==="\\"?re+=ve(H):re+=Y;const ge=H.currentChar();return ge===go||ge===Ti?(d(Qt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ge===go&&(H.next(),f(H,"'")),re):(f(H,"'"),re)}function ve(H){const Y=H.currentChar();switch(Y){case"\\":case"'":return H.next(),`\\${Y}`;case"u":return Pe(H,Y,4);case"U":return Pe(H,Y,6);default:return d(Qt.UNKNOWN_ESCAPE_SEQUENCE,i(),0,Y),""}}function Pe(H,Y,re){f(H,Y);let ge="";for(let xe=0;xe<re;xe++){const Ne=K(H);if(!Ne){d(Qt.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${Y}${ge}${H.currentChar()}`);break}ge+=Ne}return`\\${Y}${ge}`}function Re(H){return H!=="{"&&H!=="}"&&H!==si&&H!==go}function Q(H){_(H);let Y="",re="";for(;Y=A(H,Re);)re+=Y;return re}function ce(H){let Y="",re="";for(;Y=R(H);)re+=Y;return re}function Ce(H){const Y=re=>{const ge=H.currentChar();return ge==="{"||ge==="@"||ge==="|"||ge==="("||ge===")"||!ge||ge===si?re:(re+=ge,H.next(),Y(re))};return Y("")}function q(H){_(H);const Y=f(H,"|");return _(H),Y}function te(H,Y){let re=null;switch(H.currentChar()){case"{":return Y.braceNest>=1&&d(Qt.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),H.next(),re=h(Y,2,"{"),_(H),Y.braceNest++,re;case"}":return Y.braceNest>0&&Y.currentType===2&&d(Qt.EMPTY_PLACEHOLDER,i(),0),H.next(),re=h(Y,3,"}"),Y.braceNest--,Y.braceNest>0&&_(H),Y.inLinked&&Y.braceNest===0&&(Y.inLinked=!1),re;case"@":return Y.braceNest>0&&d(Qt.UNTERMINATED_CLOSING_BRACE,i(),0),re=pe(H,Y)||m(Y),Y.braceNest=0,re;default:{let xe=!0,Ne=!0,ie=!0;if(E(H))return Y.braceNest>0&&d(Qt.UNTERMINATED_CLOSING_BRACE,i(),0),re=h(Y,1,q(H)),Y.braceNest=0,Y.inLinked=!1,re;if(Y.braceNest>0&&(Y.currentType===4||Y.currentType===5||Y.currentType===6))return d(Qt.UNTERMINATED_CLOSING_BRACE,i(),0),Y.braceNest=0,oe(H,Y);if(xe=b(H,Y))return re=h(Y,4,ke(H)),_(H),re;if(Ne=v(H,Y))return re=h(Y,5,le(H)),_(H),re;if(ie=x(H,Y))return re=h(Y,6,ue(H)),_(H),re;if(!xe&&!Ne&&!ie)return re=h(Y,12,Q(H)),d(Qt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re.value),_(H),re;break}}return re}function pe(H,Y){const{currentType:re}=Y;let ge=null;const xe=H.currentChar();switch((re===7||re===8||re===11||re===9)&&(xe===go||xe===si)&&d(Qt.INVALID_LINKED_FORMAT,i(),0),xe){case"@":return H.next(),ge=h(Y,7,"@"),Y.inLinked=!0,ge;case".":return _(H),H.next(),h(Y,8,".");case":":return _(H),H.next(),h(Y,9,":");default:return E(H)?(ge=h(Y,1,q(H)),Y.braceNest=0,Y.inLinked=!1,ge):L(H,Y)||k(H,Y)?(_(H),pe(H,Y)):N(H,Y)?(_(H),h(Y,11,ce(H))):T(H,Y)?(_(H),xe==="{"?te(H,Y)||ge:h(Y,10,Ce(H))):(re===7&&d(Qt.INVALID_LINKED_FORMAT,i(),0),Y.braceNest=0,Y.inLinked=!1,oe(H,Y))}}function oe(H,Y){let re={type:13};if(Y.braceNest>0)return te(H,Y)||m(Y);if(Y.inLinked)return pe(H,Y)||m(Y);switch(H.currentChar()){case"{":return te(H,Y)||m(Y);case"}":return d(Qt.UNBALANCED_CLOSING_BRACE,i(),0),H.next(),h(Y,3,"}");case"@":return pe(H,Y)||m(Y);default:{if(E(H))return re=h(Y,1,q(H)),Y.braceNest=0,Y.inLinked=!1,re;if(O(H))return h(Y,0,X(H));break}}return re}function fe(){const{currentType:H,offset:Y,startLoc:re,endLoc:ge}=a;return a.lastType=H,a.lastOffset=Y,a.lastStartLoc=re,a.lastEndLoc=ge,a.offset=s(),a.startLoc=i(),o.currentChar()===Ti?h(a,13):oe(o,a)}return{nextToken:fe,currentOffset:s,currentPosition:i,context:c}}const R4="parser",D4=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,B4=/\\([\\@{}|])/g;function F4(e,t){return t}function H4(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function W4(e={}){const t=e.location!==!1,{onError:n}=e;function o(w,y,b,v,...x){const L=w.currentPosition();if(L.offset+=v,L.column+=v,n){const N=t?Kg(b,L):null,k=Lh(y,N,{domain:R4,args:x});n(k)}}function s(w,y,b){const v={type:w};return t&&(v.start=y,v.end=y,v.loc={start:b,end:b}),v}function i(w,y,b,v){t&&(w.end=y,w.loc&&(w.loc.end=b))}function r(w,y){const b=w.context(),v=s(3,b.offset,b.startLoc);return v.value=y.replace(B4,F4),i(v,w.currentOffset(),w.currentPosition()),v}function l(w,y){const b=w.context(),{lastOffset:v,lastStartLoc:x}=b,L=s(5,v,x);return L.index=parseInt(y,10),w.nextToken(),i(L,w.currentOffset(),w.currentPosition()),L}function a(w,y){const b=w.context(),{lastOffset:v,lastStartLoc:x}=b,L=s(4,v,x);return L.key=y,w.nextToken(),i(L,w.currentOffset(),w.currentPosition()),L}function c(w,y){const b=w.context(),{lastOffset:v,lastStartLoc:x}=b,L=s(9,v,x);return L.value=y.replace(D4,H4),w.nextToken(),i(L,w.currentOffset(),w.currentPosition()),L}function u(w){const y=w.nextToken(),b=w.context(),{lastOffset:v,lastStartLoc:x}=b,L=s(8,v,x);return y.type!==11?(o(w,Qt.UNEXPECTED_EMPTY_LINKED_MODIFIER,b.lastStartLoc,0),L.value="",i(L,v,x),{nextConsumeToken:y,node:L}):(y.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,ii(y)),L.value=y.value||"",i(L,w.currentOffset(),w.currentPosition()),{node:L})}function d(w,y){const b=w.context(),v=s(7,b.offset,b.startLoc);return v.value=y,i(v,w.currentOffset(),w.currentPosition()),v}function h(w){const y=w.context(),b=s(6,y.offset,y.startLoc);let v=w.nextToken();if(v.type===8){const x=u(w);b.modifier=x.node,v=x.nextConsumeToken||w.nextToken()}switch(v.type!==9&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,ii(v)),v=w.nextToken(),v.type===2&&(v=w.nextToken()),v.type){case 10:v.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,ii(v)),b.key=d(w,v.value||"");break;case 4:v.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,ii(v)),b.key=a(w,v.value||"");break;case 5:v.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,ii(v)),b.key=l(w,v.value||"");break;case 6:v.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,ii(v)),b.key=c(w,v.value||"");break;default:{o(w,Qt.UNEXPECTED_EMPTY_LINKED_KEY,y.lastStartLoc,0);const x=w.context(),L=s(7,x.offset,x.startLoc);return L.value="",i(L,x.offset,x.startLoc),b.key=L,i(b,x.offset,x.startLoc),{nextConsumeToken:v,node:b}}}return i(b,w.currentOffset(),w.currentPosition()),{node:b}}function m(w){const y=w.context(),b=y.currentType===1?w.currentOffset():y.offset,v=y.currentType===1?y.endLoc:y.startLoc,x=s(2,b,v);x.items=[];let L=null;do{const T=L||w.nextToken();switch(L=null,T.type){case 0:T.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,ii(T)),x.items.push(r(w,T.value||""));break;case 5:T.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,ii(T)),x.items.push(l(w,T.value||""));break;case 4:T.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,ii(T)),x.items.push(a(w,T.value||""));break;case 6:T.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,ii(T)),x.items.push(c(w,T.value||""));break;case 7:{const E=h(w);x.items.push(E.node),L=E.nextConsumeToken||null;break}}}while(y.currentType!==13&&y.currentType!==1);const N=y.currentType===1?y.lastOffset:w.currentOffset(),k=y.currentType===1?y.lastEndLoc:w.currentPosition();return i(x,N,k),x}function f(w,y,b,v){const x=w.context();let L=v.items.length===0;const N=s(1,y,b);N.cases=[],N.cases.push(v);do{const k=m(w);L||(L=k.items.length===0),N.cases.push(k)}while(x.currentType!==13);return L&&o(w,Qt.MUST_HAVE_MESSAGES_IN_PLURAL,b,0),i(N,w.currentOffset(),w.currentPosition()),N}function g(w){const y=w.context(),{offset:b,startLoc:v}=y,x=m(w);return y.currentType===13?x:f(w,b,v,x)}function _(w){const y=O4(w,Un({},e)),b=y.context(),v=s(0,b.offset,b.startLoc);return t&&v.loc&&(v.loc.source=w),v.body=g(y),e.onCacheKey&&(v.cacheKey=e.onCacheKey(w)),b.currentType!==13&&o(y,Qt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,w[b.offset]||""),i(v,y.currentOffset(),y.currentPosition()),v}return{parse:_}}function ii(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 U4(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Jk(e,t){for(let n=0;n<e.length;n++)xv(e[n],t)}function xv(e,t){switch(e.type){case 1:Jk(e.cases,t),t.helper("plural");break;case 2:Jk(e.items,t);break;case 6:{xv(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 j4(e,t={}){const n=U4(e);n.helper("normalize"),e.body&&xv(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function q4(e){const t=e.body;return t.type===2?eb(t):t.cases.forEach(n=>eb(n)),e}function eb(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const o=e.items[n];if(!(o.type===3||o.type===9)||o.value==null)break;t.push(o.value)}if(t.length===e.items.length){e.static=Sv(t);for(let n=0;n<e.items.length;n++){const o=e.items[n];(o.type===3||o.type===9)&&delete o.value}}}}function na(e){switch(e.t=e.type,e.type){case 0:{const t=e;na(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let o=0;o<n.length;o++)na(n[o]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let o=0;o<n.length;o++)na(n[o]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;na(t.key),t.k=t.key,delete t.key,t.modifier&&(na(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 z4(e,t){const{filename:n,breakLineCode:o,needIndent:s}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(g,_){r.code+=g}function c(g,_=!0){const w=_?o:"";a(s?w+" ".repeat(g):w)}function u(g=!0){const _=++r.indentLevel;g&&c(_)}function d(g=!0){const _=--r.indentLevel;g&&c(_)}function h(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:h,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function V4(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 K4(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const s=t.items.length;for(let i=0;i<s&&($a(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function G4(e,t){const{helper:n,needIndent:o}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(o());const s=t.cases.length;for(let i=0;i<s&&($a(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function Y4(e,t){t.body?$a(e,t.body):e.push("null")}function $a(e,t){const{helper:n}=e;switch(t.type){case 0:Y4(e,t);break;case 1:G4(e,t);break;case 2:K4(e,t);break;case 6:V4(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 X4=(e,t={})=>{const n=rt(t.mode)?t.mode:"normal",o=rt(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
30
|
-
`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=z4(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${Sv(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 Q4(e,t={}){const n=Un({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=W4(n).parse(e);return o?(i&&q4(l),s&&na(l),{ast:l,code:""}):(j4(l,n),X4(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function Z4(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(dl().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(dl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function fi(e){return zt(e)&&Tv(e)===0&&(Rs(e,"b")||Rs(e,"body"))}const ux=["b","body"];function J4(e){return Dr(e,ux)}const dx=["c","cases"];function e6(e){return Dr(e,dx,[])}const fx=["s","static"];function t6(e){return Dr(e,fx)}const hx=["i","items"];function n6(e){return Dr(e,hx,[])}const px=["t","type"];function Tv(e){return Dr(e,px)}const mx=["v","value"];function gd(e,t){const n=Dr(e,mx);if(n!=null)return n;throw tu(t)}const gx=["m","modifier"];function o6(e){return Dr(e,gx)}const vx=["k","key"];function s6(e){const t=Dr(e,vx);if(t)return t;throw tu(6)}function Dr(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(Rs(e,s)&&e[s]!=null)return e[s]}return n}const yx=[...ux,...dx,...fx,...hx,...vx,...gx,...mx,...px];function tu(e){return new Error(`unhandled node type: ${e}`)}function Cm(e){return n=>i6(n,e)}function i6(e,t){const n=J4(t);if(n==null)throw tu(0);if(Tv(n)===1){const i=e6(n);return e.plural(i.reduce((r,l)=>[...r,tb(e,l)],[]))}else return tb(e,n)}function tb(e,t){const n=t6(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=n6(t).reduce((s,i)=>[...s,Gg(e,i)],[]);return e.normalize(o)}}function Gg(e,t){const n=Tv(t);switch(n){case 3:return gd(t,n);case 9:return gd(t,n);case 4:{const o=t;if(Rs(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(Rs(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw tu(n)}case 5:{const o=t;if(Rs(o,"i")&&Hn(o.i))return e.interpolate(e.list(o.i));if(Rs(o,"index")&&Hn(o.index))return e.interpolate(e.list(o.index));throw tu(n)}case 6:{const o=t,s=o6(o),i=s6(o);return e.linked(Gg(e,i),s?Gg(e,s):void 0,e.type)}case 7:return gd(t,n);case 8:return gd(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const r6=e=>e;let vd=nn();function l6(e,t={}){let n=!1;const o=t.onError||M4;return t.onError=s=>{n=!0,o(s)},{...Q4(e,t),detectError:n}}function a6(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&rt(e)){jt(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||r6)(e),s=vd[o];if(s)return s;const{ast:i,detectError:r}=l6(e,{...t,location:!1,jit:!0}),l=Cm(i);return r?l:vd[o]=l}else{const n=e.cacheKey;if(n){const o=vd[n];return o||(vd[n]=Cm(e))}else return Cm(e)}}let nu=null;function c6(e){nu=e}function u6(e,t,n){nu&&nu.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const d6=f6("function:translate");function f6(e){return t=>nu&&nu.emit(e,t)}const Pi={INVALID_ARGUMENT:A4,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},h6=24;function Oi(e){return Lh(e,null,void 0)}function Av(e,t){return t.locale!=null?nb(t.locale):nb(e.locale)}let Sm;function nb(e){if(rt(e))return e;if(kn(e)){if(e.resolvedOnce&&Sm!=null)return Sm;if(e.constructor.name==="Function"){const t=e();if(S4(t))throw Oi(Pi.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Sm=t}else throw Oi(Pi.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Oi(Pi.NOT_SUPPORT_LOCALE_TYPE)}function p6(e,t,n){return[...new Set([n,...In(t)?t:zt(t)?Object.keys(t):rt(t)?[t]:[n]])]}function Yg(e,t,n){const o=rt(n)?n:ou,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;In(r);)r=ob(i,r,t);const l=In(t)||!Dt(t)?t:t.default?t.default:null;r=rt(l)?[l]:l,In(r)&&ob(i,r,!1),s.__localeChainCache.set(o,i)}return i}function ob(e,t,n){let o=!0;for(let s=0;s<t.length&&jt(o);s++){const i=t[s];rt(i)&&(o=m6(e,t[s],n))}return o}function m6(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=g6(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function g6(e,t,n){let o=!1;if(!e.includes(t)&&(o=!0,t)){o=t[t.length-1]!=="!";const s=t.replace(/!/g,"");e.push(s),(In(n)||Dt(n))&&n[s]&&(o=n[s])}return o}const Br=[];Br[0]={w:[0],i:[3,0],"[":[4],o:[7]};Br[1]={w:[1],".":[2],"[":[4],o:[7]};Br[2]={w:[2],i:[3,0],0:[3,0]};Br[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Br[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Br[5]={"'":[4,0],o:8,l:[5,0]};Br[6]={'"':[4,0],o:8,l:[6,0]};const v6=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function y6(e){return v6.test(e)}function k6(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 b6(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 w6(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:y6(t)?k6(t):"*"+t}function _6(e){const t=[];let n=-1,o=0,s=0,i,r,l,a,c,u,d;const h=[];h[0]=()=>{r===void 0?r=l:r+=l},h[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},h[2]=()=>{h[0](),s++},h[3]=()=>{if(s>0)s--,o=4,h[0]();else{if(s=0,r===void 0||(r=w6(r),r===!1))return!1;h[1]()}};function m(){const f=e[n+1];if(o===5&&f==="'"||o===6&&f==='"')return n++,l="\\"+f,h[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&m())){if(a=b6(i),d=Br[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=h[c[1]],u&&(l=i,u()===!1))))return;if(o===7)return t}}const sb=new Map;function C6(e,t){return zt(e)?e[t]:null}function S6(e,t){if(!zt(e))return null;let n=sb.get(t);if(n||(n=_6(t),n&&sb.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(yx.includes(r)&&fi(s)||!zt(s)||!Rs(s,r))return null;const l=s[r];if(l===void 0||kn(s))return null;s=l,i++}return s}const x6="11.4.5",Ph=-1,ou="en-US",If="",ib=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function T6(){return{upper:(e,t)=>t==="text"&&rt(e)?e.toUpperCase():t==="vnode"&&zt(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&rt(e)?e.toLowerCase():t==="vnode"&&zt(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&rt(e)?ib(e):t==="vnode"&&zt(e)&&"__v_isVNode"in e?ib(e.children):e}}let kx;function A6(e){kx=e}let bx;function M6(e){bx=e}let wx;function E6(e){wx=e}let _x=null;const I6=e=>{_x=e},$6=()=>_x;let Cx=null;const rb=e=>{Cx=e},N6=()=>Cx;let lb=0;function L6(e={}){const t=kn(e.onWarn)?e.onWarn:p4,n=rt(e.version)?e.version:x6,o=rt(e.locale)||kn(e.locale)?e.locale:ou,s=kn(o)?ou:o,i=In(e.fallbackLocale)||Dt(e.fallbackLocale)||rt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=Dt(e.messages)?e.messages:xm(s),l=Dt(e.datetimeFormats)?e.datetimeFormats:xm(s),a=Dt(e.numberFormats)?e.numberFormats:xm(s),c=Un(nn(),e.modifiers,T6()),u=e.pluralRules||nn(),d=kn(e.missing)?e.missing:null,h=jt(e.missingWarn)||Ia(e.missingWarn)?e.missingWarn:!0,m=jt(e.fallbackWarn)||Ia(e.fallbackWarn)?e.fallbackWarn:!0,f=!!e.fallbackFormat,g=!!e.unresolving,_=kn(e.postTranslation)?e.postTranslation:null,w=Dt(e.processor)?e.processor:null,y=jt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter,v=kn(e.messageCompiler)?e.messageCompiler:kx,x=kn(e.messageResolver)?e.messageResolver:bx||C6,L=kn(e.localeFallbacker)?e.localeFallbacker:wx||p6,N=zt(e.fallbackContext)?e.fallbackContext:void 0,k=e,T=zt(k.__datetimeFormatters)?k.__datetimeFormatters:new Map,E=zt(k.__numberFormatters)?k.__numberFormatters:new Map,O=zt(k.__meta)?k.__meta:{};lb++;const A={version:n,cid:lb,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:h,fallbackWarn:m,fallbackFormat:f,unresolving:g,postTranslation:_,processor:w,warnHtmlMessage:y,escapeParameter:b,messageCompiler:v,messageResolver:x,localeFallbacker:L,fallbackContext:N,onWarn:t,__meta:O};return A.datetimeFormats=l,A.numberFormats=a,A.__datetimeFormatters=T,A.__numberFormatters=E,__INTLIFY_PROD_DEVTOOLS__&&u6(A,n,O),A}const xm=e=>({[e]:nn()});function Mv(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return rt(l)?l:t}else return t}function hc(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function P6(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function O6(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(P6(e,t[o]))return!0;return!1}function ab(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!rt(t[0])&&!ax(t[0])&&!Hn(t[0]))return If;const[a,c,u,d]=Xg(...t),h=jt(u.missingWarn)?u.missingWarn:e.missingWarn;jt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,f=Av(e,u),g=r(e,s,f);if(!rt(a)||a===""){const L=new Intl.DateTimeFormat(f.replace(/!/g,""),d);return m?L.formatToParts(c):L.format(c)}let _={},w,y=null;const b="datetime format";for(let L=0;L<g.length&&(w=g[L],_=n[w]||{},y=_[a],!Dt(y));L++)Mv(e,a,w,h,b);if(!Dt(y)||!rt(w))return o?Ph:a;let v=`${w}__${a}`;Nh(d)||(v=`${v}__${JSON.stringify(d)}`);let x=l.get(v);return x||(x=new Intl.DateTimeFormat(w,Un({},y,d)),l.set(v,x)),m?x.formatToParts(c):x.format(c)}const Sx=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Xg(...e){const[t,n,o,s]=e,i=nn();let r=nn(),l;if(rt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Oi(Pi.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 Oi(Pi.INVALID_ISO_DATE_ARGUMENT)}}else if(ax(t)){if(isNaN(t.getTime()))throw Oi(Pi.INVALID_DATE_ARGUMENT);l=t}else if(Hn(t))l=t;else throw Oi(Pi.INVALID_ARGUMENT);return rt(n)?i.key=n:Dt(n)&&Object.keys(n).forEach(a=>{Sx.includes(a)?r[a]=n[a]:i[a]=n[a]}),rt(o)?i.locale=o:Dt(o)&&(r=o),Dt(s)&&(r=s),[i.key||"",l,i,r]}function cb(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function ub(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!Hn(t[0]))return If;const[a,c,u,d]=Qg(...t),h=jt(u.missingWarn)?u.missingWarn:e.missingWarn;jt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,f=Av(e,u),g=r(e,s,f);if(!rt(a)||a===""){const L=new Intl.NumberFormat(f.replace(/!/g,""),d);return m?L.formatToParts(c):L.format(c)}let _={},w,y=null;const b="number format";for(let L=0;L<g.length&&(w=g[L],_=n[w]||{},y=_[a],!Dt(y));L++)Mv(e,a,w,h,b);if(!Dt(y)||!rt(w))return o?Ph:a;let v=`${w}__${a}`;Nh(d)||(v=`${v}__${JSON.stringify(d)}`);let x=l.get(v);return x||(x=new Intl.NumberFormat(w,Un({},y,d)),l.set(v,x)),m?x.formatToParts(c):x.format(c)}const xx=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Qg(...e){const[t,n,o,s]=e,i=nn();let r=nn();if(!Hn(t))throw Oi(Pi.INVALID_ARGUMENT);const l=t;return rt(n)?i.key=n:Dt(n)&&Object.keys(n).forEach(a=>{xx.includes(a)?r[a]=n[a]:i[a]=n[a]}),rt(o)?i.locale=o:Dt(o)&&(r=o),Dt(s)&&(r=s),[i.key||"",l,i,r]}function db(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const R6=e=>e,D6=e=>"",B6="text",F6=e=>e.length===0?"":Sv(e),H6=x4;function Tm(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function W6(e){const t=Hn(e.pluralIndex)?e.pluralIndex:-1;return Hn(e.named?.count)?e.named.count:Hn(e.named?.n)?e.named.n:t}function U6(e={}){const t=e.locale,n=W6(e),o=rt(t)&&kn(e.pluralRules?.[t])?e.pluralRules[t]:Tm,s=o===Tm?void 0:Tm,i=w=>w[o(n,w.length,s)],r=e.list||[],l=w=>r[w],a=e.named||nn();Hn(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=w=>a[w];function u(w,y){const b=kn(e.messages)?e.messages(w,!!y):zt(e.messages)?e.messages[w]:!1;return b||(e.parent?e.parent.message(w):D6)}const d=w=>e.modifiers?e.modifiers[w]:R6,h=kn(e.processor?.normalize)?e.processor.normalize:F6,m=kn(e.processor?.interpolate)?e.processor.interpolate:H6,f=rt(e.processor?.type)?e.processor.type:B6,_={list:l,named:c,plural:i,linked:(w,...y)=>{const[b,v]=y;let x="text",L="";y.length===1?zt(b)?(L=b.modifier||L,x=b.type||x):rt(b)&&(L=b||L):y.length===2&&(rt(b)&&(L=b||L),rt(v)&&(x=v||x));const N=u(w,!0)(_),k=N===""||N===void 0?w:N,T=x==="vnode"&&In(k)&&L?k[0]:k;return L?d(L)(T,x):T},message:u,type:f,interpolate:m,normalize:h,values:Un(nn(),r,a)};return _}const fb=()=>"",Ns=e=>kn(e);function hb(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Zg(...t),u=jt(c.missingWarn)?c.missingWarn:e.missingWarn,d=jt(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,h=jt(c.escapeParameter)?c.escapeParameter:e.escapeParameter,m=!!c.resolvedMessage,f=rt(c.default)||jt(c.default)?jt(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,g=n||f!=null&&(rt(f)||kn(f)),_=Av(e,c);h&&j6(c);let[w,y,b]=m?[a,_,l[_]||nn()]:Tx(e,a,_,r,d,u),v=w,x=a;if(!m&&!(rt(v)||fi(v)||Ns(v))&&g&&(v=f,x=v),!m&&(!(rt(v)||fi(v)||Ns(v))||!rt(y)))return s?Ph:a;let L=!1;const N=()=>{L=!0},k=Ns(v)?v:Ax(e,a,y,v,x,N);if(L)return v;const T=V6(e,y,b,c),E=U6(T),O=q6(e,k,E);let A=o?o(O,a):O;if(h&&rt(A)&&(A=_4(A)),__INTLIFY_PROD_DEVTOOLS__){const $={timestamp:Date.now(),key:rt(a)?a:Ns(v)?v.key:"",locale:y||(Ns(v)?v.locale:""),format:rt(v)?v:Ns(v)?v.source:"",message:A};$.meta=Un({},e.__meta,$6()||{}),d6($)}return A}function j6(e){In(e.list)?e.list=e.list.map(t=>rt(t)?Xk(t):t):zt(e.named)&&Object.keys(e.named).forEach(t=>{rt(e.named[t])&&(e.named[t]=Xk(e.named[t]))})}function Tx(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=nn(),h,m=null;const f="translate";for(let g=0;g<u.length&&(h=u[g],d=r[h]||nn(),(m=a(d,t))===null&&(m=d[t]),!(rt(m)||fi(m)||Ns(m)));g++)if(!O6(h,u)){const _=Mv(e,t,h,i,f);_!==t&&(m=_)}return[m,h,d]}function Ax(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(Ns(o)){const c=o;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>o);return c.locale=n,c.key=t,c}const a=r(o,z6(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function q6(e,t,n){return t(n)}function Zg(...e){const[t,n,o]=e,s=nn();if(!rt(t)&&!Hn(t)&&!Ns(t)&&!fi(t))throw Oi(Pi.INVALID_ARGUMENT);const i=Hn(t)?String(t):(Ns(t),t);return Hn(n)?s.plural=n:rt(n)?s.default=n:Dt(n)&&!Nh(n)?s.named=n:In(n)&&(s.list=n),Hn(o)?s.plural=o:rt(o)?s.default=o:Dt(o)&&Un(s,o),[i,s]}function z6(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>m4(t,n,r)}}function V6(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,h={locale:t,modifiers:s,pluralRules:i,messages:(m,f)=>{let g=r(n,m);if(g==null&&(u||f)){const[_,,w]=Tx(u||e,m,t,l,a,c);g=_??r(w,m)}if(rt(g)||fi(g)){let _=!1;const y=Ax(e,m,t,g,m,()=>{_=!0});return _?fb:y}else return Ns(g)?g:fb}};return e.processor&&(h.processor=e.processor),o.list&&(h.list=o.list),o.named&&(h.named=o.named),Hn(o.plural)&&(h.pluralIndex=o.plural),h}Z4();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const K6="11.4.5";function G6(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(dl().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(dl().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(dl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(dl().__INTLIFY_PROD_DEVTOOLS__=!1)}const Io={UNEXPECTED_RETURN_TYPE:h6,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 Ko(e,...t){return Lh(e,null,void 0)}const Jg=Rr("__translateVNode"),e1=Rr("__datetimeParts"),t1=Rr("__numberParts"),Mx=Rr("__setPluralRules"),Ex=Rr("__injectWithOption"),ra=Rr("__dispose");function su(e){if(!zt(e)||fi(e))return e;for(const t in e)if(Rs(e,t))if(!t.includes("."))zt(e[t])&&su(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,i=!1;for(let r=0;r<o;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in s||(s[n[r]]=nn()),!zt(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(fi(s)?yx.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!fi(s)){const r=s[n[o]];zt(r)&&su(r)}}return e}function Ev(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=Dt(n)?n:In(o)?nn():{[e]:nn()};if(In(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||nn(),qd(c,r[a])):qd(c,r)}else rt(l)&&qd(JSON.parse(l),r)}),s==null&&i)for(const l in r)Rs(r,l)&&su(r[l]);return r}function Ix(e){return e.type}function $x(e,t,n){let o=zt(t.messages)?t.messages:nn();"__i18nGlobal"in n&&(o=Ev(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(zt(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(zt(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function pb(e){return vt(Sr,null,e,0)}function iu(){return ho()}const mb="__INTLIFY_META__",gb=()=>[],Y6=()=>!1;let vb=0;function yb(e){return((t,n,o,s)=>e(n,o,iu()||void 0,s))}const X6=()=>{const e=iu();let t=null;return e&&(t=Ix(e)[mb])?{[mb]:t}:null};function $f(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=Ef?ne:Sl;let r=jt(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:rt(e.locale)?e.locale:ou),a=i(t&&r?t.fallbackLocale.value:rt(e.fallbackLocale)||In(e.fallbackLocale)||Dt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Ev(l.value,e)),u=i(Dt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Dt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let h=t?t.missingWarn:jt(e.missingWarn)||Ia(e.missingWarn)?e.missingWarn:!0,m=t?t.fallbackWarn:jt(e.fallbackWarn)||Ia(e.fallbackWarn)?e.fallbackWarn:!0,f=t?t.fallbackRoot:jt(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,_=kn(e.missing)?e.missing:null,w=kn(e.missing)?yb(e.missing):null,y=kn(e.postTranslation)?e.postTranslation:null,b=t?t.warnHtmlMessage:jt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter;const x=t?t.modifiers:Dt(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,N;N=(()=>{o&&rb(null);const ie={version:K6,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:x,pluralRules:L,missing:w===null?void 0:w,missingWarn:h,fallbackWarn:m,fallbackFormat:g,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:b,escapeParameter:v,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ie.datetimeFormats=u.value,ie.numberFormats=d.value,ie.__datetimeFormatters=Dt(N)?N.__datetimeFormatters:void 0,ie.__numberFormatters=Dt(N)?N.__numberFormatters:void 0;const ae=L6(ie);return o&&rb(ae),ae})(),hc(N,l.value,a.value);function T(){return[l.value,a.value,c.value,u.value,d.value]}const E=F({get:()=>l.value,set:ie=>{N.locale=ie,l.value=ie}}),O=F({get:()=>a.value,set:ie=>{N.fallbackLocale=ie,a.value=ie,hc(N,l.value,ie)}}),A=F(()=>c.value),$=F(()=>u.value),R=F(()=>d.value);function D(){return kn(y)?y:null}function W(ie){y=ie,N.postTranslation=ie}function V(){return _}function U(ie){ie!==null&&(w=yb(ie)),_=ie,N.missing=w}const ee=(ie,ae,we,je,nt,ct)=>{T();let _t;try{__INTLIFY_PROD_DEVTOOLS__,o||(N.fallbackContext=t?N6():void 0),_t=ie(N)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(N.fallbackContext=void 0)}if(we!=="translate exists"&&Hn(_t)&&_t===Ph||we==="translate exists"&&!_t){const[$t,lt]=ae();return t&&f?je(t):nt($t)}else{if(ct(_t))return _t;throw Ko(Io.UNEXPECTED_RETURN_TYPE)}};function K(...ie){return ee(ae=>Reflect.apply(hb,null,[ae,...ie]),()=>Zg(...ie),"translate",ae=>Reflect.apply(ae.t,ae,[...ie]),ae=>ae,ae=>rt(ae))}function G(...ie){const[ae,we,je]=ie;if(je&&!zt(je))throw Ko(Io.INVALID_ARGUMENT);return K(ae,we,Un({resolvedMessage:!0},je||{}))}function X(...ie){return ee(ae=>Reflect.apply(ab,null,[ae,...ie]),()=>Xg(...ie),"datetime format",ae=>Reflect.apply(ae.d,ae,[...ie]),()=>If,ae=>rt(ae)||In(ae))}function ke(...ie){return ee(ae=>Reflect.apply(ub,null,[ae,...ie]),()=>Qg(...ie),"number format",ae=>Reflect.apply(ae.n,ae,[...ie]),()=>If,ae=>rt(ae)||In(ae))}function le(ie){return ie.map(ae=>rt(ae)||Hn(ae)||jt(ae)?pb(String(ae)):ae)}const ue={normalize:le,interpolate:ie=>ie,type:"vnode"};function ve(...ie){return ee(ae=>{let we;const je=ae;try{je.processor=ue,we=Reflect.apply(hb,null,[je,...ie])}finally{je.processor=null}return we},()=>Zg(...ie),"translate",ae=>ae[Jg](...ie),ae=>[pb(ae)],ae=>In(ae))}function Pe(...ie){return ee(ae=>Reflect.apply(ub,null,[ae,...ie]),()=>Qg(...ie),"number format",ae=>ae[t1](...ie),gb,ae=>rt(ae)||In(ae))}function Re(...ie){return ee(ae=>Reflect.apply(ab,null,[ae,...ie]),()=>Xg(...ie),"datetime format",ae=>ae[e1](...ie),gb,ae=>rt(ae)||In(ae))}function Q(ie){L=ie,N.pluralRules=L}function ce(ie,ae){return ee(()=>{if(!ie)return!1;const we=rt(ae)?ae:l.value,je=rt(ae)?[we]:Yg(N,a.value,we);for(let nt=0;nt<je.length;nt++){const ct=te(je[nt]);let _t=N.messageResolver(ct,ie);if(_t===null&&(_t=ct[ie]),fi(_t)||Ns(_t)||rt(_t))return!0}return!1},()=>[ie],"translate exists",we=>Reflect.apply(we.te,we,[ie,ae]),Y6,we=>jt(we))}function Ce(ie){let ae=null;const we=Yg(N,a.value,l.value);for(let je=0;je<we.length;je++){const nt=c.value[we[je]]||{},ct=N.messageResolver(nt,ie);if(ct!=null){ae=ct;break}}return ae}function q(ie){const ae=Ce(ie);return ae??(t?t.tm(ie)||{}:{})}function te(ie){return c.value[ie]||{}}function pe(ie,ae){if(s){const we={[ie]:ae};for(const je in we)Rs(we,je)&&su(we[je]);ae=we[ie]}c.value[ie]=ae,N.messages=c.value}function oe(ie,ae){c.value[ie]=c.value[ie]||{};const we={[ie]:ae};if(s)for(const je in we)Rs(we,je)&&su(we[je]);ae=we[ie],qd(ae,c.value[ie]),N.messages=c.value}function fe(ie){return u.value[ie]||{}}function H(ie,ae){u.value[ie]=ae,N.datetimeFormats=u.value,cb(N,ie,ae)}function Y(ie,ae){u.value[ie]=Un(u.value[ie]||{},ae),N.datetimeFormats=u.value,cb(N,ie,ae)}function re(ie){return d.value[ie]||{}}function ge(ie,ae){d.value[ie]=ae,N.numberFormats=d.value,db(N,ie,ae)}function xe(ie,ae){d.value[ie]=Un(d.value[ie]||{},ae),N.numberFormats=d.value,db(N,ie,ae)}vb++,t&&Ef&&(ze(t.locale,ie=>{r&&(l.value=ie,N.locale=ie,hc(N,l.value,a.value))}),ze(t.fallbackLocale,ie=>{r&&(a.value=ie,N.fallbackLocale=ie,hc(N,l.value,a.value))}));const Ne={id:vb,locale:E,fallbackLocale:O,get inheritLocale(){return r},set inheritLocale(ie){r=ie,ie&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,hc(N,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:A,get modifiers(){return x},get pluralRules(){return L||{}},get isGlobal(){return o},get missingWarn(){return h},set missingWarn(ie){h=ie,N.missingWarn=h},get fallbackWarn(){return m},set fallbackWarn(ie){m=ie,N.fallbackWarn=m},get fallbackRoot(){return f},set fallbackRoot(ie){f=ie},get fallbackFormat(){return g},set fallbackFormat(ie){g=ie,N.fallbackFormat=g},get warnHtmlMessage(){return b},set warnHtmlMessage(ie){b=ie,N.warnHtmlMessage=ie},get escapeParameter(){return v},set escapeParameter(ie){v=ie,N.escapeParameter=ie},t:K,getLocaleMessage:te,setLocaleMessage:pe,mergeLocaleMessage:oe,getPostTranslationHandler:D,setPostTranslationHandler:W,getMissingHandler:V,setMissingHandler:U,[Mx]:Q};return Ne.datetimeFormats=$,Ne.numberFormats=R,Ne.rt=G,Ne.te=ce,Ne.tm=q,Ne.d=X,Ne.n=ke,Ne.getDateTimeFormat=fe,Ne.setDateTimeFormat=H,Ne.mergeDateTimeFormat=Y,Ne.getNumberFormat=re,Ne.setNumberFormat=ge,Ne.mergeNumberFormat=xe,Ne[Ex]=n,Ne[Jg]=ve,Ne[e1]=Re,Ne[t1]=Pe,Ne}function Q6(e){const t=rt(e.locale)?e.locale:ou,n=rt(e.fallbackLocale)||In(e.fallbackLocale)||Dt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=kn(e.missing)?e.missing:void 0,s=jt(e.silentTranslationWarn)||Ia(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=jt(e.silentFallbackWarn)||Ia(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=jt(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Dt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=kn(e.postTranslation)?e.postTranslation:void 0,d=rt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,h=!!e.escapeParameterHtml,m=jt(e.sync)?e.sync:!0;let f=e.messages;if(Dt(e.sharedMessages)){const x=e.sharedMessages;f=Object.keys(x).reduce((N,k)=>{const T=N[k]||(N[k]={});return Un(T,x[k]),N},f||{})}const{__i18n:g,__root:_,__injectWithOption:w}=e,y=e.datetimeFormats,b=e.numberFormats,v=e.flatJson;return{locale:t,fallbackLocale:n,messages:f,flatJson:v,datetimeFormats:y,numberFormats:b,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:h,messageResolver:e.messageResolver,inheritLocale:m,__i18n:g,__root:_,__injectWithOption:w}}function n1(e={}){const t=$f(Q6(e)),{__extender:n}=e,o={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(s){t.setMissingHandler(s)},get silentTranslationWarn(){return jt(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=jt(s)?!s:s},get silentFallbackWarn(){return jt(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=jt(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){return Reflect.apply(t.t,t,[...s])},rt(...s){return Reflect.apply(t.rt,t,[...s])},te(s,i){return t.te(s,i)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,i){t.setLocaleMessage(s,i)},mergeLocaleMessage(s,i){t.mergeLocaleMessage(s,i)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,i){t.setDateTimeFormat(s,i)},mergeDateTimeFormat(s,i){t.mergeDateTimeFormat(s,i)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,i){t.setNumberFormat(s,i)},mergeNumberFormat(s,i){t.mergeNumberFormat(s,i)}};return o.__extender=n,o}function Z6(e,t,n){return{beforeCreate(){const o=iu();if(!o)throw Ko(Io.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=kb(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=n1(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=kb(e,s);else{this.$i18n=n1({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&$x(t,s,s),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(o,this.$i18n)},mounted(){},unmounted(){const o=iu();if(!o)throw Ko(Io.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n}}}function kb(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[Mx](t.pluralizationRules||e.pluralizationRules);const n=Ev(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const Iv={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function J6({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Oe?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},nn())}function Nx(){return Oe}const e5=Qe({name:"i18n-t",props:Un({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Hn(e)||!isNaN(e)}},Iv),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||St({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=nn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=rt(e.plural)?+e.plural:e.plural);const u=J6(t,a);return s[Jg](e.keypath,u,c)},r=Un(nn(),o),l=rt(e.tag)||zt(e.tag)?e.tag:Nx();return zt(l)?Zt(l,r,{default:i}):Zt(l,r,i())}}}),bb=e5;function t5(e){return In(e)&&!rt(e[0])}function Lx(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=nn();e.locale&&(c.locale=e.locale),rt(e.format)?c.key=e.format:zt(e.format)&&(rt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((m,f)=>n.includes(f)?Un(nn(),m,{[f]:e.format[f]}):m,nn()));const d=o(e.value,c,u);let h=[c.key];return In(d)?h=d.map((m,f)=>{const g=s[m.type],_=g?g({[m.type]:m.value,index:f,parts:d}):[m.value];return t5(_)&&(_[0].key=`${m.type}-${f}`),_}):rt(d)&&(h=[d]),h},l=Un(nn(),i),a=rt(e.tag)||zt(e.tag)?e.tag:Nx();return zt(a)?Zt(a,l,{default:r}):Zt(a,l,r())}}const n5=Qe({name:"i18n-n",props:Un({value:{type:Number,required:!0},format:{type:[String,Object]}},Iv),setup(e,t){const n=e.i18n||St({useScope:e.scope,__useComponent:!0});return Lx(e,t,xx,(...o)=>n[t1](...o))}}),wb=n5;function o5(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function s5(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Ko(Io.UNEXPECTED_ERROR);const c=o5(e,l.$),u=_b(a);return[Reflect.apply(c.t,c,[...Cb(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);Ef&&(r.__i18nWatcher=ze(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{Ef&&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=_b(l);r.textContent=Reflect.apply(a.t,a,[...Cb(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function _b(e){if(rt(e))return{path:e};if(Dt(e)){if(!("path"in e))throw Ko(Io.REQUIRED_VALUE,"path");return e}else throw Ko(Io.INVALID_VALUE)}function Cb(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return rt(n)&&(r.locale=n),Hn(s)&&(r.plural=s),Hn(i)&&(r.plural=i),[t,l,r]}function i5(e,t,...n){const o=Dt(n[0])?n[0]:{};(jt(o.globalInstall)?o.globalInstall:!0)&&([bb.name,"I18nT"].forEach(i=>e.component(i,bb)),[wb.name,"I18nN"].forEach(i=>e.component(i,wb)),[Tb.name,"I18nD"].forEach(i=>e.component(i,Tb))),e.directive("t",s5(t))}const r5=Rr("global-vue-i18n");function l5(e={}){const t=__VUE_I18N_LEGACY_API__&&jt(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=jt(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=a5(e,t),r=Rr("");function l(d){return o.get(d)||null}function a(d,h){o.set(d,h)}function c(d){o.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...h){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),Dt(h[0])){const g=h[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let m=null;!t&&n&&(m=m5(d,u.global)),__VUE_I18N_FULL_INSTALL__&&i5(d,u,...h),__VUE_I18N_LEGACY_API__&&t&&d.mixin(Z6(i,i.__composer,u));const f=d.unmount;d.unmount=()=>{m&&m(),u.dispose(),f()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function St(e={}){const t=iu();if(t==null)throw Ko(Io.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ko(Io.NOT_INSTALLED);const n=c5(t),o=d5(n),s=Ix(t),i=u5(e,s);if(i==="global")return $x(o,e,s),o;if(i==="parent"){let a=Sb(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw Ko(Io.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=Un({},e),u=Sb(n,t);c.__root=u||o;const d=$f(c);return a.__composerExtend&&(d[ra]=a.__composerExtend(d)),sv()&&iv(()=>{const m=d[ra];m&&(m(),delete d[ra])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=Un({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=$f(a),r.__composerExtend&&(l[ra]=r.__composerExtend(l)),h5(r,t,l),r.__setInstance(t,l)}return l}function a5(e,t){const n=OE(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>n1(e)):n.run(()=>$f(e));if(o==null)throw Ko(Io.UNEXPECTED_ERROR);return[n,o]}function c5(e){const t=Bt(e.isCE?r5:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ko(e.isCE?Io.NOT_INSTALLED_WITH_PROVIDE:Io.UNEXPECTED_ERROR);return t}function u5(e,t){return Nh(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function d5(e){return e.mode==="composition"?e.global:e.global.__composer}function Sb(e,t,n=!1){let o=null;const s=t.root;let i=f5(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")o=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(o=l.__composer,n&&o&&!o[Ex]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function f5(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function h5(e,t,n){sn(()=>{},t),Yt(()=>{const o=n;e.__deleteInstance(t);const s=o[ra];s&&(s(),delete o[ra])},t)}const p5=["locale","fallbackLocale","availableLocales"],xb=["t","rt","d","n","tm","te"];function m5(e,t){const n=Object.create(null);return p5.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw Ko(Io.UNEXPECTED_ERROR);const r=Ln(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,r)}),e.config.globalProperties.$i18n=n,xb.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw Ko(Io.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,xb.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const g5=Qe({name:"i18n-d",props:Un({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Iv),setup(e,t){const n=e.i18n||St({useScope:e.scope,__useComponent:!0});return Lx(e,t,Sx,(...o)=>n[e1](...o))}}),Tb=g5;G6();A6(a6);M6(S6);E6(Yg);if(__INTLIFY_PROD_DEVTOOLS__){const e=dl();e.__INTLIFY__=!0,c6(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Ct={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",workspaceNameOverrides:"kimi-web.workspace-name-overrides",betaToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align"};function Ab(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function bn(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function An(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function ru(e){try{globalThis.localStorage.removeItem(e)}catch{}}function Oh(e){const t=bn(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Tu(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function $v(){const e=bn(Ct.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[o,s]of Object.entries(t))s===!0&&(n[o]=!0);return n}catch{return{}}}function Nv(e){const n={...$v()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];An(Ct.unread,JSON.stringify(n))}function v5(){const e=Oh(Ct.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function y5(e){Tu(Ct.collapsedWorkspaces,Array.from(e))}function k5(){const e=Oh(Ct.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function Px(e){Tu(Ct.workspaceOrder,Array.from(e))}function yd(){const e=Oh(Ct.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))typeof o=="string"&&(t[n]=o);return t}function Mb(e){Tu(Ct.workspaceNameOverrides,e)}const Eb=Ct.clientId,b5="kimi-code-web",w5="web";function _5(){return{serverHttpUrl:S5(),clientId:M5(),clientName:b5,clientVersion:E5(),clientUiMode:w5}}function C5(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function S5(e){const t=C5(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function x5(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function T5(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return x5(e)}function Nf(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function A5(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 M5(){const e=bn(Eb);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return An(Eb,t),t}function E5(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function wo(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return I5(e)}function I5(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 $5(e,t){if(e.length===0)return null;const n=new Set(e),o=t.filter(i=>n.has(i)),s=e.filter(i=>!t.includes(i));return s.length===0&&o.length===t.length?null:[...s,...o]}function N5(e,t){const n=new Map(t.map((o,s)=>[o,s]));return e.toSorted((o,s)=>(n.get(o.id)??-1)-(n.get(s.id)??-1))}function L5(e,t,n,o="before"){const s=e.indexOf(t),i=e.indexOf(n);if(s===-1||i===-1||s===i)return e;const r=[...e];r.splice(s,1);const l=s<i?i-1:i,a=o==="before"?l:l+1;return r.splice(a,0,t),r}const P5={class:"row"},O5={class:"lead","aria-hidden":"true"},R5={key:0,class:"run-ico",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none"},D5={key:1,class:"unread-dot"},B5={class:"archive-label"},F5={class:"left"},H5=["onKeydown"],W5={class:"ts"},U5=["title"],j5={class:"tag-text"},q5=["title"],z5={class:"tag-text"},V5=["title"],K5={class:"tag-text"},G5=["title"],Y5=Qe({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:o}=St(),s=e,i=n,r=ne(!1),l=ne(null),a=ne(null);function c(E){const O=E.target;a.value?.contains(O)||l.value?.contains(O)||d()}function u(E){E.stopPropagation(),r.value?d():(r.value=!0,setTimeout(()=>document.addEventListener("mousedown",c),0))}function d(){r.value=!1,document.removeEventListener("mousedown",c)}Yt(()=>document.removeEventListener("mousedown",c));const h=ne(!1),m=ne(""),f=ne(null);async function g(){d(),h.value=!0,m.value=s.session.title,await ht();try{f.value?.focus(),f.value?.select()}catch{}}function _(){const E=m.value.trim();E&&i("rename",s.session.id,E),h.value=!1}function w(){h.value=!1}const y=ne(!1),b=ne(!1);async function v(){const E=await wo(s.session.id);y.value=E,b.value=!E,setTimeout(()=>{y.value=!1,b.value=!1,d()},1500)}function x(){d(),i("fork",s.session.id)}const L=ne(!1);function N(){d(),L.value=!0}function k(){i("archive",s.session.id),L.value=!1}function T(){L.value=!1}return t({closeMenu:d,cancelArchive:T}),(E,O)=>(C(),I("div",{class:Le(["se",{on:e.active}]),onClick:O[5]||(O[5]=A=>i("select",e.session.id))},[p("div",P5,[p("span",O5,[e.session.busy?(C(),I("svg",R5,[...O[6]||(O[6]=[p("circle",{class:"run-track",cx:"8",cy:"8",r:"6","stroke-width":"2"},null,-1),p("path",{class:"run-arc",d:"M8 2 A6 6 0 1 1 2 8","stroke-width":"2","stroke-linecap":"round"},null,-1)])])):e.unread?(C(),I("span",D5)):se("",!0)]),L.value?(C(),I("div",{key:0,class:"archive-confirm",onClick:O[0]||(O[0]=Ze(()=>{},["stop"]))},[p("span",B5,P(S(o)("sidebar.archiveConfirm")),1),p("button",{class:"btn-confirm",onClick:Ze(k,["stop"])},P(S(o)("sidebar.confirm")),1),p("button",{class:"btn-cancel",onClick:Ze(T,["stop"])},P(S(o)("sidebar.cancel")),1)])):(C(),I(Oe,{key:1},[p("div",F5,[h.value?qt((C(),I("input",{key:0,ref_key:"renameInputRef",ref:f,"onUpdate:modelValue":O[1]||(O[1]=A=>m.value=A),class:"rename-input",onClick:O[2]||(O[2]=Ze(()=>{},["stop"])),onKeydown:[Os(Ze(_,["stop"]),["enter"]),Os(Ze(w,["stop"]),["esc"])],onBlur:_},null,40,H5)),[[Wn,m.value]]):(C(),I("span",{key:1,class:"t",onDblclick:Ze(g,["stop"])},P(e.session.title),33))]),p("span",W5,P(e.session.time),1),!h.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(C(),I("span",{key:0,class:"tag tag-ask",title:S(o)("workspace.awaitingAnswerTitle")},[p("span",j5,P(S(o)("workspace.awaitingAnswer")),1)],8,U5)):se("",!0),!h.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(C(),I("span",{key:1,class:"tag tag-approve",title:S(o)("workspace.awaitingPermissionTitle")},[p("span",z5,P(S(o)("workspace.awaitingPermission")),1)],8,q5)):se("",!0),!h.value&&e.session.status==="aborted"?(C(),I("span",{key:2,class:"tag tag-aborted",title:S(o)("workspace.abortedTitle")},[p("span",K5,P(S(o)("workspace.aborted")),1)],8,V5)):se("",!0),h.value?se("",!0):(C(),I("button",{key:3,ref_key:"kebabRef",ref:l,class:Le(["kebab",{open:r.value}]),title:S(o)("sidebar.options"),onClick:O[3]||(O[3]=Ze(A=>u(A),["stop"]))},[...O[7]||(O[7]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"8",cy:"3",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,G5))],64))]),r.value?(C(),I("div",{key:0,ref_key:"menuRef",ref:a,class:"menu",onClick:O[4]||(O[4]=Ze(()=>{},["stop"]))},[p("button",{class:Le(["menu-item copy-id",{failed:b.value}]),onClick:Ze(v,["stop"])},P(b.value?S(o)("sidebar.copyFailed"):y.value?S(o)("sidebar.copied"):S(o)("sidebar.copySessionId")),3),O[8]||(O[8]=p("div",{class:"menu-divider"},null,-1)),p("button",{class:"menu-item",onClick:Ze(g,["stop"])},P(S(o)("sidebar.rename")),1),p("button",{class:"menu-item",onClick:Ze(x,["stop"])},P(S(o)("sidebar.fork")),1),p("button",{class:"menu-item archive",onClick:Ze(N,["stop"])},P(S(o)("sidebar.archive")),1)],512)):se("",!0)],2))}}),bt=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Ox=bt(Y5,[["__scopeId","data-v-8222aa18"]]),X5={class:"gh-top"},Q5={class:"gh-folder",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},Z5={key:0,class:"gh-name"},J5=["title","aria-label","aria-expanded"],eN=["title","aria-label"],tN=["title"],nN={class:"group-sessions"},oN=["disabled"],sN={key:1,class:"group-empty"},iN=Qe({__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}=St(),o=e,s=t,i=F({get:()=>o.renameValue,set:a=>s("updateRenameValue",a)});function r(a){o.renameInputRef.value=a instanceof HTMLInputElement?a:null}function l(a){a.dataTransfer&&(a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}return(a,c)=>(C(),I("div",{class:Le(["group",{dragging:e.dragging}])},[p("div",{class:Le(["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=>s("groupClick",e.group.workspace.id,u),["stop"])),onContextmenu:c[8]||(c[8]=u=>s("groupContextmenu",e.group.workspace,u)),onDragstart:l,onDragend:c[9]||(c[9]=u=>s("wsDragend"))},[p("div",X5,[(C(),I("svg",Q5,[e.isCollapsed(e.group.workspace.id)?(C(),I(Oe,{key:0},[c[15]||(c[15]=p("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),c[16]||(c[16]=p("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(C(),I(Oe,{key:1},[c[17]||(c[17]=p("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]=p("path",{d:"M1 5.5h12"},null,-1))],64))])),e.renamingId!==e.group.workspace.id?(C(),I("span",Z5,P(e.group.workspace.name),1)):qt((C(),I("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]=Os(u=>s("confirmRename"),["enter"])),c[2]||(c[2]=Os(u=>s("cancelRename"),["esc"]))],onBlur:c[3]||(c[3]=u=>s("cancelRename")),onClick:c[4]||(c[4]=Ze(()=>{},["stop"]))},null,544)),[[Wn,i.value]]),p("button",{type:"button",class:Le(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),title:S(n)("sidebar.options"),"aria-label":S(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:c[5]||(c[5]=Ze(u=>s("toggleWsMenu",e.group.workspace,u),["stop"]))},[...c[19]||(c[19]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"8",cy:"3",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,J5),p("button",{type:"button",class:"gh-add",title:S(n)("workspace.newInGroup"),"aria-label":S(n)("workspace.newInGroup"),onClick:c[6]||(c[6]=Ze(u=>s("createInWorkspace",e.group.workspace.id),["stop"]))},[...c[20]||(c[20]=[p("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"},[p("path",{d:"M8 3v10M3 8h10"})],-1)])],8,eN)]),p("div",{class:"gh-path",title:e.group.workspace.root},P(e.group.workspace.shortPath||e.group.workspace.root),9,tN)],34),qt(p("div",nN,[(C(!0),I(Oe,null,Xe(e.group.sessions,u=>(C(),Ve(Ox,{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=>s("selectSession",d)),onRename:c[11]||(c[11]=(d,h)=>s("renameSession",d,h)),onArchive:c[12]||(c[12]=d=>s("archiveSession",d)),onFork:c[13]||(c[13]=d=>s("forkSession",d))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(C(),I("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:c[14]||(c[14]=Ze(u=>s("loadMore",e.group.workspace.id),["stop"]))},P(e.group.loadingMore?S(n)("sidebar.loadingMore"):S(n)("sidebar.showMore",{count:Math.max(0,e.group.workspace.sessionCount-e.group.sessions.length)})),9,oN)):se("",!0),e.group.sessions.length===0?(C(),I("div",sN,P(S(n)("sidebar.noSessions")),1)):se("",!0)],512),[[Ks,!e.isCollapsed(e.group.workspace.id)]])],2))}}),rN=bt(iN,[["__scopeId","data-v-4c114e7c"]]),lN="kimi_desktop",aN="platform",Ib="kimi-desktop",$b="kimi-desktop-platform";function cN(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(lN)?(sessionStorage.setItem(Ib,"1"),e=!0):e=e||sessionStorage.getItem(Ib)==="1";const o=n.get(aN);o?(sessionStorage.setItem($b,o),t=o):t=sessionStorage.getItem($b)}catch{}return{isDesktop:e,platform:t}}const o1=cN(),uN=o1.isDesktop,Rx=o1.isDesktop&&o1.platform==="darwin",dN=["aria-label"],fN=Qe({__name:"InternalBuildBanner",setup(e){const{t}=St(),n=uN;return(o,s)=>S(n)?(C(),I("span",{key:0,class:"internal-build-tag",role:"note","aria-label":S(t)("app.internalBuildBanner")},[s[0]||(s[0]=p("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[p("path",{d:"M8 2 14 13H2L8 2Z"}),p("path",{d:"M8 6v3.5"}),p("path",{d:"M8 11.5h.01"})],-1)),p("span",null,P(S(t)("app.internalBuildBanner")),1)],8,dN)):se("",!0)}}),hN=bt(fN,[["__scopeId","data-v-b5e70a09"]]),pN={class:"ch"},mN={class:"ch-brand"},gN={class:"ch-name"},vN={key:0,class:"ch-endpoint"},yN=["title","aria-label"],kN=["title","aria-label"],bN={class:"search"},wN=["placeholder","aria-label","onKeydown"],_N=["title","aria-label"],CN={class:"btn-wrap"},SN={key:0,class:"sessions"},xN={key:1,class:"empty"},TN={key:1,class:"sessions"},AN={key:0,class:"empty"},MN=["onDragover","onDrop"],EN=Qe({__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}=St(),o=!1,s="",i=e,r=t,l=ne(""),a=F(()=>l.value.trim()),c=F(()=>a.value.length>0),u=F(()=>{const ae=a.value.toLowerCase();return ae?i.sessions.filter(we=>{const je=(we.title??"").toLowerCase(),nt=(we.lastPrompt??"").toLowerCase();return je.includes(ae)||nt.includes(ae)}):[]});function d(){l.value=""}function h(ae){d(),T(ae)}ze(c,ae=>{ae&&r("loadAllSessions")});const m=ne(new Set(v5()));function f(ae){return m.value.has(ae)}function g(ae){const we=new Set(m.value);we.has(ae)?we.delete(ae):we.add(ae),m.value=we,y5(we)}const _=ne(null),w=ne(null);function y(ae){_.value=ae}function b(){_.value=null,w.value=null}function v(ae){const we=ae.currentTarget.getBoundingClientRect();return ae.clientY<we.top+we.height/2?"before":"after"}function x(ae,we){_.value===null||_.value===we||(ae.preventDefault(),ae.dataTransfer&&(ae.dataTransfer.dropEffect="move"),w.value={id:we,position:v(ae)})}function L(ae){const we=_.value,je=w.value?.id===ae?w.value.position:"before";if(w.value=null,_.value=null,!we||we===ae)return;const nt=L5(i.groups.map(ct=>ct.workspace.id),we,ae,je);r("reorderWorkspaces",nt)}const N=ne(new Set);function k(ae,we){if(we.shiftKey){we.stopPropagation();const je=new Set(N.value);je.has(ae)?je.delete(ae):je.add(ae),N.value=je,r("selectWorkspaces",Array.from(je));return}N.value=new Set,r("selectWorkspaces",[]),g(ae)}function T(ae){N.value=new Set,r("selectWorkspaces",[]),r("select",ae)}const E=ne(null),O=ne(""),A=ne(null);function $(){return A}function R(ae,we){E.value=ae,O.value=we,ht().then(()=>A.value?.focus())}function D(){const ae=E.value,we=O.value.trim();ae&&we&&r("renameWorkspace",ae,we),E.value=null}function W(){E.value=null}function V(ae){O.value=ae}const U=ne(!1),ee=ne(null),K=ne({}),G=ne(null);function X(ae){G.value&&!G.value.contains(ae.target)&&le()}function ke(ae,we){if(we.shiftKey){we.stopPropagation();const je=new Set(N.value);je.has(ae.id)?je.delete(ae.id):je.add(ae.id),N.value=je,r("selectWorkspaces",Array.from(je));return}we.preventDefault(),we.stopPropagation(),ee.value=ae,K.value={top:`${we.clientY}px`,left:`${we.clientX}px`},U.value=!0,document.addEventListener("mousedown",X,!0)}function le(){U.value=!1,document.removeEventListener("mousedown",X,!0),ee.value=null,Q()}function He(){ee.value&&wo(ee.value.root),le()}function ue(){ee.value&&R(ee.value.id,ee.value.name),le()}function ve(){const ae=ee.value;ae&&ce(ae.id)&&(r("deleteWorkspace",ae.id),le())}const Pe=ne(null);let Re;function Q(){clearTimeout(Re),Pe.value=null}function ce(ae){return Pe.value===ae?(Q(),!0):(clearTimeout(Re),Pe.value=ae,Re=setTimeout(()=>{Pe.value=null},2500),!1)}const Ce=ne(null),q=ne(null),te=ne({}),pe=ne(null);function oe(ae){const we=ae.target;we.closest(".gh-more")||we.closest(".ws-menu")||H()}async function fe(ae,we){if(Ce.value===ae.id){H();return}const je=we.currentTarget;q.value=ae,Ce.value=ae.id,document.addEventListener("mousedown",oe),document.addEventListener("scroll",H,!0),window.addEventListener("resize",H),await ht();const nt=pe.value,ct=je.getBoundingClientRect(),_t=4,$t=8,lt=nt?.offsetHeight??0,Rt=nt?.offsetWidth??0;let fn=ct.bottom+_t;fn+lt>window.innerHeight-$t&&(fn=Math.max($t,ct.top-lt-_t));let Mn=ct.right-Rt;Mn<$t&&(Mn=$t),te.value={top:`${Math.round(fn)}px`,left:`${Math.round(Mn)}px`}}function H(){Ce.value=null,q.value=null,Q(),document.removeEventListener("mousedown",oe),document.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H)}function Y(ae){wo(ae.root),H()}function re(ae){R(ae.id,ae.name),H()}function ge(ae){ce(ae.id)&&(r("deleteWorkspace",ae.id),H())}Jo(()=>{document.removeEventListener("mousedown",X,!0),document.removeEventListener("mousedown",oe),document.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H),clearTimeout(Re)});const xe=ne(null);let Ne;function ie(){const ae=xe.value;ae&&(ae.classList.remove("blink-now"),ae.getBoundingClientRect(),ae.classList.add("blink-now"),clearTimeout(Ne),Ne=setTimeout(()=>ae.classList.remove("blink-now"),300))}return(ae,we)=>(C(),I("aside",{class:Le(["side",{"macos-desktop":S(Rx)}])},[p("div",{class:"col",style:Wt({width:e.colWidth+"px"})},[p("div",pN,[p("div",mN,[(C(),I("svg",{ref_key:"logoRef",ref:xe,class:Le(["ch-logo",{"is-dev":S(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:ie},[...we[19]||(we[19]=[Ir('<defs data-v-912b260a><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-912b260a><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-912b260a></rect><g class="ch-eyes" fill="#000" data-v-912b260a><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-912b260a></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-912b260a></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-912b260a></rect>',2)])],2)),p("span",gN,[we[20]||(we[20]=ut("Kimi Code",-1)),S(o)?(C(),I("span",vN," · "+P(S(s)),1)):se("",!0)]),vt(hN)]),p("button",{type:"button",class:"collapse-btn",title:S(n)("sidebar.collapseSidebar"),"aria-label":S(n)("sidebar.collapseSidebar"),onClick:we[0]||(we[0]=Ze(je=>r("collapse"),["stop"]))},[...we[21]||(we[21]=[Ir('<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-912b260a><path d="M11 6h9" data-v-912b260a></path><path d="M11 12h9" data-v-912b260a></path><path d="M11 18h9" data-v-912b260a></path><path d="M7 9l-3 3 3 3" data-v-912b260a></path></svg>',1)])],8,yN),p("button",{type:"button",class:"settings-btn",title:S(n)("settings.title"),"aria-label":S(n)("settings.title"),onClick:we[1]||(we[1]=Ze(je=>r("openSettings"),["stop"]))},[...we[22]||(we[22]=[p("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"},[p("circle",{cx:"12",cy:"12",r:"3"}),p("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,kN)]),p("div",bN,[we[24]||(we[24]=p("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"},[p("circle",{cx:"7",cy:"7",r:"5"}),p("path",{d:"M11 11l3 3"})],-1)),qt(p("input",{"onUpdate:modelValue":we[2]||(we[2]=je=>l.value=je),class:"search-input",type:"text",placeholder:S(n)("sidebar.searchPlaceholder"),"aria-label":S(n)("sidebar.searchPlaceholder"),onKeydown:Os(Ze(d,["stop"]),["esc"])},null,40,wN),[[Wn,l.value]]),c.value?(C(),I("button",{key:0,type:"button",class:"search-clear",title:S(n)("sidebar.searchClear"),"aria-label":S(n)("sidebar.searchClear"),onClick:Ze(d,["stop"])},[...we[23]||(we[23]=[p("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,_N)):se("",!0)]),p("div",CN,[p("button",{class:"btn-new-chat",onClick:we[3]||(we[3]=Ze(je=>r("create"),["stop"]))},[we[25]||(we[25]=p("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"},[p("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)),p("span",null,P(S(n)("sidebar.newChat")),1)]),se("",!0)]),c.value?(C(),I("div",SN,[u.value.length>0?(C(!0),I(Oe,{key:0},Xe(u.value,je=>(C(),Ve(Ox,{key:je.id,session:je,active:je.id===e.activeId,"approval-count":e.pendingBySession[je.id]?.approvals??0,"question-count":e.pendingBySession[je.id]?.questions??0,unread:e.unreadBySession[je.id]??!1,onSelect:we[5]||(we[5]=nt=>h(nt)),onRename:we[6]||(we[6]=(nt,ct)=>r("rename",nt,ct)),onArchive:we[7]||(we[7]=nt=>r("archive",nt)),onFork:we[8]||(we[8]=nt=>r("fork",nt))},null,8,["session","active","approval-count","question-count","unread"]))),128)):(C(),I("div",xN,P(S(n)("sidebar.searchNoResults")),1))])):(C(),I("div",TN,[e.groups.length===0?(C(),I("div",AN,P(S(n)("workspace.noWorkspace")),1)):(C(!0),I(Oe,{key:1},Xe(e.groups,je=>(C(),I("div",{key:je.workspace.id,class:Le(["ws-drop-target",{"drop-before":w.value?.id===je.workspace.id&&w.value.position==="before","drop-after":w.value?.id===je.workspace.id&&w.value.position==="after"}]),onDragover:nt=>x(nt,je.workspace.id),onDrop:nt=>L(je.workspace.id)},[vt(rN,{group:je,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"selected-ids":N.value,"renaming-id":E.value,"rename-value":O.value,"rename-input-ref":$(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":Ce.value,dragging:_.value===je.workspace.id,"is-collapsed":f,onGroupClick:k,onGroupContextmenu:ke,onToggleWsMenu:fe,onCreateInWorkspace:we[9]||(we[9]=nt=>r("createInWorkspace",nt)),onSelectSession:T,onRenameSession:we[10]||(we[10]=(nt,ct)=>r("rename",nt,ct)),onArchiveSession:we[11]||(we[11]=nt=>r("archive",nt)),onForkSession:we[12]||(we[12]=nt=>r("fork",nt)),onLoadMore:we[13]||(we[13]=nt=>r("loadMoreSessions",nt)),onConfirmRename:D,onCancelRename:W,onUpdateRenameValue:V,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,MN))),128))]))],4),U.value?(C(),I("div",{key:0,ref_key:"ghMenuRef",ref:G,class:"gh-menu",style:Wt(K.value),onClick:we[14]||(we[14]=Ze(()=>{},["stop"]))},[p("button",{type:"button",class:"ghm-item",onClick:He},P(S(n)("sidebar.copyPath")),1),p("button",{type:"button",class:"ghm-item",onClick:ue},P(S(n)("sidebar.rename")),1),p("button",{type:"button",class:"ghm-item del",onClick:ve},P(ee.value&&Pe.value===ee.value.id?S(n)("sidebar.confirm"):S(n)("sidebar.removeWorkspace")),1)],4)):se("",!0),Ce.value!==null&&q.value?(C(),I("div",{key:1,ref_key:"wsMenuRef",ref:pe,class:"ws-menu",style:Wt(te.value),onClick:we[18]||(we[18]=Ze(()=>{},["stop"]))},[p("button",{class:"ws-menu-item",onClick:we[15]||(we[15]=Ze(je=>Y(q.value),["stop"]))},P(S(n)("sidebar.copyPath")),1),we[27]||(we[27]=p("div",{class:"ws-menu-divider"},null,-1)),p("button",{class:"ws-menu-item",onClick:we[16]||(we[16]=Ze(je=>re(q.value),["stop"]))},P(S(n)("sidebar.rename")),1),we[28]||(we[28]=p("div",{class:"ws-menu-divider"},null,-1)),p("button",{class:"ws-menu-item del",onClick:we[17]||(we[17]=Ze(je=>ge(q.value),["stop"]))},P(Pe.value===q.value.id?S(n)("sidebar.confirm"):S(n)("sidebar.removeWorkspace")),1)],4)):se("",!0)],2))}}),IN=bt(EN,[["__scopeId","data-v-912b260a"]]);function $N(e){try{const t=bn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function NN(e,t){try{An(e,String(t))}catch{}}function LN(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(w){return Number.isFinite(w)?Math.min(QC(s),Math.max(o,Math.round(w))):n}const l=ne(r($N(t)??n)),a=ne(!1);function c(w){const y=r(w);l.value=y,NN(t,y)}let u=0,d=0,h=null,m=-1;function f(w){if(!a.value)return;const y=w.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=""),h){try{h.releasePointerCapture(m)}catch{}h.removeEventListener("pointermove",f),h.removeEventListener("pointerup",g),h.removeEventListener("pointercancel",g)}h=null,m=-1}}function _(w){w.preventDefault(),a.value=!0,u=w.clientX,d=r(l.value),h=w.currentTarget,m=w.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{h.setPointerCapture(m)}catch{}h.addEventListener("pointermove",f),h.addEventListener("pointerup",g),h.addEventListener("pointercancel",g)}return Jo(g),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:_}}const PN=["aria-label"],ON=Qe({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,o=t,{t:s}=St(),{width:i,dragging:r,onPointerDown:l}=LN({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),ze(i,a=>o("update:width",a)),ze(r,a=>o("update:dragging",a)),(a,c)=>(C(),I("div",{class:Le(["rh",{dragging:S(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??S(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>S(l)&&S(l)(...u))},[...c[1]||(c[1]=[p("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,PN))}}),Nb=bt(ON,[["__scopeId","data-v-0d454900"]]),RN={preview:"Preview"},DN={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…",internalBuildBanner:"Internal testing only"},BN={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"},FN={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.",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},HN={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…"},WN={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"},UN={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"},jN={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"},qN={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"},zN={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"},VN={justNow:"just now"},KN={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"},GN={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},YN={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"},XN={panelTitle:"Thinking",close:"Close"},QN={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"},ZN={},JN={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"}},e8={searching:"Searching…",noMatch:"No matches"},t8={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."}},n8={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Kimi in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},o8={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"}},s8={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},i8={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"},r8={label:"Theme",modern:"Explore",kimi:"Native",colorSchemeLabel:"Appearance",light:"Light",dark:"Dark",system:"System"},l8={preview:"预览"},a8={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",comingSoon:"敬请期待",internalBuildBanner:"仅供内部测试"},c8={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:"没有匹配的会话"},u8={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},d8={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:"正在加载更早的消息…"},f8={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:"进行中"},h8={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"},p8={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 后重试"},m8={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 关闭"},g8={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},v8={justNow:"刚刚"},y8={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:"拒绝并退出"},k8={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},b8={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:"展开"},w8={panelTitle:"思考过程",close:"关闭"},_8={title:"改动",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},C8={},S8={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:"无法读取这个文件"}},x8={searching:"搜索中…",noMatch:"无匹配"},T8={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:"目标描述太长了,请精简后重试。"}},A8={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Kimi"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},M8={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"计划",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"}},E8={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},I8={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},$8={label:"主题",modern:"探索",kimi:"原生",colorSchemeLabel:"外观",light:"浅色",dark:"深色",system:"跟随系统"},N8={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"},L8={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",themeLabel:"主题",modernDesc:"气泡、对话感、更柔和。",kimiDesc:"原生风格:安静、扁平。",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},P8={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",advanced:"Advanced",experimental:"Experimental"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",soundOnComplete:"Play a sound when a turn completes or needs an answer",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",notifyQuestionBody:"A question is waiting for your answer",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",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:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",beta:"Experimental",betaToc:"Proportional conversation outline",betaTocHint:" Larger bubbles, viewport indicator, and hover tooltip"},O8={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",advanced:"高级",experimental:"实验性"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",soundOnComplete:"会话完成或待回答时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",notifyQuestionBody:"有提问等待你回答",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:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",beta:"实验性",betaToc:"对话目录增强",betaTocHint:"更大的气泡、视口指示器和悬停提示"},R8={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?"},D8={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"detached",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",confirmArchive:"确认归档?"},B8={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"},F8={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},H8={en:{common:RN,app:DN,sidebar:BN,workspace:FN,conversation:HN,status:WN,composer:UN,login:jN,providers:qN,model:zN,sessions:VN,approval:KN,question:GN,tasks:YN,thinking:XN,diff:QN,fileTree:ZN,filePreview:JN,mention:e8,warnings:t8,commands:n8,tools:o8,layout:s8,mobile:i8,theme:r8,onboarding:N8,settings:P8,header:R8,sideChat:B8},zh:{common:l8,app:a8,sidebar:c8,workspace:u8,conversation:d8,status:f8,composer:h8,login:p8,providers:m8,model:g8,sessions:v8,approval:y8,question:k8,tasks:b8,thinking:w8,diff:_8,fileTree:C8,filePreview:S8,mention:x8,warnings:T8,commands:A8,tools:M8,layout:E8,mobile:I8,theme:$8,onboarding:L8,settings:O8,header:D8,sideChat:F8}},Dx=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function W8(){const e=bn(Ct.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Sn=l5({legacy:!1,locale:W8(),fallbackLocale:"en",messages:H8});function Bx(e){Sn.global.locale.value=e,An(Ct.locale,e)}const ba=Sn.global.t,U8={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"},j8={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search"};function xl(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return j8[t]??t}function Lf(e){const t=U8[xl(e)];return t?ba(t):e}const q8='<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>',z8='<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>',Lb='<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>',V8='<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>',Pb='<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>',K8='<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>',G8='<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>',Y8='<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>',Ob='<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>',X8='<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>',Q8="";function Z8(e){switch(xl(e)){case"read":return q8;case"bash":return z8;case"edit":return Lb;case"multi_edit":return Lb;case"write":return V8;case"grep":return Pb;case"search":return Pb;case"glob":return K8;case"ls":return G8;case"web_fetch":return Y8;case"todo":return Ob;case"task":return Ob;default:return(e??"").trim().toLowerCase().includes("skill")?X8:Q8}}const Fx=80;function J8(e,t=Fx){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function eL(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function tL(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 el(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function nL(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 Am(e){return Vt(e.path)??Vt(e.file_path)??Vt(e.filePath)??Vt(e.filename)}const oL=64;function s1(e,t,n=!1){const o=(s,i=Fx)=>n?s.trim():J8(s,i);try{const s=tL(t);if(!n&&eL(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(xl(e)){case"read":{const r=Am(s);if(!r)return i();const l=el(s.offset)??el(s.line_start)??el(s.start_line),a=el(s.limit)??el(s.length),c=el(s.line_end)??el(s.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return o(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=Am(s);return r?o(`${r} ${ba("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=Am(s);return r?o(r):i()}case"bash":{const r=Vt(s.command)??Vt(s.cmd)??Vt(s.script);return r?o(r,oL):i()}case"grep":case"search":{const r=Vt(s.pattern)??Vt(s.query)??Vt(s.regex),l=Vt(s.path)??Vt(s.glob)??Vt(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=Vt(s.pattern)??Vt(s.glob)??Vt(s.query),l=Vt(s.path)??Vt(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):Vt(s.path)?o(Vt(s.path)):i()}case"ls":{const r=Vt(s.path)??Vt(s.dir)??Vt(s.directory)??Vt(s.cwd);return r?o(r):i()}case"web_fetch":{const r=Vt(s.url)??Vt(s.uri);return r?o(nL(r)):i()}case"todo":case"task":{const r=Vt(s.description)??Vt(s.title)??Vt(s.prompt)??Vt(s.name)??Vt(s.subagent_type);if(r)return o(r);const l=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return l?o(ba("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function sL(e){try{switch(xl(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return ba("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const o=n.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),o=t.match(/[-−](\d+)/);if(n||o)return`${n?`+${n[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(e.status!=="error")return ba("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?ba("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const iL=1e6,Rb=5e3;function Db(e){if(e==="")return[];const t=e.split(`
|
|
39
|
-
`);return t.at(-1)===""&&t.pop(),t}function rL(e,t){const n=Db(e),o=Db(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>Rb||i>Rb||(s+1)*(i+1)>iL)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let m=1;m<=s;m++)for(let f=1;f<=i;f++)r[m][f]=n[m-1]===o[f-1]?r[m-1][f-1]+1:Math.max(r[m-1][f],r[m][f-1]);const l=[];let a=s,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===o[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:o[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,h=1;for(const m of l)m.type==="context"?(u.push({type:"context",text:m.text,oldNo:d,newNo:h}),d++,h++):m.type==="add"?(u.push({type:"add",text:m.text,newNo:h}),h++):(u.push({type:"del",text:m.text,oldNo:d}),d++);return u}function lL(e){let t=0,n=0;for(const o of e)o.type==="add"?t++:o.type==="del"&&n++;return{added:t,removed:n}}function Hx(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 Wx(e){const t=xl(e.name);if(t!=="edit"&&t!=="write")return null;const n=Hx(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const o=typeof n.old_string=="string"?n.old_string:void 0,s=typeof n.new_string=="string"?n.new_string:void 0;return o===void 0||s===void 0?null:rL(o,s)}return null}function aL(e){const t=Hx(e);return t&&typeof t.path=="string"?t.path:void 0}function cL(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const uL=["title"],dL=["title"],fL=["src","alt"],hL=["src"],pL=["src"],mL={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"},gL=["points"],vL=["innerHTML"],yL={class:"a"},kL=["title"],bL={class:"rt"},wL=["title"],_L={key:1,class:"chip"},CL={key:2,class:"spin",role:"status","aria-label":"running"},SL={key:4,class:"tm"},xL={key:0,class:"bb"},TL={key:0,class:"bb-summary"},AL={key:1,class:"bb-empty"},ML=!1,EL=Qe({__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,o=t,s=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||s.value),l=ne(n.tool.defaultExpanded===!0&&r.value),a=F(()=>{const A=xl(n.tool.name);return A==="edit"||A==="write"});function c(){if(a.value&&n.toolDiffPanel){o("openToolDiff",n.tool.id);return}r.value&&(l.value=!l.value)}ze(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status,n.tool.name],()=>{n.tool.defaultExpanded===!0&&r.value&&(l.value=!0)});const u=()=>n.tool.status==="error"?"✕":"✓",d=()=>Lf(n.tool.name),h=()=>Z8(n.tool.name),m=()=>s1(n.tool.name,n.tool.arg),f=()=>s1(n.tool.name,n.tool.arg,!0),g=()=>{const A=y.value;if(A&&n.tool.status!=="error"){const{added:$,removed:R}=lL(A);if($||R)return`+${$} −${R}`}return sL({name:n.tool.name,arg:n.tool.arg,output:n.tool.output,timing:n.tool.timing,status:n.tool.status})},_=()=>n.tool.status==="error",w=F(()=>n.tool.status==="ok"?n.tool.media:void 0),y=F(()=>Wx(n.tool)),b=F(()=>n.tool.name==="ExitPlanMode"),v=F(()=>b.value?n.tool.planPath:void 0),x=F(()=>{const A=v.value;return A?A.split(/[\\/]+/).pop()||A:""});function L(){v.value&&o("openFile",{path:v.value})}const N=F(()=>ML);function k(A){return A.split(/[\\/]+/).pop()||A}function T(A){return A<1024?`${A} B`:A<1024*1024?`${(A/1024).toFixed(1)} KB`:`${(A/1024/1024).toFixed(1)} MB`}const E=F(()=>{const A=w.value;if(!A)return"";const $=[A.path?k(A.path):Lf(n.tool.name)];return A.mimeType&&$.push(A.mimeType),A.bytes!==void 0&&$.push(T(A.bytes)),A.dimensions&&$.push(A.dimensions),$.join(" · ")});function O(){const A=w.value;A?.kind==="image"&&o("openMedia",A)}return(A,$)=>w.value?(C(),I("div",{key:0,class:Le(["media-tool",{mob:e.mobile}])},[p("div",{class:"media-title",title:w.value.path||E.value},P(E.value),9,uL),w.value.kind==="image"?(C(),I("button",{key:0,type:"button",class:"media-image-button",title:w.value.path||E.value,onClick:O},[p("img",{class:"media-image",src:w.value.url,alt:w.value.path?k(w.value.path):E.value,loading:"lazy"},null,8,fL)],8,dL)):w.value.kind==="video"?(C(),I("video",{key:1,class:"media-video",src:w.value.url,controls:"",preload:"metadata"},null,8,hL)):(C(),I("audio",{key:2,class:"media-audio",src:w.value.url,controls:""},null,8,pL))],2)):(C(),I("div",{key:1,class:Le(["box",{open:l.value,err:_(),mob:e.mobile,stacked:e.stackPosition!=="single","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[p("div",{class:"bh",onClick:c},[(C(),I("svg",mL,[p("polyline",{points:l.value?"4,6 8,10 12,6":"6,4 10,8 6,12"},null,8,gL)])),h()?(C(),I("span",{key:0,class:"gl",innerHTML:h(),"aria-hidden":"true"},null,8,vL)):se("",!0),p("span",yL,P(d()),1),l.value?se("",!0):(C(),I("span",{key:1,class:"p",title:m()},P(m()),9,kL)),p("span",bL,[N.value?(C(),I("button",{key:0,class:"plan-link",type:"button",title:v.value,onClick:Ze(L,["stop"])},"📄 "+P(x.value),9,wL)):se("",!0),g()?(C(),I("span",_L,P(g()),1)):se("",!0),e.tool.status==="running"?(C(),I("span",CL)):(C(),I("span",{key:3,class:Le(e.tool.status==="ok"?"ok":"er")},P(u()),3)),e.tool.timing&&e.tool.name!=="bash"?(C(),I("span",SL,P(e.tool.timing),1)):se("",!0)])]),l.value?(C(),I("div",xL,[f()?(C(),I("div",TL,P(f()),1)):se("",!0),i.value?se("",!0):(C(),I("div",AL,"Waiting for output…")),(C(!0),I(Oe,null,Xe(e.tool.output??[],(R,D)=>(C(),I("div",{key:D},P(R),1))),128))])):se("",!0)],2))}}),kd=bt(EL,[["__scopeId","data-v-4b9fd75b"]]);var IL=Object.create,Lv=Object.defineProperty,$L=Object.getOwnPropertyDescriptor,Ux=Object.getOwnPropertyNames,NL=Object.getPrototypeOf,LL=Object.prototype.hasOwnProperty,jx=(e,t)=>function(){return t||(0,e[Ux(e)[0]])((t={exports:{}}).exports,t),t.exports},qx=e=>{let t={};for(var n in e)Lv(t,n,{get:e[n],enumerable:!0});return t},PL=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=Ux(t),i=0,r=s.length,l;i<r;i++)l=s[i],!LL.call(e,l)&&l!==n&&Lv(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=$L(t,l))||o.enumerable});return e},zx=(e,t,n)=>(n=e!=null?IL(NL(e)):{},PL(Lv(n,"default",{value:e,enumerable:!0}),e));function OL(e,t,n,o){const s=Number(e[t].meta.id+1).toString();let i="";return typeof o.docId=="string"&&(i=`-${o.docId}-`),i+s}function RL(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function DL(e,t,n,o,s){const i=s.rules.footnote_anchor_name(e,t,n,o,s),r=s.rules.footnote_caption(e,t,n,o,s);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function BL(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 FL(){return`</ol>
|
|
44
|
-
</section>
|
|
45
|
-
`}function HL(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function WL(){return`</li>
|
|
46
|
-
`}function UL(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function jL(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=DL,e.renderer.rules.footnote_block_open=BL,e.renderer.rules.footnote_block_close=FL,e.renderer.rules.footnote_open=HL,e.renderer.rules.footnote_close=WL,e.renderer.rules.footnote_anchor=UL,e.renderer.rules.footnote_caption=RL,e.renderer.rules.footnote_anchor_name=OL;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],h=l.eMarks[a];if(d+4>h||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let m;for(m=d+2;m<h;m++){if(l.src.charCodeAt(m)===32)return!1;if(l.src.charCodeAt(m)===93)break}if(m===d+2||m+1>=h||l.src.charCodeAt(++m)!==58)return!1;if(u)return!0;m++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const f=l.src.slice(d+2,m-2);l.env.footnotes.refs[`:${f}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:f},g.level=l.level++,l.tokens.push(g);const _=l.bMarks[a],w=l.tShift[a],y=l.sCount[a],b=l.parentType,v=m,x=l.sCount[a]+m-(l.bMarks[a]+l.tShift[a]);let L=x;for(;m<h;){const k=l.src.charCodeAt(m);if(n(k))k===9?L+=4-L%4:L++;else break;m++}l.tShift[a]=m-v,l.sCount[a]=L-x,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]=w,l.sCount[a]=y,l.bMarks[a]=_;const N=new l.Token("footnote_reference_close","",-1);return N.level=--l.level,l.tokens.push(N),!0}function s(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,h=t(l,u+1);if(h<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const m=l.env.footnotes.list.length,f=[];l.md.inline.parse(l.src.slice(d,h),l.md,l.env,f);const g=l.push("footnote_ref","",0);g.meta={id:m},l.env.footnotes.list[m]={content:l.src.slice(d,h),tokens:f}}return l.pos=h+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 h=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${h}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let m;l.env.footnotes.refs[`:${h}`]<0?(m=l.env.footnotes.list.length,l.env.footnotes.list[m]={label:h,count:0},l.env.footnotes.refs[`:${h}`]=m):m=l.env.footnotes.refs[`:${h}`];const f=l.env.footnotes.list[m].count;l.env.footnotes.list[m].count++;const g=l.push("footnote_ref","",0);g.meta={id:m,subId:f,label:h}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const h={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(f){return f.type==="footnote_reference_open"?(d=!0,c=[],u=f.meta.label,!1):f.type==="footnote_reference_close"?(d=!1,h[":"+u]=c,!1):(d&&c.push(f),!d)}),!l.env.footnotes.list))return;const m=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let f=0,g=m.length;f<g;f++){const _=new l.Token("footnote_open","",1);if(_.meta={id:f,label:m[f].label},l.tokens.push(_),m[f].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=m[f].tokens,v.content=m[f].content,a.push(v);const x=new l.Token("paragraph_close","p",-1);x.block=!0,a.push(x)}else m[f].label&&(a=h[`:${m[f].label}`]);a&&(l.tokens=l.tokens.concat(a));let w;l.tokens[l.tokens.length-1].type==="paragraph_close"?w=l.tokens.pop():w=null;const y=m[f].count>0?m[f].count:1;for(let b=0;b<y;b++){const v=new l.Token("footnote_anchor","",0);v.meta={id:f,subId:b,label:m[f].label},l.tokens.push(v)}w&&l.tokens.push(w),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",o,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",s),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function qL(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==43)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){let i;const r=[],l=s.length;for(let a=0;a<l;a++){const c=s[a];if(c.marker!==43||c.end===-1)continue;const u=s[c.end];i=o.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=o.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",o.tokens[u.token-1].type==="text"&&o.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<o.tokens.length&&o.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=o.tokens[c],o.tokens[c]=o.tokens[a],o.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(o){const s=o.tokens_meta,i=(o.tokens_meta||[]).length;n(o,o.delimiters);for(let r=0;r<i;r++)s[r]&&s[r].delimiters&&n(o,s[r].delimiters)})}function zL(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==61)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){const i=[],r=s.length;for(let l=0;l<r;l++){const a=s[l];if(a.marker!==61||a.end===-1)continue;const c=s[a.end],u=o.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=o.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",o.tokens[c.token-1].type==="text"&&o.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<o.tokens.length&&o.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=o.tokens[a];o.tokens[a]=o.tokens[l],o.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(o){let s;const i=o.tokens_meta,r=(o.tokens_meta||[]).length;for(n(o,o.delimiters),s=0;s<r;s++)i[s]&&i[s].delimiters&&n(o,i[s].delimiters)})}const VL=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function KL(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==126||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(VL,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function GL(e){e.inline.ruler.after("emphasis","sub",KL)}const YL=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function XL(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==94||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(YL,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function QL(e){e.inline.ruler.after("emphasis","sup",XL)}var ZL=jx({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(g,_){_=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},_),g.core.ruler.after("inline","github-task-lists",function(w){for(var y=w.tokens,b=0,v=2;v<y.length;v++)s(y,v)&&(i(y[v],b,_,w.Token),b+=1,n(y[v-2],"class",_.liClass),n(y[o(y,v-2)],"class",_.ulClass))})};function n(g,_,w){var y=g.attrIndex(_),b=[_,w];y<0?g.attrPush(b):g.attrs[y]=b}function o(g,_){for(var w=g[_].level-1,y=_-1;y>=0;y--)if(g[y].level===w)return y;return-1}function s(g,_){return d(g[_])&&h(g[_-1])&&m(g[_-2])&&f(g[_])}function i(g,_,w,y){var b=w.idPrefix+_;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,w,y)),w.divWrap&&(g.children.unshift(c(w,y)),g.children.push(u(y)))}function r(g,_,w,y){var b=new y("checkbox_input","input",0);return b.attrs=[["type","checkbox"],["id",_]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&b.attrs.push(["checked","true"]),w.disabled===!0&&b.attrs.push(["disabled","true"]),b}function l(g,_){var w=new _("label_open","label",1);return w.attrs=[["for",g]],w}function a(g){return new g("label_close","label",-1)}function c(g,_){var w=new _("checkbox_open","div",0);return w.attrs=[["class",g.divClass]],w}function u(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function h(g){return g.type==="paragraph_open"}function m(g){return g.type==="list_item_open"}function f(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})}),JL=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))),eP=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),Mm;const tP=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]]),nP=(Mm=String.fromCodePoint)!==null&&Mm!==void 0?Mm: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 oP(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=tP.get(e))!==null&&t!==void 0?t:e}var io;(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"})(io||(io={}));const sP=32;var br;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(br||(br={}));function i1(e){return e>=io.ZERO&&e<=io.NINE}function iP(e){return e>=io.UPPER_A&&e<=io.UPPER_F||e>=io.LOWER_A&&e<=io.LOWER_F}function rP(e){return e>=io.UPPER_A&&e<=io.UPPER_Z||e>=io.LOWER_A&&e<=io.LOWER_Z||i1(e)}function lP(e){return e===io.EQUALS||rP(e)}var so;(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"})(so||(so={}));var vr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vr||(vr={}));var aP=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=so.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vr.Strict}startEntity(e){this.decodeMode=e,this.state=so.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case so.EntityStart:return e.charCodeAt(t)===io.NUM?(this.state=so.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=so.NamedEntity,this.stateNamedEntity(e,t));case so.NumericStart:return this.stateNumericStart(e,t);case so.NumericDecimal:return this.stateNumericDecimal(e,t);case so.NumericHex:return this.stateNumericHex(e,t);case so.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|sP)===io.LOWER_X?(this.state=so.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=so.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,o){if(t!==n){const s=n-t;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(t,s),o),this.consumed+=s}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(i1(o)||iP(o))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(i1(o))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===io.SEMI)this.consumed+=1;else if(this.decodeMode===vr.Strict)return 0;return this.emitCodePoint(oP(this.result),this.consumed),this.errors&&(e!==io.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let o=n[this.treeIndex],s=(o&br.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=cP(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===vr.Attribute&&(s===0||lP(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&br.VALUE_LENGTH)>>14,s!==0){if(i===io.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==vr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,o=(n[t]&br.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:o}=this;return this.emitCodePoint(t===1?o[e]&~br.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case so.NamedEntity:return this.result!==0&&(this.decodeMode!==vr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case so.NumericDecimal:return this.emitNumericEntity(0,2);case so.NumericHex:return this.emitNumericEntity(0,3);case so.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case so.EntityStart:return 0}}};function Vx(e){let t="";const n=new aP(e,o=>t+=nP(o));return function(s,i){let r=0,l=0;for(;(l=s.indexOf("&",l))>=0;){t+=s.slice(r,l),n.startEntity(i);const c=n.write(s,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+s.slice(r);return t="",a}}function cP(e,t,n,o){const s=(t&br.BRANCH_LENGTH)>>7,i=t&br.JUMP_TABLE;if(s===0)return i!==0&&o===i?n:-1;if(i){const a=o-i;return a<0||a>=s?-1:e[n+a]-1}let r=n,l=r+s-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<o)r=a+1;else if(c>o)l=a-1;else return e[a+s]}return-1}const uP=Vx(JL);Vx(eP);function Pv(e,t=vr.Legacy){return uP(e,t)}var dP=zx(ZL());const Bb={};function fP(e){let t=Bb[e];if(t)return t;t=Bb[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);t.push(o)}for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);t[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return t}function Rh(e,t){typeof t!="string"&&(t=Rh.defaultChars);const n=fP(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let s="";for(let i=0,r=o.length;i<r;i+=3){const l=parseInt(o.slice(i+1,i+3),16);if(l<128){s+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(o.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?s+="��":s+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?s+="���":s+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16),u=parseInt(o.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}s+="�"}return s})}Rh.defaultChars=";/?:@&=+$,#";Rh.componentChars="";var r1=Rh;const Fb={};function hP(e){let t=Fb[e];if(t)return t;t=Fb[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Dh(e,t,n){typeof t!="string"&&(n=t,t=Dh.defaultChars),typeof n>"u"&&(n=!0);const o=hP(t);let s="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){s+=e.slice(i,i+3),i+=2;continue}if(l<128){s+=o[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}Dh.defaultChars=";/?:@&=+$,-_.!~*'()#";Dh.componentChars="-_.!~*'()";var Kx=Dh;function Ov(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 Pf(){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 pP=/^([a-z0-9.+-]+:)/i,mP=/:[0-9]*$/,gP=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,vP=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
47
|
-
`," "]),yP=["'"].concat(vP),Hb=["%","/","?",";","#"].concat(yP),Wb=["/","?","#"],kP=255,Ub=/^[+a-z0-9A-Z_-]{0,63}$/,bP=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,jb={javascript:!0,"javascript:":!0},qb={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function wP(e,t){if(e&&e instanceof Pf)return e;const n=new Pf;return n.parse(e,t),n}Pf.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=gP.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=pP.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=i.substr(0,2)==="//",s&&!(r&&jb[r])&&(i=i.substr(2),this.slashes=!0)),!jb[r]&&(s||r&&!qb[r])){let c=-1;for(let f=0;f<Wb.length;f++)o=i.indexOf(Wb[f]),o!==-1&&(c===-1||o<c)&&(c=o);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let f=0;f<Hb.length;f++)o=i.indexOf(Hb[f]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const h=i.slice(0,c);i=i.slice(c),this.parseHost(h),this.hostname=this.hostname||"";const m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m){const f=this.hostname.split(/\./);for(let g=0,_=f.length;g<_;g++){const w=f[g];if(w&&!w.match(Ub)){let y="";for(let b=0,v=w.length;b<v;b++)w.charCodeAt(b)>127?y+="x":y+=w[b];if(!y.match(Ub)){const b=f.slice(0,g),v=f.slice(g+1),x=w.match(bP);x&&(b.push(x[1]),v.unshift(x[2])),v.length&&(i=v.join(".")+i),this.hostname=b.join(".");break}}}}this.hostname.length>kP&&(this.hostname=""),m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=i.indexOf("#");l!==-1&&(this.hash=i.substr(l),i=i.slice(0,l));const a=i.indexOf("?");return a!==-1&&(this.search=i.substr(a),i=i.slice(0,a)),i&&(this.pathname=i),qb[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Pf.prototype.parseHost=function(e){let t=mP.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 Rv=wP,Gx=qx({decode:()=>r1,encode:()=>Kx,format:()=>Ov,parse:()=>Rv}),Yx=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Xx=/[\0-\x1F\x7F-\x9F]/,_P=/[\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]/,Qx=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,CP=/[\$\+<->\^`\|~\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]/,Zx=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,SP=qx({Any:()=>Yx,Cc:()=>Xx,Cf:()=>_P,P:()=>Qx,S:()=>CP,Z:()=>Zx}),xP=Object.defineProperty,Jx=e=>{let t={};for(var n in e)xP(t,n,{get:e[n],enumerable:!0});return t},Fn=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,o=t.length;n<o;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),o=[e,t];n<0?this.attrPush(o):this.attrs[n]=o}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},TP=Jx({arrayReplaceAt:()=>LP,assign:()=>$P,countLines:()=>En,escapeHtml:()=>UP,escapeRE:()=>qP,fromCodePoint:()=>au,has:()=>IP,isMdAsciiPunct:()=>Df,isPunctChar:()=>Rf,isPunctCode:()=>l1,isSpace:()=>NP,isString:()=>MP,isValidEntityCode:()=>Fh,isWhiteSpace:()=>lu,lib:()=>zP,mdurl:()=>Gx,normalizeReference:()=>Bh,ucmicro:()=>Of,unescapeAll:()=>cu,unescapeMd:()=>DP});const Of=SP;function AP(e){return Object.prototype.toString.call(e)}function MP(e){return AP(e)==="[object String]"}const EP=Object.prototype.hasOwnProperty;function IP(e,t){return EP.call(e,t)}function $P(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(o=>{e[o]=n[o]})}}),e}function NP(e){return e===9||e===32}function lu(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 Rf(e){return Of.P.test(e)||Of.S.test(e)}const zb=new Map;function l1(e){if(Df(e))return!0;const t=zb.get(e);if(t!==void 0)return t;const n=Rf(String.fromCharCode(e));return zb.set(e,n),n}function Df(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 Bh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function LP(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Fh(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 au(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 eT=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,PP=new RegExp(`${eT.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),OP=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function RP(e,t){if(t.charCodeAt(0)===35&&OP.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Fh(o)?au(o):e}const n=Pv(e);return n!==e?n:e}function DP(e){return e.includes("\\")?e.replace(eT,"$1"):e}function cu(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(PP,(t,n,o)=>n||RP(t,o))}const BP=/[&<>"]/,FP=/[&<>"]/g,HP={"&":"&","<":"<",">":">",'"':"""};function WP(e){return HP[e]}function UP(e){return BP.test(e)?e.replace(FP,WP):e}const jP=/[.?*+^$[\]\\(){}|-]/g;function qP(e){return e.replace(jP,"\\$&")}const zP={mdurl:Gx,ucmicro:Of};function En(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
48
|
-
`,n+1))!==-1;)t++;return t}const VP=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,KP=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,GP=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,Dv=["references","footnotes","abbreviations","abbr","abbrs"],Bv=Symbol.for("markdown-it-ts.global-state"),Fv=Object.prototype.hasOwnProperty;function Vb(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Gs(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function xr(e){if(Array.isArray(e))return e.map(t=>xr(t));if(Gs(e)){const t={};for(const n of Object.keys(e))t[n]=xr(e[n]);return t}return e}function Bf(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Gs(e)?Object.keys(e):[]}function a1(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(!a1(e[n],t[n]))return!1;return!0}if(Gs(e)||Gs(t)){if(!Gs(e)||!Gs(t))return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const s of n)if(!Fv.call(t,s)||!a1(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function tT(e,t){if(Array.isArray(e))return e[Number(t)];if(Gs(e))return e[t]}function YP(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=xr(t[n]);return e}if(Gs(e)&&Gs(t)){for(const n of Object.keys(e))Fv.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=xr(t[n]);return e}return xr(t)}function XP(e,t,n){const o=n.ownedKeys??[],s=e[t];if(Gs(s)||Array.isArray(s)){const i=new Set(Bf(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=xr(tT(n.value,r)):delete s[r];!n.existed&&Bf(s).length===0&&delete e[t];return}n.existed?e[t]=xr(n.value):delete e[t]}function Hv(e){const t=e[Bv];return Vb(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Vb(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function QP(e,t){Object.defineProperty(e,Bv,{value:t,enumerable:!1,configurable:!0,writable:!0})}function jo(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:VP.test(e)?"footnote-definition":KP.test(e)?"abbreviation-definition":GP.test(e)?"reference-definition":null}function Au(e){return Hv(e)?.reason??null}function wa(e,t,n){if(Au(e)&&zi(e),!t)return n();Wv(e,t);try{const o=n();return Uv(e),o}catch(o){throw zi(e),o}}function Wv(e,t){try{zi(e);const n={};for(const o of Dv)n[o]=Fv.call(e,o)?{existed:!0,value:xr(e[o])}:{existed:!1};QP(e,{reason:t,snapshot:n})}catch{}}function Uv(e){const t=Hv(e);if(t)for(const n of Dv){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!Gs(s)&&!Array.isArray(s))continue;const i=new Set(Bf(o.existed?o.value:void 0));o.ownedKeys=Bf(s).filter(r=>i.has(r)?!a1(s[r],tT(o.value,r)):!0)}}function zi(e){const t=Hv(e);if(t){for(const n of Dv){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){XP(e,n,o);continue}o.existed?e[n]=YP(e[n],o.value):delete e[n]}delete e[Bv]}}const c1=Symbol.for("markdown-it-ts.diagnostics");function Hh(e,t){if(e)try{const n=e[c1];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[c1]=o,o}catch{return}}function Ei(e){return Hh(e,!1)}function ZP(e){if(e)try{const t=e[c1];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function Ao(e){ZP(e)}function Dn(e,t){const n=Hh(e,!0);n&&(n.strategy=t)}function Em(e,t){const n=Hh(e,!0);n&&(n.chunk=t)}function nT(e,t){const n=Hh(e,!0);n&&(n.unbounded=t)}function JP(e){const t={};e=e||{},t.src_Any=Yx.source,t.src_Cc=Xx.source,t.src_Z=Zx.source,t.src_P=Qx.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 u1(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Wh(e){return Object.prototype.toString.call(e)}function eO(e){return Wh(e)==="[object String]"}function tO(e){return Wh(e)==="[object Object]"}function nO(e){return Wh(e)==="[object RegExp]"}function Kb(e){return Wh(e)==="[object Function]"}function oO(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const oT={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function sO(e){return Object.keys(e||{}).reduce(function(t,n){return t||oT.hasOwnProperty(n)},!1)}const iO={"http:":{validate:function(e,t,n){const o=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},rO="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]",lO="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function aO(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function Gb(){return function(e,t){t.normalize(e)}}function Ff(e){const t=e.re=JP(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(rO),n.push(t.src_xn),t.src_tlds=n.join("|");function o(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(o(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(o(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(o(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const s=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,tO(a)){nO(a.validate)?c.validate=aO(a.validate):Kb(a.validate)?c.validate=a.validate:i(l,a),Kb(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Gb();return}if(eO(a)){s.push(l);return}i(l,a)}),s.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:Gb()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(oO).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function sT(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}function ks(e,t){if(!(this instanceof ks))return new ks(e,t);t||sO(e)&&(t=e,e={}),this.__opts__=u1({},oT,t),this.__schemas__=u1({},iO,e),this.__compiled__={},this.__tlds__=lO,this.__tlds_replaced__=!1,this.re={},Ff(this)}ks.prototype.add=function(t,n){return this.__schemas__[t]=n,Ff(this),this};ks.prototype.set=function(t){return this.__opts__=u1(this.__opts__,t),this};ks.prototype.test=function(t){if(!t.length)return!1;let n,o;if(this.re.schema_test.test(t)){for(o=this.re.schema_search,o.lastIndex=0;(n=o.exec(t))!==null;)if(this.testSchemaAt(t,n[2],o.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};ks.prototype.pretest=function(t){return this.re.pretest.test(t)};ks.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};ks.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(h,m){return h?m?h.index!==m.index?h.index<m.index?h:m:h.lastIndex>=m.lastIndex?h:m:h:m}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const h=[o[u[0]],i[u[1]],s[u[2]]],m=c(c(h[0],h[1]),h[2]);if(!m)break;if(m===h[0]?u[0]++:m===h[1]?u[1]++:u[2]++,m.index<d)continue;const f=new sT(t,m.schema,m.index,m.lastIndex);this.__compiled__[f.schema].normalize(f,this),n.push(f),d=m.lastIndex}return n.length?n:null};ks.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);if(!o)return null;const s=new sT(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};ks.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,s,i){return o!==i[s-1]}).reverse(),Ff(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Ff(this),this)};ks.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ks.prototype.onCompile=function(){};var iT=ks,cO=jx({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,h=/[^\0-\x7F]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,_=Math.floor,w=String.fromCharCode;function y(D){throw new RangeError(f[D])}function b(D,W){const V=[];let U=D.length;for(;U--;)V[U]=W(D[U]);return V}function v(D,W){const V=D.split("@");let U="";V.length>1&&(U=V[0]+"@",D=V[1]),D=D.replace(m,".");const ee=b(D.split("."),W).join(".");return U+ee}function x(D){const W=[];let V=0;const U=D.length;for(;V<U;){const ee=D.charCodeAt(V++);if(ee>=55296&&ee<=56319&&V<U){const K=D.charCodeAt(V++);(K&64512)==56320?W.push(((ee&1023)<<10)+(K&1023)+65536):(W.push(ee),V--)}else W.push(ee)}return W}const L=D=>String.fromCodePoint(...D),N=function(D){return D>=48&&D<58?26+(D-48):D>=65&&D<91?D-65:D>=97&&D<123?D-97:36},k=function(D,W){return D+22+75*(D<26)-((W!=0)<<5)},T=function(D,W,V){let U=0;for(D=V?_(D/700):D>>1,D+=_(D/W);D>g*26>>1;U+=36)D=_(D/g);return _(U+(g+1)*D/(D+38))},E=function(D){const W=[],V=D.length;let U=0,ee=128,K=72,G=D.lastIndexOf("-");G<0&&(G=0);for(let X=0;X<G;++X)D.charCodeAt(X)>=128&&y("not-basic"),W.push(D.charCodeAt(X));for(let X=G>0?G+1:0;X<V;){const ke=U;for(let He=1,ue=36;;ue+=36){X>=V&&y("invalid-input");const ve=N(D.charCodeAt(X++));ve>=36&&y("invalid-input"),ve>_((2147483647-U)/He)&&y("overflow"),U+=ve*He;const Pe=ue<=K?1:ue>=K+26?26:ue-K;if(ve<Pe)break;const Re=36-Pe;He>_(2147483647/Re)&&y("overflow"),He*=Re}const le=W.length+1;K=T(U-ke,le,ke==0),_(U/le)>2147483647-ee&&y("overflow"),ee+=_(U/le),U%=le,W.splice(U++,0,ee)}return String.fromCodePoint(...W)},O=function(D){const W=[];D=x(D);const V=D.length;let U=128,ee=0,K=72;for(const ke of D)ke<128&&W.push(w(ke));const G=W.length;let X=G;for(G&&W.push("-");X<V;){let ke=2147483647;for(const He of D)He>=U&&He<ke&&(ke=He);const le=X+1;ke-U>_((2147483647-ee)/le)&&y("overflow"),ee+=(ke-U)*le,U=ke;for(const He of D)if(He<U&&++ee>2147483647&&y("overflow"),He===U){let ue=ee;for(let ve=36;;ve+=36){const Pe=ve<=K?1:ve>=K+26?26:ve-K;if(ue<Pe)break;const Re=ue-Pe,Q=36-Pe;W.push(w(k(Pe+Re%Q,0))),ue=_(Re/Q)}W.push(w(k(ue,0))),K=T(ee,le,X===G),ee=0,++X}++ee,++U}return W.join("")},R={version:"2.3.1",ucs2:{decode:x,encode:L},decode:E,encode:O,toASCII:function(D){return v(D,function(W){return h.test(W)?"xn--"+O(W):W})},toUnicode:function(D){return v(D,function(W){return d.test(W)?E(W.slice(4).toLowerCase()):W})}};t.exports=R})}),rT=zx(cO());function jv(e,t,n){let o,s=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){for(s++;s<n;){if(o=e.charCodeAt(s),o===10||o===60)return i;if(o===62)return i.pos=s+1,i.str=cu(e.slice(t+1,s)),i.ok=!0,i;if(o===92&&s+1<n){s+=2;continue}s++}return i}let r=0;for(;s<n&&(o=e.charCodeAt(s),!(o===32||o<32||o===127));){if(o===92&&s+1<n){if(e.charCodeAt(s+1)===32)break;s+=2;continue}if(o===40&&(r++,r>32))return i;if(o===41){if(r===0)break;r--}s++}return t===s||r!==0||(i.str=cu(e.slice(t,s)),i.pos=s,i.ok=!0),i}var lT=jv;const zd=-2;function uO(e,t,n,o){let s=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(s--,s===0)return i;if(o){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return zd}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return zd;if(r===91){s++,i++;continue}i++}return-1}function qv(e,t,n){let o=1,s=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const h=uO(l,t,a,n);if(h!==zd)return h;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=c,-1}}let m=-1;return s&&(m=e.pos),e.pos=c,m}var Hf=qv;function zv(e,t,n,o){let s,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)r.str=o.str,r.marker=o.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(s=e.charCodeAt(i),s===r.marker)return r.pos=i+1,r.str+=cu(e.slice(t,i)),r.ok=!0,r;if(s===40&&r.marker===41)return r;s===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=cu(e.slice(t,i)),r}var aT=zv;function Uh(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 Vv(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function dO(e,t,n){const o=Uh(e,t),s=[t,n];o<0?Vv(e,s):e.attrs[o]=s}function fO(e,t){const n=Uh(e,t);return n>=0?e.attrs[n][1]:null}function hO(e,t,n){const o=Uh(e,t);o<0?Vv(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var pO=Jx({attrGet:()=>fO,attrIndex:()=>Uh,attrJoin:()=>hO,attrPush:()=>Vv,attrSet:()=>dO,parseLinkDestination:()=>jv,parseLinkLabel:()=>qv,parseLinkTitle:()=>zv});function mO(e){return e.includes("\r")||e.includes("\0")}function cT(e){return typeof e=="string"?e:e.toString()}function gO(e){if(e.inlineMode){const t=new Fn("inline","",0);t.content=cT(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 vO=/^([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])?)*)$/,yO=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function kO(e,t){let n=e.pos;const o=e.src;if(o.charCodeAt(n)!==60)return!1;const s=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=o.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=o.slice(s+1,n);if(yO.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(vO.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 bO=kO;function wO(e,t){const n=e.src;let o=e.pos;if(n.charCodeAt(o)!==96)return!1;const s=o;o++;const i=e.posMax;for(;o<i&&n.charCodeAt(o)===96;)o++;const r=n.slice(s,o),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=s)return t||(e.pending+=r),e.pos+=l,!0;let a=o,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let h=n.slice(o,c);h.includes(`
|
|
49
|
-
`)&&(h=h.replace(/\n/g," ")),h.length>2&&h.charCodeAt(0)===32&&h.charCodeAt(h.length-1)===32&&(h=h.slice(1,-1)),d.content=h}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var _O=wO;function Yb(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[o].marker!==l.marker||s!==l.token-1)&&(o=r),s=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=o-i[o]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let h=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(h=!0),!h){const m=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+m,i[c]=m,l.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function CO(e){const t=e.tokens_meta,n=e.tokens_meta.length;Yb(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Yb(t[o].delimiters)}var SO=CO;function xO(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==95&&o!==42)return!1;const s=e.scanDelims(e.pos,o===42);if(!s||s.length===0)return!1;for(let i=0;i<s.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return e.pos+=s.length,!0}function Xb(e,t){const n=t.length;for(let o=n-1;o>=0;o--){const s=t[o];if(s.marker!==95&&s.marker!==42||s.end===-1)continue;const i=t[s.end],r=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===s.marker&&t[o-1].token===s.token-1&&t[s.end+1].token===i.token+1,l=String.fromCharCode(s.marker),a=e.tokens[s.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[o-1].token].content="",e.tokens[t[s.end+1].token].content="",o--)}}function TO(e){const t=e.tokens_meta,n=e.tokens_meta.length;Xb(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Xb(e,t[o].delimiters)}const Qb={tokenize:xO,postProcess:TO};function uT(e){return Pv(e)}function Kv(e){return e>=48&&e<=57}function AO(e){const t=e|32;return Kv(e)||t>=97&&t<=102}function dT(e){const t=e|32;return t>=97&&t<=122}function MO(e){return dT(e)||Kv(e)}function EO(e,t,n){let o=t+2;if(o>=n)return null;let s=!1,i=7,r=o;for((e.charCodeAt(o)|32)===120&&(s=!0,i=6,o++,r=o);o<n&&o-r<i;){const l=e.charCodeAt(o);if(!(s?AO(l):Kv(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function IO(e,t,n){let o=t+1;if(o>=n||!dT(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&MO(e.charCodeAt(o));)o++;if(o-t-1<2||o>=n||e.charCodeAt(o)!==59)return null;const s=e.slice(t,o+1);return uT(s)!==s?s:null}function $O(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const s=EO(e.src,n,o);if(s){if(!t){const i=(s.charCodeAt(2)|32)===120?Number.parseInt(s.slice(3,-1),16):Number.parseInt(s.slice(2,-1),10),r=e.push("text_special","",0);r.content=Fh(i)?au(i):au(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=IO(e.src,n,o);if(s){const i=uT(s);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var NO=$O;const fT=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),d1=new Array(128),hT=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);d1[e]=`\\${t}`,hT[e]=fT[e]?t:d1[e]}function Zb(e,t,n){e.pending&&e.pushPending();const o=new Fn("text_special","",0);o.level=e.level,o.content=t,o.markup=n,o.info="escape",e.pendingLevel=e.level,e.tokens.push(o),e.tokens_meta.push(null)}function LO(e,t){let n=e.pos;const o=e.posMax,s=e.src;if(s.charCodeAt(n)!==92||(n++,n>=o))return!1;let i=s.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(i=s.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(Zb(e,hT[i],d1[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=s.charAt(n);if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=s.charAt(n+1),n++)}const l=`\\${r}`;return Zb(e,i<256&&fT[i]?r:l,l),e.pos=n+1,!0}var PO=LO;function OO(e){let t,n,o=0;const s=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=s[t];r&&(r.nesting&&r.nesting<0&&o--,r.level=o,r.nesting&&r.nesting>0&&o++,r.type==="text"&&t+1<i&&s[t+1]?.type==="text"?s[t+1].content=r.content+s[t+1].content:(t!==n&&(s[n]=r),n++))}t!==n&&(s.length=n)}var RO=OO;const pT=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,mT="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",DO=new RegExp(`^(?:${pT}|${mT}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),BO=new RegExp(`^(?:${pT}|${mT})`);function gT(e){return e===32||e===9||e===10||e===12||e===13}function FO(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||gT(t)}function HO(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(!gT(n))return!1}return!1}function WO(e){const t=e|32;return t>=97&&t<=122}function UO(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos,s=e.src;if(s.charCodeAt(o)!==60||o+2>=n)return!1;const i=s.charCodeAt(o+1);if(i!==33&&i!==63&&i!==47&&!WO(i))return!1;const r=s.slice(o).match(DO);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,FO(l)&&e.linkLevel++,HO(l)&&e.linkLevel--}return e.pos+=l.length,!0}var jO=UO;function qO(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const m=e.pos+2,f=Hf(e,e.pos+1,!1);if(f<0)return!1;if(i=f+1,i<h&&e.src.charCodeAt(i)===40){for(i++;i<h&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=h)return!1;if(l=lT(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<h&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=aT(e.src,i,e.posMax),i<h&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<h&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=h||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<h&&e.src.charCodeAt(i)===91?(c=i+1,i=Hf(e,i),i>=0?s=e.src.slice(c,i++):i=f+1):i=f+1,s||(s=e.src.slice(m,f)),r=e.env.references[Bh(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(m,f);const g=[];e.md.inline.parse(o,e.md,e.env,g);const _=e.push("image","img",0);_.attrs=[["src",u],["alt",""]],_.children=g,_.content=o,a&&_.attrs.push(["title",a])}return e.pos=i,e.posMax=h,!0}var zO=qO;function VO(e,t){let n,o,s,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,h=e.pos+1,m=Hf(e,e.pos,!0);if(m<0)return!1;let f=m+1;if(f<d&&e.src.charCodeAt(f)===40){for(c=!1,f++;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(f>=d)return!1;if(s=lT(e.src,f,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?f=s.pos:r="",a=f;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(s=aT(e.src,f,e.posMax),f<d&&a!==f&&s.ok)for(l=s.str,f=s.pos;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);}(f>=d||e.src.charCodeAt(f)!==41)&&(c=!0),f++}if(c){if(typeof e.env.references>"u")return!1;if(f<d&&e.src.charCodeAt(f)===91?(a=f+1,f=Hf(e,f),f>=0?o=e.src.slice(a,f++):f=m+1):f=m+1,o||(o=e.src.slice(h,m)),i=e.env.references[Bh(o)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=h,e.posMax=m;const g=e.push("link_open","a",1),_=[["href",r]];g.attrs=_,l&&_.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=d,!0}var KO=VO;function vT(e){const t=e|32;return t>=97&&t<=122}function GO(e){return e>=48&&e<=57}function YO(e){return vT(e)||GO(e)||e===43||e===45||e===46}function XO(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&YO(e.charCodeAt(t));)t--;return t++,t>=e.length||!vT(e.charCodeAt(t))?null:e.slice(t)}function QO(e,t,n){let o=t;for(;o<n;){const s=e.charCodeAt(o);if(s<=32||s===127||s===60)break;o++}return e.slice(t,o)}function ZO(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=XO(e.pending);if(!s)return!1;const i=QO(e.src,n-s.length,o),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=s.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const h=e.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return e.pos+=l.length-s.length,!0}function JO(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,s=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<s;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var eR=JO;function tR(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const s=e.scanDelims(e.pos,!0);if(!s)return!1;let i=s.length;const r=String.fromCharCode(o);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:o,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}function Jb(e,t){let n;const o=[],s=t.length;for(let i=0;i<s;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&o.push(l.token-1)}for(;o.length;){const i=o.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function nR(e){const t=e.delimiters;Jb(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&Jb(e,n[o].delimiters)}const ew={tokenize:tR,postProcess:nR};function tw(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 oR(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||tw(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!tw(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var sR=oR;function Gv(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function iR(e){if(e.length===0)return 0;const t=e.slice().sort((o,s)=>o-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function rR(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 yT(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,o={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:Gv(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function _a(e,t,n,o,s,i){const r=yT(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=rR(t,n));a.calls++,a.inclusiveMs+=o,o>a.maxMs&&(a.maxMs=o),a.samples.push(o),i?(a.silentCalls++,s&&a.silentHits++):(a.normalCalls++,s&&a.normalHits++),s&&a.hits++,r.completedAt=Gv()}function lR(e){const t=yT(e);if(!t)return null;const n=Object.keys(t.records);for(let o=0;o<n.length;o++){const s=t.records[n[o]];s.medianMs=iR(s.samples)}return t.completedAt=Gv(),t}var nw=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const o=this.rules.findIndex(s=>s.name===e);o>=0&&this.rules.splice(o,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const o=this.rules.findIndex(s=>s.name===e);if(t===void 0){if(o<0)return;const s=this.rules[o];return Object.freeze({name:s.name,fn:s.fn,alt:s.alt?Object.freeze(s.alt.slice()):void 0,enabled:s.enabled})}if(o<0)throw new Error(`Parser rule not found: ${e}`);this.rules[o].fn=t,n?.alt!==void 0&&(this.rules[o].alt=n.alt),this.invalidateCache()}before(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s+1,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const o of this.rules)if(o.enabled&&o.alt)for(const s of o.alt)e.add(s);const t=new Map,n=new Map;for(const o of e){const s=[],i=[];for(const r of this.rules)r.enabled&&(o!==""&&!r.alt?.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(o,s),n.set(o,i)}this.cache=t,this.namedCache=n}},kT=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,this.tokens_meta=new Array(o.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Fn("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 Fn(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const o=new Fn(e,t,n);let s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(s),o}scanDelims(e,t){const{src:n,posMax:o}=this,s=n.charCodeAt(e);let i=e;for(;i<o&&n.charCodeAt(i)===s;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<o?n.charCodeAt(i):32,c=lu(l),u=lu(a),d=l1(l),h=l1(a),m=!u&&(!h||c||d),f=!c&&(!d||u||h);return{can_open:m&&(t||!f||d),can_close:f&&(t||!m||h),length:r}}};kT.prototype.Token=Fn;const aR=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function bT(e){return!aR.test(e)}var cR=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new nw,this.ruler2=new nw,this.ruler.push("text",sR),this.ruler.push("linkify",ZO),this.ruler.push("newline",eR),this.ruler.push("escape",PO),this.ruler.push("backticks",_O),this.ruler.push("strikethrough",ew.tokenize),this.ruler.push("emphasis",Qb.tokenize),this.ruler.push("link",KO),this.ruler.push("image",zO),this.ruler.push("autolink",bO),this.ruler.push("html_inline",jO),this.ruler.push("entity",NO),this.ruler2.push("balance_pairs",SO),this.ruler2.push("strikethrough",ew.postProcess),this.ruler2.push("emphasis",Qb.postProcess),this.ruler2.push("fragments_join",RO),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),o=n.length,s=e.cache,i=s[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<o;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(_a(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<o;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,s[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,o=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const s=this.ruler.getNamedRules("");for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=s[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(_a(e.env,"inline",s[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,o){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&bT(e)){const a=new Fn("text","",0);a.content=e,o.push(a);return}const s=new kT(e,t,n,o);this.tokenize(s);const i=this.getRules2(),r=i.length;if(!(s.env&&(Object.prototype.hasOwnProperty.call(s.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(s.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](s,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(s,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();_a(s.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,o){this.parseSource(e,t,n,o)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function uR(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let o=0,s=t.length;o<s;o++){const i=t[o];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&bT(i.content)){const r=new Fn("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const dR=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,fR=/[0-9a-z]/i;function hR(e){return/^<a[>\s]/i.test(e)}function pR(e){return/^<\/a\s*>/i.test(e)}function mR(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const o=t.raw[n-1],s=t.raw[n];if(!dR.test(o)||!fR.test(s))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function gR(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const o=t[n];if(o.type!=="inline"||!e.md.linkify.pretest(o.content))continue;let s=o.children;s||(s=[],o.children=s);let i=0;for(let r=s.length-1;r>=0;r--){const l=s[r];if(l.type==="link_close"){for(r--;r>=0&&s[r].level!==l.level&&s[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(hR(l.content)&&i>0&&i--,pR(l.content)&&i++),i>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let c=(e.md.linkify.match(a)||[]).map(m=>mR(e.md.linkify,m));if(c.length===0)continue;const u=[];let d=l.level,h=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let m=0;m<c.length;m++){const f=c[m],g=e.md.normalizeLink(f.url);if(!e.md.validateLink(g))continue;let _=f.text;f.schema?f.schema==="mailto:"&&!/^mailto:/i.test(_)?_=e.md.normalizeLinkText(`mailto:${_}`).replace(/^mailto:/,""):_=e.md.normalizeLinkText(_):_=e.md.normalizeLinkText(`http://${_}`).replace(/^http:\/\//,"");const w=f.index;if(w>h){const x=new Fn("text","",0);x.content=a.slice(h,w),x.level=d,u.push(x)}const y=new Fn("link_open","a",1);y.attrs=[["href",g]],y.level=d++,y.markup="linkify",y.info="auto",u.push(y);const b=new Fn("text","",0);b.content=_,b.level=d,u.push(b);const v=new Fn("link_close","a",-1);v.level=--d,v.markup="linkify",v.info="auto",u.push(v),h=f.lastIndex}if(h!==0){if(h<a.length){const m=new Fn("text","",0);m.content=a.slice(h),m.level=d,u.push(m)}s.splice(r,1,...u)}}}}const vR=/\r\n?|\n/g,yR=/\0/g;function kR(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),o=t.includes("\0");if(!n&&!o)return;let s=t;n&&(s=s.replace(vR,`
|
|
50
|
-
`)),o&&(s=s.replace(yR,"�")),e.src=s}const wT=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,bR=/\((?:c|tm|r)\)/i,wR=/\((c|tm|r)\)/gi,_R={c:"©",r:"®",tm:"™"};function CR(e,t){return _R[t.toLowerCase()]}function SR(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(wR,CR)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function xR(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&wT.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function TR(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=n.content||(Array.isArray(n.children)?n.children.map(s=>s.type==="text"?s.content:"").join(""):"");bR.test(o)&&SR(n.children||[]),wT.test(o)&&xR(n.children||[])}}var AR=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(o=>o.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(o=>o.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const MR=/['"]/,ow=/['"]/g,sw="’";function bd(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function ER(e,t){let n;const o=[],s=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=o.length-1;n>=0&&!(o[n].level<=l);n--);if(o.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){ow.lastIndex=c;const d=ow.exec(a);if(!d)break;let h=!0,m=!0;c=d.index+1;const f=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 _=32;if(c<u)_=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){_=e[n].content.charCodeAt(0);break}const w=Df(g)||Rf(String.fromCharCode(g)),y=Df(_)||Rf(String.fromCharCode(_)),b=lu(g),v=lu(_);if(v?h=!1:y&&(b||w||(h=!1)),b?m=!1:w&&(v||y||(m=!1)),_===34&&d[0]==='"'&&g>=48&&g<=57&&(m=h=!1),h&&m&&(h=w,m=y),!h&&!m){f&&(r.content=bd(r.content,d.index,sw));continue}if(m)for(n=o.length-1;n>=0;n--){let x=o[n];if(o[n].level<l)break;if(x.single===f&&o[n].level===l){x=o[n];let L,N;f?(L=s[2]||"‘",N=s[3]||"’"):(L=s[0]||"“",N=s[1]||"”"),r.content=bd(r.content,d.index,N),e[x.token].content=bd(e[x.token].content,x.pos,L),c+=N.length-1,x.token===i&&(c+=L.length-1),a=r.content,u=a.length,o.length=n;continue e}}h?o.push({token:i,pos:d.index,single:f,level:l}):m&&f&&(r.content=bd(r.content,d.index,sw))}}}function IR(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=typeof n.content=="string"?n.content:(n.children||[]).map(s=>s.content||"").join("");!MR.test(o)||!n.children||ER(n.children,e)}}function $R(e){const t=e.tokens||[],n=t.length;for(let o=0;o<n;o++){const s=t[o];if(s.type!=="inline"||!Array.isArray(s.children))continue;const i=s.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const NR=/^(?:vbscript|javascript|file|data):/,LR=/^data:image\/(?:gif|png|jpeg|webp);/,_T=["http:","https:","mailto:"];function CT(e){const t=e.trim().toLowerCase();return NR.test(t)?LR.test(t):!0}function ST(e){const t=Rv(e,!0);if(t.hostname&&(!t.protocol||_T.includes(t.protocol)))try{t.hostname=rT.default.toASCII(t.hostname)}catch{}return Kx(Ov(t))}function xT(e){const t=Rv(e,!0);if(t.hostname&&(!t.protocol||_T.includes(t.protocol)))try{t.hostname=rT.default.toUnicode(t.hostname)}catch{}return r1(Ov(t),`${r1.defaultChars}%`)}function PR(e){switch(e){case 9:case 32:return!0}return!1}function OR(e,t,n,o){const s=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const h=e.lineMax;if(a[t]-e.blkIndent>=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const m=[],f=[],g=[],_=[],w=e.md.block.ruler.getRulesForState(e,"blockquote"),y=e.parentType;e.parentType="blockquote";let b=!1,v;for(v=t;v<n;v++){const T=a[v]<e.blkIndent;if(u=i[v]+l[v],d=r[v],u>=d)break;if(s.charCodeAt(u++)===62&&!T){let O=a[v]+1,A,$;s.charCodeAt(u)===32?(u++,O++,$=!1,A=!0):s.charCodeAt(u)===9?(A=!0,(c[v]+O)%4===3?(u++,O++,$=!1):$=!0):A=!1;let R=O;for(m.push(i[v]),i[v]=u;u<d;){const D=s.charCodeAt(u);if(PR(D))D===9?R+=4-(R+c[v]+($?1:0))%4:R++;else break;u++}b=u>=d,f.push(c[v]),c[v]=a[v]+1+(A?1:0),g.push(a[v]),a[v]=R-O,_.push(l[v]),l[v]=u-i[v];continue}if(b)break;let E=!1;for(let O=0,A=w.length;O<A;O++)if(w[O](e,v,n,!0)){E=!0;break}if(E){e.lineMax=v,e.blkIndent!==0&&(m.push(i[v]),f.push(c[v]),_.push(l[v]),g.push(a[v]),a[v]-=e.blkIndent);break}m.push(i[v]),f.push(c[v]),_.push(l[v]),g.push(a[v]),a[v]=-1}const x=e.blkIndent;e.blkIndent=0;const L=e.push("blockquote_open","blockquote",1);L.markup=">";const N=[t,0];L.map=N,e.md.block.tokenize(e,t,v);const k=e.push("blockquote_close","blockquote",-1);k.markup=">",e.lineMax=h,e.parentType=y,N[1]=e.line;for(let T=0;T<_.length;T++)i[T+t]=m[T],l[T+t]=_[T],a[T+t]=g[T],c[T+t]=f[T];return e.blkIndent=x,!0}function RR(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,s=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,s=o;continue}break}e.line=s;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,s,4+e.blkIndent,!1)}
|
|
51
|
-
`,i.map=[t,e.line],!0}function DR(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,h=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-l<a)&&(s=e.skipSpaces(s),!(s<i)))){h=!0;break}a=e.sCount[t],e.line=d+(h?1:0);const m=e.push("fence","code",0);return m.info=u,m.content=e.getLines(t+1,d,a,!0),m.markup=c,m.map=[t,e.line],!0}const iw=["","h1","h2","h3","h4","h5","h6"],rw=["","#","##","###","####","#####","######"];function lw(e){switch(e){case 9:case 32:return!0}return!1}function BR(e,t,n,o){const s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=s.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=s.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=s.charCodeAt(++a);if(d>6||a<c&&!lw(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const h=e.skipCharsBack(c,35,a);h>a&&lw(s.charCodeAt(h-1))&&(c=h),e.line=t+1;const m=e.push("heading_open",iw[d],1);m.markup=rw[d],m.map=[t,e.line];const f=e.push("inline","",0);f.content=s.slice(a,c).trim(),f.map=[t,e.line],f.children=[];const g=e.push("heading_close",iw[d],-1);return g.markup=rw[d],!0}function FR(e){switch(e){case 9:case 32:return!0}return!1}function HR(e,t,n,o){const s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<s;){const c=e.src.charCodeAt(i++);if(c!==r&&!FR(c))return!1;c===r&&l++}if(l<3)return!1;if(o)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const Gl=[[/^<(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(`${BO.source}\\s*$`),/^$/,!1]];function WR(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,i),l=0;for(;l<Gl.length&&!Gl[l][0].test(r);l++);if(l===Gl.length)return!1;if(o)return Gl[l][2];let a=t+1;if(!Gl[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(s=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(s,i),Gl[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 aw(e){switch(e){case 9:case 32:return!0}return!1}const Lc={Pipe:1,ParagraphTerminator:2};function UR(e){switch(e){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 124:case 126:return!0}return e>=48&&e<=57}var TT=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=s.length;u<d;u++){const h=s.charCodeAt(u);if(h===124&&(c|=Lc.Pipe|Lc.ParagraphTerminator),!a)if(aw(h)){i++,h===9?r+=4-r%4:r++;continue}else a=!0,UR(h)&&(c|=Lc.ParagraphTerminator);(h===10||u===d-1)&&(h!==10&&u++,this.bMarks.push(l),this.eMarks.push(u),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),this.lineFlags.push(c),a=!1,i=0,r=0,c=0,l=u+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineFlags.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const s=new Fn(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new Fn(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,o=this.eMarks;for(let s=this.lineMax;e<s&&!(t[e]+n[e]<o[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const o=t.charCodeAt(e);if(o!==9&&o!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const o=n.charCodeAt(--e);if(o!==9&&o!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let o=n.length;e<o&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const o=this.src;for(;e>n;)if(t!==o.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let h=d;const m=o?this.eMarks[u]+1:this.eMarks[u];let f=0;const g=this.src,_=this.bsCount,w=this.tShift;for(;h<m&&f<n;){const y=g.charCodeAt(h);if(y===9||y===32)y===9?f+=4-(f+_[u])%4:f++;else if(h-d<w[u])f++;else break;h++}return f>n?new Array(f-n+1).join(" ")+g.slice(h,m):g.slice(h,m)}const s=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let h=0;const m=r[d];let f=m,g;for(d+1<t||o?g=l[d]+1:g=l[d];f<g&&h<n;){const _=i.charCodeAt(f);if(aw(_))_===9?h+=4-(h+a[d])%4:h++;else if(f-m<c[d])h++;else break;f++}h>n?s[u]=new Array(h-n+1).join(" ")+i.slice(f,g):s[u]=i.slice(f,g)}return s.join("")}};TT.prototype.Token=Fn;function jR(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function AT(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function MT(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&Lc.ParagraphTerminator)===0||o>=s)return!1;const i=n.charCodeAt(o);switch(i){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return i>=48&&i<=57?!0:jR(n,o,s)}const cw=["","h1","h2"];function qR(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=AT(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let h=0,m,f=t+1;for(;f<n;f++){const v=i[f]+r[f],x=l[f];if(v>=x)break;if(a[f]-c>3)continue;if(a[f]>=c&&(m=s.charCodeAt(v),m===45||m===61)){let N=v+1,k=N;for(;N<x&&s.charCodeAt(N)===m;)N++;for(k=N;N<x;){const T=s.charCodeAt(N);if(T!==9&&T!==32)break;N++}if(N>=x){h=m===61?1:2;break}if(k-v>1)continue}if(a[f]<0||u&&!MT(e,f,s,v,x))continue;let L=!1;for(let N=0,k=o.length;N<k;N++)if(o[N](e,f,n,!0)){L=!0;break}if(L)break}if(!h)return!1;let g;if(f===t+1){const v=i[t]+r[t];let x=l[t];for(;x>v;){const L=s.charCodeAt(x-1);if(L!==9&&L!==32)break;x--}g=s.slice(v,x)}else g=e.getLines(t,f,c,!1).trim();e.line=f+1;const _=m===61?"=":"-",w=e.push("heading_open",cw[h],1);w.markup=_,w.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",cw[h],-1);return b.markup=_,e.parentType=d,!0}function ET(e){switch(e){case 9:case 32:return!0}return!1}function uw(e,t){const n=e.eMarks,o=e.bMarks,s=e.tShift,i=e.src,r=n[t];let l=o[t]+s[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!ET(i.charCodeAt(l))?-1:l}function dw(e,t){const n=e.bMarks,o=e.tShift,s=e.eMarks,i=e.src,r=n[t]+o[t],l=s[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!ET(c))?-1:a}function zR(e,t,n){const o=e.bMarks,s=e.tShift,i=e.src,r=o[t]+s[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const VR=["0","1","2","3","4","5","6","7","8","9"];function KR(e,t){const n=e.level+2,o=e.tokens;for(let s=t+2,i=o.length-2;s<i;s++){const r=o[s];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,o[s+2].hidden=!0,s+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++s<i;)l+=o[s].nesting}}}}function GR(e,t,n,o){let s,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,h;const m=e.src,f=e.bMarks,g=e.tShift,_=e.eMarks,w=e.sCount,y=e.bsCount,b=f[l]+g[l];if(b>=_[l])return!1;const v=m.charCodeAt(b);if(v>=48&&v<=57){if(h=dw(e,l),h<0||(u=!0,r=b,d=zR(e,l,h),c&&d!==1))return!1}else if(v===42||v===45||v===43){if(h=uw(e,l),h<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(h)>=_[l])return!1;if(o)return!0;const x=m.charCodeAt(h-1),L=String.fromCharCode(x);if(u){const A=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(A.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const N=[l,0];e.tokens[e.tokens.length-1].map=N,e.tokens[e.tokens.length-1].markup=L;let k=!1;const T=e.tokens.length-1,E=e.md.block.ruler.getRulesForState(e,"list"),O=e.parentType;for(e.parentType="list";l<n;){i=h,s=_[l];const A=w[l]+h-(f[l]+g[l]);let $=A;for(;i<s;){const le=m.charCodeAt(i);if(le===9)$+=4-($+y[l])%4;else if(le===32)$++;else break;i++}const R=i;let D;R>=s?D=1:D=$-A,D>4&&(D=1);const W=A+D,V=e.push("list_item_open","li",1);V.markup=L;const U=[l,0];V.map=U,u&&(V.info=h-r-1===1?VR[m.charCodeAt(r)-48]:m.slice(r,h-1));const ee=e.tight,K=e.tShift[l],G=e.sCount[l],X=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=W,e.tight=!0,e.tShift[l]=R-f[l],e.sCount[l]=$,R>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||k)&&(a=!1),k=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=X,e.tShift[l]=K,e.sCount[l]=G,e.tight=ee,e.push("list_item_close","li",-1).markup=L,l=e.line,U[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let ke=!1;for(let le=0,He=E.length;le<He;le++)if(E[le](e,l,n,!0)){ke=!0;break}if(ke)break;if(u){if(h=dw(e,l),h<0)break;r=f[l]+g[l]}else if(h=uw(e,l),h<0)break;if(x!==m.charCodeAt(h-1))break}return u?e.push("ordered_list_close","ol",-1).markup=L:e.push("bullet_list_close","ul",-1).markup=L,N[1]=l,e.line=l,e.parentType=O,a&&KR(e,T),!0}function fw(e){return e===9||e===32}function YR(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=AT(e);let h=t+1;for(e.parentType="paragraph";h<n&&!e.isEmpty(h);h++){if(c[h]-u>3||c[h]<0)continue;if(s==="list"&&c[h]>=u){const b=r[h]+l[h],v=a[h];if(b<v){const x=i.charCodeAt(b);if(x===42||x===45||x===43){if(b+1>=v||fw(i.charCodeAt(b+1)))break}else if(x>=48&&x<=57&&b+1<v){let L=b+1;for(;;){if(L>=v){L=-1;break}const N=i.charCodeAt(L++);if(N>=48&&N<=57){if(L-b>=10){L=-1;break}continue}if((N===41||N===46)&&(L>=v||fw(i.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const _=r[h]+l[h],w=a[h];if(d&&!MT(e,h,i,_,w))continue;let y=!1;for(let b=0,v=o.length;b<v;b++)if(o[b](e,h,n,!0)){y=!0;break}if(y)break}const m=e.getLines(t,h,u,!1).trim();e.line=h;const f=e.push("paragraph_open","p",1);f.map=[t,e.line];const g=e.push("inline","",0);return g.content=m,g.map=[t,e.line],g.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function wd(e){switch(e){case 9:case 32:return!0}return!1}function XR(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(s)!==91)return!1;function a(b){const v=e.lineMax;if(b>=v||e.isEmpty(b))return null;let x=!1;if(e.sCount[b]-e.blkIndent>3&&(x=!0),e.sCount[b]<0&&(x=!0),!x){const k=e.parentType;e.parentType="reference";let T=!1;for(let E=0,O=l.length;E<O;E++)if(l[E](e,b,v,!0)){T=!0;break}if(e.parentType=k,T)return null}const L=e.bMarks[b]+e.tShift[b],N=e.eMarks[b];return e.src.slice(L,N+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const b=c.charCodeAt(s);if(b===91)return!1;if(b===93){u=s;break}else if(b===10){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}else if(b===92&&(s++,s<i&&c.charCodeAt(s)===10)){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const b=c.charCodeAt(s);if(b===10){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}else if(!wd(b))break}const d=e.md.helpers.parseLinkDestination(c,s,i);if(!d.ok)return!1;const h=e.md.normalizeLink(d.str);if(!e.md.validateLink(h))return!1;s=d.pos;const m=s,f=r,g=s;for(;s<i;s++){const b=c.charCodeAt(s);if(b===10){const v=a(r);v!==null&&(c+=v,i=c.length,r++)}else if(!wd(b))break}let _=e.md.helpers.parseLinkTitle(c,s,i);for(;_.can_continue;){const b=a(r);if(b===null)break;c+=b,s=i,i=c.length,r++,_=e.md.helpers.parseLinkTitle(c,s,i,_)}let w;for(s<i&&g!==s&&_.ok?(w=_.str,s=_.pos):(w="",s=m,r=f);s<i&&wd(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&w)for(w="",s=m,r=f;s<i&&wd(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const y=Bh(c.slice(1,u));return y?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[y]>"u"&&(e.env.references[y]={title:w,href:h}),e.line=r),!0):!1}function Im(e){switch(e){case 9:case 32:return!0}return!1}const QR=65536;function $m(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function ZR(e,t){if(e.lineFlags)return(e.lineFlags[t]&Lc.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];n<o;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function hw(e){const t=[],n=e.length;let o=0,s=e.charCodeAt(o),i=!1,r=0,l="";for(;o<n;)s===124&&(i?(l+=e.substring(r,o-1),r=o):(t.push(l+e.substring(r,o)),l="",r=o+1)),i=s===92,o++,s=e.charCodeAt(o);return t.push(l+e.substring(r)),t}function JR(e,t,n,o){if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[s])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!Im(l)||r===45&&Im(l)||!ZR(e,t))return!1;for(;i<e.eMarks[s];){const v=e.src.charCodeAt(i);if(v!==124&&v!==45&&v!==58&&!Im(v))return!1;i++}let a=$m(e,t+1),c=a.split("|");const u=[];for(let v=0;v<c.length;v++){const x=c[v].trim();if(!x){if(v===0||v===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(x))return!1;x.charCodeAt(x.length-1)===58?u.push(x.charCodeAt(0)===58?"center":"right"):x.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=$m(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=hw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(o)return!0;const h=e.parentType;e.parentType="table";const m=e.md.block.ruler.getRulesForState(e,"blockquote"),f=e.push("table_open","table",1),g=[t,0];f.map=g;const _=e.push("thead_open","thead",1);_.map=[t,t+1];const w=e.push("tr_open","tr",1);w.map=[t,t+1];for(let v=0;v<c.length;v++){const x=e.push("th_open","th",1);u[v]&&(x.attrs=[["style",`text-align:${u[v]}`]]);const L=e.push("inline","",0);L.content=c[v].trim(),L.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y,b=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let v=!1;for(let L=0,N=m.length;L<N;L++)if(m[L](e,s,n,!0)){v=!0;break}if(v||(a=$m(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=hw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),b+=d-c.length,b>QR))break;if(s===t+2){const L=e.push("tbody_open","tbody",1);L.map=y=[t+2,0]}const x=e.push("tr_open","tr",1);x.map=[s,s+1];for(let L=0;L<d;L++){const N=e.push("td_open","td",1);u[L]&&(N.attrs=[["style",`text-align:${u[L]}`]]);const k=e.push("inline","",0);k.content=c[L]?c[L].trim():"",k.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return y&&(e.push("tbody_close","tbody",-1),y[1]=s),e.push("table_close","table",-1),g[1]=s,e.parentType=h,e.line=s,!0}var eD=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}after(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s+1,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:o,fn:s})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=s(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return _a(i?.env,"block",o,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const o=this._rules.findIndex(s=>s.name===e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[o].fn=t,n?.alt&&(this._rules[o].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,s=!0)}),s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,s=!0)}),s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this._rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const o of this._rules)if(o.enabled)for(const s of o.alt)e.add(s);const t=Object.create(null),n=Object.create(null);for(const o of e){const s=[],i=[];for(const r of this._rules)r.enabled&&(o!==""&&!r.alt.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t[o]=s,n[o]=i}this.cache=t,this.namedCache=n}};const _d=[["table",JR,["paragraph","reference"]],["code",RR],["fence",DR,["paragraph","reference","blockquote","list"]],["blockquote",OR,["paragraph","reference","blockquote","list"]],["hr",HR,["paragraph","reference","blockquote","list"]],["list",GR,["paragraph","reference","blockquote"]],["reference",XR],["html_block",WR,["paragraph","reference","blockquote"]],["heading",BR,["paragraph","reference","blockquote"]],["lheading",qR],["paragraph",YR]];var tD=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new eD;for(let e=0;e<_d.length;e++)this.ruler.push(_d[e][0],_d[e][1],{alt:(_d[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const o=this.getRules(),s=o.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const m=e.line;let f=!1;for(let g=0;g<s;g++)if(f=o[g](e,u,n,!1),f){if(m>=e.line)throw new Error("block rule didn't increment state.line");break}if(!f)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const h=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const m=e.line;let f=!1;for(let g=0;g<s;g++){const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();f=h[g].fn(e,u,n,!1);const w=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(_a(e.env,"block",h[g].name,w-_,f,!1),f){if(m>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!f)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,o){if(!e||e.length===0)return;const s=new TT(e,t,n,o);this.tokenize(s,s.line,s.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},IT=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}};IT.prototype.Token=Fn;const pw=[["normalize",kR],["block",gO],["inline",uR],["linkify",gR],["replacements",TR],["smartquotes",IR],["text_join",$R]],nD={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},oD={parseLinkLabel:qv,parseLinkDestination:jv,parseLinkTitle:zv};function sD(){return{...nD}}function iD(){return{...oD}}var rD=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new tD,this.inline=new cR,this.ruler=new AR;for(let e=0;e<pw.length;e++){const[t,n]=pw[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:sD(),helpers:iD(),normalizeLink:ST,normalizeLinkText:xT,validateLink:CT,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new iT),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 IT(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let o=0;o<n.length;o++)n[o](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();_a(e.env,"core",t[n].name,s-o,!0,!1)}lR(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&mO(e))return this.parse(cT(e),t,n);const o=this.createState(e,t,n);return this.process(o),this.lastState=o,o}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const lD=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function Wf(e){return!lD.test(e)}function _c(e,t){const n=e.indexOf(`
|
|
52
|
-
`,t);return n===-1?e.length:n}function Vd(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function mw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function Nm(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function aD(e){if(e.length>3)return Wf(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!1}return!0}const cD=["","h1","h2","h3","h4","h5","h6"],uD=["","#","##","###","####","#####","######"],gw=0,Lm=1,Pm=2;function us(e,t,n,o){const s=new Fn(e,t,n);return s.level=o,s.block=!0,s}function $T(e,t,n){const o=us("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new Fn("text","",0);return s.content=e,o.children=[s],o}function dD(e,t,n,o,s){let i=0,r=n;for(;r<o&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=o||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<o&&t.charCodeAt(l)===32;)l++;let a=o;for(;a>l&&t.charCodeAt(a-1)===32;)a--;let c=a;for(;c>l&&t.charCodeAt(c-1)===35;)c--;if(c>l&&t.charCodeAt(c-1)===32)for(a=c-1;a>l&&t.charCodeAt(a-1)===32;)a--;const u=t.slice(l,a);if(!Wf(u))return!1;const d=cD[i],h=uD[i],m=us("heading_open",d,1,0);m.map=[s,s+1],m.markup=h,e.push(m),e.push($T(u,s,1));const f=us("heading_close",d,-1,0);return f.markup=h,e.push(f),!0}function fD(e,t,n){const o=us("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push($T(t,n,1)),e.push(us("paragraph_close","p",-1,0))}function hD(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function Om(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function pD(e,t){const n=us("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function mD(e,t,n){const o=us("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=us("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=us("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new Fn("text","",0);r.content=t,i.children=[r],e.push(i);const l=us("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=us("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function gD(e){const t=us("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function vD(e,t,n,o){if(!mw(e,t,n))return null;const s=e.slice(t+3,n);if(s.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=o+1;for(;l<e.length;){const c=_c(e,l);if(mw(e,l,c)&&Vd(e,l+3,c)){const u=us("fence","code",0,0);return u.map=[o,a+1],u.markup="```",u.info=s,u.content=e.slice(i,r),{token:u,nextPos:c<e.length?c+1:c,nextLine:a+1}}l=c<e.length?c+1:c,r=l,a++}return null}function yD(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?gw:Pm,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=_c(e,r);if(r===a){r=a<e.length?a+1:a,l++;continue}const c=e.charCodeAt(r);if(c===32||c===9){if(!Vd(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!dD(t,e,r,a,l))return null;const m=a<e.length?a+1:a;r=Om(e,m),l+=1+r-m;continue}if(c===45){if(!Nm(e,r,a))return null;const m=l;let f=r,g=l,_=null,w=null;for(;f<e.length;){const v=_c(e,f);if(!Nm(e,f,v))break;const x=f+2,L=v===x+1?e[x]:e.slice(x,v);if(!aD(L))return null;_===null&&(_=pD(t,m)),w=mD(t,L,g),f=v<e.length?v+1:v,g++}if(_===null||w===null)return null;let y=f,b=g;for(;y<e.length;){if(e.charCodeAt(y)===10){y++,b++;continue}const v=_c(e,y);if(!Vd(e,y,v)){if(Nm(e,y,v))return null;break}y=v<e.length?v+1:v,b++}_.map[1]=b,w.map[1]=b,gD(t),r=y,l=b;continue}if(c===96){const m=vD(e,r,a,l);if(!m)return null;t.push(m.token),r=Om(e,m.nextPos),l=m.nextLine+r-m.nextPos;continue}const u=hD(e,r,a);let d;if(n===Pm?d=Wf(u):n===Lm&&u===o?d=s:(d=Wf(u),n===gw?(i&&(n=u===o?Lm:Pm),o=u,s=d,i=!0):n===Lm&&(o=u,s=d)),!d)return null;const h=a<e.length?a+1:a;if(h<e.length&&e.charCodeAt(h)!==10&&!Vd(e,h,_c(e,h)))return null;fD(t,u,l),r=Om(e,h),l+=1+r-h}return t}const kD=/[&<>"]/,vw=/[&<>"]/g,bD=/&/g,wD=/[<>"]/g,_D={"&":"&","<":"<",">":">",'"':"""};function Rm(e){return _D[e]||e}function ln(e){if(e.length===0)return"";if(e.length<32)return kD.test(e)?e.replace(vw,Rm):e;const t=e.includes("&"),n=e.includes("<"),o=e.includes(">"),s=e.includes('"');return!t&&!n&&!o&&!s?e:t&&!n&&!o&&!s?e.replace(bD,"&"):t?e.replace(vw,Rm):e.replace(wD,Rm)}const CD=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),SD=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function NT(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(CD,(t,n,o)=>{if(n)return n;if(SD.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return Fh(i)?au(i):"�"}const s=Pv(t);return s!==t?s:t})}const xD=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,TD=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,AD=/"/g;function la(e,t){const n=e.indexOf(`
|
|
53
|
-
`,t);return n===-1?e.length:n}function Uf(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function Cd(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function MD(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!Uf(e,t,la(e,t))}function yw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function ED(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function Yv(e){return TD.test(e)?xD.test(e)?null:e.replace(AD,"""):e}function ID(e,t,n){let o=0,s=t;for(;s<n&&e.charCodeAt(s)===35&&o<6;)s++,o++;if(o===0||s>=n||e.charCodeAt(s)!==32)return null;let i=s+1;for(;i<n&&e.charCodeAt(i)===32;)i++;let r=n;for(;r>i&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>i&&e.charCodeAt(l-1)===35;)l--;if(l>i&&e.charCodeAt(l-1)===32)for(r=l-1;r>i&&e.charCodeAt(r-1)===32;)r--;const a=Yv(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
|
|
54
|
-
`}function kw(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function $D(e,t){switch(e.charCodeAt(t)){case 34:return`<li>"</li>
|
|
55
|
-
`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`<li>${e[t]}</li>
|
|
56
|
-
`}function ND(e,t,n){const o=t+2;if(n===o+1)return $D(e,o);const s=Yv(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
|
|
57
|
-
`}function LD(e,t,n){for(;t<n;){const s=e.charCodeAt(t);if(s!==32&&s!==9)break;t++}for(;n>t;){const s=e.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}let o=n;for(let s=t;s<n;s++){const i=e.charCodeAt(s);if(i===96)return null;if(i===32||i===9){o=s;break}}return e.slice(t,o)}function PD(e,t,n,o){if(!yw(e,t,n))return null;const s=LD(e,t+3,n);if(s===null)return null;const i=n<e.length?n+1:n;let r=i,l=i;for(;l<e.length;){const a=la(e,l);if(yw(e,l,a)&&Uf(e,l+3,a)){const c=e.slice(i,r);let u;return s===o.lang?u=o.open:(u=s?`<pre><code class="language-${ln(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${ln(c)}</code></pre>
|
|
58
|
-
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function bw(e){if(e.length===0)return"";if(e.includes("\r")||e.includes("\0"))return null;let t=0,n="";const o=e.length>=25e4,s=[],i={lang:"",open:"<pre><code>"};let r="",l="",a="",c="";for(;t<e.length;){const u=la(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!Uf(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const g=ID(e,t,u);if(g===null)return null;o?s.push(g):n+=g,t=Cd(e,u<e.length?u+1:u);continue}if(d===45){let g=t;for(;g<e.length;){const b=la(e,g);if(!kw(e,g,b))break;g=b<e.length?b+1:b}if(g===t)return null;const _=e.slice(t,g);let w;if(_===r)w=l;else{let b=t;for(w=`<ul>
|
|
59
|
-
`;b<g;){const v=la(e,b),x=ND(e,b,v);if(x===null)return null;w+=x,b=v<e.length?v+1:v}w+=`</ul>
|
|
60
|
-
`,r=_,l=w}let y=Cd(e,g);for(;y<e.length;){if(e.charCodeAt(y)===10){y++;continue}const b=la(e,y);if(!Uf(e,y,b)){if(kw(e,y,b))return null;break}y=b<e.length?b+1:b}o?s.push(w):n+=w,t=y;continue}if(d===96){const g=PD(e,t,u,i);if(!g)return null;o?s.push(g.html):n+=g.html,t=Cd(e,g.nextPos);continue}const h=ED(e,t,u);let m;if(h===a)m=c;else{const g=Yv(h);if(g===null)return null;m=`<p>${g}</p>
|
|
61
|
-
`,a=h,c=m}const f=u<e.length?u+1:u;if(f<e.length&&e.charCodeAt(f)!==10&&MD(e,f))return null;o?s.push(m):n+=m,t=Cd(e,f)}return o?s.join(""):n}const OD={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function jf(e,t,n={},o){Ao(n);const s={...OD,...o||{}},i=jo(t);if(s.fallbackOnGlobalState!==!1&&i)return Em(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),wa(n,i,()=>e.core.parse(t,n,e).tokens);let r=Kd(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=FD(r,s.maxChunks)),Gd(t,r))return Em(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),wa(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return Em(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),wa(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),h=e.core.parse(d,n,e).tokens;l!==0&&h.length&&DD(h,l),BD(a,h),l+=u.lineCount}return a})}function Kd(e,t,n=!0){const o=[];let s=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(h){h<=r||(o.push({start:r,end:h,lineCount:l}),r=h,s=0,i=0,l=0)}for(let h=0;h<e.length;){let m=e.indexOf(`
|
|
62
|
-
`,h),f=m;m===-1?(m=e.length,f=e.length):f=m+1;const g=HD(e,h,m);if(t.fenceAware){let y=h;for(;y<m;){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<m&&e[v]===b;)v++;const x=v-y;x>=3&&(u?u.marker===b&&x>=u.length&&(u=null):u={marker:b,length:x})}}const _=f-h;s+=_,i+=1,l+=1,g?(a=0,c=0):(a+=1,c+=_);const w=g;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(w)d(f);else{const y=Math.max(10,Math.floor(t.maxChunkLines*.5)),b=Math.max(t.maxChunkChars,8e3);(a>=y||c>=b)&&d(f)}h=f}return n&&d(e.length),o}function Gd(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!RD(e,t[s].end))return!0;return!1}function RD(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let o=n+1;o<t-1;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function DD(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function BD(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function FD(e,t){if(e.length<=t)return e;const n=[];let o=0;for(let s=0;s<t;s++){const i=t-s,r=e.length-o,l=Math.ceil(r/i),a=e.slice(o,o+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),o+=l}return n}function HD(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}const LT=4e6,PT=8e4,WD=1e4,UD=200,jD=1e4,qD=200;function OT(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function zD(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function sr(e){return e.length===0?0:En(e)+(e.charCodeAt(e.length-1)===10?0:1)}function VD(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function KD(e,t){if(!t||e.length===0)return!1;let n=null;for(let o=0;o<e.length;){let s=e.indexOf(`
|
|
63
|
-
`,o);s===-1&&(s=e.length);let i=o;for(;i<s;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<s&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}o=s===e.length?e.length:s+1}return n!==null}function GD(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 VD(e,n+1,e.length-1)?!KD(e,t):!1}function YD(e,t,n,o={}){const s=o.mode??"full",i=o.fenceAware??(s==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(o.maxChunkChars!==void 0||o.maxChunkLines!==void 0||o.autoTune===!1){const r=o.maxChunkChars??(s==="stream"?e.options.streamChunkSizeChars??jD:e.options.fullChunkSizeChars??WD),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??qD:e.options.fullChunkSizeLines??UD);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return s==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var Mu=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=sr(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=Kd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(Gd(this.pending,o,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const s=this.commitRanges(o,e);return this.pending=this.pending.slice(s),this.updateEnvDiagnostics(e,t,sr(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!GD(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,sr(this.pending)),null;const n=Kd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,sr(this.pending)),null;const o=Gd(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:sr(this.pending)}]:n;return this.commitRanges(o,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const o=this.resolveWindow();return this.updateEnvDiagnostics(e,o,0),this.tokens}const t=this.resolveWindow(),n=Kd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=Gd(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:sr(this.pending)}]:n;this.commitRanges(o,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:sr(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+sr(this.pending);return YD(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Au(e)&&zi(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=jo(t);n&&(Wv(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let o=0;o<e.length;o++){const s=e[o],i=this.pending.slice(s.start,s.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&zD(r,a),this.options.retainTokens!==!1&&OT(this.tokens,r),this.committedChars+=i.length,this.committedLines+=s.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:s.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=s.end}return this.markedGlobalStateReason&&Uv(t),n}catch(o){throw this.markedGlobalStateReason&&(zi(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){nT(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 XD(e,t,n={},o={}){Ao(n);const s=new Mu(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function QD(e,t,n={},o={}){Ao(n);const s=new Mu(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function ZD(e,t,n,o={},s={}){Ao(o);const i=new Mu(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}async function JD(e,t,n,o={},s={}){Ao(o);const i=new Mu(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}function RT(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??LT,s=e.options.autoUnboundedThresholdLines??PT;return t>=o||n>=s}function DT(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??LT))return"yes";const o=e.options.autoUnboundedThresholdLines??PT;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function Pc(e,t,n={},o={}){Ao(n);const s=jo(t);if(Au(n)&&zi(n),o.fallbackOnGlobalState!==!1&&s)return nT(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:En(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),wa(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new Mu(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){OT(i,l)}});if(s&&Wv(n,s),r.feed(t),r.flushForce(n),s&&(Uv(n),o.fallbackOnGlobalState===!1)){const l=Ei(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const Ca=(e,t,n)=>e<t?t:e>n?n:e;function BT(e){return e.experimental?{...e,...e.experimental}:e}const ww=[{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"}],_w=[{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 FT(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function e7(e,t=Math.max(0,e/40|0),n={}){const o=BT(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<ww.length;l++){const a=ww[l];if(e<=a.max){if(a.strategy!=="adaptive")return FT(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Ca(Math.ceil(e/i),8e3,64e3),maxChunkLines:Ca(Math.ceil(t/i),150,700),maxChunks:Ca(Math.ceil(e/64e3),i,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.fullChunkSizeChars??1e4,maxChunkLines:o.fullChunkSizeLines??200,fenceAware:s,maxChunks:o.fullChunkMaxChunks}}function Cw(e,t=Math.max(0,e/40|0),n={}){const o=BT(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<_w.length;l++){const a=_w[l];if(e<=a.max){if(a.strategy!=="adaptive")return FT(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Ca(Math.ceil(e/i),8e3,64e3),maxChunkLines:Ca(Math.ceil(t/i),150,700),maxChunks:Ca(Math.ceil(e/64e3),i,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.streamChunkSizeChars??1e4,maxChunkLines:o.streamChunkSizeLines??200,maxChunks:o.streamChunkMaxChunks,fenceAware:s}}var t7={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"]}}},n7={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},o7={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function jh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Yd(e,t){if(jh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const Sw=e=>jh(e)?e:Promise.resolve(e);function Oc(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 ln(e)}}function Nr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Oc(t[0])}="${ln(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${Oc(s[0])}="${ln(s[1])}"`}return n}function HT(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const o=e.charCodeAt(t);if(o===32||o===9||o===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const o=e.charCodeAt(n);if(o!==32&&o!==9&&o!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function Rc(e,t,n,o,s){if(t.indexOf("<pre")===0)return`${t}
|
|
64
|
-
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${ln(`${s.langPrefix??"language-"}${o}`)}">${t}</code></pre>
|
|
65
|
-
`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${o}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${Nr(r)}>${t}</code></pre>
|
|
66
|
-
`}return`<pre><code${Nr(e.attrs)}>${t}</code></pre>
|
|
67
|
-
`}function qf(e){return!e.attrs||e.attrs.length===0?`<code>${ln(e.content)}</code>`:`<code${Nr(e.attrs)}>${ln(e.content)}</code>`}function f1(e){const t=ln(e.content);return e.attrs?`<pre${Nr(e.attrs)}><code>${t}</code></pre>
|
|
68
|
-
`:`<pre><code>${t}</code></pre>
|
|
69
|
-
`}function s7(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="${ln(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${ln(n[0][1])}">`}return null}function xw(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Oc(t[0][0])}="${ln(t[0][1])}">`:t.length===2?`<a ${Oc(t[0][0])}="${ln(t[0][1])}" ${Oc(t[1][0])}="${ln(t[1][1])}">`:`<a${Nr(t)}>`}function i7(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 Tw(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 zf(e,t){if(e.hidden)return"";const n=e.attrs,o=e.nesting,s=e.tag;if(!n||n.length===0)return o===0?t?`<${s} />`:`<${s}>`:o===-1?`</${s}>`:`<${s}>`;let i=(o===-1?"</":"<")+s+Nr(n);return o===0&&t&&(i+=" /"),`${i}>`}const r7={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Sd=Object.prototype.hasOwnProperty,rn={code_inline(e,t){return qf(e[t])},code_block(e,t){return f1(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?NT(i.info).trim():"",{langName:l,langAttrs:a}=HT(r),c=n.highlight,u=ln(i.content);if(!c)return Rc(i,u,r,l,n);const d=c(i.content,l,a);return jh(d)?d.then(h=>Rc(i,h||u,r,l,n)):Rc(i,d||u,r,l,n)},image(e,t,n,o,s){const i=e[t],r=s.renderInlineAsText(i.children||[],n,o),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],zf(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
70
|
-
`:`<br>
|
|
71
|
-
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
72
|
-
`:`<br>
|
|
73
|
-
`:`
|
|
74
|
-
`},text(e,t){return ln(e[t].content)},text_special(e,t){return ln(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Aw(e,t,n){const o=e.info?NT(e.info).trim():"",{langName:s,langAttrs:i}=HT(o),r=t.highlight,l=ln(e.content);if(!r)return Rc(e,l,o,s,t);const a=r(e.content,s,i);if(jh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Rc(e,a||l,o,s,t)}function xd(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===rn.text)return l.content.length===0?"":ln(l.content);break;case"text_special":if(s.text_special===rn.text_special)return l.content.length===0?"":ln(l.content);break;case"softbreak":if(s.softbreak===rn.softbreak)return r;break;case"hardbreak":if(s.hardbreak===rn.hardbreak)return i;break;case"html_inline":if(s.html_inline===rn.html_inline)return l.content;break;case"code_inline":if(s.code_inline===rn.code_inline)return qf(l);break}const a=s[l.type];if(!a)return zf(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:Yd(c,l.type)}var l7=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...rn}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,h,m="",f="",g=!1,_="";for(let w=0;w<e.length;w++){const y=e[w],b=y.type,v=w>0&&e[w-1].hidden?`
|
|
75
|
-
`:"";if(b==="list_item_open"&&(!y.attrs||y.attrs.length===0)&&w+3<e.length){const N=e[w+1],k=e[w+2],T=e[w+3];if(N.type==="paragraph_open"&&N.hidden&&k.type==="inline"&&T.type==="paragraph_close"&&T.hidden){_+=`${v}<li>${this.renderInlineTokens(k.children||[],o,s)}`,w+=3;continue}}if(w+2<e.length){const N=e[w+1],k=e[w+2];if(N.type==="inline"&&k.nesting===-1&&k.tag===y.tag&&!k.hidden){const T=s7(y,v);if(T!==null){_+=`${T+this.renderInlineTokens(N.children||[],o,s)}</${y.tag}>
|
|
76
|
-
`,w+=2;continue}}}if(b==="inline"){const N=y.children||[];if(N.length===1){g||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,h=i.code_inline,m=o.xhtmlOut?`<br />
|
|
77
|
-
`:`<br>
|
|
78
|
-
`,f=o.breaks?m:`
|
|
79
|
-
`,g=!0);const k=N[0];switch(k.type){case"text":if(l===rn.text){_+=ln(k.content);continue}break;case"text_special":if(a===rn.text_special){_+=ln(k.content);continue}break;case"softbreak":if(c===rn.softbreak){_+=f;continue}break;case"hardbreak":if(u===rn.hardbreak){_+=m;continue}break;case"html_inline":if(d===rn.html_inline){_+=k.content;continue}break;case"code_inline":if(h===rn.code_inline){_+=qf(k);continue}break}}_+=this.renderInlineTokens(N,o,s);continue}const x=i[b];if(!x){const N=y.attrs;if(!y.hidden){if(!N||N.length===0)switch(b){case"hr":_+=r?`<hr />
|
|
80
|
-
`:`<hr>
|
|
81
|
-
`;continue;case"heading_open":_+=`<${y.tag}>`;continue;case"heading_close":_+=`</${y.tag}>
|
|
82
|
-
`;continue;case"paragraph_open":_+=`${v}<p>`;continue;case"paragraph_close":_+=`</p>
|
|
83
|
-
`;continue;case"list_item_open":{const k=e[w+1];_+=v+(k&&(k.type==="inline"||k.hidden||k.nesting===-1&&k.tag==="li")?"<li>":`<li>
|
|
84
|
-
`);continue}case"list_item_close":_+=`</li>
|
|
85
|
-
`;continue;case"bullet_list_open":_+=`${v}<ul>
|
|
86
|
-
`;continue;case"bullet_list_close":_+=`</ul>
|
|
87
|
-
`;continue;case"blockquote_open":_+=v+(e[w+1]&&e[w+1].nesting===-1&&e[w+1].tag==="blockquote"?"<blockquote>":`<blockquote>
|
|
88
|
-
`);continue;case"blockquote_close":_+=`</blockquote>
|
|
89
|
-
`;continue;case"ordered_list_open":_+=`${v}<ol>
|
|
90
|
-
`;continue;case"ordered_list_close":_+=`</ol>
|
|
91
|
-
`;continue;case"table_open":_+=`${v}<table>
|
|
92
|
-
`;continue;case"table_close":_+=`</table>
|
|
93
|
-
`;continue;case"thead_open":_+=`${v}<thead>
|
|
94
|
-
`;continue;case"thead_close":_+=`</thead>
|
|
95
|
-
`;continue;case"tbody_open":_+=`${v}<tbody>
|
|
96
|
-
`;continue;case"tbody_close":_+=`</tbody>
|
|
97
|
-
`;continue;case"tr_open":_+=`${v}<tr>
|
|
98
|
-
`;continue;case"tr_close":_+=`</tr>
|
|
99
|
-
`;continue;case"td_open":_+=`${v}<td>`;continue;case"td_close":_+=`</td>
|
|
100
|
-
`;continue;case"th_open":_+=`${v}<th>`;continue;case"th_close":_+=`</th>
|
|
101
|
-
`;continue}else if(N.length===1){const k=N[0];if(b==="ordered_list_open"&&k[0]==="start"){_+=`${v}<ol start="${ln(k[1])}">
|
|
102
|
-
`;continue}if(b==="td_open"&&k[0]==="style"){_+=`${v}<td style="${ln(k[1])}">`;continue}if(b==="th_open"&&k[0]==="style"){_+=`${v}<th style="${ln(k[1])}">`;continue}}}_+=this.renderToken(e,w,o);continue}if(b==="code_block"&&x===rn.code_block){_+=f1(y);continue}if(b==="fence"&&x===rn.fence){_+=Aw(y,o);continue}if(b==="html_block"&&x===rn.html_block){_+=y.content;continue}const L=x(e,w,o,s,this);typeof L=="string"?_+=L:_+=Yd(L,y.type)}return _}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],o,s);continue}const c=i[a.type];c?r+=await Sw(c(e,l,o,s,this)):r+=this.renderToken(e,l,o)}return r}renderInline(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokens(e,o,s)}async renderInlineAsync(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokensAsync(e,o,s)}renderInlineAsText(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineAsTextInternal(e,o,s)}renderAttrs(e){return Nr(e.attrs)}renderToken(e,t,n){const o=e[t];if(o.hidden)return"";const s=o.block,i=o.nesting,r=o.tag,l=o.attrs;let a=!1;if(s&&(a=!0,i===1&&t+1<e.length)){const h=e[t+1];(h.type==="inline"||h.hidden||h.nesting===-1&&h.tag===r)&&(a=!1)}const c=s&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
103
|
-
`:"",u=a?`>
|
|
104
|
-
`:">";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+Nr(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const o=()=>(n||(n={...t}),n);if(Sd.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),Sd.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(Sd.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(Sd.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...r7,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===rn.code_block)return f1(t);if(i==="html_block"&&s.html_block===rn.html_block)return t.content;const r=this.mergeOptions(n),l=o??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=s[i];if(!a)return t.block?this.renderToken(e,0,r):zf(t,r.xhtmlOut===!0);if(i==="fence"&&a===rn.fence)return Aw(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Yd(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules,s=o.text,i=o.text_special,r=o.softbreak,l=o.hardbreak,a=o.html_inline,c=o.code_inline,u=o.link_open,d=o.link_close,h=o.em_open,m=o.em_close,f=o.strong_open,g=o.strong_close,_=t.xhtmlOut===!0,w=_?`<br />
|
|
105
|
-
`:`<br>
|
|
106
|
-
`,y=t.breaks?w:`
|
|
107
|
-
`;if(e.length===1)return xd(e,t,n,this,o,w,y);let b="";for(let v=0;v<e.length;v++){const x=e[v];if(x.type==="link_open"&&!u&&!d&&v+2<e.length){const k=e[v+1];if(e[v+2].type==="link_close"&&i7(k)){const T=`${xw(x)+xd([k],t,n,this,o,w,y)}</a>`;if(r===rn.softbreak&&v+3<e.length&&e[v+3].type==="softbreak"){b+=T+y,v+=3;continue}b+=T,v+=2;continue}}if(x.type==="link_open"&&!u&&!d&&v+1<e.length&&e[v+1].type==="link_close"){b+=`${xw(x)}</a>`,v+=1;continue}if(x.type==="em_open"&&!h&&!m&&v+2<e.length){const k=e[v+1];if(e[v+2].type==="em_close"&&Tw(k)){b+=`<em>${xd([k],t,n,this,o,w,y)}</em>`,v+=2;continue}}if(x.type==="strong_open"&&!f&&!g&&v+2<e.length){const k=e[v+1];if(e[v+2].type==="strong_close"&&Tw(k)){b+=`<strong>${xd([k],t,n,this,o,w,y)}</strong>`,v+=2;continue}}switch(x.type){case"text":if(s===rn.text){const k=x.content.length===0?"":ln(x.content);if(a===rn.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===rn.text_special){x.content.length!==0&&(b+=ln(x.content));continue}break;case"softbreak":if(r===rn.softbreak){b+=y;continue}break;case"hardbreak":if(l===rn.hardbreak){b+=w;continue}break;case"html_inline":if(a===rn.html_inline){for(b+=x.content;v+1<e.length&&e[v+1].type==="html_inline";)b+=e[++v].content;continue}break;case"code_inline":if(c===rn.code_inline){b+=qf(x);continue}break}const L=o[x.type];if(!L){b+=x.block?this.renderToken(e,v,t):zf(x,_);continue}const N=L(e,v,t,n,this);typeof N=="string"?b+=N:b+=Yd(N,x.type)}return b}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const o=this.rules;let s="";for(let i=0;i<e.length;i++){const r=o[e[i].type];r?s+=await Sw(r(e,i,t,n,this)):s+=this.renderToken(e,i,t)}return s}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let o="";for(let s=0;s<e.length;s++){const i=e[s];switch(i.type){case"text":case"text_special":o+=i.content;break;case"image":o+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":o+=i.content;break;case"softbreak":case"hardbreak":o+=`
|
|
108
|
-
`;break}}return o}},a7=l7;const c7=[],Dm=4096;function u7(e){const t=e.length;let n=0;for(;n<=t;){let o=e.indexOf(`
|
|
109
|
-
`,n);o===-1&&(o=t);const s=o<t;let i=n,r=0;for(;i<o;){const l=e.charCodeAt(i);if(l===32){if(r++,i++,r>=4)return!0;continue}if(l===9){if(r+=4-r%4,i++,r>=4)return!0;continue}break}if(i<o){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<o&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<o){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===o&&s)return!0}break}case 62:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 96:case 126:{let a=i;for(;a<o&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<o;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<o&&e.charCodeAt(a)===46){const c=a+1;if(c<o){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===o&&s)return!0}}break}}if(o===t)break;n=o+1}return!1}function d7(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return!1;return!0}function f7(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!WT(e[n],t[n]))return!1;return!0}function WT(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,o=t.map;return!!n!=!!o||n&&o&&(n[0]!==o[0]||n[1]!==o[1])||e.tag!==t.tag||e.nesting!==t.nesting||e.markup!==t.markup||e.info!==t.info||e.block!==t.block||e.hidden!==t.hidden||!d7(e.attrs,t.attrs)||!f7(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function Mw(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var h7=class{core;cache=null;stats=Mw();MIN_SIZE_FOR_OPTIMIZATION=1e3;DEFAULT_SKIP_CACHE_CHARS=1e6;DEFAULT_SKIP_CACHE_LINES=1e5;IMPLICIT_STREAM_CHUNK_MIN_CHARS=16e4;MIN_LIST_LINES_FOR_MERGE=80;MIN_LIST_CHARS_FOR_MERGE=800;MIN_TABLE_LINES_FOR_MERGE=48;MIN_TABLE_CHARS_FOR_MERGE=1200;MIN_UNBOUNDED_APPEND_TOTAL_CHARS=5e5;MIN_UNBOUNDED_APPEND_CHARS=64e3;MIN_UNBOUNDED_APPEND_LINES=700;constructor(e){this.core=e}reset(){this.cache=null,this.stats.resets+=1,this.stats.lastMode="reset"}resetStats(){const{resets:e}=this.stats;this.stats=Mw(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(Ao(o??s?.env),!s||o&&o!==s.env){const $=o??{},R=!!n.__explicitStreamChunkFallbackSetting,D=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,W=!!n.options?.streamChunkedFallback,V=!R&&D,U=W||V,ee=n.options?.streamChunkAdaptive!==!1,K=n.options?.streamChunkTargetChunks??8,G=n.options?.streamChunkSizeChars,X=n.options?.streamChunkSizeLines,ke=n.options?.streamChunkMaxChunks,le=!!n.__explicitStreamChunkConfig,He=n.options?.autoTuneChunks!==!1,ue=n.options?.streamChunkFenceAware??!0,ve=n.options?.streamLargeCachePolicy??"retain",Pe=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,Re=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let Q,ce=!1;if(ve==="skip"&&(ce=e.length>=Pe,!ce&&Re!==void 0&&(Q=En(e),ce=Q>=Re)),ce){const q=this.parseFullDocument(e,$,n,Q,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn($,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!Ei($)?.unbounded}),q.tokens}else if(U){const q=(re,ge,xe)=>re<ge?ge:re>xe?xe:re;Q===void 0&&(Q=En(e));const te=He&&!le?Cw(e.length,Q,n.options):null,pe=te?.maxChunkChars??(ee?q(Math.ceil(e.length/K),8e3,64e3):G??1e4),oe=te?.maxChunkLines??(ee?q(Math.ceil(Q/K),150,700):X??200),fe=te?.maxChunks??(ee?q(Math.ceil(e.length/64e3),K,32):ke),H=e.length>0&&e.charCodeAt(e.length-1)===10,Y=V&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&te?.strategy!=="plain";if((W||Y)&&(e.length>=pe*2||Q>=oe*2)&&H){const re=jf(n,e,$,{maxChunkChars:pe,maxChunkLines:oe,fenceAware:te?.fenceAware??ue,maxChunks:fe});return this.cache={src:e,tokens:re,env:$,lineCount:Q,lastSegment:void 0,globalStateReason:jo(e)},this.updateCacheLineCount(this.cache,Q),this.recordChunkedParseResult($,W?"explicit-initial-large-doc":"default-initial-large-doc"),re}}const Ce=this.parseFullDocument(e,$,n,Q);return Q=Ce.lineCount,this.cache={src:e,tokens:Ce.tokens,env:$,lineCount:Q,lastSegment:void 0,globalStateReason:jo(e)},this.updateCacheLineCount(this.cache,Q),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn($,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!Ei($)?.unbounded}),Ce.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",Dn(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const i=e.startsWith(s.src)?e.slice(s.src.length):null;let r=s.globalStateReason;r===void 0&&(r=jo(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):jo(e),a=r||l;if(a){const $=o??s.env;zi($);const R=jo(e),D=this.parseFullDocument(e,$,n),W=D.tokens,V=D.lineCount;return this.cache={src:e,tokens:W,env:$,lineCount:V,lastSegment:void 0,globalStateReason:R},this.updateCacheLineCount(this.cache,V),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn($,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!Ei($)?.unbounded}),W}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length<c&&e.length<c*1.5&&!e.startsWith(s.src)){const $=o??s.env,R=this.parseFullDocument(e,$,n),D=R.tokens,W=R.lineCount;return this.cache={src:e,tokens:D,env:$,lineCount:W,lastSegment:void 0,globalStateReason:jo(e)},this.updateCacheLineCount(this.cache,W),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn($,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!Ei($)?.unbounded}),D}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const $=s.lineCount??En(s.src);let R=3;u.length>5e3?R=8:u.length>1e3?R=6:u.length>200&&(R=4),R=Math.min(R,$);let D=null;const W=n.options?.streamContextParseStrategy??"chars",V=n.options?.streamContextParseMinChars??200,U=n.options?.streamContextParseMinLines??2;let ee;const K=()=>(ee===void 0&&(ee=En(u)),ee),G=this.canDirectlyParseAppend(s),X=G&&this.shouldUseUnboundedAppend(e,s,u);let ke=!1;if(!G)switch(W){case"lines":ke=K()>=U;break;case"constructs":if(u.length>=V){ke=!0;break}if(u7(u)){ke=!0;break}ke=K()>=U;break;case"chars":default:ke=u.length>=V}if(R>0&&ke){const ue=this.getTailLines(s.src,R)+u;try{const ve=this.core.parse(ue,s.env,n).tokens,Pe=ve.findIndex(Re=>Re.map&&typeof Re.map[1]=="number"&&Re.map[1]>R);if(Pe!==-1){const Re=ve.slice(Pe),Q=$-R;Q!==0&&this.shiftTokenLines(Re,Q),D={tokens:Re}}}catch{D=null}}else D=null;if(!D){const ue=$;if(X)D={tokens:Pc(n,u,s.env,{mode:"stream"})},ue>0&&this.shiftTokenLines(D.tokens,ue);else{const ve=this.core.parse(u,s.env,n);ue>0&&this.shiftTokenLines(ve.tokens,ue),D=ve}}let le=0;if(s.tokens.length>0&&D.tokens.length>0){const ue=s.tokens[s.tokens.length-1],ve=D.tokens[0];try{ue.type==="inline"&&ve.type==="inline"&&(ve.children&&ve.children.length>0&&(ue.children||(ue.children=[]),this.appendTokens(ue.children,ve.children)),ue.content=(ue.content||"")+(ve.content||""),le=1)}catch{le=0}}const He=s.tokens.length;if(D.tokens.length>le){const ue=s.tokens,ve=D.tokens,Pe=Math.min(ue.length,ve.length-le);let Re=0;for(let Q=Pe;Q>0;Q--){let ce=!0;for(let Ce=0;Ce<Q;Ce++){const q=ue[ue.length-Q+Ce],te=ve[le+Ce];if(!WT(q,te)){ce=!1;break}}if(ce){Re=Q;break}}Re>0&&(le+=Re),ve.length>le&&this.appendTokens(s.tokens,ve,le)}if(s.src=e,s.globalStateReason=null,s.lineCount=$+(ee??K()),s.tokens.length>He){const ue=this.getLastSegment(s.tokens,e,He,s.tokens.length,e.length-u.length,$);ue?s.lastSegment=ue:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,X&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",Dn(s.env,{area:"stream",path:X?"stream-unbounded-append":"stream-append",reason:X?"large-delta":"safe-append",unbounded:X}),s.tokens}const d=o??s.env,h=this.tryTailSegmentReparse(e,s,d,n);if(h)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",Dn(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),h;const m=!!n.__explicitStreamChunkFallbackSetting,f=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,_=!m&&!u&&f,w=g||_,y=n.options?.streamChunkAdaptive!==!1,b=n.options?.streamChunkTargetChunks??8,v=n.options?.streamChunkSizeChars,x=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,N=!!n.__explicitStreamChunkConfig,k=n.options?.autoTuneChunks!==!1,T=n.options?.streamChunkFenceAware??!0;let E=u&&s.lineCount!==void 0?s.lineCount+En(u):void 0;if(w){E===void 0&&(E=En(e));const $=(K,G,X)=>K<G?G:K>X?X:K,R=k&&!N?Cw(e.length,E,n.options):null,D=R?.maxChunkChars??(y?$(Math.ceil(e.length/b),8e3,64e3):v??1e4),W=R?.maxChunkLines??(y?$(Math.ceil(E/b),150,700):x??200),V=R?.maxChunks??(y?$(Math.ceil(e.length/64e3),b,32):L),U=e.length>0&&e.charCodeAt(e.length-1)===10,ee=_&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&R?.strategy!=="plain";if((g||ee)&&(e.length>=D*2||E>=W*2)&&U){const K=jf(n,e,d,{maxChunkChars:D,maxChunkLines:W,fenceAware:R?.fenceAware??T,maxChunks:V});return this.cache={src:e,tokens:K,env:d,lineCount:E,lastSegment:void 0,globalStateReason:jo(e)},this.updateCacheLineCount(this.cache,E),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),K}}const O=this.parseFullDocument(e,d,n,E),A=O.tokens;return E=O.lineCount,this.cache={src:e,tokens:A,env:d,lineCount:E,lastSegment:void 0,globalStateReason:jo(e)},this.updateCacheLineCount(this.cache,E),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!Ei(d)?.unbounded}),A}recordChunkedParseResult(e,t){const n=Ei(e)?.chunk,o=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,o){this.stats.fullParses+=1,this.stats.lastMode="full",Dn(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!Ei(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",Dn(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=jo(e);Au(t)&&zi(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?DT(n,e.length,o):"no";if(r==="yes"){const a=Pc(n,e,t);return Dn(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?En(e):0)}}let l=o;if(r==="need-lines"&&(l=En(e),RT(n,e.length,l))){const a=Pc(n,e,t);return Dn(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?En(e):0),{tokens:wa(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:En(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
|
|
110
|
-
`))return null;const o=n??t.slice(e.length);if(!o)return null;const s=o.length;if(o.charCodeAt(s-1)!==10)return null;let i=0,r=-1;for(let a=0;a<s&&!(o.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?o:o.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
|
|
111
|
-
`);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(o)?null:o}tryTailSegmentReparse(e,t,n,o){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const i=t.src.slice(0,s.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(s.srcOffset),l=e.slice(s.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,o,s,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,o),u=this.getLastSegment(c.tokens,l);return s.lineStart>0&&this.shiftTokenLines(c.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=s.lineStart+En(l),u?t.lastSegment={tokenStart:s.tokenStart+u.tokenStart,tokenEnd:s.tokenStart+u.tokenEnd,lineStart:s.lineStart+u.lineStart,lineEnd:s.lineStart+u.lineEnd,srcOffset:s.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let o=e.length-1;o>=0;o--)if(e.charCodeAt(o)===10&&(n--,n===0))return e.slice(o+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,o=e.slice(n),s=o.length;let i=null,r=0;for(;r<=s;){let l=o.indexOf(`
|
|
112
|
-
`,r);l===-1&&(l=s);let a=r;for(;a<l;){const c=o.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=o.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&o.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===s)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??c7}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;s<o;s++)e.push(t[s])}updateCacheLineCount(e,t){e.lineCount=t??En(e.src),e.lastSegment=void 0,e.globalStateCarry=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-Dm))+t,o=jo(n);return e.globalStateCarry=n.length>Dm?n.slice(n.length-Dm):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,i){if(o<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,h=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:h,srcOffset:this.getLineStartOffset(t,d,s,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,h=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:h,srcOffset:this.getLineStartOffset(t,d,s,i)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,i=-1;for(;s>0;){if(i=e.indexOf(`
|
|
113
|
-
`,i+1),i===-1)return e.length;s--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let o=n,s=t-1;for(;o>0;){if(s=e.indexOf(`
|
|
114
|
-
`,s+1),s===-1)return e.length;o--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,o,s,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[s.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,o,s,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,o,s,i,r);default:return null}}tryListTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const h=t.lineCount??En(t.src);h>0&&this.shiftTokenLines(d,h);const m=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),f=this.getListParagraphMode(u,0,u.length,0);(m==="loose"||f==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=h+En(i);t.lineCount=g;const _=this.getDocLineCount(e,g);return r.map&&(r.map[1]=_),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:_,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(s.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const h=this.getTableBodySection(d,0,d.length,0),m=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!h||!m||h.tbodyOpenIndex<0||h.tbodyCloseIndex<0)return null;const f=m.tbodyOpenIndex>=0?d.slice(h.tbodyOpenIndex+1,h.tbodyCloseIndex):d.slice(h.tbodyOpenIndex,h.tbodyCloseIndex+1);if(f.length===0)return null;const g=s.lineEnd-2;g!==0&&this.shiftTokenLines(f,g);const _=m.tbodyCloseIndex>=0?m.tbodyCloseIndex:m.tableCloseIndex,w=t.lineCount??En(t.src);t.tokens.splice(_,0,...f),t.src=e,t.env=n,t.globalStateReason=null;const y=w+En(i);t.lineCount=y;const b=this.getDocLineCount(e,y);if(r.map&&(r.map[1]=b),m.tbodyOpenIndex>=0){const v=t.tokens[m.tbodyOpenIndex];v?.map&&(v.map[1]=b)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:b,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
|
|
115
|
-
`);if(t<0)return null;const n=e.indexOf(`
|
|
116
|
-
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,o){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===o){s=l;break}}if(s<0)return null;let i=-1,r=-1;for(let l=t+1;l<s;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===o+1){i=l;break}}if(i>=0){for(let l=s-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===o+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,o){if(e.length<2)return!1;const s=e[0],i=e[e.length-1];if(s.type!==t||i.type!==n||s.level!==0||i.level!==0||o!==void 0&&s.markup!==o)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,o){let s=!1,i=!1;const r=o+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?s=!0:i=!0,s&&i))return"loose"}return i?"loose":s?"tight":"none"}setListParagraphVisibility(e,t,n,o,s){const i=o+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=s)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const o=e.charCodeAt(n);if(o===32||o===9){n--;continue}return o===10}return!0}getDocLineCount(e,t=En(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let o=0;o<e.length;o++){const s=e[o];if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children){n??=[];for(let i=s.children.length-1;i>=0;i--)n.push(s.children[i]);for(;n.length>0;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let r=i.children.length-1;r>=0;r--)n.push(i.children[r])}}}}};const Ew={default:n7,zero:o7,commonmark:t7};function p7(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function m7(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 Iw(e){return e.experimental?{...e,...e.experimental}:e}function Es(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 $w(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(Es(t,s)||Es(e,s))return!0}return!1}function Nw(e,t,n){return Es(t,n)||Es(e,n)}function Lw(e,t){const n=Ei(e)?.chunk;if(n?.fallback){Dn(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}Dn(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function g7(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamLargeCachePolicy:"retain",streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},o="default",s;!t&&typeof e!="string"?(s=e,o="default"):typeof e=="string"&&(o=e,s=t);const i=Ew[o];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${o}", check name`);if(i?.options&&(n={...n,...i.options}),s&&(n={...n,...s}),n=Iw(n),typeof n.quotes=="string"){const k=n.quotes;k.length>=4?n.quotes=[k[0],k[1],k[2],k[3]]:n.quotes=["“","”","‘","’"]}let r=$w(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=$w(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=Nw(i?.options,s,"fullChunkedFallback"),c=Nw(i?.options,s,"streamChunkedFallback"),u=!1,d=null,h=null;const m=new rD;let f=null;const g=()=>(f||(f=new a7(n)),f);let _=null;const w=()=>(_||(_=new h7(m)),_);let y=null;const b=()=>(y||(y=new iT),y),v=k=>!u&&!!d&&!m7(k,d),x=(k,T)=>o==="default"&&!u&&f===null&&h!==null&&k.parse===h&&v(k)&&!k.stream.enabled&&T<(k.options.autoUnboundedThresholdChars??4e6)&&k.options.html===!1&&k.options.xhtmlOut===!1&&k.options.breaks===!1&&k.options.langPrefix==="language-"&&k.options.linkify===!1&&k.options.typographer===!1&&k.options.highlight===null,L=(k,T)=>o==="default"&&!u&&v(k)&&!k.stream.enabled&&!k.options.fullChunkedFallback&&T<(k.options.autoUnboundedThresholdChars??4e6)&&k.options.html===!1&&k.options.linkify===!1&&k.options.typographer===!1,N={core:m,block:m.block,inline:m.inline,get linkify(){const k=b();return Object.defineProperty(this,"linkify",{value:k,writable:!0,configurable:!0}),k},get renderer(){const k=g();return Object.defineProperty(this,"renderer",{value:k,writable:!0,configurable:!0}),k},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return v(this)},set(k){const T=Iw(k);return this.options={...this.options,...T},(Es(k,"fullChunkSizeChars")||Es(k,"fullChunkSizeLines")||Es(k,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(Es(k,"streamChunkSizeChars")||Es(k,"streamChunkSizeLines")||Es(k,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),Es(k,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),Es(k,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),f&&f.set(T),typeof T.stream=="boolean"&&(this.stream.enabled=T.stream,_&&(_.reset(),_.resetStats())),this},configure(k){const T=typeof k=="string"?Ew[k]:k;if(!T)throw new Error("Wrong `markdown-it` preset, can't be empty");if(T.options&&this.set(T.options),T.components){const E=T.components;E.core?.rules&&this.core.ruler.enableOnly(E.core.rules),E.block?.rules&&this.block.ruler.enableOnly(E.block.rules),E.inline?.rules&&this.inline.ruler.enableOnly(E.inline.rules),E.inline2?.rules&&this.inline.ruler2.enableOnly(E.inline2.rules)}return this},enable(k,T){const E=Array.isArray(k)?k:[k],O=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],A=new Set;for(const $ of O){if(!$)continue;const R=$.enable(E,!0);for(let D=0;D<R.length;D++)A.add(R[D])}if(!T){const $=E.filter(R=>!A.has(R));if($.length)throw new Error(`Rules manager: invalid rule name ${$.join(", ")}`)}return this},disable(k,T){const E=Array.isArray(k)?k:[k],O=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],A=new Set;for(const $ of O){if(!$)continue;const R=$.disable(E,!0);for(let D=0;D<R.length;D++)A.add(R[D])}if(!T){const $=E.filter(R=>!A.has(R));if($.length)throw new Error(`Rules manager: invalid rule name ${$.join(", ")}`)}return this},use(k,...T){const E=typeof k=="function"?k:k&&typeof k.default=="function"?k.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const O=[this,...T],A=k;return u=!0,E.apply(A,O),this},render(k,T){if(x(this,k.length)){T!==void 0&&Ao(T);const A=bw(k);if(A!==null)return T!==void 0&&Dn(T,{area:"render",path:"stock-fast",reason:"stock-subset"}),A}const E=T??{},O=this.parse(k,E);return g().render(O,this.options,E)},async renderAsync(k,T){if(x(this,k.length)){T!==void 0&&Ao(T);const A=bw(k);if(A!==null)return T!==void 0&&Dn(T,{area:"render",path:"stock-fast",reason:"stock-subset"}),A}const E=T??{},O=this.parse(k,E);return g().renderAsync(O,this.options,E)},renderIterable(k,T={}){const E=this.parseIterable(k,T);return g().render(E,this.options,T)},async renderAsyncIterable(k,T={}){const E=await this.parseAsyncIterable(k,T);return g().renderAsync(E,this.options,T)},renderInline(k,T={}){const E=this.parseInline(k,T);return g().render(E,this.options,T)},validateLink:CT,normalizeLink:ST,normalizeLinkText:xT,utils:TP,helpers:{...pO},parse(k,T){if(typeof k!="string")throw new TypeError("Input data should be a String");if(T!==void 0&&Ao(T),L(this,k.length)){const $=yD(k);if($!==null)return T!==void 0&&Dn(T,{area:"parse",path:"stock-fast",reason:"stock-subset"}),$}const E=T??{};let O;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&v(this)){const $=DT(this,k.length);if($==="yes"){const R=Pc(this,k,E);return Dn(T,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),R}$==="need-lines"&&(O=En(k))}if(!this.stream.enabled){const $=k.length,R=this.options.autoTuneChunks!==!1,D=r,W=!a&&v(this),V=!!this.options.fullChunkedFallback,U=W&&$>=2e5;let ee;(V||U||O!==void 0)&&(ee=O??En(k));const K=(V||U)&&R&&!D?e7($,ee,this.options):null;if(V||U){const G=ee??0;if(V?$>=(this.options.fullChunkThresholdChars??2e4)||G>=(this.options.fullChunkThresholdLines??400):U){if(K&&K.strategy!=="plain"){const X=jf(this,k,E,{maxChunkChars:K.maxChunkChars,maxChunkLines:K.maxChunkLines,fenceAware:K.fenceAware,maxChunks:K.maxChunks});return T&&Lw(T,V?"explicit-full-chunk":"default-large-string"),X}if(V){const X=(ce,Ce,q)=>ce<Ce?Ce:ce>q?q:ce,ke=this.options.fullChunkAdaptive!==!1,le=this.options.fullChunkTargetChunks??8,He=X(Math.ceil($/le),8e3,64e3),ue=X(Math.ceil(G/le),150,700),ve=ke?He:this.options.fullChunkSizeChars??1e4,Pe=ke?ue:this.options.fullChunkSizeLines??200,Re=ke?X(Math.ceil($/64e3),le,32):this.options.fullChunkMaxChunks,Q=jf(this,k,E,{maxChunkChars:ve,maxChunkLines:Pe,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Re});return T&&Lw(T,"explicit-full-chunk"),Q}}}if(O!==void 0&&v(this)&&RT(this,$,ee??O)){const G=Pc(this,k,E);return Dn(T,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),G}}const A=jo(k);return Dn(T,{area:"parse",path:"plain",reason:"default-plain"}),wa(E,A,()=>m.parse(k,E,this).tokens)},parseIterable(k,T={}){return Ao(T),XD(this,k,T)},parseAsyncIterable(k,T={}){return Ao(T),QD(this,k,T)},parseIterableToSink(k,T,E={}){return Ao(E),ZD(this,k,T,E)},parseAsyncIterableToSink(k,T,E={}){return Ao(E),JD(this,k,T,E)},parseInline(k,T={}){if(typeof k!="string")throw new TypeError("Input data should be a String");Ao(T),Au(T)&&zi(T);const E=m.createState(k,T,this);return E.inlineMode=!0,m.process(E),E.tokens}};if(N.stream={enabled:!!n.stream,parse(k,T){return N.stream.enabled?w().parse(k,T,N):N.parse(k,T??{})},reset(){w().reset()},peek(){return _?_.peek():[]},stats(){return _?_.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){_&&_.resetStats()}},i?.components){const k=i.components;k.core?.rules&&N.core.ruler.enableOnly(k.core.rules),k.block?.rules&&N.block.ruler.enableOnly(k.block.rules),k.inline?.rules&&N.inline.ruler.enableOnly(k.inline.rules),k.inline2?.rules&&N.inline.ruler2.enableOnly(k.inline2.rules)}return d=p7(N),h=N.parse,N}var v7=g7;const UT=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],y7=["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"],jT=["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"],k7=["svg","g","path"],b7=["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"],w7=["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"],_7=["action","data","href","src","srcset","poster","xlink:href","formaction"],C7=["script"],S7=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Tl=new Set(UT),x7=new Set(jT),uu=new Set([...UT,...y7,...jT,...k7]),qT=new Set([...uu,...b7]),T7=new Set(w7),A7=new Set(_7),Eu=new Set(C7),zT=new Set(S7);function VT(e){let t="";for(const n of e){const o=n.charCodeAt(0);o<=31||o>=127&&o<=159||/\s/u.test(n)||(t+=n)}return t}const M7={amp:"&",bsol:"\\",colon:":",newline:`
|
|
117
|
-
`,sol:"/",tab:" "};function KT(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,o,s)=>{const i=n??o;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return M7[String(s??"").toLowerCase()]??t})}const Td=new Set(["http","https","mailto","tel"]),E7=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),tl=new Set(["http","https"]);function GT(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function I7(e,t,n){if(!Dc(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function Dc(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function $7(e,t){return t==="href"||t==="xlink:href"?Dc(e,t)?Td:tl:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?tl:(Dc(e,t),Td)}function vl(e,t={}){const n=VT(KT(e)).toLowerCase(),o=String(t.tagName??"").toLowerCase(),s=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return o==="img"&&s==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=GT(n);return i?i==="file"?!I7(n,o,s):Dc(o,s)?E7.has(i):!$7(o,s).has(i):!1}function N7(e){const t=KT(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=GT(VT(t).toLowerCase());return n==="http"||n==="https"}function L7(e,t={}){const n=String(e??"").trim();return n?vl(n,t)?"":n:""}function Pw(e){return L7(e,{tagName:"img",attrName:"src"})}function P7(e,t,n){function o(h){return h.trim().split(" ",2)[0]===t}function s(h,m,f,g,_){return h[m].nesting===1&&h[m].attrJoin("class",t),_.renderToken(h,m,f,g,_)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(h,m,f,g){let _,w=!1,y=h.bMarks[m]+h.tShift[m],b=h.eMarks[m];if(l!==h.src.charCodeAt(y))return!1;for(_=y+1;_<=b&&r[(_-y)%a]===h.src[_];_++);const v=Math.floor((_-y)/a);if(v<i)return!1;_-=(_-y)%a;const x=h.src.slice(y,_),L=h.src.slice(_,b);if(!c(L,x))return!1;if(g)return!0;let N=m;for(;N++,!(N>=f||(y=h.bMarks[N]+h.tShift[N],b=h.eMarks[N],y<b&&h.sCount[N]<h.blkIndent));)if(l===h.src.charCodeAt(y)&&!(h.sCount[N]-h.blkIndent>=4)){for(_=y+1;_<=b&&r[(_-y)%a]===h.src[_];_++);if(!(Math.floor((_-y)/a)<v)&&(_-=(_-y)%a,_=h.skipSpaces(_),!(_<b))){w=!0;break}}const k=h.parentType,T=h.lineMax;h.parentType="container",h.lineMax=N;const E=h.push("container_"+t+"_open","div",1);E.markup=x,E.block=!0,E.info=L,E.map=[m,N],h.md.block.tokenize(h,m+1,N);const O=h.push("container_"+t+"_close","div",-1);return O.markup=h.src.slice(y,_),O.block=!0,h.parentType=k,h.lineMax=T,h.line=N+(w?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 O7(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const o=[];let s="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){s+=c,a+1<n.length&&(s+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,s+=c;continue}if(!i&&c==='"'){r=!r,s+=c;continue}if(!i&&!r&&c===","){o.push(s.trim()),s="";continue}s+=c}s.trim()&&o.push(s.trim());const l={};for(const a of o){if(!a)continue;let c=!1,u=!1,d=-1;for(let _=0;_<a.length;_++){const w=a[_];if(w==="\\"){_++;continue}if(!u&&w==="'"){c=!c;continue}if(!c&&w==='"'){u=!u;continue}if(!c&&!u&&w===":"){d=_;break}}if(d===-1)return null;const h=a.slice(0,d).trim(),m=a.slice(d+1).trim();if(!h)return null;let f=h;if(f.startsWith('"')&&f.endsWith('"')||f.startsWith("'")&&f.endsWith("'"))try{f=JSON.parse(f.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(f))return null;let g;if(!m)g="";else if(m.startsWith('"')&&m.endsWith('"')||m.startsWith("'")&&m.endsWith("'"))try{g=JSON.parse(m.replace(/^'/,'"').replace(/'$/,'"'))}catch{g=m}else/^-?\d+(?:\.\d+)?$/.test(m)?g=Number(m):m==="true"||m==="false"?g=m==="true":m==="null"?g=null:g=m;l[f]=g}return l}function R7(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(P7,t,{render(n,o){return n[o].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
118
|
-
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let h,m;const f=d.indexOf("{"),g=f>=0?d.slice(f).trimStart():void 0;if(f===-1)h=d||void 0;else{if(h=d.slice(0,f).trim()||void 0,g?.startsWith("{")){let x=0,L=-1;for(let N=0;N<g.length;N++)if(g[N]==="{"?x++:g[N]==="}"&&x--,x===0){L=N+1;break}L>0&&(m=g.slice(0,L))}m||(h=d||void 0)}if(s)return!0;const _=!!i.env.__markstreamFinal;let w=n+1,y=!1;for(;w<=o;){const x=i.bMarks[w]+i.tShift[w],L=i.eMarks[w];if(i.src.slice(x,L).trim()===":::"){y=!0;break}w++}y||(w=o);const b=i.push("vmr_container_open","div",1);if(b.attrSet("class",`vmr-container vmr-container-${u}`),b.meta={...b.meta??{},unclosed:!y&&!_},h&&b.attrSet("data-args",h),m)try{const x=JSON.parse(m);for(const[L,N]of Object.entries(x)){const k=N!=null&&typeof N=="object";b.attrSet(`data-${L}`,k?JSON.stringify(N):String(N))}}catch{const x=O7(m);if(x)for(const[L,N]of Object.entries(x)){const k=N!=null&&typeof N=="object";b.attrSet(`data-${L}`,k?JSON.stringify(N):String(N))}else b.attrSet("data-attrs",m)}const v=[];for(let x=n+1;x<w;x++){const L=i.bMarks[x]+i.tShift[x],N=i.eMarks[x];v.push(i.src.slice(L,N))}if(v.some(x=>x.trim().length>0)){let x=v.join(`
|
|
119
|
-
`);x.endsWith(`
|
|
120
|
-
`)||(x+=`
|
|
121
|
-
`),x.endsWith(`
|
|
122
|
-
|
|
123
|
-
`)||(x+=`
|
|
124
|
-
`);const L=i.tokens[i.tokens.length-1];L&&(L.raw=x);const N=[];i.md.block.parse(x,i.md,i.env,N),i.tokens.push(...N)}return y&&i.push("vmr_container_close","div",-1),i.line=y?w+1:w,!0},{alt:["paragraph","reference","blockquote","list"]})}function hs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xn(e){let t=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="\\"){o++;continue}if(!n&&s==="'"){t=!t;continue}if(!t&&s==='"'){n=!n;continue}if(!t&&!n&&s===">")return o}return-1}function qh(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=o[2]||o[3]||o[4]||"";t.push([s,i])}return t}const D7=/^[a-z][a-z0-9_-]*$/;function Ow(e){return D7.test(String(e??"").trim().toLowerCase())}function Hs(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return Ow(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const o=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const s=t.slice(o,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":Ow(s)?s:""}function Ba(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=Hs(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function B7(...e){const t=new Set,n=[];for(const o of e)for(const s of Ba(o))t.has(s)||(t.add(s),n.push(s));return n}function F7(e){const t=Ba(e);return{key:t.join(","),tags:t}}function YT(e){return Hs(e)}function H7(e,t){const n=String(e??""),o=Hs(t);if(!o)return!1;const s=hs(o),i=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function XT(e,t){const n=Hs(t);return!!n&&!uu.has(n)&&!H7(e,n)}function W7(e,t){const n=String(e??""),o=Hs(t);if(!o)return n;const s=hs(o),i=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const QT=Tl,U7=uu,ZT=new Set(x7);ZT.delete("details");const j7=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,q7=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,h1=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,z7=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Vf(e){return(e.match(h1)?.[1]??"").toLowerCase()}function Xv(e){return/^\s*<\s*\//.test(e)}function Qv(e,t){return QT.has(t)||/\/\s*>\s*$/.test(e)}function V7(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(!s||s.type!=="html_inline")continue;const i=String(s.content??""),r=Vf(i);if(r===t){if(Xv(i)){if(n===0)return o;n--;continue}Qv(i,r)||n++}}return-1}function K7(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=Vf(s);if(i===t){if(Xv(s)){n>0&&n--;continue}Qv(s,i)||n++}}return n}function Rw(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${hs(t)}(?=[\s>/])[^>]*>`,"gi");o.lastIndex=Math.max(0,n);let s=0,i;for(;(i=o.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(s===0)return{start:i.index,end:i.index+r.length};s--;continue}a||s++}return null}function G7(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${hs(t)}(?=[\s>/])[^>]*>`,"gi");let o=0,s;for(;(s=n.exec(e))!==null;){const i=s[0]??"",r=!!s[1],l=!r&&/\/\s*>$/.test(i);if(r){o>0&&o--;continue}l||o++}return o}function Kf(e){const t=e;return String(t.raw??t.content??t.markup??"")}function Y7(e){const t=e;return t.meta||(t.meta={}),t.meta}function Bm(e,t,n){const o=Y7(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function X7(e,t){if(!t.size)return;const n=Array.from(t,m=>new RegExp(String.raw`<\s*${hs(m)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=m=>m?n.some(f=>f.test(m)):!1,r=m=>{if(!(!m||!o.length))for(const f of o)f.raw+=m,f.inner+=m},l=()=>{!o.length||!s||(r(`
|
|
125
|
-
`),s=!1)},a=m=>{r(m)},c=m=>{for(let g=0;g<o.length;g++)o[g].raw+=m,g<o.length-1&&(o[g].inner+=m);const f=o.pop();Bm(f.token,f.raw,f.inner)},u=m=>{const f=o[o.length-1]?.tag;if(!f)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${hs(f)}\s*>`,"i");return m.match(g)?.[0]??null},d=m=>!!u(m),h=(m,f,g)=>{const _=g??(m.type==="html_inline"?Vf(f):"");if(!(_&&t.has(_))){r(f);return}const w=Xv(f),y=!w&&Qv(f,_);if(w){if(!o.length||o[o.length-1].tag!==_){r(f);return}c(f);return}if(r(f),y){Bm(m,f,"");return}o.push({tag:_,token:m,raw:f,inner:""})};for(const m of e){if(m.type==="inline"&&Array.isArray(m.children)){const f=String(m.content??"");if(d(f)?s=!1:l(),!o.length&&!i(f)){s=!1;continue}let g=0,_=!0;for(const w of m.children){const y=Kf(w),b=w.type==="html_inline"?Vf(y):"",v=b&&t.has(b);let x=y;if(_&&f&&y&&(o.length||v)){const L=f.indexOf(y,g);if(L!==-1)a(f.slice(g,L)),x=f.slice(L,L+y.length),g=L+y.length;else{if(o.length&&!v)continue;_=!1}}h(w,x,b)}_&&f&&g<f.length&&o.length&&a(f.slice(g)),s=o.length>0;continue}if(o.length&&typeof m.content=="string"){const f=Kf(m),g=m.type==="html_block"?u(f):null;if(g){c(`${s?`
|
|
126
|
-
`:""}${g}`),s=o.length>0;continue}if(!m.content)continue;l(),r(m.content),s=!0}}for(const m of o)Bm(m.token,m.raw,m.inner)}function Q7(e){return/^\s*<\s*[!?]/.test(e)}function Z7(e){const t=new Set(U7);if(e&&Array.isArray(e))for(const n of e){const o=String(n??"").trim();if(!o)continue;const s=o.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function Dw(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function J7(e,t){let n=null;for(const i of e.matchAll(j7)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Dw(l,t)&&xn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(q7)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Dw(l,t)&&xn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const o=/<\/\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const s=/<\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function eB(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function tB(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(eB(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 h=a.slice(d),m=h.match(h1);if(!m){i("<",c),u=d+1;continue}const f=xn(h);if(f===-1){i("<",c),u=d+1;continue}const g=h.slice(0,f+1),_=(m[1]??"").toLowerCase();t.has(_)?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=J7(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),o={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},s=o.buffer}for(const a of e){if(o){o.buffer+=Kf(a),s=o.buffer;const c=xn(o.buffer);if(c===-1)continue;const u=o.buffer.slice(0,c+1),d=o.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),o=null,s=null,d&&l(d);continue}if(a.type==="html_inline"){const c=Kf(a),u=(c.match(h1)?.[1]??"").toLowerCase();if(u&&t.has(u)&&xn(c)===-1){o={tag:u,buffer:c,closing:/^<\s*\//.test(c)},s=o.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:s??void 0}}const nB=["a","span","strong","em","b","i","u"];function oB(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const h of t.customHtmlTags){const m=Hs(h);m&&n.add(m)}const o=h=>{const m=h,f=new Set(n),g=Array.isArray(m.env?.__markstreamCustomHtmlTags)?m.env.__markstreamCustomHtmlTags:[];for(const b of g){const v=Hs(String(b??""));v&&f.add(v)}const _=Z7(Array.from(f)),w=new Set(nB);for(const b of f)w.add(b);return{autoCloseInlineTagSet:w,commonHtmlTags:_,customTagSet:f,shouldMergeHtmlBlockTag:b=>f.has(b)||!_.has(b)||ZT.has(b)}},s=h=>{if(h.type==="html_block")return String(h.content??"");if(h.type!=="inline"||!Array.isArray(h.children)||h.children.length!==1)return"";const m=h.children[0];return m?.type!=="html_block"?"":String(h.content??m.content??"")},i=(h,m)=>{h.type="html_block",h.content=m,h.raw=m,h.children=[]},r=h=>h.replace(/^(?:\r?\n)+/,""),l=h=>/^(?: {4}|\t)/.test(h),a=h=>h.replace(/^(?: {4}|\t)/gm,""),c=(h,m)=>{const f=r(h);if(!/\S/.test(f))return[];if(l(f))return[{type:"code_block",content:a(f),raw:f}];const g=f.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const _={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return m==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},_,{type:"paragraph_close",tag:"p",nesting:-1}]:m==="text"?[{type:"text",content:g,raw:g}]:[_]},u=(h,m,f)=>h[m-1]?.type==="paragraph_open"&&h[m+1]?.type==="paragraph_close"?"inline":f,d=(h,m)=>{const f=r(m);return!/\S/.test(f)||h.type!=="inline"||!Array.isArray(h.children)?!1:(h.content=`${String(h.content??"")}${f}`,h.children.push({type:"text",content:f,raw:f}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",h=>{const m=h.tokens??[],{commonHtmlTags:f,customTagSet:g}=o(h);for(const _ of m){const w=_;if(w.type!=="inline"||!Array.isArray(w.children))continue;const y=String(w.content??""),b=w.children.length?w.children:y.includes("<")?[{type:"text",content:y,raw:y}]:null;if(b)try{const v=tB(b,f);if(w.children=v.children,v.pendingBuffer){const x=y.lastIndexOf(v.pendingBuffer);if(x!==-1){const L=y.slice(0,x);w.content=L,typeof w.raw=="string"&&(w.raw=L)}}}catch(v){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",v)}}X7(m,g)}),e.core.ruler.push("fix_html_inline_tokens",h=>{const m=h.tokens??[],{autoCloseInlineTagSet:f,customTagSet:g,shouldMergeHtmlBlockTag:_}=o(h),w=[];for(let y=0;y<m.length;y++){const b=m[y];if(w.length>0){const[x,L]=w[w.length-1];if(y!==L){if(b.type==="paragraph_open"||b.type==="paragraph_close"){m.splice(y,1),y--;continue}const N=String(b.content??b.raw??"");if(N){const k=m[L],T=`${String(k.content||"")}
|
|
127
|
-
${N}`,E=xn(T),O=E===-1?null:Rw(T,x,E+1);if(O){const A=T.slice(0,O.end),$=T.slice(O.end);k.content=A,k.loading=!1,m.splice(y,1),w.pop();const R=d(k,$)?[]:c($,u(m,y,"paragraph"));R.length&&m.splice(y,0,...R),y--;continue}k.content=T,k.loading!==!1&&(k.loading=!0)}m.splice(y,1),y--;continue}}const v=s(b);if(v){if(Q7(v))continue;const x=(v.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(v);if(!x||!_(x))continue;if(i(b,v),!L)x&&!new RegExp(`^\\s*<\\s*${x}\\b[^>]*\\/\\s*>`,"i").test(v)&&G7(v,x)>0&&w.push([x,y]);else if(w.length>0&&x&&w[w.length-1][0]===x){const[,N]=w[w.length-1],k=m[N];k.content=`${String(k.content||"")}
|
|
128
|
-
${v}`,k.loading=!1,w.pop(),m.splice(y,1),y--}continue}else if(w.length>0){if(b.type==="paragraph_open"||b.type==="paragraph_close"){m.splice(y,1),y--;continue}const x=b.content||"",L=new RegExp(`<\\s*\\/\\s*${w[w.length-1][0]}\\s*>`,"i").test(x);if(x){const[,N]=w[w.length-1],k=m[N];k.content=`${k.content||""}
|
|
129
|
-
${x}`,k.loading!==!1&&(k.loading=!L)}L&&w.pop(),m.splice(y,1),y--}else continue}if(g.size>0){const y=new Map,b=new Map,v=N=>{let k=y.get(N);return k||(k=new RegExp(`<\\s*${N}\\b`,"i"),y.set(N,k)),k},x=N=>{let k=b.get(N);return k||(k=new RegExp(`<\\s*\\/\\s*${N}\\s*>`,"i"),b.set(N,k)),k},L=[];for(let N=0;N<m.length;N++){const k=m[N],T=String(k.content??"");if(L.length>0){const O=L[L.length-1],A=m[O.index],$=k.type==="html_block"?x(O.tag).exec(T):null;if($){const W=$.index+$[0].length,V=T.slice(0,W),U=T.slice(W);A.content=`${String(A.content??"")}
|
|
130
|
-
${V}`,Array.isArray(A.children)&&A.children.push({type:"html_inline",content:`</${O.tag}>`,raw:`</${O.tag}>`}),L.pop();const ee=d(A,U)?[]:c(U,u(m,N,"paragraph"));ee.length?m.splice(N,1,...ee):(m.splice(N,1),N--);continue}if(k.type!=="inline")continue;const R=Array.isArray(k.children)?k.children:[],D=V7(R,O.tag);if(D!==-1){const W=R.slice(0,D+1),V=R.slice(D+1),U=W.map(ee=>String(ee?.content??ee?.raw??"")).join("");if(A.content=`${String(A.content??"")}
|
|
131
|
-
${U}`,Array.isArray(A.children)&&A.children.push(...W),V.length){const ee=V.map(K=>String(K.content??K.raw??"")).join("");if(ee.trim()){const K=ee.replace(/^\s+/,"");if(d(A,ee))m.splice(N,1),N--;else if(K.startsWith("<"))m.splice(N,1,{type:"html_block",content:K});else{const G=c(ee,u(m,N,"paragraph"));m.splice(N,1,...G)}}else m.splice(N,1),N--}else m.splice(N,1),N--;L.pop();continue}A.content=`${String(A.content??"")}
|
|
132
|
-
${T}`,Array.isArray(A.children)&&A.children.push(...R),m.splice(N,1),N--;continue}if(k.type!=="inline")continue;const E=Array.isArray(k.children)?k.children:[];for(const O of g)if((E.length?K7(E,O):v(O).test(T)&&!x(O).test(T)?1:0)>0){L.push({tag:O,index:N});break}}}{let y=0;for(let b=0;b<m.length;b++){const v=m[b];if(v.type==="paragraph_open"){y++;continue}v.type==="paragraph_close"&&(y>0?y--:(m.splice(b,1),b--))}}for(let y=0;y<m.length;y++){const b=m[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 D=String(b.content??""),W=xn(D),V=W===-1?null:Rw(D,k,W+1);b.loading=V?!1:b.loading!==void 0?b.loading:!0;const U=V?.start??-1,ee=V?V.end-V.start:0;if(U!==-1){const K=D.slice(0,U+ee);let G="";W!==-1&&W<U&&(G=D.slice(W+1,U)),b.children=[{type:k,content:G,raw:K,attrs:[],tag:k,loading:!1}],b.content=K,b.raw=K;const X=c(D.slice(U+ee)||"","text");X.length&&m.splice(y+1,0,...X)}else b.children=[{type:k,content:"",raw:D,attrs:[],tag:k,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(k))continue;b.type="inline";const T=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let E;for(;(E=T.exec(b.content||""))!==null;)E[1],E[2]||E[3]||E[4];const O=String(b.content??""),A=new RegExp(`<\\/\\s*${k}\\s*>`,"i").exec(O),$=A?A.index:-1,R=A?A[0].length:0;if($!==-1){const D=O.slice(0,$+R),W=(O.slice($+R)||"").replace(/^\s+/,"");b.children=[{type:"html_block",content:D,tag:k,loading:!1}],b.content=D,b.raw=D,W&&m.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(),T=b.children[1],E=String(T?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(T?.type==="html_inline"&&E===k)continue;f.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(f.has(k))continue;b.children=[{type:"html_block",loading:!1,tag:k,content:b.children.map(T=>T.content).join("")}];continue}if(!b.content?.startsWith("<")||b.children?.length!==1)continue;const v=String(b.content),x=b,L=x.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(v)&&(x.children.length=0);continue}const N=String(L.content??v).match(z7)?.[1]?.toLowerCase()??"";if(N){if(/\/\s*>\s*$/.test(v)||QT.has(N)){x.children=[{type:"html_inline",content:v}];continue}x.children.length=0}}})}function sB(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 iB(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const o=n.tokens??[];for(let s=0;s<o.length;s++){const i=o[s];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!sB(l[0]??"")){const a=l[0]??"",c=i.level??0;o.splice(s,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),s+=2}}})}const JT=/\.([a-z0-9]{1,15})$/i,rB=/[_()[\]{}<>]/u,lB=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,aB=/[?#@]/u,cB=/[\\/]/u,uB=/^[\p{L}\p{N}./\\-]+$/u,dB=/^[A-Za-z0-9-]{1,63}$/u,fB=/^xn--[a-z0-9-]{2,59}$/i,hB=/^(?:[A-Z]{1,6}|\d{1,8})$/u,pB=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,mB=/文件名\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,gB=/文件名\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,vB=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,yB=new Set(["ai","md","py","rs","sh","zip"]),eA=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),kB=new Set([...eA,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),bB=new Set(["com","dev","io","page","site"]),wB=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),_B=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 du(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Fm(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return du(n)?n:void 0}function Bw(e,t){if(!du(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 Fw(e){const t=Iu(e);return du(t)?t:void 0}function CB(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Hw(e,t){if(!du(t))return;const n=String(e??"").trim().split(/\s+/u).map(CB).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>Gf(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>Gf(s,{marketTicker:!0}))&&(o.marketTicker=!0),du(o)?o:void 0}function Fr(e,t=!1){let n;return{options(o){return t||o==null?Bw(e,n):Bw(e,Fm(Fw(o),Hw(o,n)))},remember(o){const s=Fw(o);n=t?Fm(n,s):Fm(s,Hw(o,n))},reset(){n=void 0}}}function Ww(e){return dB.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function SB(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return Ww(n)||fB.test(n)?t.every(Ww):!1}function tA(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function xB(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function TB(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function nA(e,t,n){const o=xB(t);return tA(e)&&TB(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function Iu(e){const t=String(e??"");return{explicitFilename:mB.test(t),filename:gB.test(t),marketTicker:vB.test(t)}}function AB(e){return SB(e.split(/[\\/]/)[0]??"")}function MB(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function EB(e){if(rB.test(e)||!uB.test(e))return!0;if(cB.test(e))return!AB(e);const t=e.replace(JT,"");return tA(t)?!0:t.split(".").filter(Boolean).some(MB)}function IB(e,t,n){if(!(n?kB:eA).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?pB:hB).test(o)}function Gf(e,t={}){if(!e||lB.test(e)||aB.test(e))return!1;const n=e.match(JT);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return IB(e,o,t.marketTicker===!0)?!0:_B.has(o)?!yB.has(o)||t.filename?!0:EB(e):!!(t.explicitFilename&&bB.has(o)||t.filename&&wB.has(o))}const Uw=["!"];function Wo(e){return{type:"text",content:e,raw:e}}function nl(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 ol(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 ir(e,t,n){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return{type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function $B(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(Wo(t))}}function jw(e,t){let n=-1;for(const o of t){const s=e.indexOf(o);s!==-1&&(n===-1||s<n)&&(n=s)}return n}function NB(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function LB(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(o=>o?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function PB(e,t,n){let o="";for(let s=t+1;s<n;s++){const i=e[s];if(i?.type!=="text"||typeof i.content!="string")return null;o+=i.content}return o||null}function OB(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=RB(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function RB(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=Iu(t);for(let o=0;o<=e.length-1;o++){o<0&&(o=0);const s=e[o];if(!s)break;if(s.type==="link_open"&&(s.markup==="linkify"||s.markup==="autolink")){let i=-1;for(let r=o+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=PB(e,o,i),l=NB(s);if(s.markup==="linkify"&&r&&!nA(r,l,t)&&Gf(r,n)){e.splice(o,i-o+1,Wo(r));continue}const a=jw(l,Uw);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=jw(u.content,Uw);if(d===-1)continue;const h=u.content[d],m=u.content.slice(0,d);let f=u.content.slice(d);for(let w=c+1;w<i;w++){const y=e[w];y?.type==="text"&&typeof y.content=="string"&&(f+=y.content)}u.content=m,u.raw=m;const g=i-(c+1);g>0&&(e.splice(c+1,g),i=c+1);let _=l;if(a!==-1)_=l.slice(0,a);else if(f){const w=encodeURI(f);if(w&&l.endsWith(w))_=l.slice(0,l.length-w.length);else{const y=h?encodeURI(h):"",b=y?l.indexOf(y):-1;b!==-1&&(_=l.slice(0,b))}}_!==l&&LB(s,_),f&&e.splice(i+1,0,Wo(f));break}}}if(s?.type==="em_open"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("*")){const i=e[o-1].content?.replace(/(\*+)$/,"")||"";e[o-1].content=i,s.type="strong_open",s.tag="strong",s.markup="**";for(let r=o+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(s?.type==="text"&&s.content?.endsWith("(")&&e[o+1]?.type==="link_open"){const i=s.content.match(/\[([^\]]+)\]/);if(i){let r=s.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(Wo(r));const c=i[1],u=l[1].length;nl(a,u);let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(ir(c,d,!e[o+4]?.content?.startsWith(")"))),ol(a,u),e[o+4]?.type==="text"){const h=e[o+4].content?.replace(/^\)\**/,"");h&&a.push(Wo(h)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(Wo(r));let c=i[1];const u=c.match(/^\*+/);if(u){const h=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let m=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(m+=e[o+4]?.content||"",e[o+4].content=""),nl(a,h),a.push(ir(c,m,!e[o+4]?.content?.startsWith(")"))),ol(a,h),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(Wo(f)),e.splice(o,5,...a)}else e.splice(o,4,...a);o===0?o=a.length-1:o-=a.length+1;continue}let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(ir(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const h=e[o+4].content?.replace(/^\)/,"");h&&a.push(Wo(h)),e.splice(o,5,...a)}else e.splice(o,4,...a)}o-=a.length+1;continue}}else if(s.type==="link_open"&&s.markup==="linkify"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("(")){if(e[o-2]?.type==="link_close"){const i=[],r=e[o-3].content||"";let l=s.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[o+3]?.type==="text"){const a=(e[o+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[o+3]?.content?.slice(0,a)||"",e[o+3].content=""),i.push(ir(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(Wo(u)),e.splice(o-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(o-4,7,...i);continue}else if(e[o-1].content==="]("&&e[o-3]?.type==="text"&&e[o-3].content?.endsWith(")"))if(e[o-2]?.type==="strong_open"){const[i,r]=e[o-3].content?.split("[**")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else if(e[o-2]?.type==="em_open"){const[i,r]=e[o-3].content?.split("[*")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else{const[i,r]=e[o-3].content?.split("[")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}}if(s.type==="link_close"&&s.nesting===-1&&e[o-2]?.type==="link_open"&&e[o+1]?.type==="text"&&e[o-1]?.type==="text"){const i=e[o-1].content||"",r=e[o-2].attrs||[],l=r.find(f=>f[0]==="href")?.[1]||"",a=r.find(f=>f[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),h=[];if(d){u+=1;const f=d[1].length;nl(h,f)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let f=o+1;f<e.length;f++){const g=d?d[1].length:e[o-3].markup.length,_=e[f];if(g===1&&_.type==="em_close")break;if(g===2&&_.type==="strong_close")break;if(g===3&&(_.type==="em_close"||_.type==="strong_close"))break;c+=1}}const m={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(h.push(m),d){const f=d[1].length;ol(h,f)}e.splice(o-u,c,...h),o-=h.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].markup?.includes("*")&&e[o-4]?.type==="text"&&e[o-4].content?.endsWith("[")){const i=e[o-1].markup.length,r=[],l=e[o-4].content.slice(0,e[o-4].content.length-i);l&&r.push(Wo(l)),nl(r,i);const a=e[o-2].content||"";let c=s.content.slice(2),u=!0;if(e[o+1]?.type==="text"){const d=(e[o+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[o+1]?.content?.slice(0,d)||"",e[o+1].content="")}if(r.push(ir(a,c,u)),ol(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(Wo(d)),e.splice(o-4,8,...r)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...r):e.splice(o-4,7,...r);o-=r.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].type==="strong_close"&&e[o-4]?.type==="text"&&e[o-4]?.content?.includes("**[")){const i=[],r=e[o-4].content.split("**[")[0];r&&i.push(Wo(r)),nl(i,2);const l=e[o-2].content||"";let a=s.content.slice(2),c=!0;if(e[o+1]?.type==="text"){const u=(e[o+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[o+1]?.content?.slice(0,u)||"",e[o+1].content="")}if(i.push(ir(l,a,c)),ol(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(Wo(u)),e.splice(o-4,8,...i)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...i):e.splice(o-4,7,...i);o-=i.length+1;continue}else if(s.type==="strong_close"&&e[o+1]?.type==="text"&&e[o+1].content?.includes("](")&&e[o-1].type==="text"&&/\[.*$/.test(e[o-1].content||"")){const i=[],[r,l]=e[o-1].content?.split("[")||["",""];r&&i.push(Wo(r)),nl(i,2);let[a,c]=e[o+1].content.split("](");a=l+a;let u=4;if(e[o+2]?.type==="link_open"){const h=e[o+2].attrs?.find(m=>m[0]==="href")?.[1];e[o+5]?.type==="text"&&e[o+5].content==="."?(c=(h||c)+e[o+5].content,e[o+5].content=""):c=h||c,u+=3}let d=!0;if(s.nesting===-1&&(a=a.replace(/\*+$/,"")),e[o+2]?.type==="text"){const h=(e[o+2]?.content??"").indexOf(")");d=h===-1,h===-1&&(c+=e[o+2]?.content?.slice(0,h)||"",e[o+2].content="")}i.push(ir(a,c,d)),ol(i,2),e.splice(o-2,u,...i)}if(s.type==="text"&&/\*+\[[^\]]*$/.test(s.content||"")&&e[o+1]?.type==="strong_open"&&e[o+2]?.type==="text"&&e[o+2].content==="]("&&e[o+3]?.type==="link_open"&&e[o+5]?.type==="link_close"&&e[o+6]?.type==="text"&&e[o+6].content===")"&&e[o+7]?.type==="strong_close"){const i=(s.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[o+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[o+4]?.type==="text"&&(l=e[o+4].content||"");const a=[];nl(a,2),a.push(ir(r,l,!1)),ol(a,2),e.splice(o,9,...a),o-=a.length-1;continue}}}for(let o=0;o<e.length-1;o++){const s=e[o],i=e[o+1];if(s?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(s.href??"");if(String(s.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;$B(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function DB(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=BB(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function BB(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 FB(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=HB(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function HB(e){let t=0;const n=new Set,o=new Set;let s=0;for(let u=0;u<e.length;u++){const d=e[u],h=d.type;if(h==="strong_open"){t++;const m=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const g=e[f];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const w=e[_];m==="__"&&(g?.content?.endsWith("_")||w?.content?.startsWith("_")||w?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=m,d.raw=m,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(h==="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(h==="em_open"){s++;const m=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const g=e[f];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const w=e[_];m==="_"&&(g?.content?.endsWith("_")||w?.content?.startsWith("_")||w?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=m,d.raw=m,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,o.add(s))}else h==="em_close"&&(o.has(s)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),s--,s<0&&(s=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,h=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],m=c.slice(0,-1);m&&h.unshift({type:"text",content:m,raw:m}),l.splice(i,d,...h)}return l=WB(l),l}function WB(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const h=u.slice(0,d),m=u.slice(d+2);t.push(o),t.push(s),t.push(l),h&&t.push({...c,type:"text",content:h,raw:h}),t.push(a),m&&t.push({...c,type:"text",content:m,raw:m}),n+=6;continue}}if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=UB(e,n+6);if(u){t.push(o),t.push(s),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(o)}return t}function UB(e,t){for(let n=t;n<e.length;n++){const o=e[n];if(o?.type==="strong_open")return null;if(o?.type!=="text")continue;const s=String(o.content??""),i=s.indexOf("**");if(i!==-1)return{index:n,beforeClose:s.slice(0,i),afterClose:s.slice(i+2)}}return null}function jB(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=YB(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(o)&&(n.tokens=o)}catch(o){console.error("[applyFixTableTokens] failed to fix table tokens",o)}})}function qw(){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 zw(){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 Vw(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 oA(e,t){if(!e.startsWith("|")||e.includes(`
|
|
133
|
-
`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(o=>o.trim().length>0)?n:null}function Hm(e){return oA(e)!==null}function sA(e){return/^:?-+:?$/.test(e.trim())}function qB(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(sA)}function zB(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function VB(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(sA)&&zB(n)}function KB(e){return e==="|"||e==="|:"}function GB(e){const t=oA(e);return t!==null&&t.every(n=>!n.includes(":"))}function YB(e,t=!1,n=""){const o=[...e];if(e.length<3)return o;const s=e.length-2,i=e[s];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
|
|
134
|
-
`)[0]??"",[a="",c="",...u]=r.split(`
|
|
135
|
-
`),d=!t&&!r.includes(`
|
|
136
|
-
`)&&/\r?\n$/.test(n)&&Hm(r);if(!t&&(r.includes(`
|
|
137
|
-
`)&&u.length===0&&Hm(a)&&VB(c)||d)){const h=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>Vw(f)),m=[...qw(),...h,...zw()];o.splice(s-1,3,...m)}else if(r.includes(`
|
|
138
|
-
`)&&u.length===0&&Hm(a)&&qB(c)){const h=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>Vw(f)),m=[...qw(),...h,...zw()];o.splice(s-1,3,...m)}else r.includes(`
|
|
139
|
-
`)&&u.length===0&&GB(a)&&KB(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function XB(e,t,n,o){const s=e.length;if(n==="$$"&&o==="$$"){let c=t;for(;c<s-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=o;let l=0,a=t;for(;a<s;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var QB=XB;const ZB=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Yf=ZB.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),JB=/\\[a-z]+/i,iA="(?:\\\\|\\u0008)",eF=new RegExp(String.raw`${iA}(?:${Yf})\s*\{[^}]+\}`,"i"),tF=new RegExp(String.raw`(?:${iA})?(?:${Yf})\s*\{`,"i"),nF=/\\(?:text|frac|left|right|times)/,oF=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,sF=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,iF=/[A-Z]+\s*\([^)]+\)/i,rF=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,lF=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,aF=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,cF={"\b":"\\b","\v":"\\v","\f":"\\f"};function uF(e){let t="";for(const n of e)t+=cF[n]??n;return t}function aa(e){if(!e)return!1;const t=uF(e),n=t.trim();if(aF.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=JB.test(t),s=eF.test(t),i=tF.test(t),r=nF.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=oF.test(t)&&!sF.test(t),c=iF.test(t),u=rF.test(n),d=lF.test(t),h=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),m=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||h||m}const rA="__markstreamMathPluginApplied",p1=80,lA=2e4,Kw=lA+4096;function aA(e){return!!e[rA]}function dF(e){e[rA]=!0}const cA=["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"],fF=["cdot","mathbf{","partial","mu_{"],uA=cA.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),dA="[ \r\b\f\v]",hF=new RegExp(`([^\\\\])(${fF.map(e=>e).join("|")})+`,"g"),pF=/span\{([^}]+)\}/,mF=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,gF=/(^|[^\\])\\\r?\n/g,vF=/(^|[^\\])\\$/g,yF=new RegExp(`(${dA})|(${uA})\\b`,"g"),Gw=new Map,Yw=new Map;function kF(e){if(!e)return yF;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=Gw.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${dA})|(${s})\\b`,"g");return Gw.set(n,i),i}function bF(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=Yw.get(o);if(s)return s;const i=e?[Yf,uA].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Yf].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return Yw.set(o,r),r}const Xw={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Qw(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Zw(e){const t=/(^|[^\\])(__|\*\*)/g;let n,o=null;for(;(n=t.exec(e))!==null;)o={marker:n[2],index:n.index+(n[1]?.length??0)};return o}function rr(e,t){const n=t?.commands??cA,o=t?.escapeExclamation??!0,s=t?.commands==null,i=kF(s?void 0:n);let r=e.replace(i,(c,u,d,h,m)=>{if(u!==void 0&&Xw[u]!==void 0)return`\\${Xw[u]}`;if(d&&n.includes(d)){const f=m&&typeof h=="number"?m[h-1]:void 0;return f==="\\"||f&&/\w/.test(f)?c:`\\${d}`}return c});o&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=bF(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(pF,"span\\{$1\\}").replace(mF,"\\operatorname{span}\\{$1\\}"),l=l.replace(gF,`$1\\\\
|
|
140
|
-
`),l=l.replace(vF,"$1\\\\"),l=l.replace(hF,"$1\\$2"),l}function Jw(e){const t=e.trim();return!(!aa(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 fA(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const o=n;let s=1;for(;o+s<e.length&&e[o+s]==="`";)s++;let i=o+s,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===s){r=i;break}i+=l}if(r!==-1){t.push([o,r+s]),n=r+s;continue}n=o+s}return t}function Xf(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function wF(e,t=!1){const n=[];let o=0;for(;o<e.length-1;){if(e[o]==="!"&&e[o+1]==="["){const s=o;let i=o+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([s,l]),o=l;continue}if(t){n.push([s,e.length]),o=e.length;continue}}}o++}return n}function $u(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function m1(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if($u(e,o)){n=o+1;continue}return o}return-1}function Wm(e,t){let n=t;for(;n<e.length;){const o=m1(e,n);if(o===-1)return-1;if(o>0&&e[o-1]==="$"||o+1<e.length&&e[o+1]==="$"){n=o+1;continue}return o}return-1}function Cc(e,t,n=0){let o=Math.max(0,n);for(;o<e.length;){const s=e.indexOf(t,o);if(s===-1)return-1;if(!$u(e,s))return s;o=s+Math.max(1,t.length)}return-1}function e_(e,t,n=0,o=e.length,s=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,o));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=Xf(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}$u(e,a)||i++,r=a+Math.max(1,t.length)}return i}function Zv(e,t,n){const o=hu(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!hu(o.slice(0,s)).trim()||$u(o,s))return-1;const i=fA(o);if(Xf(i,s))return-1;const r=e_(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>e_(o,n,0,s,i))return-1;return s}function fu(e){return e===" "||e===" "}function hu(e){let t=e.length;for(;t>0&&fu(e[t-1]);)t--;return e.slice(0,t)}function t_(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
141
|
-
`&&t++;return t}function n_(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function _F(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(s===t){n++;continue}if(!fu(s))return!1}return n>=3}function CF(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let o=0;for(;t[n]==="-";)o++,n++;return o<3?!1:(t[n]===":"&&n++,n===t.length)}function SF(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(CF)}function xF(e){let t=0;if(!n_(e[t]))return!1;for(;n_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:fu(e[t+1])}function hA(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&&fu(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&fu(t[1])||xF(t)||_F(t)||SF(t))}function o_(e,t){return e?t?`${e}
|
|
142
|
-
${t}`:e:t}function g1(e){const t=String(e??"").trim();return t?aa(t):!1}function s_(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function pA(e){if(e.length<=Kw)return{source:e,lineOffset:0};let t=e.length-Kw;const n=e.indexOf(`
|
|
143
|
-
`,t);return n===-1?{source:"",lineOffset:t_(e)}:(t=n+1,{source:e.slice(t),lineOffset:t_(e.slice(0,t))})}function mA(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=pA(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-p1-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=hu(o[r]);if(l&&!hA(l)){for(const[a,c]of i)if(Zv(l,a,c)!==-1)return!0}}return!1}function TF(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=pA(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-p1-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=hu(s[l]);for(const[c,u]of r){const d=Zv(a,c,u);if(d===-1)continue;let h="",m=!1;for(let f=l+1;f<s.length;f++){if(f-l>p1){m=!0;break}const g=s[f],_=Cc(g,u);if(_!==-1){const w=o_(h,g.slice(0,_));if(!g1(w)){m=!0;break}const y=g.slice(_+u.length),b=y.trim()?`suffix:${s_(y)}`:"nosuffix";return["closed",c,o+l,d,o+f,_,s_(w),b].join(":")}if(hA(g)){m=!0;break}if(h=o_(h,g),h.length>lA){m=!0;break}}if(!m&&g1(h))return["pending",c,o+l,d].join(":")}}return null}function Um(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function AF(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const o=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(o)?!1:o===""||/^[)\s,.!?;:]/.test(o)}function jm(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function MF(e,t){dF(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},o=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(y,b)=>{let v=b;for(;v<y.length&&(y[v]===" "||y[v]===" ");)v++;if(v===b||!(y[v]===`
|
|
144
|
-
`||y[v]==="\r"&&y[v+1]===`
|
|
145
|
-
`))return b;const x=y.slice(b,v),L=a.push("text","",0);return L.content=x,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 x=a.push("text","",0);return x.content=a.src.slice(a.pos,y),a.pos=y,!0}}const h=[["$$","$$"],["$","$"],["\\(","\\)"]],m=String(a.pending??""),f=Math.max(0,a.pos-m.length);let g=f,_=f;const w=f;for(const[y,b]of h){const v=a.src,x=fA(v),L=wF(v,u);let N=!1;y==="$$"&&g!==w&&(g=w);let k=-1,T=-1,E=0;const O=A=>{if((A==="undefined"||A==null)&&(A=""),A==="\\"){a.pos=a.pos+A.length,g=a.pos;return}if(A==="\\)"||A==="\\("){const D=a.push("text_special","",0);D.content=A==="\\)"?")":"(",D.markup=A,a.pos=a.pos+A.length,g=a.pos;return}if(!A)return;if(y==="$$"&&A.includes("$")){let D=0;for(;D<A.length;){const W=m1(A,D);if(W===-1){const ue=A.slice(D);if(ue){const ve=a.push("text","",0);ve.content=ue,a.pos=a.pos+ue.length,g=a.pos}break}if(W>0&&A[W-1]==="$"||W+1<A.length&&A[W+1]==="$"){const ue=A.slice(D,W+1);if(ue){const ve=a.push("text","",0);ve.content=ue,a.pos=a.pos+ue.length,g=a.pos}D=W+1;continue}const V=A.slice(D,W);if(V){const ue=a.push("text","",0);ue.content=V,a.pos=a.pos+V.length,g=a.pos}const U=Wm(A,W+1);if(U===-1){const ue=A.slice(W),ve=a.push("text","",0);ve.content=ue,a.pos=a.pos+ue.length,g=a.pos;break}const ee=A.slice(W+1,U),K=ee.includes("`"),G=!ee||!ee.trim(),X=A[U+1],ke=Um(ee,X),le=jm(ee);if(!K&&!G&&!ke&&!le){const ue=a.push("math_inline","math",0);ue.content=rr(ee,t),ue.markup="$",ue.raw=`$${ee}$`,ue.loading=!1,a.pos=a.pos+(U-W+1),g=a.pos,D=U+1;continue}const He=a.push("text","",0);He.content="$",a.pos=a.pos+1,g=a.pos,D=W+1}return}const $=A.indexOf("![");if($!==-1){if($>0){const V=A.slice(0,$),U=a.push("text","",0);U.content=V,a.pos=a.pos+V.length,g=a.pos}const D=A.slice($).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(D){const[,V,U]=D,ee=U.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),K=ee?ee[1]:U,G=ee&&ee[2]?ee[2]:null,X=a.push("image","img",0);X.attrs=[["src",K],["alt",V]],G&&X.attrs.push(["title",G]),X.content=V,X.children=[{type:"text",content:V,tag:""}],a.pos=a.pos+D[0].length,g=a.pos;const ke=A.slice($+D[0].length);ke&&O(ke);return}const W=a.push("text","",0);W.content=A,a.pos=a.pos+A.length,g=a.pos;return}const R=a.push("text","",0);R.content=A,a.pos=a.pos+A.length,g=a.pos};for(;!(g>=v.length);){const A=v.indexOf(y,g);if(A===-1)break;if($u(v,A)){g=A+Math.max(1,y.length);continue}const $=Xf(x,A);if($){g=$[1];continue}const R=Xf(L,A);if(R){g=R[1];continue}if(A===k&&g===T){if(E++,E>2){g=A+Math.max(1,y.length);continue}}else E=0,k=A,T=g;if(y==="("&&A>0){let ke=A-1;for(;ke>=0&&v[ke]===" ";)ke--;if(ke>=0&&v[ke]==="]"){g=A+y.length;continue}}if(y==="$"&&A>0&&v[A-1]==="$"){g=A+1;continue}if(y==="$"&&A<v.length-1&&v[A+1]==="$"){g=A+2;continue}const D=y==="$"?Wm(v,A+y.length):QB(v,A+y.length,y,b);if(D===-1){const ke=v.slice(A+y.length);if(ke.includes(y)){g=v.indexOf(y,A+y.length);continue}if(D===-1){const le=y==="$"&&AF(ke);if(u&&!c&&!le&&aa(ke)&&!ke.includes("`")){if(g=A+y.length,N=!0,!l){a.pending="";const He=_?v.slice(_,g):v.slice(0,g),ue=Qw(He)%2===1;if(_)O(v.slice(_,g));else{let ve=v.slice(0,g);ve.endsWith(y)&&(ve=ve.slice(0,ve.length-y.length)),O(ve)}if(ue){const ve=Zw(He)?.marker??"**",Pe=a.push("strong_open","",0);Pe.markup=ve;const Re=a.push("math_inline","math",0);Re.content=rr(ke,t),Re.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",Re.raw=`${y}${ke}${b}`,Re.loading=!0,Pe.content=ke,a.push("strong_close","",0)}else{const ve=a.push("math_inline","math",0);ve.content=rr(ke,t),ve.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",ve.raw=`${y}${ke}${b}`,ve.loading=!0}a.pos=v.length}g=v.length,_=g}break}}const W=v.slice(A+y.length,D),V=W.includes("`"),U=!W||!W.trim(),ee=y==="$",K=v[D+b.length],G=ee&&Um(W,K),X=ee&&jm(W);if(c?V||U||G||X:V||U||G||X||!ee&&!aa(W)){g=D+b.length;const ke=v.slice(a.pos,g);a.pending||(O(ke),_=g);continue}if(N=!0,!l){const ke=v.slice(a.pos-(a.pending??"").length,A);let le=v.slice(0,g)?v.slice(_,A):ke;const He=Qw(le)%2===1;A!==a.pos&&He&&(le=a.pending+v.slice(a.pos,A));const ue=He?Zw(le):null,ve=ue?.marker??"**";if(a.pending!==le)if(a.pending="",He)if(ue){const Pe=le.slice(ue.index+ve.length);O(le.slice(0,ue.index));const Re=a.push("strong_open","",0);Re.markup=ve;const Q=a.push("text","",0);Q.content=Pe,a.push("strong_close","",0)}else O(le);else O(le);if(He){const Pe=a.push("strong_open","",0);Pe.markup=ve;const Re=a.push("math_inline","math",0);Re.content=rr(W,t),Re.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",Re.raw=`${y}${W}${b}`,Re.loading=!1;const Q=v.slice(D+b.length).startsWith(ve);return Q&&a.push("strong_close","",0),a.pos=d(v,D+b.length),g=a.pos,_=g,Q||a.push("strong_close","",0),!0}else{const Pe=a.push("math_inline","math",0);Pe.content=rr(W,t),Pe.markup=y==="$$"?"$$":y==="\\("?"\\(\\)":y==="$"?"$":"()",Pe.raw=`${y}${W}${b}`,Pe.loading=!1}}return g=d(v,D+b.length),_=g,a.pos=g,!0}if(N){if(l)a.pos=g;else{if(y==="$$"&&g<v.length&&v.slice(g).includes("$")){let A=g;for(;!(A>=v.length);){const $=m1(v,A);if($===-1)break;if($+1<v.length&&v[$+1]==="$"){A=$+2;continue}if($>0&&v[$-1]==="$"){A=$+1;continue}const R=Wm(v,$+1);if(R===-1)break;const D=v.slice($+1,R),W=D.includes("`"),V=!D||!D.trim(),U=v[R+1],ee=Um(D,U),K=jm(D);if(!W&&!V&&!ee&&!K){const G=v.slice(g,$);G&&O(G);const X=a.push("math_inline","math",0);X.content=rr(D,t),X.markup="$",X.raw=`$${D}$`,X.loading=!1,g=R+1,A=R+1}else O("$"),A=$+1}A<v.length&&O(v.slice(A))}else g<v.length&&O(v.slice(g));a.pos=v.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,h=t?.strictDelimiters,m=h?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],f=u.bMarks[l]+u.tShift[l];let g=u.src.slice(f,u.eMarks[l]).trim(),_=!1,w="",y="",b=!1,v="",x=!1;for(const[G,X]of m)if(g.startsWith(G))if(G.includes("["))if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1<a){_=!0,w=G,y=X;break}continue}}else if(g.replace("\\","")==="["){if(l+1<a){_=!0,w=G,y=X;break}continue}else{const ke=u.tokens[u.tokens.length-1];if(ke&&ke.type==="list_item_open"&&ke.mark==="-"&&g.slice(G.length,g.indexOf("]")).trim()==="x")continue;if(g.replace("\\","").startsWith("[")&&!g.includes("](")){const le=g.indexOf("]");if(g.slice(le).trim()!=="]")continue;const He=g.slice(G.length,le);if(G==="["?Jw(He):aa(He)){_=!0,w=G,y=X;break}continue}}else{_=!0,w=G,y=X;break}else if((G==="$$"||G==="\\[")&&g.endsWith(G)&&l+1<a){const ke=Zv(g,G,X);if(ke===-1)continue;v=hu(g.slice(0,ke)),x=!0;const le=u.bMarks[l+1]+u.tShift[l+1];g=u.src.slice(le,u.eMarks[l+1]).trim(),b=!0,_=!0,w=G,y=X;break}if(!_)return!1;if(c&&!x)return!0;const L=g.indexOf(w),N=L+w.length,k=!h&&w==="["?g.indexOf("\\]",N):-1,T=k>=0?"\\]":y,E=k>=0?k:Cc(g,y,N);if(!b&&E>w.length){const G=g.slice(L+w.length,E),X=u.push("math_block","math",0);X.content=rr(G),X.markup=w==="$$"?"$$":w==="["?"[]":"\\[\\]",X.map=[l,l+1],X.raw=`${w}${G}${T}`,X.block=!0,X.loading=!1,u.line=l+1;const ke=g.slice(E+T.length);return ke.trim()&&n(u,ke,l),!0}let O=l,A="",$=!1,R="",D=l;const W=b?g:g===w?"":g.slice(w.length),V=!h&&w==="\\["?"]":"",U=Cc(W,y);if(U!==-1){const G=U;A=W.slice(0,G),R=W.slice(G+y.length),D=b?l+1:l,$=!0,O=D}else for(W&&!b&&(A=W),O=l+1;O<a;O++){const G=u.bMarks[O]+u.tShift[O],X=u.eMarks[O],ke=u.src.slice(G,X),le=ke.trim();if(!h&&w==="["&&le==="\\]"){y="\\]",$=!0;break}if(V&&ke.trim()===V){y=V,$=!0;break}if(le===y){$=!0;break}else if(!h&&w==="["&&ke.includes("\\]")){$=!0;const He=ke.indexOf("\\]");y="\\]";const ue=ke.slice(0,He);ue&&(A+=(A?`
|
|
146
|
-
`:"")+ue),R=ke.slice(He+y.length),D=O;break}else if(Cc(ke,y)!==-1){$=!0;const He=Cc(ke,y),ue=ke.slice(0,He);ue&&(A+=(A?`
|
|
147
|
-
`:"")+ue),R=ke.slice(He+y.length),D=O;break}A+=(A?`
|
|
148
|
-
`:"")+ke}if((!d||h)&&!$)return!1;const ee=/^\s*!\[/.test(A);if(!(x?!ee&&g1(A):w==="$$"?!ee:w==="["?Jw(A):aa(A)))return!1;if(c)return!0;v&&n(u,v,l);const K=u.push("math_block","math",0);return K.content=rr(A),K.markup=w==="$$"?"$$":w==="["?"[]":"\\[\\]",K.raw=`${w}${A}${A.startsWith(`
|
|
149
|
-
`)?`
|
|
150
|
-
`:""}${y}`,K.map=[l,O+1],K.block=!0,K.loading=!$,u.line=O+1,R.trim()&&n(u,R,D),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],h=u.src.slice(d,u.eMarks[l]).trim();return!h.startsWith("$$")&&!h.startsWith("\\[")?!1:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function EF(e){const t=e.renderer.rules.image||function(n,o,s,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,o,s):""};e.renderer.rules.image=(n,o,s,i,r)=>{const l=n;return l[o].attrSet?.("loading","lazy"),t(l,o,s,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,o)=>{const s=n[o],i=String(s.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(s.content??""))}</code></pre>`})}function IF(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},o=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new v7({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!vl(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&MF(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&R7(i),e.enableFixIndentedCodeBlock!==!1&&iB(i),OB(i),FB(i),DB(i),jB(i),EF(i),oB(i,{customHtmlTags:e.customHtmlTags}),i}function yl(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=>yl(n))),t}function $F(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function NF(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,o=n===""||n==="true";return{type:"checkbox_input",checked:o,raw:o?"[x]":"[ ]"}}function LF(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Ad(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];s+=String(e[i].content??l.text??""),r.push(e[i]),i++}return o.push(...Tn(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const i_=/\r?\n[ \t]*`+\s*$/,gA=["diff ","index ","--- ","+++ ","@@ "],PF=/\r?\n/;function OF(e){const t=String(e??"");return t?gA.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function r_(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function RF(e,t){const n=[],o=[],s=[],i=[],r=e.split(PF),l=/\r?\n$/.test(e),a=r.some(m=>m.startsWith("diff ")||m.startsWith("--- ")||m.startsWith("+++ ")||m.startsWith("@@ ")),c=m=>{const f=m;if(!gA.some(g=>f.startsWith(g)))if(f.startsWith("-")){const g=f.slice(1);s.push(!a&&g.startsWith(" ")?` ${g}`:g)}else if(f.startsWith("+")){const g=f.slice(1);i.push(!a&&g.startsWith(" ")?` ${g}`:g)}else{r_(n,o,s,i);const g=a&&f.startsWith(" ")?f.slice(1):f;n.push(g),o.push(g)}},u=l?Math.max(0,r.length-1):r.length;for(let m=0;m<u;m++){const f=r[m]??"";!t&&!l&&m===u-1&&OF(f)||c(f)}(t||s.length>0||i.length>0)&&r_(n,o,s,i);const d=n.join(`
|
|
151
|
-
`),h=o.join(`
|
|
152
|
-
`);return{original:t&&l&&d?`${d}
|
|
153
|
-
`:d,updated:t&&l&&h?`${h}
|
|
154
|
-
`:h}}function Jv(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},o=typeof n.closed=="boolean"?n.closed:void 0,s=o===!0||o!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(i_.test(a)&&(a=a.replace(i_,"")),r){const{original:c,updated:u}=RF(a,s===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t}}function DF(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function BF(){return{type:"hardbreak",raw:`\\
|
|
155
|
-
`}}function FF(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...Tn(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let qm=null;const zm=new WeakMap;function l_(){return qm||(qm={customTagSet:null,allowedTagSet:Kh()}),qm}function vA(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function yA(e){return/^<\s*\//.test(e)}function kA(e,t){return/\/\s*>\s*$/.test(t)||Tl.has(e)}function HF(e){if(!e||e.length===0)return l_();const t=zm.get(e);if(t)return t;const n=e.map(Hs).filter(Boolean);if(!n.length){const s=l_();return zm.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:Kh({customHtmlTags:e})};return zm.set(e,o),o}function bA(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function WF(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function Qf(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function UF(e,t,n){const o=e.slice();return Qf(o,"href")||o.push(["href",t]),n!=null&&!Qf(o,"title")&&o.push(["title",n]),o}function v1(e){return e.map(bA).join("")}function Xd(e){const t=[],n=o=>{const s=String(o??"");if(!s)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${s}`,i.raw=`${i.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const o of e)if(o){if(o.type==="reference"||o.type==="footnote_reference"){n(String(o.raw??""));continue}if("children"in o&&Array.isArray(o.children)){t.push({...o,children:Xd(o.children)});continue}t.push(o)}return t}function jF(e,t,n){let o=0;for(let s=t;s<e.length;s++){const i=e[s];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=vA(r),a=yA(r),c=kA(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function Vm(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?jF(e,t+1,n):-1;return l!==-1?(s=e.slice(t+1,l),o.push(...s,e[l]),i=l+1,r=!0):(s=e.slice(t+1),s.length&&o.push(...s),i=e.length),{closed:r,html:v1(o),innerTokens:s,nextIndex:i}}function qF(e,t,n,o,s,i,r){const l=String(e.content??""),a=vA(l),{customTagSet:c,allowedTagSet:u}=HF(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!Vm(t,n,a).closed){const x=bA(e);return[{type:"text",content:x,raw:x},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=yA(l),h=kA(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const x=Vm(t,n,a),L=qh(l),N=x.innerTokens,k=String(Qf(L,"href")??""),T=Qf(L,"title"),E=T==null?null:String(T),O=UF(L,k,E),A=Xd(N.length?o(N,s,i,r):[]),$=N.length?v1(N):k||"";return!A.length&&$&&A.push({type:"text",content:$,raw:$}),[{type:"link",href:k,title:E,text:$,attrs:O,children:A,loading:!x.closed,raw:x.html||l},x.nextIndex]}if(h)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const m=Vm(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Xd(m.innerTokens.length?o(m.innerTokens,s,i,r):[]),raw:m.html},m.nextIndex];const f=Xd(m.innerTokens.length?o(m.innerTokens,s,i,r):[]);let g=m.html||l,_=!m.closed,w=!1;if(!m.closed){const x=`</${a}>`;g.toLowerCase().includes(x.toLowerCase())||(g+=x),w=!0,_=!0}const y=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let v;for(;(v=b.exec(l))!==null;){const x=v[1],L=v[2]||v[3]||v[4]||"";y.push([x,L])}if(c?.has(a)){const x=WF(e);return[{type:a,tag:a,attrs:y,content:x?x.inner:m.innerTokens.length?v1(m.innerTokens):"",children:m.innerTokens.length?o(m.innerTokens,s,i,r):[],raw:x?.raw??g,loading:e.loading||_,autoClosed:w},m.nextIndex]}return[{type:"html_inline",tag:a,attrs:y,content:g,children:f,raw:g,loading:_,autoClosed:w},m.nextIndex]}function wA(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=>wA(t)).join(""):String(e.content??"")}function zF(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>wA(t)).join("")}function a_(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const h=d.attrs;if(Array.isArray(h)&&h.length>0){n=h,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=zF(o??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):o?.content!=null&&String(o.content).length>0?l=String(o.content):Array.isArray(o?.children)&&o.children[0]?.content?l=String(o.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:s,alt:l,title:c,raw:u,loading:t}}function VF(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function KF(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...Tn(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function GF(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const o=n?.[0];o&&t.push([String(o),String(n?.[1]??"")])}return t}function Zf(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function YF(e,t,n){const o=e.slice();return Zf(o,"href")||o.push(["href",t]),n!=null&&!Zf(o,"title")&&o.push(["title",n]),o}function Md(e,t,n){const o=e[t],s=GF(o.attrs),i=String(Zf(s,"href")??""),r=Zf(s,"title"),l=r==null?null:String(r),a=YF(s,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let h=u;const m=u[u.length-1];if(n?.__insideStrong&&m?.type==="text"&&String(m.content??"").endsWith("**")&&!u.some(_=>_.type==="strong_open")){const _=String(m.content??""),w=String(m.raw??_),y=yl(m);y.content=_.slice(0,-2),y.raw=w.replace(/\*\*$/,""),h=u.slice(),h[h.length-1]=y}const f=Tn(h,void 0,void 0,n),g=f.map(_=>{const w=_;return"content"in _?String(w.content??""):String(w.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:g,children:f,raw:`[${g}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function c_(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 XF(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function u_(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...Tn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const QF=/\\([\\()[\]`$|*_\-!])/g;function ZF(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(QF,"$1")===t))return n}function pc(e,t,n,o){const s=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...o,__insideStrong:!0};return s.push(...Tn(l,ZF(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function JF(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)s+=String(e[i].content??""),r.push(e[i]),i++;o.push(...Tn(r,void 0,void 0,n));const l=String(e[t].content??""),a=s||l;return{node:{type:"subscript",children:o.length>0?o:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function e9(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...Tn(r,void 0,void 0,n)),{node:{type:"superscript",children:o.length>0?o:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function t9(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const n9=/[^~]*~{2,}[^~]+/,o9=/\*\*/,s9=/[[_*^~]/,i9=/\\([\\()[\]`$|*_\-!])/g,e0=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),r9=/\s/u,l9=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,a9=/\p{P}/u,c9=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,u9=/:\/\//;function d9(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 _A(e,t=0){if(!e)return-1;let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&e0.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function Lr(e){return!!e&&r9.test(e)}function Pr(e){return!!e&&(l9.test(e)||a9.test(e))}function f9(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||Lr(o)?!1:!(Pr(o)&&n&&!Lr(n)&&!Pr(n))}function h9(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||Lr(n)?!1:!(Pr(n)&&o&&!Lr(o)&&!Pr(o))}function p9(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?_A(e,o):t.indexOf("*",o);if(i===-1)break;if(h9(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function m9(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||Lr(o)?!1:!(Pr(o)&&n&&!Lr(n)&&!Pr(n))}function g9(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||Lr(n)?!1:!(Pr(n)&&o&&!Lr(o)&&!Pr(o))}function v9(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(g9(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function y9(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let o=0;for(;n+o<e.length&&e[n+o]==="\\";)o++;const s=e[n+o];if(t+="\\".repeat(Math.floor(o/2)),o%2===1){if(s&&e0.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function k9(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&e0.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function b9(e,t,n){const o=k9(e,t);if(o===-1||e[o]!==n)return!1;let s=0;for(let i=o-1;i>=0&&e[i]==="\\";i--)s++;return s%2===1}const w9=/[\p{L}\p{N}]/u,_9=/^[\p{L}\p{N}]+$/u;function y1(e){return e?w9.test(e):!1}function CA(e){return e?_9.test(e):!1}function Bc(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const o=t>0?e[t-1]:void 0,s=n<e.length?e[n]:void 0;return{len:n-t,prev:o,next:s,intraword:y1(o)&&y1(s)}}function C9(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=Bc(e,n),s=n+o.len;o.len>=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n<t.length-1;n++){const o=t[n],s=t[n+1];if(!CA(e.slice(o.end,s.start)))return s.end}return-1}function S9(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function x9(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=Bc(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function T9(e){return e?c9.test(e)||u9.test(e):!1}function A9(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Tn(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=Iu(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,h=e;function m(){return e===h&&(e=e.slice()),e}function f(){c=null}function g(Q,ce){const Ce=e.length===1?t:String(ce.content??""),q=[],te=C9(Q);if(te!==-1){x(Q.slice(0,te),Q.slice(0,te));const oe=Q.slice(te);return oe&&(E({type:"text",content:oe,raw:oe}),u--),u++,!0}if(n9.test(Q)){const oe=Q.indexOf("~~");oe!==-1&&q.push({type:"strikethrough",index:oe})}if(o9.test(Q)){const oe=Q.indexOf("**");oe!==-1&&q.push({type:"strong",index:oe})}if(/[^*]*\*[^*]+/.test(Q)){const oe=Ce?_A(Ce,0):Q.indexOf("*");if(Ce&&oe===-1)return!1;oe!==-1&&q.push({type:"emphasis",index:oe})}q.sort((oe,fe)=>oe.index!==fe.index?oe.index-fe.index:oe.type===fe.type?0:oe.type==="strong"?-1:fe.type==="strong"?1:0);const pe=q[0];if(!pe)return!1;if(pe.type==="strikethrough"){const oe=pe.index,fe=oe>-1?Q.slice(0,oe):"";if(fe&&x(fe,fe),oe===-1)return u++,!0;const H=Q.indexOf("~~",oe+2),Y=H===-1?Q.slice(oe+2):Q.slice(oe+2,H),re=H===-1?"":Q.slice(H+2),{node:ge}=u_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:Y,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return f(),v(ge),re&&(E({type:"text",content:re,raw:re}),u--),u++,!0}if(pe.type==="strong"){const oe=pe.index,fe=oe>-1?Q.slice(0,oe):"";if(fe&&x(fe,fe),oe===-1)return u++,!0;if(t&&oe===0){let Ne=!1,ie=0;for(;ie<Q.length&&Q[ie]==="*";)ie++;if(t.startsWith("\\*")&&(Ne=!0),Ne){let ae=0,we=0;for(;we<t.length&&ae<ie;)if(t[we]==="\\"&&we+1<t.length&&t[we+1]==="*")ae+=1,we+=2;else{if(t[we]==="*")break;we++}if(ae>=2)return x(Q,Q),u++,!0}}if(t&&(Q.match(/\*/g)||[]).length>d9(t))return x(Q.slice(fe.length),Q.slice(fe.length)),u++,!0;const H=Bc(Q,oe);if(H.len>=3){const Ne=x9(Q,oe+H.len);if(Ne!==-1){const ie=Q.slice(oe+H.len,Ne);if(S9(ie)){const{node:ae}=pc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ie,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);f(),v(ae);const we=Q.slice(Ne+3);return we&&(E({type:"text",content:we,raw:we}),u--),u++,!0}}}if(!m9(Q,oe)){const Ne=Q.slice(oe,oe+H.len);x(Ne,Ne);const ie=Q.slice(oe+H.len);return ie&&(E({type:"text",content:ie,raw:ie}),u--),u++,!0}const Y=v9(Q,oe+2);let re="",ge="";if(Y.index!==-1){re=Q.slice(oe+2,Y.index),ge=Q.slice(Y.index+2);const Ne=Y.index,ie=Bc(Q,Ne);if(H.intraword&&ie.intraword&&!CA(re)||!re&&H.len>=4&&H.intraword)return x(Q.slice(fe.length),Q.slice(fe.length)),u++,!0}else{if(d||Y.sawInvalidClose||H.intraword)return x(Q.slice(fe.length),Q.slice(fe.length)),u++,!0;re=Q.slice(oe+2),ge=""}if(!re&&/^\*+$/.test(ge))return x(Q,Q),u++,!0;const{node:xe}=pc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:re,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return f(),v(xe),ge&&(E({type:"text",content:ge,raw:ge}),u--),u++,!0}if(pe.type==="emphasis"){let oe=pe.index;oe===-1&&(oe=0);const fe=Q.slice(0,oe);if(fe&&x(fe,fe),!f9(Q,oe)){x(Q[oe],Q[oe]);const Ne=Q.slice(oe+1);return Ne&&(E({type:"text",content:Ne,raw:Ne}),u--),u++,!0}const H=Bc(Q,oe),Y=p9(Ce,Q,oe+1),re=Y.index,ge=e[u+1];if(o?.final&&ge?.type==="em_open"&&re!==-1&&Q.slice(oe+1,re).trim()!==Q.slice(oe+1,re)||re===-1&&(Y.sawInvalidClose||o?.final||H.intraword||!y1(Q[oe+1])))return x(Q.slice(oe),Q.slice(oe)),u++,!0;const{node:xe}=Ad([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:re>-1?Q.slice(oe+1,re):Q.slice(oe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(f(),v(xe),re!==-1&&re<Q.length-1){const Ne=Q.slice(re+1);Ne&&(E({type:"text",content:Ne,raw:Ne}),u--)}return u++,!0}return!1}function _(Q,ce){if(!Q.includes("`"))return!1;const q=(ge=>{for(let xe=0;xe<ge.length;xe++){if(ge[xe]!=="`")continue;let Ne=0;for(let ie=xe-1;ie>=0&&ge[ie]==="\\";ie--)Ne++;if(Ne%2===0)return xe}return-1})(Q);if(q===-1)return!1;let te=1;for(let ge=q+1;ge<Q.length&&Q[ge]==="`";ge++)te++;const pe="`".repeat(te),oe=q+te,fe=Q.indexOf(pe,oe);if(fe===-1){if(te===1){const xe=Q.slice(0,q),Ne=Q.slice(q+1);return xe&&(g(xe,ce)?u--:x(xe,xe)),y({type:"inline_code",code:Ne,raw:String(Ne)}),u++,!0}let ge=Q;for(let xe=u+1;xe<e.length;xe++)ge+=String((e[xe].content??"")+(e[xe].markup??""));return u=e.length-1,x(ge,ge),u++,!0}f();const H=Q.slice(0,q),Y=Q.slice(q+te,fe),re=Q.slice(fe+te);return H&&(g(H,ce)?u--:x(H,H)),y({type:"inline_code",code:Y,raw:String(Y??"")}),re&&(E({type:"text",content:re,raw:re}),u--),u++,!0}function w(Q){const ce=l?.__markdownIt;if(!ce||e.length<=1||!e.some(pe=>pe?.type==="math_inline")||!s9.test(Q))return null;const Ce=ce.parseInline(Q,{__markstreamFinal:!!o?.final});if(!Array.isArray(Ce)||Ce.length===0)return null;const q=(Ce.find(pe=>pe?.type==="inline")?.children??[]).filter(pe=>!(pe?.type==="text"&&String(pe.content??"")===""));if(!q.length||!q.some(pe=>pe?.type!=="text")||q.length===1&&q[0]?.type==="text"&&String(q[0].content??"")===Q)return null;const te=Tn(q,Q,n,o);return te.length?te:null}function y(Q){f(),a.push(Q)}function b(Q){f();const ce=yl(Q);a.push(ce)}function v(Q){y(Q)}function x(Q,ce){c?(c.content+=Q,c.raw+=ce??Q):(c={type:"text",content:String(Q??""),raw:String(ce??Q??"")},a.push(c))}function L(Q,ce){if(!Q)return;const Ce=Tn([{...ce,type:"text",content:Q,raw:Q}],Q,n,o);if(Ce.length===1&&Ce[0]?.type==="text"){const q=Ce[0];x(String(q.content??""),String(q.raw??q.content??""));return}for(const q of Ce)v(q)}function N(Q,ce){return String(Q.markup??"").startsWith(ce)}function k(Q){return Q.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function T(Q,ce){let Ce=Q;const q=String(ce.content??"");return Ce.endsWith("\\")&&!N(ce,"\\\\")&&!q.endsWith("\\\\")&&(Ce=Ce.slice(0,-1)),Ce.endsWith("(")&&!N(ce,"\\(")&&!q.endsWith("\\(")&&(Ce=Ce.slice(0,-1)),/\*+$/.test(Ce)&&!N(ce,"\\*")&&!q.endsWith("\\*")&&(Ce=Ce.replace(/\*+$/,"")),Ce}for(;u<e.length;){const Q=e[u];E(Q)}function E(Q){switch(Q.type){case"text":A(Q);break;case"softbreak":c?(c.content+=`
|
|
156
|
-
`,c.raw+=`
|
|
157
|
-
`):(c={type:"text",content:`
|
|
158
|
-
`,raw:`
|
|
159
|
-
`},a.push(c)),u++;break;case"code_inline":v(VF(Q)),u++;break;case"html_inline":{const[ce,Ce]=qF(Q,e,u,Tn,t,n,o);v(ce),u=Ce;break}case"link_open":$(Q);break;case"image":ke(Q)||(f(),v(a_(Q)),u++);break;case"strong_open":{f();const{node:ce,nextIndex:Ce}=pc(e,u,Q.content,o);v(ce),u=Ce;break}case"em_open":{f();const{node:ce,nextIndex:Ce}=Ad(e,u,o);v(ce),u=Ce;break}case"s_open":{f();const{node:ce,nextIndex:Ce}=u_(e,u,o);v(ce),u=Ce;break}case"mark_open":{f();const{node:ce,nextIndex:Ce}=FF(e,u,o);v(ce),u=Ce;break}case"ins_open":{f();const{node:ce,nextIndex:Ce}=KF(e,u,o);v(ce),u=Ce;break}case"sub_open":{f();const{node:ce,nextIndex:Ce}=JF(e,u,o);v(ce),u=Ce;break}case"sup_open":{f();const{node:ce,nextIndex:Ce}=e9(e,u,o);v(ce),u=Ce;break}case"sub":f(),v({type:"subscript",children:[{type:"text",content:String(Q.content??""),raw:String(Q.content??"")}],raw:`~${String(Q.content??"")}~`}),u++;break;case"sup":f(),v({type:"superscript",children:[{type:"text",content:String(Q.content??""),raw:String(Q.content??"")}],raw:`^${String(Q.content??"")}^`}),u++;break;case"emoji":{f();const ce=e[u-1];ce?.type==="text"&&/\|:-+/.test(String(ce.content??""))?x("",""):v(LF(Q)),u++;break}case"checkbox":f(),v($F(Q)),u++;break;case"checkbox_input":f(),v(NF(Q)),u++;break;case"footnote_ref":f(),v(DF(Q)),u++;break;case"footnote_anchor":{f();const ce=Q.meta??{};y({type:"footnote_anchor",id:String(ce.label??Q.content??""),raw:String(Q.content??"")}),u++;break}case"hardbreak":f(),v(BF()),u++;break;case"fence":f(),v(Jv(e[u])),u++;break;case"math_inline":f(),!Q.content&&Q.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(v(c_({...Q,content:e[u+1].content})),u+=2):v(c_(Q)),u++;break;case"reference":D(Q);break;case"text_special":x(String(Q.content??""),String(Q.content??"")),u++;break;default:{const ce=Q;if(Q.type==="link"&&ce.href!=null&&o?.validateLink&&!o.validateLink(String(ce.href))){f();const Ce=String(ce.text??"");x(Ce,Ce),u++}else le(Q)||V(Q)||ee(Q)||W(Q)||b(Q),u++;break}}}function O(Q,ce,Ce,q){const te=t9({...ce,content:Q});if(c){c.content+=T(te.content,ce),c.raw+=te.raw;return}const pe=Ce?.tag==="br"&&e[u-2]?.content==="[";q||(te.content=T(te.content,ce)),c=te,c.center=pe,a.push(c)}function A(Q){const ce=String(Q.content??""),Ce=e.length===1&&ce.includes("\\")&&typeof t=="string"?String(t):"";let q=Ce?y9(Ce):ce.replace(i9,"$1");if(Q.content==="<"||q==="1"&&e[u-1]?.tag==="br"){u++;return}const te=q.indexOf("$");te!==-1&&te===q.lastIndexOf("$")&&q.endsWith("$")&&(q=q.slice(0,-1)),q.endsWith("undefined")&&!t?.endsWith("undefined")&&(q=q.slice(0,-9));let pe=a.length,oe="";for(let re=a.length-1;re>=0;re--){const ge=a[re];if(ge.type!=="text")break;pe=re,oe=String(ge.content??"")+oe}pe<a.length&&(q.startsWith(oe)?(c=null,a.length=pe):c=a[a.length-1]);const fe=e[u+1];if((q==="`"||q==="|"||q==="$")&&!N(Q,`\\${q}`)||/^\*+$/.test(q)&&!N(Q,"\\*")){u++;return}if(!fe&&/[^\]]\s*\(\s*$/.test(q)&&(q=q.replace(/\(\s*$/,"")),!q){u++;return}if(X(q)||He(q))return;if(!(q.includes("*")||q.includes("_")||q.includes("~")||q.includes("`")||q.includes("[")||q.includes("!")||q.includes("$")||q.includes("|")||q.includes("("))){O(q,Q,e[u-1],fe),u++;return}if(Re(q))return;const H=e[u-1];if(q==="["&&!fe?.markup?.includes("*")&&!N(Q,"\\[")||q==="]"&&!H?.markup?.includes("*")&&!N(Q,"\\]")){u++;return}if(_(ce,Q)||Pe(q)||(e[u+1]?.type!=="link_open"||k(q))&&ve(q,Q))return;const Y=w(ce);if(Y){f();for(const re of Y)v(re);u++;return}g(q,Q)||(O(q,Q,H,fe),u++)}function $(Q){if(R(Q))return;if(ue()){const{node:fe,nextIndex:H}=Md(e,u,o),Y=String(fe.text||fe.href||"");x(Y,Y),u=H;return}f();const{node:ce,nextIndex:Ce}=Md(e,u,o);u=Ce;const q=ce.text||ce.href||"";if(Q.markup==="linkify"&&!nA(q,ce.href,t)&&Gf(q,l?.__linkifyDemotionContext)){x(q,q);return}const te=ce.children.length===1&&ce.children[0]?.type==="text";if(ce.loading&&t&&ce.text===ce.href&&te){const fe=A9(t,ce.href);fe&&(ce.text=fe,ce.children=[{type:"text",content:fe,raw:fe}],ce.raw=`[${fe}](${ce.href}${ce.title?` "${ce.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(ce.href)){x(ce.text,ce.text);return}const pe=Q.attrs?.find(([fe])=>fe==="href")?.[1],oe=String(pe??"");if(t&&oe){const fe=t.indexOf("](");if(fe!==-1){const H=t.indexOf(")",fe+2);H===-1?ce.loading=!0:ce.loading&&t.slice(fe+2,H).includes(oe)&&(ce.loading=!1)}}W(ce)||y(ce)}function R(Q){if(Q.markup!=="linkify")return!1;const{node:ce,nextIndex:Ce}=Md(e,u,o);return U(ce,Ce)?(u=Ce,!0):!1}function D(Q){f(),v(XF(Q)),u++}function W(Q){if(Q.type!=="link")return!1;const ce=a[a.length-1];if(!ce||ce.type!=="text")return!1;const Ce=String(ce.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!Ce)return!1;const q=Q,te=String(q.href??""),pe=String(q.text??""),oe=String(Ce[2]??""),fe=te.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!te||!(pe===te||pe===fe||T9(pe)))return!1;const H=String(Ce[1]??"");return H?(ce.content=H,ce.raw=H):a.pop(),y({...Q,text:oe,children:[{type:"text",content:oe,raw:oe}],raw:`[${oe}](${te}${q.title?` "${q.title}"`:""})`}),!0}function V(Q){if(Q.type!=="link")return!1;const ce=Q,Ce=String(ce.href??"");return Ce?U({href:Ce,title:ce.title==null||ce.title===""?null:String(ce.title),loading:!!ce.loading},u+1):!1}function U(Q,ce){const Ce=a[a.length-1];if(Ce?.type!=="image"||Ce.src||!Ce.loading||!String(Ce.raw??"").endsWith("]("))return!1;const q=e[ce],te=String(q?.content??"");if(q?.type!=="text"||!te.startsWith(")"))return!1;a.pop(),c=null;const pe=String(Ce.alt??"");y({type:"image",src:Q.href,alt:pe,title:Q.title,raw:``,loading:!!Q.loading});const oe=te.slice(1),fe=yl(q);return fe.content=oe,fe.raw=oe,m()[ce]=fe,!0}function ee(Q){if(Q.type!=="link")return!1;const ce=a[a.length-1],Ce=e[u-1];if(!ce||ce.type!=="text"||Ce?.type!=="text")return!1;const q=String(ce.content??""),te=String(Ce.content??"");if(!q.endsWith("!")||!te.endsWith("!")||N(Ce,"\\!"))return!1;const pe=q.slice(0,-1);pe?(ce.content=pe,ce.raw=pe,c=ce):(a.pop(),c=null);const oe=Q,fe=String(oe.text??oe.children?.map(re=>String(re?.content??re?.raw??"")).join("")??""),H=String(oe.href??""),Y=oe.title==null||oe.title===""?null:String(oe.title);return y({type:"image",src:H,alt:fe,title:Y,raw:``,loading:!!oe.loading}),!0}function K(Q,ce="",Ce=null){const q=String(Q.alt??Q.raw??"");return{type:"link",href:ce,title:Ce,text:q,children:[Q],raw:`[${q}](${ce}${Ce?` "${Ce}"`:""})`,loading:!0}}function G(Q){const ce=Q.startsWith(";return{type:"image",src:"",alt:q===-1?Ce.replace(/\]$/,""):Ce.slice(0,q),title:null,raw:ce,loading:!0}}function X(Q){const ce=Q.indexOf("[![");if(ce===-1||typeof t=="string"&&e.length===1&&b9(t,ce,"["))return!1;const Ce=Q.slice(0,ce);return Ce&&x(Ce,Ce),y(K(G(Q.slice(ce+1)))),u++,!0}function ke(Q){if(o?.final)return!1;const ce=e[u-1];if(ce?.type!=="text"||!String(ce.content??"").endsWith("[")||N(ce,"\\["))return!1;const Ce=a[a.length-1];if(Ce?.type==="text"&&Ce.content.endsWith("[")){const q=Ce.content.slice(0,-1);q?(Ce.content=q,Ce.raw=q,c=Ce):(a.pop(),c=null)}return y(K(a_(Q))),u++,!0}function le(Q){if(Q.type!=="link")return!1;const ce=Q,Ce=String(ce.raw??""),q=String(ce.text??"");if(!Ce.startsWith("[![")&&!q.startsWith("!["))return!1;const te=ce.title==null||ce.title===""?null:String(ce.title);return y(K({type:"image",src:String(ce.href??""),alt:q.replace(/^!\[/,"").replace(/\]$/,""),title:te,raw:Ce.startsWith("[)return!1;const ce=e[u-2];if(ce?.type==="text"&&String(ce.content??"").endsWith("[")&&N(ce,"\\["))return!1;const Ce=a[a.length-1];if(Ce?.type!=="image"&&Ce?.type!=="link")return!1;const q=Ce,te=Ce?.type==="link"&&Array.isArray(q.children)&&q.children.length===1&&q.children[0]?.type==="image"?a.pop():null,pe=te?te.children[0]:a.pop();if(!pe||pe.type!=="image")return!1;const oe=e[u+1];let fe=String(te?.href??""),H=te?.title==null?null:String(te.title),Y=!0;if(oe?.type==="link_open"){const{node:ge,nextIndex:xe}=Md(e,u+1,o);fe=ge.href,H=ge.title,Y=!0,u=xe}else{if(fe=Q.slice(2),fe.includes('"')){const ge=fe.split('"');fe=String(ge[0]??"").trim(),H=ge[1]==null?null:String(ge[1]).trim()}u++}const re=K(pe,fe,H);return re.loading=Y,y(re),!0}function ue(){const Q=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&Q?.type==="text"&&String(Q.content??"").endsWith("[")&&N(Q,"\\[")}function ve(Q,ce){const Ce=Q.indexOf("[");if(Ce===-1)return!1;let q=Q.slice(0,Ce);const te=Q.indexOf("](",Ce);if(te!==-1){const pe=e[u+2];let oe=Q.slice(Ce+1,te);if(oe.includes("[")){const Ne=oe.indexOf("[");q+=Q.slice(0,Ce+Ne+1);const ie=Ce+Ne+1;oe=Q.slice(ie+1,te)}const fe=e[u+1];if(Q.endsWith("](")&&fe?.type==="link_open"&&pe){const Ne=e[u+4];let ie=4,ae=!0;if(Ne?.type==="text"){const je=String(Ne.content??"");if(je.startsWith(")")){ae=!1;const nt=je.slice(1);if(nt){const ct=yl(Ne);ct.content=nt,ct.raw=nt,m()[u+4]=ct}else ie++}else je==="."&&ie++}L(q,ce);const we=String(pe.content??"");return o?.validateLink&&!o.validateLink(we)?x(oe,oe):y({type:"link",href:we,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:ae}),u+=ie,!0}const H=Q.indexOf(")",te),Y=H!==-1?Q.slice(te+2,H):"",re=H===-1;let ge=q.match(/\*+$/);if(ge&&(q=q.replace(/\*+$/,"")),L(q,ce),ge||(ge=oe.match(/^\*+/)),!d&&ge){const Ne=ge[0].length;oe=oe.replace(/^\*+/,"").replace(/\*+$/,"");const ie=[];if(Ne===1?ie.push({type:"em_open",tag:"em",nesting:1}):Ne===2?ie.push({type:"strong_open",tag:"strong",nesting:1}):Ne===3&&(ie.push({type:"strong_open",tag:"strong",nesting:1}),ie.push({type:"em_open",tag:"em",nesting:1})),ie.push({type:"link",href:Y,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:re}),Ne===1){ie.push({type:"em_close",tag:"em",nesting:-1});const{node:ae}=Ad(ie,0,o);v(ae)}else if(Ne===2){ie.push({type:"strong_close",tag:"strong",nesting:-1});const{node:ae}=pc(ie,0,void 0,o);v(ae)}else if(Ne===3){ie.push({type:"em_close",tag:"em",nesting:-1}),ie.push({type:"strong_close",tag:"strong",nesting:-1});const{node:ae}=pc(ie,0,void 0,o);v(ae)}else{const{node:ae}=Ad(ie,0,o);v(ae)}}else o?.validateLink&&!o.validateLink(Y)?x(oe,oe):y({type:"link",href:Y,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:re});const xe=H!==-1?Q.slice(H+1):"";return xe&&(E({type:"text",content:xe,raw:xe}),u--),u++,!0}return!1}function Pe(Q){const ce=Q.indexOf("![");if(ce===-1)return!1;const Ce=Q.slice(0,ce);return Ce&&!c?c={type:"text",content:Ce,raw:Ce}:Ce&&c&&(c.content+=Ce),c&&(a.push(c),c=null),y(G(Q.slice(ce))),u++,!0}function Re(Q){if(!(Q?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ce=Q.slice(1).match(/[^\s\]]/);if(ce===null)return u++,!0;if(ce&&/x/i.test(ce[0])){const Ce=ce[0]==="x"||ce[0]==="X";return y({type:"checkbox_input",checked:Ce,raw:Ce?"[x]":"[ ]"}),u++,!0}return!1}return a}function M9(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){s.content=r;break}o.pop();continue}break}}function E9(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){o.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?s.content=r:o.pop())}break}}function I9(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Fa(e,t,n){const o=e[t],s=[],i=Fr(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=I9(c)?yl(c):c,d=e[a-1];u!==c&&(E9(u),M9(u));const h=String(u.content??"");l.push({type:"paragraph",children:Tn(u.children||[],h,d,i.options()),raw:h}),i.remember(h),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=Ha(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]=Fa(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=n0(e,a,i.options(),t0);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}s.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const l=o.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:s,raw:s.map(l=>l.raw).join(`
|
|
160
|
-
`)},r+1]}function $9(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=Fr(o,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:Tn(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]=Fa(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=Ha(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=zh(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:s,title:i,children:r,raw:`:::${s} ${i}
|
|
161
|
-
${r.map(c=>c.raw).join(`
|
|
162
|
-
`)}
|
|
163
|
-
:::`},a+1]}const N9=new Set(["warning","info","note","tip","danger","caution"]);function L9(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const o=n.search(/\s/),s=(o===-1?n:n.slice(0,o)).toLowerCase();return N9.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function P9(e,t,n){const o=e[t];let s="note",i="";const r=o.type.match(/^container_(\w+)_open$/);if(r){s=r[1];const d=String(o.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(s)){const h=d.slice(s.length).trim();h&&(i=h)}}else{const d=L9(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=Fr(n,!0);let c=t+1;const u=new RegExp(`^container_${s}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const h=d.children||[];let m=-1;for(let g=h.length-1;g>=0;g--){const _=h[g];if(_.type==="text"&&/:+/.test(_.content)){m=g;break}}const f={type:"paragraph",children:Tn((m!==-1?h.slice(0,m):h)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(f),a.remember(f.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,h]=Fa(e,c,a.options());l.push(d),a.remember(d.raw),c=h}else if(e[c].type==="blockquote_open"){const[d,h]=Ha(e,c,a.options());l.push(d),a.remember(d.raw),c=h}else{const d=zh(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:s,title:i,children:l,raw:`:::${s} ${i}
|
|
164
|
-
${l.map(d=>d.raw).join(`
|
|
165
|
-
`)}
|
|
166
|
-
:::`},c+1]}const O9=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function R9(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=O9.exec(String(o.info??""));return s?$9(e,t,s,n):null}const t0={parseContainer:(e,t,n)=>P9(e,t,n),matchAdmonition:R9};function Ha(e,t,n){const o=[],s=Fr(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:Tn(r.children||[],String(r.content??""),void 0,s.options()),raw:String(r.content??"")};o.push(l),s.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=Fa(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=Ha(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}default:{const r=n0(e,i,s.options(),t0);r?(o.push(r[0]),s.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:o,raw:o.map(r=>r.raw).join(`
|
|
167
|
-
`)},i+1]}function D9(e){if(e.info?.startsWith("diff"))return Jv(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let o=t;n?.[1]&&(o=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const s=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:o,raw:o,loading:!s}}function B9(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=Fr(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=Tn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:Tn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(o.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
|
|
168
|
-
`)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
|
|
169
|
-
`)},s+1]}function F9(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=Fr(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:Tn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:s,children:i,raw:`[^${s}]: ${i.map(a=>a.raw).join(`
|
|
170
|
-
`)}`},l+1]}function H9(e,t,n){const o=e[t],s=o.attrs,i=Array.isArray(s)&&s.length?Object.fromEntries(s.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(o.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:Tn(a.children||[],c,void 0,n),raw:c}}function W9(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=xn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(s.test(c)){const u=xn(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 SA(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const o=xn(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=Tl.has(n),l=qh(s),a=(o===-1?-1:W9(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
|
|
171
|
-
</${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function U9(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 j9(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,o]=t;if(!o)continue;const s=String(o).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(s);if(i)return i[1].toLowerCase()}}return"left"}function xA(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function TA(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return xA(n)?n:void 0}function q9(e,t,n){const o=TA(Iu(t),n);if(!xA(o))return e;const s=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:s?.filename||o?.filename,explicitFilename:s?.explicitFilename||o?.explicitFilename,marketTicker:s?.marketTicker||o?.marketTicker}}}function z9(e,t,n){let o=t+1,s=null;const i=[];let r=!1;for(;o<e.length&&e[o].type!=="table_close";)if(e[o].type==="thead_open")r=!0,o++;else if(e[o].type==="thead_close")r=!1,o++;else if(e[o].type==="tbody_open"||e[o].type==="tbody_close")o++;else if(e[o].type==="tr_open"){const a=[];let c=o+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const h=e[c].type==="th_open",m=e[c+1],f=String(m.content??""),g=j9(e[c].attrs),_=a.length,w=!h&&!r,y=w?s?.cells[_]?.raw:void 0;a.push({type:"table_cell",header:h||r,children:Tn(m.children||[],f,void 0,q9(n,y,w?u:void 0)),raw:f,align:g}),w&&(u=TA(u,Iu(f))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(h=>h.raw).join("|")};r?s=d:i.push(d),o=c+1}else o++;s||(s={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:s,rows:i,loading:l&&!n?.final&&i.length===0,raw:[s,...i].map(a=>a.raw).join(`
|
|
172
|
-
`)},o+1]}function V9(){return{type:"thematic_break",raw:"---"}}let Km=null;const Gm=new WeakMap;function d_(){return Km||(Km={allowedTagSet:Kh(),customTagSet:null}),Km}function K9(e){if(!e||e.length===0)return d_();const t=Gm.get(e);if(t)return t;const n=e.map(Hs).filter(Boolean);if(!n.length){const s=d_();return Gm.set(e,s),s}const o={allowedTagSet:Kh({customHtmlTags:e}),customTagSet:new Set(n)};return Gm.set(e,o),o}function G9(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[m,f]of s)if(m==="class"){const g=f.match(/(?:\s|^)vmr-container-(\S+)/);g&&(i=g[1])}else if(m.startsWith("data-")){const g=m.slice(5);try{r[g]=JSON.parse(f)}catch{r[g]=f}}}const l=[],a=Fr(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const m=e[c+1];if(m){const f={type:"paragraph",children:Tn(m.children||[],void 0,void 0,a.options()),raw:String(m.content??"")};l.push(f),a.remember(f.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[m,f]=Fa(e,c,a.options());l.push(m),a.remember(m.raw),c=f}else if(e[c].type==="blockquote_open"){const[m,f]=Ha(e,c,a.options());l.push(m),a.remember(m.raw),c=f}else{const m=zh(e,c,a.options());m?(l.push(m[0]),a.remember(m[0].raw),c=m[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let h=`::: ${i}`;return Object.keys(r).length>0&&(h+=` ${JSON.stringify(r)}`),h+=`
|
|
173
|
-
`,l.length>0&&(h+=o.raw??l.map(m=>m.raw).join(`
|
|
174
|
-
`),h+=`
|
|
175
|
-
`),h+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:h},u?c+1:c]}function Y9(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function X9(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function Q9(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${hs(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${hs(o)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=xn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(s.test(c)){const u=xn(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 Z9(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${o}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n||0);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=xn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const f=c+1;return{raw:e.slice(r,f),end:f}}let u=1,d=c+1;const h=f=>{const g=e.slice(f);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(g)},m=f=>{const g=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),end:e.length};if(m(f)){const g=e.indexOf(">",f);if(g===-1)return null;if(u--,u===0){const _=g+1;return{raw:e.slice(r,_),end:_}}d=g+1;continue}if(h(f)){const g=xn(e.slice(f));if(g===-1)return null;u++,d=f+g+1;continue}d=f+1}return{raw:e.slice(r),end:e.length}}function k1(e){return Number.isFinite(e)&&e>0?e:0}function J9(e,t){const n=k1(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
|
|
176
|
-
`&&(o++,o===n))return s+1;return e.length}function zh(e,t,n){const o=e[t];switch(o.type){case"heading_open":return[H9(e,t,n),t+3];case"code_block":return[D9(o),t+1];case"fence":return[Jv(o),t+1];case"math_block":return[U9(o),t+1];case"html_block":{const s=SA(o),i=s.tag?K9(n?.customHtmlTags):null;if(s.tag&&s.loading&&i&&!i.allowedTagSet.has(s.tag)){const r=String(o.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(s.tag&&i?.customTagSet?.has(s.tag)){const r=s.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(o.map)?J9(l,Number(o.map?.[0]??0)):0,u=Z9(l,r,Math.max(k1(a),k1(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??s.raw??""),h=xn(d),m=h!==-1?d.slice(0,h+1):d,f=h!==-1&&/\/\s*>\s*$/.test(m),g=h===-1?null:Q9(d,r,h+1),_=g?.start??-1;let w="";h!==-1&&(_!==-1&&h<_?w=d.slice(h+1,_):w=d.slice(h+1)),_===-1&&(w=X9(w,r));const y=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let v;for(;(v=b.exec(m))!==null;){const L=v[1];if(!L||L.toLowerCase()===r)continue;const N=v[2]||v[3]||v[4]||"";y.push([L,N])}const x=!n?.final&&!f&&g==null;return[{type:r,tag:r,content:Y9(w),raw:String(u?.raw??s.raw??d),loading:x,attrs:y.length?y:void 0},t+1]}return[s,t+1]}case"table_open":{const[s,i]=z9(e,t,n);return[s,i]}case"dl_open":{const[s,i]=B9(e,t,n);return[s,i]}case"footnote_open":{const[s,i]=F9(e,t,n);return[s,i]}case"hr":return[V9(),t+1]}return null}function n0(e,t,n,o){const s=zh(e,t,n);if(s)return s;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(o?.parseContainer)return o.parseContainer(e,t,n);break;case"container_open":if(o?.matchAdmonition){const i=o.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return G9(e,t,n)}return null}function eH(){return{type:"hardbreak",raw:`\\
|
|
177
|
-
`}}function tH(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:Tn(o.children||[],s,void 0,n),raw:s}}const f_=new WeakMap,Vh=new WeakMap,nH=["$$","\\["];function Na(){return typeof performance<"u"?performance.now():Date.now()}function o0(e,t,n){e&&(e[t]=(e[t]??0)+n)}function AA(e){return e.__timing}function Ym(e,t,n){return t&&o0(t,"parseMarkdownToStructureTotalMs",Na()-n),e}function h_(e,t,n){if(!n)return w_(e,t);const o=Na(),s=w_(e,t);return o0(n,"processTokensMs",Na()-o),s}function oH(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=Ba(t);return n.length?new Set(n):null}function sH(e,t){const n=e;let o=f_.get(n);o||(o=new Map,f_.set(n,o));const s=t.__markstreamFinal===!0?"final":"streaming";let i=o.get(s);i||(i={},o.set(s,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function iH(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ed(e,t,n){for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!("value"in s))continue;const i=Object.getOwnPropertyDescriptor(t,o);i&&(!("value"in i)||i.writable===!1)||(t[o]=ll(s.value,n))}}function ll(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,o=t.get(n);if(o)return o;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(ll(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(ll(l,t),ll(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(ll(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),Ed(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Ed(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),Ed(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!iH(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Ed(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=ll(i[r],t);return s}function MA(e,t=!0){if(!t)return yl(e);const n=Object.create(Object.getPrototypeOf(e)),o=new WeakMap;for(const s of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,s);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,s,i);continue}const r=i.value;let l=r;s==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):s==="map"&&Array.isArray(r)?l=[...r]:s==="children"&&Array.isArray(r)?l=r.map(a=>MA(a,t)):t&&r&&typeof r=="object"&&(l=ll(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function p_(e,t=!0){return e.map(n=>MA(n,t))}function EA(e,t){const n=t,o=e.stream,s=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(s===!0||s==="auto"&&t.final!==!0)&&o?.enabled===!0&&typeof o.parse=="function"}function rH(e,t){const n=t,o=t.streamParse??"auto",s=e.stream;return t.final===!0&&o==="auto"&&n.__disableStreamParse!==!0&&s?.enabled===!0&&typeof s.reset=="function"}function lH(e){Vh.delete(e)}function aH(e,t,n){Vh.set(e,{source:t,key:n,pendingCandidate:n===null&&mA(t)})}function cH(e){return e.endsWith("$")||e.endsWith("\\")}function uH(e){const t=Math.max(e.lastIndexOf(`
|
|
178
|
-
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return nH.some(o=>n.endsWith(o))}function dH(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||uH(e)&&/[\r\n]/.test(t)):!1}function fH(e,t){if(!aA(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=Vh.get(o);if(s?.source===t)return;if(s&&t.startsWith(s.source)){const l=t.slice(s.source.length);if(s.key===null&&s.pendingCandidate===!1&&!dH(s.source,l)&&!cH(t)){s.source=t;return}}const i=TF(t),r=s?!t.startsWith(s.source):!1;(s&&(r||s.key!==i)||!s&&i)&&n.reset(),aH(e,t,i)}function hH(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function pH(e,t){const n=e?.map,o=t?.map;return n===o?!0:!Array.isArray(n)||!Array.isArray(o)?!1:n.length===o.length&&n.every((s,i)=>s===o[i])}function Xm(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&&pH(e,t)}function m_(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function mH(e){for(let t=0;t+5<e.length;t++)if(m_(e,t)&&m_(e,t+3)&&Xm(e[t],e[t+3])&&Xm(e[t+1],e[t+4])&&Xm(e[t+2],e[t+5]))return!0;return!1}function gH(e,t,n){return aA(e)&&mA(t)&&mH(n)}function vH(e){const t=Vh.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function g_(e,t,n,o){if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!EA(e,o)||(fH(e,t),vH(e)))return e.parse(t,n);const s=e.stream.parse(t,sH(e,n));if(gH(e,t,s))return e.stream?.reset?.(),e.parse(t,n);if(!hH(o))return s;const i=AA(o);if(!i)return p_(s,!0);const r=Na(),l=p_(s,!0);return o0(i,"tokenCloneMs",Na()-r),l}function Kh(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return uu;const n=new Set(uu);for(const o of Ba(t))o&&n.add(o);return n}function yH(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 v_(e){return{type:"paragraph",children:e,raw:e.map(yH).join("")}}function y_(e,t){if(e.type!=="paragraph")return null;const n=e.children,o=Array.isArray(n)?n:[];if(o.length===0)return null;const s=oH(t);if(!s?.size)return null;let i=-1;for(let u=0;u<o.length;u++){const d=o[u];if(!s.has(String(d?.type??"").toLowerCase()))continue;const h=o.slice(0,u);if(String(d.content??"").trim()&&h.some(m=>m?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=o.slice(0,i),l=o[i];if(!l)return null;const a=[];r.length&&a.push(v_(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(v_(c)),a}function kH(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),o=/<\/html>\s*$/i.test(t);return!n||!o?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function Fc(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function bH(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*${hs(t)}\s*>\s*$`,"i").test(n)}function s0(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${hs(o)}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=xn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(Tl.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const h=f=>{const g=e.slice(f);return new RegExp(String.raw`^<\s*${hs(o)}(?=\s|>|/)`,"i").test(g)},m=f=>{const g=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${hs(o)}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(m(f)){const g=xn(e.slice(f));if(g===-1)return null;u--;const _=f+g+1;if(u===0)return{raw:e.slice(r,_),start:r,end:_,closed:!0};d=_;continue}if(h(f)){const g=xn(e.slice(f));if(g===-1)return null;const _=e.slice(f,f+g+1);/\/\s*>$/.test(_)||u++,d=f+g+1;continue}d=f+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function wH(e,t){if(!t)return 0;let n=0,o=0;for(;n<e.length&&o<t.length;){if(e[n]===t[o]){n++,o++;continue}if(e[n]==="\r"||e[n]===`
|
|
179
|
-
`){n++;continue}return-1}return o===t.length?n:-1}function _H(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
180
|
-
</${t}>`}function k_(e){return e.replace(/\r\n/g,`
|
|
181
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function CH(e,t,n){return n?e.includes(n,t)?!0:k_(e.slice(Math.max(0,t))).includes(k_(n)):!1}function SH(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
|
|
182
|
-
`&&n++,n):e[n]===`
|
|
183
|
-
`?n+1:t}function b_(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 xH(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function i0(e,t){const n=new RegExp(String.raw`<\s*\/\s*${hs(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function IA(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const TH=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),AH=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function MH(e){return/\n\s*\n/.test(e)||AH.test(e)}function EH(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>TH.has(String(o?.type??"").toLowerCase()))||t.some(o=>{if(o?.type!=="html_block")return!1;const s=o;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!MH(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function IH(e,t,n,o){return e.map(s=>{if(s?.type!=="html_block")return s;const i=s,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||zT.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=xn(l);if(a===-1)return s;const c=i0(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return s;const d=Hc(u,t,IA(n,o));return EH(u,d)?{...s,children:d}:s})}function Hc(e,t,n){return e.trim()?NA(e,t,{...n,__disableStreamParse:!0}):[]}function $H(e,t,n){const o=Hc(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function NH(e,t,n){const o=SA({content:e}),s=xn(e),i=i0(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=$H(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function LH(e,t,n){const o=xn(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=s0(s,"summary",0);if(!i)return Hc(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...Hc(r,t,n),NH(i.raw,t,n),...Hc(l,t,n)]}function $A(e,t,n,o,s,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=Fc(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!b_(c)){r.push(c);continue}const h=String(c.raw??Fc(c)??""),m=d!==-1?d:t.indexOf(h,Math.max(0,l-h.length));if(m===-1){r.push(c);continue}let f=1,g=-1;for(let ee=a+1;ee<e.length;ee++){const K=e[ee];if(b_(K)){f++;continue}if(xH(K)&&(f--,f===0)){g=ee;break}}const _=s0(t,"details",m),w=g===-1&&_?.closed===!0,y=w?(()=>{const ee=i0(h,"details");return ee!==-1?h.slice(0,ee):h})():h,[b]=$A(w?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,o,s,m+h.length),v=LH(y,n,IA(o,s)),x=g===-1?"</details>":String(e[g].raw??Fc(e[g])??"</details>"),L=w||g!==-1&&_?.closed===!0,N=x.replace(/[\t\r\n ]+$/,""),k=L?(()=>{const ee=(_?.raw??"").lastIndexOf(N);return ee===-1?t.length:m+ee})():t.length,T=xn(h),E=w&&T!==-1?m+T+1:m+h.length,O=t.slice(E,k===-1?t.length:k),A=n.parse(O,{__markstreamFinal:s}),$=n.renderer.render(A,n.options,{__markstreamFinal:s}),R=k+N.length,D=L?Math.max(k+x.length,SH(t,R)):t.length,W=L?t.slice(k,D):x,V=L?t.slice(m,D):t.slice(m),U=w&&T!==-1?h.slice(0,T+1):h;if(r.push({...c,tag:"details",attrs:qh(h.slice(0,T+1)),raw:V,content:`${U}${$}${W}`,children:[...v,...b],loading:!s&&!L}),l=L?D:t.length,g===-1&&!w)break;g!==-1&&(a=g)}return[r,l]}function PH(e,t,n){if(!n)return e;const o=e.slice();let s=0;for(let i=0;i<o.length;i++){const r=o[i],l=Fc(r),a=l?n.indexOf(l,s):-1;if(r?.type!=="html_block"){a!==-1&&(s=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(s=a+l.length);continue}const u=s0(n,c,a!==-1?a:s);if(!u)continue;s=u.end;const d=String(r.content??l),h=String(r.raw??d),m=_H(u.raw,c,u.closed),f=!t&&!u.closed,g=d!==m||h!==u.raw||!!r.loading!==f,_=xn(u.raw),w=_===-1?"":u.raw.slice(0,_+1),y=w?qh(w):[];if(r.content=m,r.raw=u.raw,r.loading=f,r.attrs=y.length?y:void 0,!g)continue;let b=wH(u.raw,h);b===-1&&(b=0);const v=i+1;for(;v<o.length;){if(u.closed&&bH(o[v],c)){o.splice(v,1);continue}const x=Fc(o[v]);if(!x)break;const L=u.raw.indexOf(x,b);if(L===-1){if(CH(n,u.end,x))break;o.splice(v,1);continue}b=L+x.length,o.splice(v,1)}}return o}function OH(e){const t=l=>l===" "||l===" "||l===`
|
|
184
|
-
`||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 _=g.charCodeAt(0);return _>=65&&_<=90||_>=97&&_<=122},u=g=>{const _=g.charCodeAt(0);return _>=48&&_<=57},d=g=>g==="!"||c(g),h=g=>c(g)||u(g)||g===":"||g==="-",m=g=>c(g)||u(g)||g==="_"||g==="."||g===":"||g==="-",f=m;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&h(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!m(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const 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 _=l[a];if(t(_)||_==="<"||_===">"||_==='"'||_==="'"||_==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const h=y=>y===" "||y===" ",m=y=>{let b=0;for(;b<y.length&&h(y[b]);)b++;const v=y[b];if(v!=="`"&&v!=="~")return null;let x=b;for(;x<y.length&&y[x]===v;)x++;const L=x-b;return L<3?null:{markerChar:v,markerLen:L,rest:y.slice(x)}},f=y=>{let b=0;for(;b<y.length&&h(y[b]);)b++;let v=!1;for(;b<y.length&&y[b]===">";)for(v=!0,b++;b<y.length&&h(y[b]);)b++;return v?y.slice(b):null},g=y=>{const b=m(y);if(b)return b;const v=f(y);return v==null?null:m(v)};let _=0;const w=l.split(/\r?\n/);for(const y of w){const b=_,v=_+y.length;if(a<b)break;const x=g(y);if(x){const L=x.markerChar,N=x.markerLen;c?L===u&&N>=d&&/^\s*$/.test(x.rest)&&(c=!1,u="",d=0):(c=!0,u=L,d=N)}if(a<=v)break;_=v+1}return c},s=String(e??""),i=s.lastIndexOf("<");if(i===-1||o(s,i))return s;if(i>0){const l=s[i-1],a=l===" "||l===" "||l===`
|
|
185
|
-
`||l==="\r",c=s[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return s}const r=s.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
|
|
186
|
-
`||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function RH(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{const g=f.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||f==="_"||f==="-"||f===":"},i=f=>{if(!f)return!1;if(f[0]===" ")return!0;let g=0;for(let _=0;_<f.length;_++){const w=f[_];if(w===" "){if(g++,g>=4)return!0;continue}if(w===" ")return!0;break}return!1},r=f=>{let g=!1,_=!1;for(let w=0;w<f.length;w++){const y=f[w];if(y==="\\"){w++;continue}if(!_&&y==="'"){g=!g;continue}if(!g&&y==='"'){_=!_;continue}if(!g&&!_&&y===">")return w}return-1},l=f=>{let g=0;for(;g<f.length&&o(f[g]);)g++;const _=f[g];if(_!=="`"&&_!=="~")return null;let w=g;for(;w<f.length&&f[w]===_;)w++;const y=w-g;return y<3?null:{markerChar:_,markerLen:y,rest:f.slice(w)}},a=(f,g)=>{if(i(f))return-1;const _=f.replace(/^[ \t]+/,"");if(!_||_.startsWith(">")||_.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(_))return-1;let w=!1,y=0;for(;y<f.length;){const b=f[y];if(b!=="<"){o(b)||(w=!0),y++;continue}const v=r(f.slice(y));if(v===-1){w=!0,y++;continue}const x=f.slice(y,y+v+1);let L=1;for(;L<x.length&&o(x[L]);)L++;if(L>=x.length){w=!0,y++;continue}const N=x[L];if(N==="!"||N==="?"){w=!0,y+=v+1;continue}if(N==="/"){w=!0,y+=v+1;continue}const k=L;for(;L<x.length&&s(x[L]);)L++;if(L===k){w=!0,y++;continue}const T=x.slice(k,L).toLowerCase(),E=x[L];if(E&&E!==" "&&E!==" "&&E!==">"&&E!=="/"){w=!0,y++;continue}const O=new RegExp(String.raw`<\s*\/\s*${T}\s*>`,"i"),A=/\/\s*>$/.test(x),$=O.test(f.slice(y+v+1)),R=O.test(e.slice(g+y+v+1)),D=/[\r\n]/.test(e.slice(g+y+v+1));if(w&&n.has(T)&&!A&&!$&&(R||D))return y;w=!0,y+=v+1}return-1};let c=!1,u="",d=0,h="",m=0;for(;m<e.length;){const f=e.indexOf(`
|
|
187
|
-
`,m),g=f!==-1,_=g&&f>m&&e[f-1]==="\r",w=g?_?f-1:f:e.length,y=e.slice(m,w),b=g?_?`\r
|
|
188
|
-
`:`
|
|
189
|
-
`:"",v=l(y);let x=y;if(!c&&!v){const L=a(y,m);if(L!==-1){const N=b||`
|
|
190
|
-
`;x=`${y.slice(0,L).replace(/[ \t]+$/,"")}${N}${N}${y.slice(L).replace(/^[ \t]+/,"")}`}}h+=x,h+=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)),m=g?f+1:e.length}return h}function DH(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const h=d.charCodeAt(0);return h>=65&&h<=90||h>=97&&h<=122||h>=48&&h<=57||d==="_"||d==="-"},i=d=>{let h=0;for(;h<d.length&&o(d[h]);)h++;return d.slice(h)},r=d=>{let h=!1,m=!1;for(let f=0;f<d.length;f++){const g=d[f];if(g==="\\"){f++;continue}if(!m&&g==="'"){h=!h;continue}if(!h&&g==='"'){m=!m;continue}if(!h&&!m&&g===">")return f}return-1},l=(d,h,m)=>{const f=m.toLowerCase();let g=d.indexOf("<",h);for(;g!==-1;){let _=g+1;for(;_<d.length&&o(d[_]);)_++;if(_>=d.length||d[_]!=="/"){g=d.indexOf("<",g+1);continue}for(_++;_<d.length&&o(d[_]);)_++;if(_+f.length>d.length){g=d.indexOf("<",g+1);continue}let w=!0;for(let b=0;b<f.length;b++){const v=d[_+b];if((v>="A"&&v<="Z"?String.fromCharCode(v.charCodeAt(0)+32):v)!==f[b]){w=!1;break}}if(!w){g=d.indexOf("<",g+1);continue}let y=_+f.length;if(y<d.length&&s(d[y])){g=d.indexOf("<",g+1);continue}for(;y<d.length&&o(d[y]);)y++;if(y<d.length&&d[y]===">")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let h=0;for(;h<d.length&&o(d[h]);)h++;if(h>=d.length||d[h]!=="<")return d;for(h++;h<d.length&&o(d[h]);)h++;if(h>=d.length||d[h]==="/")return d;const m=h;for(;h<d.length&&s(d[h]);)h++;if(h===m)return d;const f=d.slice(m,h).toLowerCase();if(!n.has(f))return d;const g=r(d.slice(h));if(g===-1)return d;const _=h+g;if(l(d,_+1,f))return d;const w=i(d.slice(_+1));return w?`${d.slice(0,_+1)}
|
|
191
|
-
${w}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
|
|
192
|
-
`,u);if(d===-1){c+=a(e.slice(u));break}const h=d>u&&e[d-1]==="\r",m=h?d-1:d,f=e.slice(u,m);c+=a(f),c+=h?`\r
|
|
193
|
-
`:`
|
|
194
|
-
`,u=d+1}return c}function BH(e,t){if(!e||!t.length)return e;const n=new Set(t.map(h=>String(h??"").toLowerCase()));if(!n.size)return e;const o=h=>h===" "||h===" ",s=h=>{let m=0,f=!1,g=0;for(;m<h.length;){for(;m<h.length&&o(h[m]);)m++;if(m>=h.length||h[m]!==">")break;for(f=!0,m++;m<h.length&&o(h[m]);)m++;g=m}return f?{prefix:h.slice(0,g),content:h.slice(g)}:null},i=h=>{let m=0;for(;m<h.length&&o(h[m]);)m++;const f=h[m];if(f!=="`"&&f!=="~")return null;let g=m;for(;g<h.length&&h[g]===f;)g++;const _=g-m;return _<3?null:{markerChar:f,markerLen:_,rest:h.slice(g)}},r=Array.from(n).map(h=>new RegExp(String.raw`(<\s*\/\s*${h}\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 h=e.indexOf(`
|
|
195
|
-
`,d),m=h!==-1,f=m&&h>d&&e[h-1]==="\r",g=m?f?h-1:h:e.length,_=e.slice(d,g),w=m?f?`\r
|
|
196
|
-
`:`
|
|
197
|
-
`:"",y=s(_),b=y?.prefix??"",v=y?.content??_,x=i(v);x&&(l?x.markerChar===a&&x.markerLen>=c&&/^\s*$/.test(x.rest)&&(l=!1,a="",c=0):(l=!0,a=x.markerChar,c=x.markerLen));let L=v;if(!l&&L.includes("</"))for(const N of r)L=L.replace(N,(k,T,E,O)=>{if(O.replace(/^[\t ]+/,"").startsWith("|"))return k;const A=O.slice(0,E).replace(/^[\t ]+/,"");if(A.length>0){const $=T.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",R=A.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!$||!R||$!==R)return k}return`${T}
|
|
198
|
-
|
|
199
|
-
`});if(b){const N=b+L.split(`
|
|
200
|
-
`).join(`
|
|
201
|
-
${b}`);u+=N}else u+=L;u+=w,d=m?h+1:e.length}return u}function FH(e,t){if(!e||!t.length)return e;const n=new Set(t.map(A=>String(A??"").toLowerCase()));if(!n.size)return e;const o=A=>A===" "||A===" ",s=A=>{if(!A)return!1;if(A[0]===" ")return!0;let $=0;for(let R=0;R<A.length;R++){const D=A[R];if(D===" "){if($++,$>=4)return!0;continue}if(D===" ")return!0;break}return!1},i=A=>{const $=A.charCodeAt(0);return $>=65&&$<=90||$>=97&&$<=122||$>=48&&$<=57||A==="_"||A==="-"||A===":"},r=A=>{let $=0;for(;$<A.length&&o(A[$]);)$++;return A.slice($)},l=A=>{let $=0,R=!1,D=0;for(;$<A.length;){for(;$<A.length&&o(A[$]);)$++;if($>=A.length||A[$]!==">")break;for(R=!0,$++;$<A.length&&o(A[$]);)$++;D=$}if(!R)return null;const W=A.slice(0,D);return{prefix:W,key:W.replace(/[ \t]+$/,""),content:A.slice(D)}},a=A=>r(A).startsWith("<"),c=A=>{for(let $=0;$<A.length;$++){const R=A[$];if(R!==" "&&R!==" ")return!1}return!0},u=A=>{if(s(A))return"";const $=r(A);if(!$.startsWith("<"))return"";let R=1;for(;R<$.length&&o($[R]);)R++;if(R>=$.length||$[R]==="/"||$[R]==="!"||$[R]==="?")return"";const D=R;for(;R<$.length&&i($[R]);)R++;if(R===D)return"";const W=$.slice(D,R).toLowerCase();if(!n.has(W))return"";const V=$[R];return V&&V!==" "&&V!==" "&&V!==">"&&V!=="/"?"":W},d=A=>{if(s(A))return null;const $=r(A);if(!$.startsWith("<"))return null;let R=1;for(;R<$.length&&o($[R]);)R++;if(R>=$.length)return null;const D=$[R]==="/";if(D)for(R++;R<$.length&&o($[R]);)R++;const W=$[R];if(!W||W==="!"||W==="?")return null;const V=R;for(;R<$.length&&i($[R]);)R++;if(R===V)return null;const U=$.slice(V,R).toLowerCase();if(!n.has(U))return null;const ee=$[R];if(ee&&ee!==" "&&ee!==" "&&ee!==">"&&ee!=="/")return null;if(D)return{type:"close",name:U};if(/\/\s*>\s*$/.test($))return{type:"open",name:U,complete:!0};const K=$.indexOf(">",R);if(K!==-1){const G=$.slice(K+1);if(new RegExp(`<\\s*\\/\\s*${U}\\s*>`,"i").test(G))return{type:"open",name:U,complete:!0}}return{type:"open",name:U,complete:!1}},h=A=>{if(s(A))return null;const $=r(A).replace(/[ \t]+$/,"");if(!$.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test($))return null;const R=$.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(R?.[1])return R[1].toLowerCase();const D=$.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!D?.[1]||!D[2])return null;const W=D[1].toLowerCase();return W===D[2].toLowerCase()?W:null};let m=!1,f="",g=0;const _=A=>{let $=0;for(;$<A.length&&o(A[$]);)$++;const R=A[$];if(R!=="`"&&R!=="~")return null;let D=$;for(;D<A.length&&A[D]===R;)D++;const W=D-$;return W<3?null:{markerChar:R,markerLen:W,rest:A.slice(D)}},w=A=>_(A),y=A=>{const $=r(A);return $?s(A)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test($):!1},b=(A,$,R)=>{let D=A,W=0;for(;D<e.length;){const V=e.indexOf(`
|
|
202
|
-
`,D),U=V!==-1,ee=U&&V>D&&e[V-1]==="\r",K=U?ee?V-1:V:e.length,G=e.slice(D,K),X=l(G),ke=X?.key??"";if(W>0&&$&&ke!==$)break;const le=X?.content??G,He=d(le);if(He?.name===R){if(He.type==="open")He.complete||W++;else if(W>0&&(W--,W===0))return!1}else if(W>0&&(c(le)||y(le)))return!0;if(U)D=V+1;else break}return!1};let v="",x=0,L=!0,N=!1,k=!1,T=`
|
|
203
|
-
`;const E=[];let O="";for(;x<e.length;){const A=e.indexOf(`
|
|
204
|
-
`,x),$=A!==-1,R=$&&A>x&&e[A-1]==="\r",D=$?R?A-1:A:e.length,W=e.slice(x,D),V=$?R?`\r
|
|
205
|
-
`:`
|
|
206
|
-
`:"",U=l(W),ee=U?.key??"",K=U?.content??W,G=w(K);G&&(m?G.markerChar===f&&G.markerLen>=g&&/^\s*$/.test(G.rest)&&(m=!1,f="",g=0):(m=!0,f=G.markerChar,g=G.markerLen));const X=E.length>0;if(!m&&!X){const le=u(K),He=!!le&&!L&&N&&k&&b(x,ee,le);le&&!L&&(!N||He)&&(ee&&O&&ee===O?v+=`${ee}${T}`:ee||(v+=T))}if(v+=W,v+=V,V&&(T=V),!m){const le=d(K);if(le){if(le.type==="open")le.complete||E.push(le.name);else for(let He=E.length-1;He>=0;He--)if(E[He]===le.name){E.length=He;break}}}const ke=c(K);L=ke,N=!ke&&a(K),k=!ke&&!!h(K),O=ee,x=$?A+1:e.length}return v}function NA(e,t,n={}){const o=AA(n),s=o?Na():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(rH(t,n)&&(t.stream.reset(),lH(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,_=>_.startsWith(`
|
|
207
|
-
`)?`
|
|
208
|
-
`:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,_=>_.startsWith(`
|
|
209
|
-
`)?`
|
|
210
|
-
`:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,_=>_.startsWith(`
|
|
211
|
-
`)?`
|
|
212
|
-
`:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
213
|
-
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,_=>_.startsWith(`
|
|
214
|
-
`)?`
|
|
215
|
-
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(_,w,y)=>`${w}${y.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,_=>_.startsWith(`
|
|
216
|
-
`)?`
|
|
217
|
-
`:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
218
|
-
`))),n.customHtmlTags?.length&&r.includes("<")){const _=Ba(n.customHtmlTags);if(_.length&&(r=RH(r,_),r=DH(r,_),r=FH(r,_),r=BH(r,_),r.includes("</")))for(const w of _){const y=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${w}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(y,"$1$2$2")}}i||(r=OH(r));const l=kH(r);if(l){const _=n.preTransformTokens,w=n.postTransformTokens;if(EA(t,n)||typeof _=="function"||typeof w=="function"){const y=g_(t,r,{__markstreamFinal:i},n),b=typeof _=="function"&&_(y)||y;typeof w=="function"&&w(b)}return Ym(l,o,s)}const a=g_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return Ym([],o,s);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const h=t,m=n.validateLink??h.options?.validateLink??(typeof h.validateLink=="function"?h.validateLink:void 0),f={...n,validateLink:m,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let g=h_(d,f,o);if(u&&typeof u=="function"){const _=u(d);if(Array.isArray(_)){const w=_[0],y=w?.type;w&&typeof y=="string"?g=h_(_,void 0,o):g=_}}if(g=PH(g,i,r),g=$A(g,r,t,n,i)[0],g=IH(g,t,n,i),i){const _=new WeakSet,w=y=>{if(!y||typeof y!="object"||_.has(y))return;if(_.add(y),Array.isArray(y)){for(const v of y)w(v);return}const b=y;b.type==="html_block"&&b.loading===!0&&(b.loading=!1);for(const v of Object.values(b))w(v)};w(g)}return n.debug&&console.log("Parsed Markdown Tree Structure:",g),Ym(g,o,s)}function w_(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=Fr(t);let s=0;for(;s<e.length;){const i=n0(e,s,o.options(),t0);if(i){n.push(i[0]),o.remember(i[0].raw),s=i[1];continue}const r=e[s];switch(r.type){case"paragraph_open":{const l=String(e[s+1]?.content??""),a=tH(e,s,o.options(l)),c=y_(a,t);c?n.push(...c):n.push(a),o.remember(a.raw),s+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=Fa(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"blockquote_open":{const[l,a]=Ha(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),o.remember(String(r.content??"")),s++;break}case"hardbreak":n.push(eH()),o.reset(),s++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),o.remember(l),s++;break}case"inline":{const l=String(r.content??""),a=Tn(r.children||[],l,void 0,o.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=y_(c,t);u?n.push(...u):n.push(c)}o.remember(l)}s+=1;break;default:s+=1;break}}return n}const HH=new Set([...Eu,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),WH=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"]),__=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function C_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function UH(e){return typeof e=="string"?e:e==null?"":String(e)}function LA(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function yr(e){return UH(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function PA(e){return yr(e).replace(/`/g,"`")}function Gh(e){return String(e??"").trim().toLowerCase()}function r0(e,t="safe"){const n=Gh(e);return n?t==="escape"?!0:t==="trusted"?Eu.has(n):!WH.has(n):!1}function OA(e,t="safe"){const n=Gh(e);return n?t==="escape"?!0:t==="trusted"?Eu.has(n):HH.has(n):!1}function S_(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${PA(o)}"`).join("")}function jH(e,t){const n=e.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.some(o=>{const s=o.split(/\s+/,1)[0]??"";return!s||vl(s,{tagName:t,attrName:"srcset"})})}function RA(e,t,n,o){return T7.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?jH(t,o):!!(A7.has(e)&&t&&vl(t,{tagName:o,attrName:e}))}function al(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function DA(e,t,n,o=!1){if(t!=="safe"||Gh(n)!=="a")return e;const s=al(e,"href");if(o&&(!s||!e[s])){const a=al(e,"target"),c=al(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=al(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=al(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 x_(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!LA(r)||RA(l,i,t,n)||(o[r]=i)}return DA(o,t,n,!!al(e,"href"))}function BA(e,t){const n=e.toLowerCase();return qT.has(n)?!1:C_(t,n)||C_(t,e)}function l0(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!LA(r)||RA(l,i,t,n)||(o[r]=i)}return DA(o,t,n,!!al(e,"href"))}function Jf(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,o]of e)n&&(t[String(n)]=o==null?"":String(o));return t}function b1(e,t="safe",n){const o=l0(Jf(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function qH(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const o=Number(e);if(e!==""&&!Number.isNaN(o))return o}return e}function zH(e){const t={};for(const[n,o]of Object.entries(e))t[n]=qH(o,n);return t}function T_(e){return e.trim().length>0}function VH(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const o=e.indexOf("<",n);if(o===-1){if(n<e.length){const a=e.slice(n);T_(a)&&t.push({type:"text",content:a})}break}if(o>n){const a=e.slice(n,o);T_(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",o+1)){const a=e.indexOf("]]>",o);if(a!==-1){t.push({type:"text",content:e.slice(o,a+3)}),n=a+3;continue}break}if(e.startsWith("!",o+1)){const a=e.indexOf(">",o);if(a!==-1){n=a+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const h=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let m;for(;(m=h.exec(u))!==null;){const f=m[1],g=m[2]??m[3]??m[4]??"";f&&!f.endsWith("/")&&(d[f]=g)}}t.push({type:l||Tl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=s+1}return t}function KH(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const h=e.indexOf("-->",n);if(h!==-1){n=h+3;continue}break}const o=e.indexOf("<",n);if(o===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(o>n&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const h=e.indexOf("]]>",o);if(h!==-1){t.push({type:"text",content:e.slice(o,h+3)}),n=h+3;continue}break}if(e.startsWith("!",o+1)){const h=e.indexOf(">",o);if(h!==-1){n=h+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim();if(!i){n=s+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const h=i.slice(1).trim();t.push({type:"tag_close",tagName:h}),n=s+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const h=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let m;for(;(m=h.exec(u))!==null;){const f=m[1],g=m[2]??m[3]??m[4]??"";f&&!f.endsWith("/")&&(d[f]=g)}}t.push({type:l||Tl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=s+1}return t}function GH(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${yr(t)}>`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${yr(o)}`:` ${yr(o)}="${PA(s)}"`).join("");return e.type==="self_closing"?`<${yr(t)}${n} />`:`<${yr(t)}${n}>`}function YH(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;__.lastIndex=0;let n;for(;(n=__.exec(e))!==null;)if(BA(n[1],t))return!0;return!1}function Sa(e,t="safe"){if(!e)return"";if(t==="escape")return yr(e);const n=KH(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(yr(r.content??""));continue}const l=Gh(r.tagName);if(!l)continue;if(OA(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"&&r0(l,t)){s.push(GH(r));continue}if(r.type==="self_closing"){s.push(`<${l}${S_(x_(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${S_(x_(r.attrs??{},t,l))}>`),Tl.has(l)||o.push(l);continue}const a=o.lastIndexOf(l);if(a===-1)continue;for(;o.length>a+1;){const u=o.pop();u&&s.push(`</${u}>`)}const c=o.pop();c&&s.push(`</${c}>`)}for(;o.length>0;){const r=o.pop();r&&s.push(`</${r}>`)}return s.join("")}const XH=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],A_="http://www.w3.org/2000/svg",QH=new Set(["script","style","iframe","object","embed","link","meta"]),ZH=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"]),JH=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),eW=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),tW=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function nW(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function oW(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function sW(e){const t=e.nodeName.toLowerCase();return t==="use"?nW(e):t==="image"?oW(e):t==="text"||t==="tspan"?!!e.textContent?.trim():tW.has(t)}function iW(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 rW(e,t,n){const o=e.toLowerCase(),s=t.toLowerCase(),i=String(n??"").trim();return i?(o==="use"||o==="marker"||o==="clippath"||o==="mask")&&(s==="href"||s==="xlink:href")?i.startsWith("#")?i:"":o==="a"&&(s==="href"||s==="xlink:href")?vl(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?vl(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":vl(i,{tagName:o,attrName:s})?"":i:""}function lW(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const o=e[n];if(o==='"'||o==="'"){const i=n+1,r=e.indexOf(o,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const s=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(s,n)}}function FA(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const o=n.trim();if(/^[0-9a-f]+$/i.test(o)){const s=Number.parseInt(o,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function HA(e){const t=FA(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=lW(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function M_(e){const t=FA(e);return XH.some(n=>n.test(t))||HA(t)}function aW(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 Id(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function WA(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!QH.has(o)){if(o==="br"){t.push(`
|
|
219
|
-
`);return}for(const s of Array.from(n.childNodes))WA(s,t)}}function cW(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];WA(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=Id(t.getAttribute("width")),i=Id(t.getAttribute("height")),r=Id(t.getAttribute("x")),l=Id(t.getAttribute("y")),a=e.ownerDocument.createElementNS(A_,"text");a.setAttribute("x",String(r+s/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,h]of o.entries()){const m=e.ownerDocument.createElementNS(A_,"tspan");m.setAttribute("x",String(r+s/2)),m.setAttribute("dy",d===0?`${u}em`:"1.2em"),m.textContent=h,a.appendChild(m)}}t.parentNode?.replaceChild(a,t)}}function uW(e){cW(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!ZH.has(o)){n.remove();continue}if(o==="style"&&M_(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const i of s){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&M_(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(JH.has(r)&&i.value){const l=rW(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(eW.has(r)&&i.value&&HA(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=iW(i.value);l!==i.value&&n.setAttribute(i.name,l)}}aW(n)}}function Kme(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 uW(n),dW(n)?null:n}catch{return null}}function dW(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const i=Number.parseFloat(s[2]||""),r=Number.parseFloat(s[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let o=!1;for(const s of n){sW(s)&&(o=!0);for(const i of Array.from(s.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!o}const E_=[];function Qm(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function fW(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function hW(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function I_(e=`editor-${Date.now()}`,t={}){const n=IF(t),o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;s=m=>h[m]??o[m]??m}else s=h=>o[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[f,...g]=m;typeof f=="function"&&n.use(f,...g)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(E_.length)for(const h of E_)if(Array.isArray(h)){const[m,...f]=h;typeof m=="function"&&n.use(m,...f)}else typeof h=="function"&&n.use(h);n.use(GL),n.use(QL),n.use(zL);const i=dP,r=i.default??i;n.use(r),n.use(qL),n.use(jL),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,f=m.src,g=!!m.env?.__markstreamFinal,_=f.split(/\r?\n/);for(const w of m.tokens){if(w.type!=="fence"||!w.map||!w.markup)continue;const y=w.map[0],b=w.map[1],v=w.markup,x=v[0],L=v.length,N=_[Math.max(0,b-1)]??"";let k=0;for(;k<N.length&&(N[k]===" "||N[k]===" ");)k++;let T=0;for(;k+T<N.length&&N[k+T]===x;)T++;let E=k+T;for(;E<N.length&&(N[E]===" "||N[E]===" ");)E++;const O=g?!0:b>y+1&&T>=L&&E===N.length,A=w;A.meta=A.meta??{},A.meta.unclosed=!O,A.meta.closed=!!O}});const l=(h,m)=>{const f=h,g=f.pos;if(f.src[g]!=="~")return!1;const _=f.src[g-1],w=f.src[g+1];if(/\d/.test(_)&&/\d/.test(w)){if(!m){const y=f.push("text","",0);y.content="~"}return f.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(h,m)=>{const f=h[m],g=String(f.info??"").trim(),_=String(f.content??""),w=btoa(unescape(encodeURIComponent(_))),y=fW(g),b=Qm(y),v=hW(`editor-${e}-${m}-${y}`),x=Qm(s("common.copy"));return`<div class="code-block" data-code="${w}" data-lang="${b}" id="${v}">
|
|
220
|
-
<div class="code-header">
|
|
221
|
-
<span class="code-lang">${Qm(y.toUpperCase())}</span>
|
|
222
|
-
<button class="copy-button" data-code="${w}">${x}</button>
|
|
223
|
-
</div>
|
|
224
|
-
<div class="code-editor"></div>
|
|
225
|
-
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=h=>{if(!h.startsWith("["))return!1;const m=c.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const f=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(f)},d=(h,m)=>{const f=h;if(f.src[f.pos]!=="[")return!1;const g=a.exec(f.src.slice(f.pos));if(!g)return!1;const _=f.src.slice(Math.max(0,f.pos-120),f.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(_))return!1;const w=f.src.slice(f.pos+g[0].length);if(w.startsWith("](")||w.startsWith("(")||u(w))return!1;if(!m){const y=g[1],b=f.push("reference","span",0);b.content=y,b.markup=g[0],b.raw=g[0]}return f.pos+=g[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const g=String(h[m].content??"");return`<span class="reference-link" data-reference-id="${g}" role="button" tabindex="0" title="Click to view reference">${g}</span>`},n}const pW="modulepreload",mW=function(e){return"/"+e},$_={},Vo=function(t,n,o){let s=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");s=r(n.map(c=>{if(c=mW(c),c in $_)return;$_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":pW,u||(h.as="script"),h.crossOrigin="",h.href=c,a&&h.setAttribute("nonce",a),document.head.appendChild(h),u)return new Promise((m,f)=>{h.addEventListener("load",m),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function gW({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 UA({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&i===e?s?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:gW({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const N_=new WeakMap;function vW(e){let t=N_.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},N_.set(e,t)),t}function L_(e,t){if(!t?.length)return[...e];const n=[...e],o=new Set(n);for(const s of t)o.has(s)||(o.add(s),n.push(s));return n}function a0(e){return!!(e.themes?.length||e.langs?.length)}function jA(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(o=>n.has(o))}function yW(e,t){return!t?.length||e.registeredAllLangs?!0:jA(e.registeredLangs,t)}function Zm(e,t){return a0(t)&&jA(e.registeredThemes,t.themes)&&yW(e,t.langs)}function kW(e,t){if(!a0(t))return t;const n=L_(e.registeredThemes,t.themes),o=e.registeredAllLangs?[]:L_(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...o.length?{langs:o}:{}}}const bW={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 wW(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function qA(e){const t=wW(e);return bW[t]??t}function zA(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>qA(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function VA(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function _W(e){return VA(e)?.join("\0")??""}function KA(e,t){const n=VA(e),o=zA(t);return{...n?.length?{themes:n}:{},...o?.length?{langs:o}:{}}}function eh(e,t){return`${_W(e)}\0\0${zA(t)?.join("\0")??""}`}function Gme(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const o=KA(e,t),s={...o},i=!!(s.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete o.langs,delete s.langs),{key:eh(s.themes,s.langs),registerOptions:o,rendererOptions:s,ignoredLangs:i}}async function Yme(e,t={},n){if(!e)return"ready";const o=KA(t.themes,t.langs),s=eh(o.themes,o.langs),i=n&&n===s?n:s,r=vW(e);if(r.completed.has(i))return"ready";if(Zm(r,o))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||Zm(r,o))return r.completed.add(i),"ready";const c=kW(r,o),u=eh(c.themes,c.langs);return r.completed.has(u)||Zm(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(a0(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 Yl(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function P_(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var CW=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 h=this.source.length>0,m=this.pendingChars<=0;if(this.source+=d,m){const f=O_();this.startedAt=h&&this.hasStarted?f-this.normalizedStartDelayMs:f,this.lastTick=f,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=O_();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 h=1e3/Math.max(1,this.maxCommitFps),m=Math.min(100,Math.max(0,d-this.lastTick));if(m<h){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const f=this.pendingChars,g=f>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,_=AW(f/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(_-this.currentCps)*.2,this.charBudget+=this.currentCps*(m/1e3),this.charBudget<1){this.ensureLoop();return}const w=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),y=TW(this.source.slice(this.visible.length),w,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:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Yl(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Yl(o,1e3,1)),this.normalizedTargetLatencyMs=Yl(s,900,1),this.normalizedCatchUpLatencyMs=Yl(i,350,1),this.normalizedCatchUpThreshold=P_(r,600),this.normalizedStartDelayMs=P_(a,80),this.maxCommitFps=Math.trunc(Yl(l,30,1)),this.maxCharsPerCommit=Math.trunc(Yl(c,80,1)),this.flushOnFinish=u,this.segmenter=xW(),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 SW(e={},t){const n=new CW(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 xW(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function TW(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let o="",s=0;for(const i of n.segment(e)){if(s>=t)break;o+=i.segment,s++}return{text:o,graphemeCount:s}}function O_(){return typeof performance<"u"?performance.now():Date.now()}function AW(e,t,n){return Math.min(n,Math.max(t,e))}var MW=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const w1=Symbol.for("markstream-vue:node-lifecycle"),R_='<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>',D_='<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>',EW={id:"material",core:{"":D_,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:D_,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:R_,csharp:R_,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:()=>Vo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},_1=new Map;let B_="material";const ca=new Map,F_=new Map;let C1=null;function IW(e){_1.set(e.id,e)}function $W(e){return MW(this,null,function*(){var t,n,o;if(ca.has(e.id))return(t=ca.get(e.id))!=null?t:null;let s=F_.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(ca.set(e.id,i),C1?.(),i)).catch(()=>(ca.set(e.id,null),null)),F_.set(e.id,s)),s})}const NW=Sl(0);C1=()=>{NW.value++},IW(EW);const LW={"":"",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 c0(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[i]=s.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=LW[n])!=null?t:n}function Xme(e){const t=c0(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Qme(e){return(function(o){const s=_1.get(B_);if(!s)return;const i=s.core[o];if(i)return i;const r=ca.get(s.id);if(r){const l=r[o];if(l)return l}s.loadExtended&&!ca.has(s.id)&&$W(s)})(c0(e))||((n=(t=_1.get(B_))==null?void 0:t.fallback)!=null?n:"");var t,n}const Zme={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 GA=!1;function Jme(){return GA}function ege(){GA=!0}var Yh=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let cs=null,Qd=!1,Xh=d0;function Qh(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function u0(){try{const e=globalThis;return Qh(e?.katex)}catch{return null}}function d0(){return Yh(null,null,function*(){const e=u0();if(e)return e;const t=yield Vo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield Vo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Qh(t)})}function PW(e){Xh=e,cs=null,Qd=!1}function OW(e){PW(d0)}function YA(){return typeof Xh=="function"}function tge(){var e;const t=Xh;if(!t||t===d0)return null;if(cs)return cs;const n=u0();if(n)return cs=n,cs;try{const o=t();return o&&typeof o?.then!="function"?(cs=(e=Qh(o))!=null?e:o,cs):null}catch{return null}}function f0(){return Yh(this,null,function*(){var e;const t=u0();if(t)return cs=t,cs;if(cs)return cs;if(Qd)return null;const n=Xh;if(!n)return Qd=!0,null;try{const o=yield n();if(o)return cs=(e=Qh(o))!=null?e:o,cs}catch{}return Qd=!0,null})}function XA(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let wr=null,hr=null;const Ls=new Map,Ri=new Map;let th=5;const fl=new Set;function pu(){if(Ls.size<th&&fl.size){const e=Array.from(fl);fl.clear();for(const t of e)try{t()}catch{}}}function RW(e){wr=e,hr=null,wr.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=Ls.get(n);if(i)if(Ls.delete(n),clearTimeout(i.timeoutId),pu(),s)i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Ri.set(a,o),Ri.size>200){const c=Ri.keys().next().value;Ri.delete(c)}}i.resolve(o)}},wr.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of Ls.entries())clearTimeout(o.timeoutId),o.reject(new Error(`Worker error: ${t.message}`));Ls.clear(),pu()}}function DW(){var e;wr&&((e=wr.terminate)==null||e.call(wr)),wr=null,hr=null}function BW(e,t=!0,n=2e3,o){return Yh(this,null,function*(){performance.now();const s=XA(e);if(!YA()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(hr)return Promise.reject(hr);const i=`${t?"d":"i"}:${s}`,r=Ri.get(i);if(r)return Promise.resolve(r);const l=wr||(hr=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),hr.name="WorkerInitError",hr.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(hr);if(Ls.size>=th){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Ls.size,a.max=th,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const f=new Error("Aborted");return f.name="AbortError",void c(f)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{Ls.delete(u);const f=new Error("Worker render timed out");f.name="WorkerTimeout",f.code="WORKER_TIMEOUT",c(f),pu()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(d),Ls.has(u)&&Ls.delete(u);const f=new Error("Aborted");f.name="AbortError",c(f),pu()},{once:!0});const h=a,m=c;Ls.set(u,{resolve:f=>{h(f)},reject:f=>{m(f)},timeoutId:d}),l.postMessage({id:u,content:s,displayMode:t})})})}function nge(e,t=!0,n){const o=`${t?"d":"i"}:${XA(e)}`;if(Ri.set(o,n),Ri.size>200){const s=Ri.keys().next().value;Ri.delete(s)}}const FW="WORKER_BUSY";function HW(e=2e3,t){return Ls.size<th?Promise.resolve():new Promise((n,o)=>{let s,i=!1;const r=()=>{i||(i=!0,s&&globalThis.clearTimeout(s),fl.delete(r),n())};if(fl.add(r),s=globalThis.setTimeout(()=>{if(i)return;i=!0,fl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",o(l)},e),queueMicrotask(()=>pu()),t){const l=()=>{if(i)return;i=!0,s&&globalThis.clearTimeout(s),fl.delete(r);const a=new Error("Aborted");a.name="AbortError",o(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const mc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function oge(e){return Yh(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!YA()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(s=o.timeout)!=null?s:mc.timeout,c=(i=o.waitTimeout)!=null?i:mc.waitTimeout,u=(r=o.backoffMs)!=null?r:mc.backoffMs,d=(l=o.maxRetries)!=null?l:mc.maxRetries,h=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):mc.maxRetries,m=o.signal;let f=0;for(;;){if(m?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield BW(t,n,a,m)}catch(g){if(g?.code!==FW||f>=h)throw g;if(f++,yield HW(c,m).catch(()=>{}),m?.aborted){const _=new Error("Aborted");throw _.name="AbortError",_}u>0&&(yield new Promise(_=>globalThis.setTimeout(_,u*f)))}}})}function ua(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function WW(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function S1(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=WW(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function x1(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 QA(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function T1(e,t=360,n=500){return QA(e,t,n)}function A1(e,t=360,n=500){return QA(e,t,n)}var UW=Object.defineProperty,jW=Object.defineProperties,qW=Object.getOwnPropertyDescriptors,H_=Object.getOwnPropertySymbols,zW=Object.prototype.hasOwnProperty,VW=Object.prototype.propertyIsEnumerable,W_=(e,t,n)=>t in e?UW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZA=(e,t)=>{for(var n in t||(t={}))zW.call(t,n)&&W_(e,n,t[n]);if(H_)for(var n of H_(t))VW.call(t,n)&&W_(e,n,t[n]);return e},h0=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const p0=()=>Vo(()=>import("./mermaid.core-DYzdrsrJ.js").then(e=>e.bn),[]);let Ai=null,m0=p0;function KW(e){m0=e,Ai=null}function GW(e){KW(p0)}function YW(){return typeof m0=="function"}function U_(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=ZA({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):s.initialize?s.initialize(i):void 0},jW(n,qW(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function j_(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=ZA({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function sge(){return h0(this,null,function*(){if(Ai)return Ai;const e=(function(){try{const o=globalThis;return U_(o?.mermaid)}catch{return null}})();if(e)return Ai=e,j_(Ai),Ai;const t=m0;if(!t)return null;let n;try{n=yield t()}catch(o){throw t===p0?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):o}return n?(Ai=U_(n),j_(Ai),Ai):null})}let Mo=null,pr=null;const ao=new Map;let q_=5,z_=!1;const XW="WORKER_BUSY",QW="MERMAID_DISABLED";function ZW(e){Mo=e,pr=null;const t=e;Mo.onmessage=n=>{if(Mo!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=ao.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Mo.onerror=n=>{var o,s;if(Mo===t)if(ao.size!==0){try{z_?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of ao.entries())r.reject(new Error(`Worker error: ${n.message}`));ao.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Mo.onmessageerror=n=>{var o,s;if(Mo===t)if(ao.size!==0){try{z_?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of ao.entries())r.reject(new Error("Worker messageerror"));ao.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function JW(){var e;if(Mo)try{for(const[t,n]of ao.entries())n.reject(new Error("Worker cleared"));ao.clear(),(e=Mo.terminate)==null||e.call(Mo)}catch{}Mo=null,pr=null}function JA(e,t,n=1400){if(!YW()){const s=new Error("Mermaid rendering disabled");return s.name="MermaidDisabled",s.code=QW,Promise.reject(s)}if(pr)return Promise.reject(pr);const o=Mo||(pr=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),pr.name="WorkerInitError",pr.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(pr);if(ao.size>=q_){const s=new Error("Worker busy");return s.name="WorkerBusy",s.code=XW,s.inFlight=ao.size,s.max=q_,Promise.reject(s)}return new Promise((s,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),ao.delete(r))},u={resolve:d=>{c(),s(d)},reject:d=>{c(),i(d)}};ao.set(r,u);try{o.postMessage({id:r,action:e,payload:t})}catch(d){return ao.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const h=ao.get(r);h&&h.reject(d)},n)})}function ige(e,t,n=1400){return h0(this,null,function*(){try{return yield JA("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function rge(e,t,n=1400){return h0(this,null,function*(){try{return yield JA("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function lge(){if(Mo)try{for(const[e,t]of ao.entries())t.reject(new Error("Worker terminated"));ao.clear(),Mo.terminate()}finally{Mo=null}}var eU=Object.defineProperty,tU=Object.defineProperties,nU=Object.getOwnPropertyDescriptors,V_=Object.getOwnPropertySymbols,oU=Object.prototype.hasOwnProperty,sU=Object.prototype.propertyIsEnumerable,K_=(e,t,n)=>t in e?eU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,et=(e,t)=>{for(var n in t||(t={}))oU.call(t,n)&&K_(e,n,t[n]);if(V_)for(var n of V_(t))sU.call(t,n)&&K_(e,n,t[n]);return e},Mt=(e,t)=>tU(e,nU(t)),Cn=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const iU="__global__",Jm="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",M1=(()=>{const e=globalThis;if(e[Jm])return e[Jm];const t={scopedCustomComponents:{},revision:Sl(0)};return e[Jm]=t,t})(),G_=M1.revision,rU=Symbol("markstreamCustomComponents"),lU=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 Nu(e){return lU.has(String(e).trim().toLowerCase())}function aU(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function eg(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([Hs(n),Hs(aU(n))]))!s||Nu(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function jn(e){const t=Bt(rU,null);return F(()=>{var n;return G_.value,(function(o,s={}){return G_.value,et(et(et({},eg(M1.scopedCustomComponents[iU]||{})),eg(s)),eg((function(i){return i&&M1.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const cU=["aria-label"],uU={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"},dU={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"},Jt=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},ps=Jt(Qe({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(C(),I("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(C(),I("svg",dU,[...n[1]||(n[1]=[p("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),p("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(C(),I("svg",uU,[...n[0]||(n[0]=[p("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,cU))}),[["__scopeId","data-v-be21ab83"]]);ps.install=e=>{e.component(ps.__name,ps)};const fU={class:"emoji-node"},Go=Jt(Qe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(C(),I("span",fU,P(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Go.install=e=>{e.component(Go.__name,Go)};const hU=["id"],pU=["title"],ms=Jt(Qe({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(C(),I("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[p("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+P(e.node.id)+"]",9,pU)],8,hU))}}),[["__scopeId","data-v-c1463a29"]]);ms.install=e=>{e.component(ms.__name,ms)};const e3=(()=>{try{return!1}catch{}return!1})();function tg(e){e3&&console.warn(e)}function Y_(e,t="safe",n){return l0(e,t,n)}function t3(e){return zH(e)}function ng(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function g0(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=b1((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),ng(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),ng(r.value)]):Object.entries(s).map(([r,l])=>[r,ng(l)]):null,t,n);var s;if(!o)return;const i=t3(Jf(o));return Object.keys(i).length>0?i:void 0}function X_(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function gc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function og(e,t,n,o,s,i,r=!1){const l=(function(d,h){return BA(d,h)})(e,o);if(Eu.has(e.toLowerCase())||!l&&OA(e,i))return null;if(!l&&r0(e,i))return r?[X_(e,t,!0)]:[X_(e,t),...n,`</${e}>`];const a=l0(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],h=t3(a);return Zt(d,Mt(et({},h),{key:u}),n.length>0?n:void 0)}return Zt(e,Mt(et({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function n3(e,t){return YH(e,t)}function nh(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 h=og(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);gc(c.length>0?c[c.length-1].children:u,h)}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 h=d.tagName.toLowerCase();let m=-1;for(let f=c.length-1;f>=0;f--)if(c[f].tagName.toLowerCase()===h){m=f;break}if(m!==-1)for(;c.length>m;){const f=c.pop(),g=og(f.tagName,f.attrs||{},f.children,r,f.autoKey,l);c.length>0?gc(c[c.length-1].children,g):gc(u,g),f.tagName.toLowerCase()!==h&&c.length>m&&tg(`Auto-closing unclosed tag: <${f.tagName}>`)}else tg(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),h=og(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?gc(c[c.length-1].children,h):gc(u,h),tg(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(VH(e),t,n)}catch(s){return o=s,e3&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const mU=["innerHTML"],gs=Jt(Qe({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Bt("markstreamHtmlPolicy",void 0),o=F(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=jn(()=>t.customId),i=Qe({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(o.value==="escape")return{mode:"html",content:Sa(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=nh(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!n3(l,s.value))return{mode:"html",content:Sa(l,o.value)};const a=nh(l,s.value,o.value);return a===null?{mode:"html",content:Sa(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(C(),I("span",{key:0,class:Le(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[vt(S(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(C(),I("span",{key:1,class:Le(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},P(r.value.content),3)):(C(),I("span",{key:2,class:Le(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,mU))}}),[["__scopeId","data-v-d17f12b0"]]);gs.install=e=>{e.component(gs.__name,gs)};const gU={class:"inline-code"},vU={key:0},_o=Jt(Qe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Su(),o=Bt("markstreamFade",void 0),s=Bt("markstreamTextStreamState",void 0),i=Bt("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 o?.value!="boolean"||o.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=ne(t.node.code),h=ne("");let m=i?.value;const f=ne(0);function g(){return d.value+h.value}function _(){h.value&&(d.value=g(),h.value="")}ze([()=>t.node.code,u,l,()=>i?.value],([y,b,v,x])=>{const L=String(y??""),N=u.value,k=x!==m;m=x;const T=UA({nextContent:L,persistedContent:N?s?.get(N):void 0,currentState:{settledContent:d.value,streamedDelta:h.value},typewriterEnabled:l.value,streamRenderVersionChanged:k});d.value=T.settledContent,h.value=T.streamedDelta,T.appended&&(f.value+=1),N&&s?.set(N,L)},{immediate:!0}),ze(l,y=>{var b;y||(b=g(),d.value=b,h.value="")});const w=F(()=>f.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(y,b)=>(C(),I("code",gU,[c.value?(C(),I(Oe,{key:0},[ut(P(a.value),1)],64)):(C(),I(Oe,{key:1},[d.value?(C(),I("span",vU,P(d.value),1)):se("",!0),h.value?(C(),I("span",{key:1,class:Le(["inline-code-stream-delta",[w.value]]),onAnimationend:_},P(h.value),35)):se("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);_o.install=e=>{e.component(_o.__name,_o)};const E1=ne(!1),Q_=ne(""),Z_=ne("top"),Wc=ne(null),Uc=ne(null),I1=ne(null),$1=ne(null),J_=ne(null);let Zd=null,Jd=null,N1=0;function o3(){Zd&&(clearTimeout(Zd),Zd=null),Jd&&(clearTimeout(Jd),Jd=null)}let $d=!1,Nd=null,e2=!1;function yU(e,t,n="top",o=!1,s,i){if(!e)return;const r=++N1;o3();const l=()=>Cn(null,null,function*(){var a,c;if(yield(function(){return Cn(this,null,function*(){if(!$d&&!e2&&typeof document<"u"){Nd!=null||(Nd=Cn(null,null,function*(){const[{createApp:u,h:d},{default:h}]=yield Promise.all([Vo(()=>import("./vue.runtime.esm-bundler-CQbR9uOv.js"),[]),Vo(()=>import("./Tooltip-DtxNXMAM.js"),[])]),m=document.createElement("div");m.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(m),u({setup:()=>()=>{var f;return d(h,{visible:E1.value,"anchor-el":Wc.value,content:Q_.value,placement:Z_.value,id:Uc.value,originX:I1.value,originY:$1.value,isDark:(f=J_.value)!=null?f:void 0})}}).mount(m),$d=!0}));try{yield Nd}catch(u){$d=!1,Nd=null,e2=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),$d&&r===N1){Uc.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Wc.value=e,Q_.value=t,Z_.value=n,I1.value=(a=s?.x)!=null?a:null,$1.value=(c=s?.y)!=null?c:null,J_.value=typeof i=="boolean"?i:null,E1.value=!0;try{e.setAttribute("aria-describedby",Uc.value)}catch{}}});o?l():Zd=setTimeout(l,80)}function kU(e=!1){N1+=1,o3();const t=()=>{if(Wc.value&&Uc.value)try{Wc.value.removeAttribute("aria-describedby")}catch{}E1.value=!1,Wc.value=null,Uc.value=null,I1.value=null,$1.value=null};e?t():Jd=setTimeout(t,120)}const L1={"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..."},P1=e=>{var t;return(t=L1[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function t2(e){return{t(t){if(e.te&&L1[t]&&!e.te(t))return P1(t);const n=e.t(t);return n===t&&L1[t]?P1(t):n}}}function bU(){const e=(function(){var t,n;try{const o=ho(),s=o?.proxy,i=s?.$t;if(typeof i=="function"){const a=s?.$te;return{t:i.bind(s),te:typeof a=="function"?a.bind(s):void 0}}const r=(n=(t=o?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return t2(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return t2({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:P1}}function wU(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const _U=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],CU={key:1,class:"image-placeholder"},SU={key:1,class:"image-node__raw-text"},xU={key:0,class:"image-shimmer-overlay"},TU={key:1,class:"image-node__raw-text"},AU={key:2,class:"image-error"},Tr=Jt(Qe({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,o=t,s=ne(!1),i=ne(!1),r=ne(""),l=ne("primary"),a=ne(null),c=Su(),u=Bt(w1,null);let d="",h=null;const m=F(()=>Pw(n.node.src)),f=F(()=>Pw(n.fallbackSrc)),g=F(()=>r.value),_=F(()=>!n.lazy),w=F(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),y=F(()=>l.value==="failed"),b=F(()=>!_.value&&!s.value&&!i.value&&l.value!=="failed"&&r.value.length>0),v=F(()=>wU(n,c));function x(R=v.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function L(R=v.value){R&&ht(()=>{x(R)})}function N(){h&&(clearTimeout(h),h=null)}function k(){const R=v.value;R&&d!==R&&(d&&u?.markSettled(d),N(),d=R,u?.markPending(R),typeof window<"u"&&(h=window.setTimeout(()=>{d===R&&(L(R),T())},8e3)))}function T(){return Cn(this,null,function*(){const R=d;R&&(N(),d="",yield ht(),x(R),u?.markSettled(R))})}function E(){if(l.value==="primary"&&f.value&&f.value!==r.value)return l.value="fallback",r.value=f.value,s.value=!1,i.value=!1,void L();l.value="failed",i.value=!0,o("error",r.value),L()}function O(){s.value=!0,i.value=!1,o("load",g.value),L()}function A(R){R.preventDefault(),s.value&&!i.value&&o("click",[R,g.value])}const{t:$}=bU();return ze([m,f,()=>n.node.loading],()=>(s.value=!1,i.value=!1,n.node.loading||m.value?(r.value=m.value,void(l.value="primary")):f.value?(r.value=f.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),ze([w,s,i,g,()=>n.lazy],([R,D,W,V,U])=>R&&V&&!W?D?(T(),void L()):U?(k(),void L()):void(D||W||k()):(T(),void L()),{flush:"post",immediate:!0}),Jo(()=>{(function(){const R=d;R&&(N(),d="",u?.markSettled(R))})()}),(R,D)=>{var W,V,U,ee,K;return C(),I("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[w.value?(C(),I("img",{key:0,src:g.value,alt:String((V=(W=n.node.alt)!=null?W:n.node.title)!=null?V:""),title:String((ee=(U=n.node.title)!=null?U:n.node.alt)!=null?ee:""),class:Le(["image-node__img",{"is-loading":!_.value&&!s.value,"is-loaded":_.value||s.value,"has-natural-size":s.value,"cursor-pointer":s.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:_.value?"high":void 0,decoding:_.value?"sync":"async",tabindex:s.value?0:-1,"aria-label":(K=n.node.alt)!=null?K:S($)("image.preview"),onError:E,onLoad:O,onClick:A},null,42,_U)):se("",!0),e.node.loading&&!i.value?(C(),I("span",CU,[n.usePlaceholder?ga(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=p("span",{class:"image-shimmer"},null,-1))],!0):(C(),I("span",SU,P(e.node.raw),1))])):se("",!0),vt(qi,{name:"shimmer-fade"},{default:$n(()=>[b.value&&!e.node.loading?(C(),I("span",xU,[n.usePlaceholder?ga(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=p("span",{class:"image-shimmer"},null,-1))],!0):(C(),I("span",TU,P(e.node.raw),1))])):se("",!0)]),_:3}),y.value?(C(),I("span",AU,[ga(R.$slots,"error",{node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[2]||(D[2]=p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[p("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)),p("span",null,P(S($)("image.loadError")),1)],!0)])):se("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Tr.install=e=>{e.component(Tr.__name,Tr)};const MU={key:2},pi=Qe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=jn(()=>t.customId),o=Bt("markstreamHtmlPolicy",void 0),s=Bt("markstreamNestedRendererProps",void 0),i=F(()=>{var f;return(f=o?.value)!=null?f:"safe"}),r=F(()=>{var f,g;const _=(f=s?.value)!=null?f:{};return Mt(et({},_),{customId:(g=t.customId)!=null?g:_.customId,htmlPolicy:i.value})}),l=di({loader:()=>Promise.resolve().then(()=>C0),suspensible:!1}),a=F(()=>t.components[String(t.node.type)]),c=F(()=>!!(a.value&&n.value[t.node.type]&&!Nu(String(t.node.type)))),u=F(()=>c.value?g0(t.node,i.value):void 0),d=F(()=>Array.isArray(t.node.children)&&t.node.children.length>0),h=F(()=>{var f;return String((f=t.node.content)!=null?f:"")}),m=F(()=>{var f,g;return String((g=(f=t.node.content)!=null?f:t.node.raw)!=null?g:"")});return(f,g)=>a.value&&c.value?(C(),Ve(ko(a.value),en({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:$n(()=>[d.value?(C(),Ve(S(l),en({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"])):h.value?(C(),Ve(S(l),en({key:1},r.value,{content:h.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"])):se("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(C(),Ve(ko(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(C(),I("span",MU,P(m.value),1)):se("",!0)}}),EU=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],IU={key:0,translate:"no",class:"markstream-pre__diff-code"},$U={class:"markstream-pre__diff-number","aria-hidden":"true"},NU={class:"markstream-pre__diff-content"},LU={class:"markstream-pre__diff-content-inner"},PU={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},OU=["textContent"],ls=Qe({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=F(()=>{var A,$,R;const D=String(($=(A=t.node)==null?void 0:A.language)!=null?$:"");return String((R=String(D).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=F(()=>`language-${n.value}`),s=F(()=>{var A,$,R,D,W;return((A=t.node)==null?void 0:A.diff)===!0?String((R=($=t.node)==null?void 0:$.code)!=null?R:""):(function(V,U){const ee=String(V??"");return U?ee:ee.replace(/\r\n$|\n$|\r$/,"")})((D=t.node)==null?void 0:D.code,((W=t.node)==null?void 0:W.loading)===!0)}),i=F(()=>s.value.split(/\r\n|\n|\r/)),r=F(()=>Array.from({length:Math.max(1,i.value.length)},(A,$)=>$+1)),l=F(()=>{var A;return t.showLineNumbers===!0&&((A=t.node)==null?void 0:A.diff)===!0}),a=F(()=>l.value&&t.diffInline===!0),c=F(()=>{const A=Number(t.reservedHeightPx);if(!Number.isFinite(A)||A<=0)return;const $=`${Math.ceil(A)}px`;return{height:$,minHeight:$,maxHeight:$,overflow:"auto"}});function u(A){return String(A??"").trim().length===0}function d(A,$="context",R={}){const D=u(A);return{code:A,kind:D&&$!=="hunk"&&!R.preserveBlankKind?"context":$,empty:D}}function h(A){const $=String(A??"");return $?$.split(/\r\n|\n|\r/):[]}function m(A,$){return!u(A[$])||$<A.length-1}function f(A){return A.startsWith("-")&&!A.startsWith("---")}function g(A){return A.startsWith("+")&&!A.startsWith("+++")}function _(A,$){const R=h(A),D=h($),W=(function(X,ke){const le=X.length,He=ke.length;if((le+1)*(He+1)>15e5)return null;const ue=He+1,ve=new Uint32Array((le+1)*(He+1));for(let ce=1;ce<=le;ce++)for(let Ce=1;Ce<=He;Ce++){const q=ce*ue+Ce;if(X[ce-1]===ke[Ce-1])ve[q]=ve[(ce-1)*ue+(Ce-1)]+1;else{const te=ve[(ce-1)*ue+Ce],pe=ve[ce*ue+(Ce-1)];ve[q]=te>=pe?te:pe}}const Pe=[];let Re=le,Q=He;for(;Re>0&&Q>0;)X[Re-1]===ke[Q-1]?(Pe.push({originalIndex:Re-1,modifiedIndex:Q-1}),Re--,Q--):ve[(Re-1)*ue+Q]>=ve[Re*ue+(Q-1)]?Re--:Q--;return Pe.reverse(),Pe})(R,D);if(W){const X=[];let ke=0,le=0;for(const He of W){for(;ke<He.originalIndex;)X.push(Mt(et({},d(R[ke],"removed",{preserveBlankKind:m(R,ke)})),{key:`inline-removed-source-${ke}`,number:""})),ke++;for(;le<He.modifiedIndex;)X.push(Mt(et({},d(D[le],"added",{preserveBlankKind:m(D,le)})),{key:`inline-added-source-${le}`,number:le+1})),le++;X.push(Mt(et({},d(D[He.modifiedIndex])),{key:`inline-context-source-${He.originalIndex}-${He.modifiedIndex}`,number:He.modifiedIndex+1})),ke=He.originalIndex+1,le=He.modifiedIndex+1}for(;ke<R.length;)X.push(Mt(et({},d(R[ke],"removed",{preserveBlankKind:m(R,ke)})),{key:`inline-removed-source-${ke}`,number:""})),ke++;for(;le<D.length;)X.push(Mt(et({},d(D[le],"added",{preserveBlankKind:m(D,le)})),{key:`inline-added-source-${le}`,number:le+1})),le++;return X}const V=[];let U=0,ee=R.length-1,K=D.length-1;for(;U<=ee&&U<=K&&R[U]===D[U];)V.push(Mt(et({},d(D[U])),{key:`inline-prefix-${U}`,number:U+1})),U++;const G=[];for(;ee>=U&&K>=U&&R[ee]===D[K];)G.unshift(Mt(et({},d(D[K])),{key:`inline-suffix-${K}`,number:K+1})),ee--,K--;for(let X=U;X<=ee;X++)V.push(Mt(et({},d(R[X],"removed",{preserveBlankKind:m(R,X)})),{key:`inline-removed-source-${X}`,number:""}));for(let X=U;X<=K;X++)V.push(Mt(et({},d(D[X],"added",{preserveBlankKind:m(D,X)})),{key:`inline-added-source-${X}`,number:X+1}));return V.concat(G)}const w=F(()=>{var A,$,R,D;const W=(function(K){const G=K.some(ke=>f(ke)),X=K.some(ke=>g(ke));return G&&X||(function(){var ke,le,He,ue;if(n.value==="diff")return!0;const ve=(ue=(He=String((le=(ke=t.node)==null?void 0:ke.raw)!=null?le:"").split(/\r?\n/,1)[0])==null?void 0:He.trim())!=null?ue:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(ve)})()&&(G||X)})(i.value),V=(function(){var K,G;return((K=t.node)==null?void 0:K.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(K){const G=[];let X=1;for(const[ke,le]of K.entries())if(le.startsWith("@@"))G.push(Mt(et({},d(le,"hunk")),{key:`inline-hunk-${ke}`,number:""}));else if(f(le))G.push(Mt(et({},d(le.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ke}`,number:""}));else if(g(le))G.push(Mt(et({},d(le.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${ke}`,number:X++}));else{const He=le.startsWith(" ")?le.slice(1):le;G.push(Mt(et({},d(He)),{key:`inline-context-${ke}`,number:X})),X++}return G})(i.value):_((A=t.node)==null?void 0:A.originalCode,($=t.node)==null?void 0:$.updatedCode)}];if(!W&&V){const K=h((R=t.node)==null?void 0:R.originalCode),G=h((D=t.node)==null?void 0:D.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:K.map((X,ke)=>{const le=G[ke]===X?"context":"removed";return Mt(et({},d(X,le,{preserveBlankKind:m(K,ke)})),{key:`original-${ke}`,number:ke+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:G.map((X,ke)=>{const le=K[ke]===X?"context":"added";return Mt(et({},d(X,le,{preserveBlankKind:m(G,ke)})),{key:`modified-${ke}`,number:ke+1})})}]}const U=[],ee=[];for(const K of i.value)if(K.startsWith("@@"))U.push(d(K,"hunk")),ee.push(d(K,"hunk"));else if(K.startsWith("-")&&!K.startsWith("---"))U.push(d(K.slice(1),"removed",{preserveBlankKind:!0}));else if(K.startsWith("+")&&!K.startsWith("+++"))ee.push(d(K.slice(1),"added",{preserveBlankKind:!0}));else{const G=K.startsWith(" ")?K.slice(1):K;U.push(d(G)),ee.push(d(G))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((K,G)=>Mt(et({},K),{key:`original-${G}`,number:G+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ee.map((K,G)=>Mt(et({},K),{key:`modified-${G}`,number:G+1}))}]}),y=F(()=>{const A=n.value;return A?`Code block: ${A}`:"Code block"}),b=ne(null),v=ne([]);let x=null,L=null;function N(A){const $=Number.parseFloat(String(A??""));return Number.isFinite($)&&$>0?$:0}function k(A,$){var R;if(!A)return $;const D=A.querySelector(".markstream-pre__diff-content"),W=D?.getBoundingClientRect(),V=(R=W?.height)!=null?R:0;return Math.max($,Math.ceil(V))}function T(){typeof window<"u"&&(x!=null&&window.cancelAnimationFrame(x),x=window.requestAnimationFrame(()=>{(function(){var A,$;x=null;const R=b.value;if(!R||!l.value)return void(v.value.length&&(v.value=[]));const D=(function(X){const ke=window.getComputedStyle(X),le=N(ke.getPropertyValue("--markstream-pre-diff-line-height"));if(le>0)return le;const He=N(ke.lineHeight);return He>0?He:18})(R),W=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),V=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),U=Math.max(W.length,V.length),ee=[];for(let X=0;X<U;X++){const ke=k((A=W[X])!=null?A:null,D),le=k(($=V[X])!=null?$:null,D),He=Math.max(D,ke,le);ee.push({rowHeight:He,originalHeight:ke,modifiedHeight:le})}var K,G;K=v.value,G=ee,K.length===G.length&&K.every((X,ke)=>{const le=G[ke];return le&&Math.abs(X.rowHeight-le.rowHeight)<=.5&&Math.abs(X.originalHeight-le.originalHeight)<=.5&&Math.abs(X.modifiedHeight-le.modifiedHeight)<=.5})||(v.value=ee)})()}))}function E(A){L?.disconnect(),L=null,A&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{T()}),L.observe(A))}function O(A,$){const R=v.value[A];if(!R)return;const D=$==="original"?R.originalHeight:R.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(R.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(D)}px`}}return ze(b,A=>{E(A),ht(()=>T())},{flush:"post"}),ze([l,w],()=>{E(b.value),ht(()=>T())},{flush:"post",immediate:!0}),Jo(()=>{x!=null&&(window.cancelAnimationFrame(x),x=null),L?.disconnect(),L=null}),(A,$)=>(C(),I("pre",{ref_key:"preRef",ref:b,style:Wt(c.value),class:Le([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":y.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(C(),I("code",IU,[(C(!0),I(Oe,null,Xe(w.value,R=>(C(),I("span",{key:R.key,class:Le(["markstream-pre__diff-pane",R.className])},[(C(!0),I(Oe,null,Xe(R.lines,(D,W)=>(C(),I("span",{key:D.key,class:Le(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:Wt(O(W,R.key))},[$[0]||($[0]=p("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),p("span",$U,P(D.number),1),p("span",NU,[p("span",LU,P(D.code),1)])],6))),128))],2))),128))])):(C(),I(Oe,{key:1},[t.showLineNumbers?(C(),I("span",PU,[(C(!0),I(Oe,null,Xe(r.value,R=>(C(),I("span",{key:R,class:"markstream-pre__line-number"},P(R),1))),128))])):se("",!0),p("code",{translate:"no",class:"markstream-pre__code",textContent:P(s.value)},null,8,OU)],64))],14,EU))}});ls.install=e=>{e.component(ls.__name,ls)};const sg=Sl(!1);let n2=null;const RU={key:0},Nn=Jt(Qe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(n2||(n2=f0().then(w=>{sg.value=!!w}).catch(()=>{sg.value=!1})),df(sg)),o=Su(),s=Bt("markstreamFade",void 0),i=Bt("markstreamTextStreamState",void 0),r=Bt("markstreamStreamVersion",void 0),l=F(()=>{const w=o.fade;return w===""||w===!0||w==="true"||w!==!1&&w!=="false"&&void 0}),a=F(()=>typeof l.value=="boolean"?l.value:typeof s?.value!="boolean"||s.value),c=F(()=>{var w;const y=(w=o["index-key"])!=null?w:o.indexKey;return y==null||y===""?"":String(y)}),u=ne(t.node.content),d=ne("");let h=r?.value;const m=ne(0);function f(){return u.value+d.value}function g(){d.value&&(u.value=f(),d.value="")}ze([()=>t.node.content,c,a,()=>r?.value],([w,y,b,v])=>{const x=String(w??""),L=c.value,N=v!==h;h=v;const k=UA({nextContent:x,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:N});u.value=k.settledContent,d.value=k.streamedDelta,k.appended&&(m.value+=1),L&&i?.set(L,x)},{immediate:!0}),ze(a,w=>{var y;w||(y=f(),u.value=y,d.value="")});const _=F(()=>m.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(w,y)=>(C(),I("span",{class:Le([[S(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(C(),I("span",RU,P(u.value),1)):se("",!0),d.value?(C(),I("span",{key:1,class:Le(["text-node-stream-delta",[_.value]]),onAnimationend:g},P(d.value),35)):se("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Nn.install=e=>{e.component(Nn.__name,Nn)};const s3=Qe({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var o;return Zt(ls,Mt(et({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(o=n.estimatedHeightPx)!=null?o:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),ig=di({loader:()=>Cn(null,null,function*(){try{return(yield Vo(()=>import("./CodeBlockNode-j7RGe-Ru.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),ls}}),loadingComponent:s3,delay:0,suspensible:!1}),Qs=di(()=>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,o,s,i;return Zt(Nn,Mt(et({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))};try{if(yield f0())return(yield Vo(()=>import("./index6-fL_9Ohtp.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,o,s,i;return Zt(Nn,Mt(et({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),i3=di(()=>Cn(null,null,function*(){try{if(yield f0())return(yield Vo(()=>import("./index5-C_gkYwVK.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,o,s;return Zt(Nn,Mt(et({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),$o=Jt(Qe({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(C(),I("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},P(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);$o.install=e=>{e.component($o.__name,$o)};const DU={class:"superscript-node"},Yo=Jt(Qe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=jn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:Po,html_inline:gs,strong:No,emphasis:Oo,footnote_reference:ms,strikethrough:Lo,highlight:vs,insert:Qo,subscript:Xo,emoji:Go,math_inline:Qs,reference:$o},n.value));return(s,i)=>(C(),I("sup",DU,[(C(!0),I(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(pi),{key:`${e.indexKey||"superscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Yo.install=e=>{e.component(Yo.__name,Yo)};const BU={class:"subscript-node"},Xo=Jt(Qe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=jn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:Po,html_inline:gs,strong:No,emphasis:Oo,footnote_reference:ms,strikethrough:Lo,highlight:vs,insert:Qo,superscript:Yo,emoji:Go,math_inline:Qs,reference:$o},n.value));return(s,i)=>(C(),I("sub",BU,[(C(!0),I(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(pi),{key:`${e.indexKey||"subscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Xo.install=e=>{e.component(Xo.__name,Xo)};const FU={class:"strong-node"},No=Jt(Qe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=jn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:Po,html_inline:gs,emphasis:Oo,strikethrough:Lo,highlight:vs,insert:Qo,subscript:Xo,superscript:Yo,emoji:Go,footnote_reference:ms,math_inline:Qs,reference:$o},n.value));return(s,i)=>(C(),I("strong",FU,[(C(!0),I(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(pi),{key:`${e.indexKey||"strong"}-${l}`,components:o.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);No.install=e=>{e.component(No.__name,No)};const HU={class:"strikethrough-node"},Lo=Jt(Qe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=jn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:Po,html_inline:gs,strong:No,emphasis:Oo,highlight:vs,insert:Qo,subscript:Xo,superscript:Yo,emoji:Go,footnote_reference:ms,math_inline:Qs,reference:$o},n.value));return(s,i)=>(C(),I("del",HU,[(C(!0),I(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(pi),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);Lo.install=e=>{e.component(Lo.__name,Lo)};const WU=["href","title","aria-label","aria-hidden","target","rel"],UU=["aria-hidden"],jU={class:"link-text-wrapper relative inline-flex"},qU={class:"leading-[normal] link-text"},Po=Jt(Qe({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Bt("markstreamShowTooltips",void 0),o=F(()=>{const w=n?.value;return typeof w=="boolean"?w:t.showTooltip}),s=F(()=>{var w,y,b,v,x;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",N=(w=t.animationOpacity)!=null?w:.35,k=Math.max(.12,Math.min(.5*N,N)),T={"--underline-height":`${(y=t.underlineHeight)!=null?y:2}px`,"--underline-bottom":L,"--underline-opacity":String(N),"--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):(x=t.animationIteration)!=null?x:"infinite"};return t.color&&(T["--link-color"]=t.color),T}),i=jn(()=>t.customId),r=F(()=>et({text:Nn,strong:No,strikethrough:Lo,emphasis:Oo,image:Tr,html_inline:gs,inline_code:_o},i.value)),l=Su(),a=F(()=>{var w,y;const b=(w=t.node)==null?void 0:w.attrs;if(!b||typeof b!="object")return{};const v={};if(Array.isArray(b))for(const x of b)Array.isArray(x)&&x[0]&&(v[String(x[0])]=String((y=x[1])!=null?y:""));else for(const[x,L]of Object.entries(b))x&&L!=null&&L!==!1&&(v[x]=L===!0?"":String(L));return Y_(v,"safe","a")}),c=F(()=>et(et({},l),a.value)),u=F(()=>{var w,y;return Y_({href:String((y=(w=t.node)==null?void 0:w.href)!=null?y:"")},"safe","a").href}),d=F(()=>{if(!u.value)return;const w=c.value.target;return(typeof w=="string"?w.trim():String(w??"").trim())||(N7(u.value)?"_blank":void 0)}),h=F(()=>{var w;return String((w=d.value)!=null?w:"").trim().toLowerCase()==="_blank"}),m=F(()=>{if(!u.value)return;const w=c.value.rel,y=new Set((typeof w=="string"?w:String(w??"")).split(/\s+/).filter(Boolean)),b=new Set(Array.from(y).filter(v=>v.toLowerCase()!=="opener"));return h.value&&(b.add("noopener"),b.add("noreferrer")),b.size>0?Array.from(b).join(" "):void 0}),f=F(()=>{const w=et({},c.value);return delete w.title,delete w.href,delete w.target,delete w.rel,w});function g(){o.value&&kU()}const _=F(()=>{var w,y;const b=(w=t.node)==null?void 0:w.title;return typeof b=="string"&&b.trim().length>0?b:String((y=u.value)!=null?y:"")});return(w,y)=>{var b,v;return e.node.loading?(C(),I("span",en({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},S(l),{style:s.value}),[p("span",jU,[p("span",qU,[vt(S(Nn),{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]=p("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,UU)):(C(),I("a",en({key:0,class:"link-node",href:u.value,title:o.value?"":_.value,"aria-label":`Link: ${_.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:m.value},f.value,{style:s.value,onMouseenter:y[0]||(y[0]=x=>(function(L){var N,k,T,E;if(!o.value)return;const O=L,A=O?.clientX!=null&&O?.clientY!=null?{x:O.clientX,y:O.clientY}:void 0,$=((N=t.node)==null?void 0:N.title)||((k=u.value)!=null&&k.includes("xn--")&&((E=(T=t.node)==null?void 0:T.text)!=null&&E.includes("://"))?t.node.text:u.value)||"";yU(L.currentTarget,$,"top",!1,A)})(x)),onMouseleave:g}),[(C(!0),I(Oe,null,Xe(e.node.children,(x,L)=>(C(),Ve(S(pi),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:x,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,WU))}}}),[["__scopeId","data-v-367e6ca4"]]);Po.install=e=>{e.component(Po.__name,Po)};const zU={class:"insert-node"},Qo=Jt(Qe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=jn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:Po,html_inline:gs,strong:No,emphasis:Oo,strikethrough:Lo,highlight:vs,subscript:Xo,superscript:Yo,emoji:Go,footnote_reference:ms,math_inline:Qs,reference:$o},n.value));return(s,i)=>(C(),I("ins",zU,[(C(!0),I(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(pi),{key:`${e.indexKey||"insert"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Qo.install=e=>{e.component(Qo.__name,Qo)};const VU={class:"highlight-node"},vs=Jt(Qe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=jn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:Po,html_inline:gs,strong:No,emphasis:Oo,strikethrough:Lo,insert:Qo,subscript:Xo,superscript:Yo,emoji:Go,footnote_reference:ms,math_inline:Qs,reference:$o},n.value));return(s,i)=>(C(),I("mark",VU,[(C(!0),I(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(pi),{key:`${e.indexKey||"highlight"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);vs.install=e=>{e.component(vs.__name,vs)};const KU={class:"emphasis-node"},Oo=Jt(Qe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=jn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:Po,html_inline:gs,strong:No,strikethrough:Lo,highlight:vs,insert:Qo,subscript:Xo,superscript:Yo,emoji:Go,footnote_reference:ms,math_inline:Qs,reference:$o},n.value));return(s,i)=>(C(),I("em",KU,[(C(!0),I(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(S(pi),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Oo.install=e=>{e.component(Oo.__name,Oo)};const GU={class:"hard-break"},Ar=Jt(Qe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(C(),I("br",GU))}),[["__scopeId","data-v-50c58f70"]]);Ar.install=e=>{e.component(Ar.__name,Ar)};const mu=Qe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=kr({checkbox:ps,checkbox_input:ps,emoji:Go,emphasis:Oo,hardbreak:Ar,highlight:vs,inline_code:_o,insert:Qo,link:Po,reference:$o,strikethrough:Lo,strong:No,subscript:Xo,superscript:Yo,text:Nn}),o=jn(()=>t.customId),s=F(()=>{const i=o.value;return Object.keys(i).length>0?et(et({},n),i):n});return(i,r)=>(C(!0),I(Oe,null,Xe(e.nodes,(l,a)=>(C(),Ve(S(pi),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function O1(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(O1)}function oh(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(O1))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(O1)?s:null}function La(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const YU=["cite"],XU={key:0,dir:"auto",class:"paragraph-node"},QU=["custom-id"],ef=Jt(Qe({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=jn(()=>t.customId),o=F(()=>!!n.value.paragraph),s=F(()=>!!n.value.text),i=F(()=>oh(t.node.children,!o.value)),r=F(()=>t.fade!==!1||s.value?null:La(i.value));return yn("markstreamShowTooltips",F(()=>t.showTooltips)),yn("markstreamFade",F(()=>t.fade)),(l,a)=>(C(),I("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(C(),I("p",XU,[r.value!==null?(C(),I("span",{key:0,class:"text-node","custom-id":t.customId},P(r.value),9,QU)):(C(),Ve(S(mu),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(C(),Ve(S(Zo),{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,YU))}}),[["__scopeId","data-v-abfecebc"]]);ef.install=e=>{e.component(ef.__name,ef)};const ZU={class:"definition-list"},JU={class:"definition-term"},ej={class:"definition-desc"},tf=Jt(Qe({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(C(),I("dl",ZU,[(C(!0),I(Oe,null,Xe(t.node.items,(s,i)=>(C(),I(Oe,{key:i},[p("dt",JU,[vt(S(Zo),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),p("dd",ej,[vt(S(Zo),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);tf.install=e=>{e.component(tf.__name,tf)};const tj=["href","title"],jc=Jt(Qe({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const i=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(C(),I("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,tj))}}),[["__scopeId","data-v-e1eb37b6"]]);jc.install=e=>{e.component(jc.__name,jc)};const nj=["id"],oj={class:"flex-1"},nf=Qe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(C(),I("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[p("div",oj,[vt(S(Zo),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,nj))}});nf.install=e=>{e.component(nf.__name,nf)};const sj=["custom-id"],R1=Jt(Qe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=jn(()=>t.customId),o=Bt("markstreamFade",void 0),s=F(()=>o?.value!==!1||n.value.text?null:La(t.node.children)),i=F(()=>et({text:Nn,inline_code:_o,link:Po,image:Tr,strong:No,emphasis:Oo,strikethrough:Lo,highlight:vs,insert:Qo,subscript:Xo,superscript:Yo,emoji:Go,checkbox:ps,checkbox_input:ps,footnote_reference:ms,hardbreak:Ar,math_inline:Qs,reference:$o},n.value));return(r,l)=>(C(),Ve(ko(`h${e.node.level}`),en({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:$n(()=>[s.value!==null?(C(),I("span",{key:0,class:"text-node","custom-id":t.customId},P(s.value),9,sj)):(C(!0),I(Oe,{key:1},Xe(e.node.children,(a,c)=>(C(),Ve(S(pi),{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"]]),sh=R1;sh.install=e=>{e.component(R1.__name,R1)};const ij={key:0,dir:"auto",class:"paragraph-node"},rj=["custom-id"],lj={dir:"auto",class:"paragraph-node"},aj=["custom-id"],xa=Jt(Qe({__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 m;return(m=t.node)!=null?m:t.item}),o=jn(()=>t.customId),s=F(()=>!!o.value.paragraph),i=F(()=>!!o.value.text),r=F(()=>{var m;return oh((m=n.value)==null?void 0:m.children,!s.value)}),l=F(()=>{var m;if(s.value)return null;const f=(m=n.value)==null?void 0:m.children;if(!Array.isArray(f)||f.length<2)return null;const g=f[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const _=f.slice(1);if(!_.every(y=>y?.type==="list"))return null;const w=oh([g]);return w?{paragraphChildren:w,nestedLists:_}:null});function a(){return t.fade===!1&&!i.value}const c=F(()=>a()?La(r.value):null),u=F(()=>{var m;return a()?La((m=l.value)==null?void 0:m.paragraphChildren):null}),d=Object.freeze({}),h=F(()=>{const{value:m}=t;return typeof m=="number"&&Number.isFinite(m)?{value:m}:d});return yn("markstreamShowTooltips",F(()=>t.showTooltips)),yn("markstreamFade",F(()=>t.fade)),(m,f)=>{var g,_;return C(),I("li",en({class:"list-item",dir:"auto"},h.value),[r.value?(C(),I("p",ij,[c.value!==null?(C(),I("span",{key:0,class:"text-node","custom-id":t.customId},P(c.value),9,rj)):(C(),Ve(S(mu),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(C(),I(Oe,{key:1},[p("p",lj,[u.value!==null?(C(),I("span",{key:0,class:"text-node","custom-id":t.customId},P(u.value),9,aj)):(C(),Ve(S(mu),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(C(!0),I(Oe,null,Xe(l.value.nestedLists,(w,y)=>(C(),Ve(S(Zo),{key:y,nodes:[w],"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:f[0]||(f[0]=b=>m.$emit("copy",b))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(C(),Ve(S(Zo),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(_=(g=n.value)==null?void 0:g.children)!=null?_:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:f[1]||(f[1]=w=>m.$emit("copy",w))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);xa.install=e=>{e.component(xa.__name,xa)};const Ta=Jt(Qe({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=jn(()=>e.customId),n=F(()=>t.value.list_item||xa);return(o,s)=>(C(),Ve(ko(e.node.ordered?"ol":"ul"),{class:Le(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:$n(()=>[(C(!0),I(Oe,null,Xe(e.node.items,(i,r)=>{var l;return C(),Ve(ko(n.value),en({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);Ta.install=e=>{e.component(Ta.__name,Ta)};const r3=Symbol("ViewportPriority");function cj(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?ne(t):t,r=s?(n=window.requestIdleCallback)!=null?n:y=>window.setTimeout(()=>y({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:y=>window.clearTimeout(y):null;let a=null,c=null;const u=new Map,d=new Set;let h=null;function m(){if(h!=null){try{l?.(h)}catch{}h=null}}function f(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||m()}}function g(y){const b=u.get(y);if(b){if(!b.visible.value){b.visible.value=!0;try{b.resolve()}catch{}}try{a?.unobserve(y)}catch{}u.delete(y),d.delete(y),f()}}function _(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&d.size&&(h=r(()=>{h=null;const y=d.values().next().value;y&&(d.delete(y),g(y),d.size&&_())},{timeout:1200}))}ze(i,y=>{if(!y){for(const b of Array.from(u.keys()))g(b);m()}},{flush:"sync"});const w=(y,b)=>{const v=ne(!1);let x,L=!1;const N=new Promise(E=>{x=()=>{L||(L=!0,E())}}),k=()=>{try{a?.unobserve(y)}catch{}u.delete(y),d.delete(y),f()};if(!s||!i.value)return v.value=!0,x(),{isVisible:v,whenVisible:N,destroy:k};const T=(function(E,O){if(!s)return a;if(typeof IntersectionObserver>"u")return null;const A=(function(D,W){var V,U,ee;return{root:(V=e?.(D??null))!=null?V:null,rootMargin:(U=W?.rootMargin)!=null?U:"300px",threshold:(ee=W?.threshold)!=null?ee:0}})(E,O);if(a&&(R=A,($=c)&&$.root===R.root&&$.rootMargin===R.rootMargin&&$.threshold===R.threshold))return a;var $,R;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const W of D)(W.isIntersecting||W.intersectionRatio>0)&&g(W.target)},{root:A.root,rootMargin:A.rootMargin,threshold:A.threshold}),c=A;for(const D of u.keys())a.observe(D);return a})(y,b);return T?(u.set(y,{resolve:x,visible:v}),T.observe(y),d.add(y),_(),{isVisible:v,whenVisible:N,destroy:k}):(v.value=!0,x(),{isVisible:v,whenVisible:N,destroy:k})};return yn(r3,w),w}function uj(){var e,t;const n=Bt(r3,void 0);if(n)return n;const o=new WeakMap;let s=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=h=>{const m=o.get(h);if(m){if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{s?.unobserve(h)}catch{}o.delete(h),i.delete(h),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const h=i.values().next().value;h&&(i.delete(h),u(h),i.size&&d())},{timeout:1200}))};return h=>{const m=ne(!1);let f,g=!1;const _=new Promise(b=>{f=()=>{g||(g=!0,b())}}),w=()=>{try{s?.unobserve(h)}catch{}o.delete(h),i.delete(h),i.size||c()},y=s||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(s=new IntersectionObserver(b=>{for(const v of b)(v.isIntersecting||v.intersectionRatio>0)&&u(v.target)},{root:null,rootMargin:"300px",threshold:0}),s));return y?(o.set(h,{resolve:f,visible:m}),y.observe(h),i.add(h),d(),{isVisible:m,whenVisible:_,destroy:w}):(m.value=!0,f(),{isVisible:m,whenVisible:_,destroy:w})}}const dj={key:2,class:"html-block-node__raw"},fj=["innerHTML"],hj={key:1,class:"html-block-node__placeholder"},qc=Jt(Qe({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Bt("markstreamHtmlPolicy",void 0),o=Bt("markstreamNestedRendererProps",void 0),s=F(()=>{var L,N;return(N=(L=t.htmlPolicy)!=null?L:n?.value)!=null?N:"safe"}),i=F(()=>{var L,N;const k=(L=o?.value)!=null?L:{};return Mt(et({},k),{customId:(N=t.customId)!=null?N:k.customId,htmlPolicy:s.value})}),r=di({loader:()=>Promise.resolve().then(()=>C0),suspensible:!1}),l=F(()=>{const L=b1(t.node.attrs,s.value);if(!L)return;const N=Jf(L);return Object.keys(N).length>0?N:void 0}),a=F(()=>{const L=String(t.node.tag||"").trim(),N=b1(t.node.attrs,s.value,L);if(!N)return;const k=Jf(N);return Object.keys(k).length>0?k:void 0}),c=jn(()=>t.customId),u=Qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=ne(null),h=ne(typeof window>"u"),m=ne(t.node.content),f=F(()=>Array.isArray(t.node.children)?t.node.children:[]),g=F(()=>String(t.node.tag||"div")),_=F(()=>{const L=g.value.trim().toLowerCase();return zT.has(L)||r0(L,s.value)}),w=F(()=>f.value.length>0&&!!t.node.tag&&!_.value),y=F(()=>{var L,N,k;if(w.value)return{mode:"structured"};if(!h.value)return{mode:"html",content:(L=m.value)!=null?L:""};const T=(N=m.value)!=null?N:t.node.content;if(!T)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:Sa(T,s.value)};if(t.node.loading){const O=nh(T,c.value,s.value);return O===null?{mode:"text",content:(k=t.node.raw)!=null?k:T}:{mode:"dynamic",nodes:O}}if(!n3(T,c.value))return{mode:"html",content:Sa(T,s.value)};const E=nh(T,c.value,s.value);return E===null?{mode:"html",content:Sa(T,s.value)}:{mode:"dynamic",nodes:E}}),b=uj(),v=ne(null),x=!!t.node.loading;return typeof window<"u"?(ze(d,L=>{var N,k;if((k=(N=v.value)==null?void 0:N.destroy)==null||k.call(N),v.value=null,!x)return h.value=!0,void(m.value=t.node.content);if(!L)return void(h.value=!1);const T=b(L,{rootMargin:"400px"});v.value=T,h.value=T.isVisible.value,T.whenVisible.then(()=>{h.value=!0})},{immediate:!0}),ze(()=>t.node.content,L=>{x&&!h.value||(m.value=L)})):h.value=!0,Jo(()=>{var L,N;(N=(L=v.value)==null?void 0:L.destroy)==null||N.call(L),v.value=null}),(L,N)=>(C(),Ve(ko(w.value?g.value:"div"),en({ref_key:"htmlRef",ref:d,class:"html-block-node"},w.value?a.value:void 0),{default:$n(()=>[h.value?(C(),I(Oe,{key:0},[y.value.mode==="structured"?(C(),Ve(S(r),en({key:0},i.value,{nodes:f.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):y.value.mode==="dynamic"?(C(),Ve(S(u),{key:1,nodes:y.value.nodes},null,8,["nodes"])):y.value.mode==="text"?(C(),I("pre",dj,P(y.value.content),1)):(C(),I("div",en({key:3},l.value,{innerHTML:y.value.content}),null,16,fj))],64)):(C(),I("div",hj,[ga(L.$slots,"placeholder",{node:e.node},()=>[N[0]||(N[0]=p("span",{class:"html-block-node__placeholder-bar"},null,-1)),N[1]||(N[1]=p("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),N[2]||(N[2]=p("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);qc.install=e=>{e.component(qc.__name,qc)};const pj={dir:"auto",class:"paragraph-node"},mj=["custom-id"],kl=Jt(Qe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=jn(()=>t.customId),o=Bt("markstreamHtmlPolicy",void 0),s=Bt("markstreamFade",void 0),i=Bt("markstreamParseOptions",void 0),r=Bt("markstreamCustomMarkdownIt",void 0),l=Bt("markstreamNestedRendererProps",void 0),a=F(()=>{var k;return(k=o?.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,T;return(T=t.customHtmlTags)!=null?T:(k=l?.value)==null?void 0:k.customHtmlTags}),h=F(()=>{var k,T;const E=(k=l?.value)!=null?k:{};return Mt(et({},E),{customId:(T=t.customId)!=null?T:E.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),m=di({loader:()=>Promise.resolve().then(()=>C0),suspensible:!1});function f(k){var T;return k.type==="text"&&String((T=k.content)!=null?T:"").trim()===""}const g=F(()=>t.node.children.filter(k=>!f(k))),_=F(()=>g.value.length>0&&g.value.every(k=>k.type==="image"||(function(T){var E;const O=(function(A){return A.type==="link"&&Array.isArray(A.children)?A.children.filter($=>!f($)):[]})(T);return O.length===1&&((E=O[0])==null?void 0:E.type)==="image"})(k))),w=F(()=>new Set(Ba(d.value))),y=F(()=>{if(!_.value||g.value.length<=1)return t.node.children;const k=[];for(let T=0;T<t.node.children.length;T++){const E=t.node.children[T];if(!f(E)){k.push(E);continue}const O=k.length>0,A=t.node.children.slice(T+1).some($=>!f($));O&&A&&k.push(Mt(et({},E),{content:" ",raw:" "}))}return k}),b=F(()=>s?.value===!1&&!n.value.text),v=F(()=>b.value?La(y.value):null);function x(k,T){return{node:k,"index-key":`${t.indexKey}-${T}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=F(()=>et({inline_code:_o,image:Tr,link:Po,hardbreak:Ar,emphasis:Oo,strong:No,strikethrough:Lo,highlight:vs,insert:Qo,subscript:Xo,superscript:Yo,html_inline:gs,html_block:qc,emoji:Go,checkbox:ps,math_inline:Qs,checkbox_input:ps,reference:$o,footnote_anchor:jc,footnote_reference:ms,text:Nn},n.value)),N=F(()=>y.value.map((k,T)=>{var E;const O=(function(A){var $,R,D,W;if(A.type==="html_block"||A.type==="html_inline"){const V=String(($=A.tag)!=null?$:"").trim().toLowerCase()||YT(A.content);if(V&&!w.value.has(V)&&XT((R=A.content)!=null?R:A.raw,V)){const U=String((W=(D=A.content)!=null?D:A.raw)!=null?W:"");return{child:{type:"text",content:U,raw:U},component:Nn,isCustomComponent:!1}}}return{child:A,component:L.value[A.type],isCustomComponent:!!(n.value[A.type]&&!Nu(String(A.type)))}})(k);return Mt(et({},O),{index:T,key:`${t.indexKey||"paragraph"}-${T}`,customAttrs:O.isCustomComponent?g0(O.child,a.value):void 0,hasSlotChildren:Array.isArray(O.child.children)&&O.child.children.length>0,slotContent:String((E=O.child.content)!=null?E:""),originalChild:k})}));return(k,T)=>(C(),I("p",pj,[v.value!==null?(C(),I("span",{key:0,class:"text-node","custom-id":t.customId},P(v.value),9,mj)):(C(!0),I(Oe,{key:1},Xe(N.value,E=>{return C(),I(Oe,{key:E.key},[_.value&&f(E.originalChild)?(C(),I(Oe,{key:0},[ut(P((O=E.originalChild,String((A=O.content)!=null?A:""))),1)],64)):E.isCustomComponent?(C(),Ve(ko(E.component),en({key:1,ref_for:!0},E.customAttrs,{node:E.child,loading:E.child.loading,"index-key":E.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":h.value.isDark}),{default:$n(()=>[E.hasSlotChildren?(C(),Ve(S(m),en({key:0,ref_for:!0},h.value,{nodes:E.child.children,"index-key":E.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):E.slotContent?(C(),Ve(S(m),en({key:1,ref_for:!0},h.value,{content:E.slotContent,final:!E.child.loading,"index-key":`${E.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):se("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(C(),Ve(ko(E.component),en({key:2,ref_for:!0},x(E.child,E.index)),null,16))],64);var O,A}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);kl.install=e=>{e.component(kl.__name,kl)};const gj={class:"table-node-wrapper"},vj=["aria-busy"],yj={key:0},kj=["custom-id"],bj=["aria-label","onPointerdown"],wj=["custom-id"],_j={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},zc=Jt(Qe({__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 w;return(w=t.node.loading)!=null&&w}),o=F(()=>{var w;return(w=t.node.rows)!=null?w:[]}),s=ne(null),i=ne([]);let r=null;const l=F(()=>t.node.header.cells.length),a=F(()=>i.value.some(w=>Number.isFinite(w)&&w>0)),c=F(()=>a.value?i.value.map(w=>w>0?{width:`${w}px`}:void 0):[]);yn("markstreamShowTooltips",F(()=>t.showTooltips)),yn("markstreamFade",F(()=>t.fade));const u=jn(()=>t.customId),d=F(()=>!!u.value.text),h=F(()=>!!u.value.paragraph),m=new WeakMap;function f(w){const y=t.fade===!1&&!d.value,b=!h.value,v=m.get(w);if(v?.children===w.children&&v.textFastPath===y&&v.paragraphFastPath===b)return v.info;const x=oh(w.children,b,!0),L={simpleChildren:x,plainText:x&&y?La(x):null};return m.set(w,{children:w.children,textFastPath:y,paragraphFastPath:b,info:L}),L}function g(w){if(!r)return;w.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+w.clientX-r.startX))),x=[...r.widths];x[r.index]=v,x[r.index+1]=y-v,i.value=x}function _(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),r=null)}return ze(l,()=>{_(),i.value=[]}),Jo(_),(w,y)=>(C(),I("div",gj,[p("table",{ref_key:"tableRef",ref:s,class:Le(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(C(),I("colgroup",yj,[(C(!0),I(Oe,null,Xe(e.node.header.cells,(b,v)=>(C(),I("col",{key:v,style:Wt(c.value[v])},null,4))),128))])):se("",!0),p("thead",null,[p("tr",null,[(C(!0),I(Oe,null,Xe(e.node.header.cells,(b,v)=>(C(),I("th",{key:v,dir:"auto",class:Le([b.align==="right"?"text-right":b.align==="center"?"text-center":"text-left"])},[f(b).plainText!==null?(C(),I("span",{key:0,class:"text-node","custom-id":t.customId},P(f(b).plainText),9,kj)):f(b).simpleChildren?(C(),Ve(S(mu),{key:1,nodes:f(b).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${v}`},null,8,["nodes","custom-id","index-key"])):(C(),Ve(S(Zo),{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]=x=>w.$emit("copy",x))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),v<e.node.header.cells.length-1?(C(),I("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${v+1} and ${v+2}`,onPointerdown:x=>(function(L,N){if(N.button!==0)return;const k=(function(){var O;const A=(O=s.value)==null?void 0:O.querySelectorAll("thead th");return Array.from(A??[],$=>Math.round($.getBoundingClientRect().width))})(),T=k[L],E=k[L+1];T&&E&&(N.preventDefault(),r={index:L,startX:N.clientX,startWidth:T,nextStartWidth:E,widths:k},i.value=k,window.addEventListener("pointermove",g),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_))})(v,x)},null,40,bj)):se("",!0)],2))),128))])]),p("tbody",null,[(C(!0),I(Oe,null,Xe(o.value,(b,v)=>(C(),I("tr",{key:v},[(C(!0),I(Oe,null,Xe(b.cells,(x,L)=>(C(),I("td",{key:L,class:Le([x.align==="right"?"text-right":x.align==="center"?"text-center":"text-left"]),dir:"auto"},[f(x).plainText!==null?(C(),I("span",{key:0,class:"text-node","custom-id":t.customId},P(f(x).plainText),9,wj)):f(x).simpleChildren?(C(),Ve(S(mu),{key:1,nodes:f(x).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${v}-${L}`},null,8,["nodes","custom-id","index-key"])):(C(),Ve(S(Zo),{key:2,nodes:x.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]=N=>w.$emit("copy",N))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,vj),vt(qi,{name:"table-node-fade"},{default:$n(()=>[n.value?(C(),I("div",_j,[ga(w.$slots,"loading",{isLoading:n.value},()=>[y[2]||(y[2]=p("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),y[3]||(y[3]=p("span",{class:"sr-only"},"Loading",-1))],!0)])):se("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);zc.install=e=>{e.component(zc.__name,zc)};const Cj={class:"hr-node"},of=Jt({},[["render",function(e,t){return C(),I("hr",Cj)}],["__scopeId","data-v-39b2349c"]]);of.install=e=>{e.component(of.__name,of)};const Sj={class:"unknown-node"},D1=Qe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(C(),I("div",Sj,P(e.node.raw),1))}),sf=Jt(Qe({__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}`),o=jn(()=>t.customId),s=F(()=>et({text:Nn,paragraph:kl,heading:sh,inline_code:_o,link:Po,image:Tr,strong:No,emphasis:Oo,strikethrough:Lo,insert:Qo,subscript:Xo,superscript:Yo,checkbox:ps,checkbox_input:ps,hardbreak:Ar,math_inline:Qs,reference:$o,list:Ta,math_block:i3,table:zc},o.value));return(i,r)=>(C(),I("div",en({class:n.value},e.node.attrs),[(C(!0),I(Oe,null,Xe(e.node.children,(l,a)=>{return C(),Ve(ko((c=l.type,s.value[c]||D1)),{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"]]);sf.install=e=>{e.component(sf.__name,sf)};const xj=["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"],o2=[[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 Tj(e){if(e<=255)return xj[e];let t=0,n=o2.length-1;for(;t<=n;){const o=t+n>>1,s=o2[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const Aj=/[ \t\n\r\f]+/g,Mj=/[\t\n\r\f]| {2,}|^ | $/;let rg=null;const Ej=new RegExp("\\p{Script=Arabic}","u"),Zh=new RegExp("\\p{M}","u"),l3=new RegExp("\\p{Nd}","u");function s2(e){return Ej.test(e)}function i2(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 Bi(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){if(i2(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(i2(n))return!0}}return!1}const Ij=new Set([" "," ","","\uFEFF"]);function $j(e){return Bi(e)}function B1(e){return!(function(t){const n=ih(t);return n!==null&&(v0.has(n)||_l.has(n))})(e)&&!(function(t){const n=ih(t);return n!==null&&Ij.has(n)})(e)}const v0=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Jh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),y0=new Set(["'","’"]),_l=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Nj=new Set([":",".","،","؛"]),Lj=new Set(["၏"]),Pj=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Oj(e){if(k0(e))return!0;let t=!1;for(const n of e)if(_l.has(n))t=!0;else if(!t||!Zh.test(n))return!1;return t}function Rj(e){for(const t of e)if(!v0.has(t)&&!_l.has(t))return!1;return e.length>0}function Dj(e){if(k0(e))return!0;for(const t of e)if(!Jh.has(t)&&!y0.has(t)&&!Zh.test(t))return!1;return e.length>0}function k0(e){let t=!1;for(const n of e)if(n!=="\\"&&!Zh.test(n)){if(!(Jh.has(n)||_l.has(n)||y0.has(n)))return!1;t=!0}return t}function a3(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function ih(e){if(e.length===0)return null;const t=a3(e,e.length);return e.slice(t)}function Bj(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Zh.test(o))n--;else{if(!Jh.has(o)&&!y0.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Fj(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function r2(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function l2(e,t){return e&&t!==null&&Nj.has(t)}function Hj(e){const t=ih(e);return t!==null&&Lj.has(t)}function Wj(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 F1(e){let t=e.length;for(;t>0;){const n=a3(e,t),o=e.slice(n,t);if(Pj.has(o))return!0;if(!_l.has(o))return!1;t=n}return!1}function Uj(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
226
|
-
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const jj=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Is(e){return e.length===1?e[0]:e.join("")}function qj(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Is(n)}function zj(e,t,n,o){if(!jj.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=Uj(u,o),h=d==="text"&&t;i===null||d!==i||h!==a?(i!==null&&s.push({text:Is(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=h,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&s.push({text:Is(r),isWordLike:a,kind:i,start:l}),s}function lg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Vj=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Kj(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Vj.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Gj(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const Yj=new Set([":","-","/","×",",",".","+","–","—"]),a2=/^[A-Za-z0-9_]+[,:;]*$/,c2=/[,:;]+$/;function u2(e){for(const t of e)if(l3.test(t))return!0;return!1}function rf(e){if(e.length===0)return!1;for(const t of e)if(!l3.test(t)&&!Yj.has(t))return!1;return!0}function d2(e,t,n){var o,s,i;const r=(rg===null&&(rg=new Intl.Segmenter(void 0,{granularity:"word"})),rg);let l=0;const a=[],c=[],u=[],d=[],h=[],m=[],f=[],g=[],_=[],w=[],y=[],b=[];for(const k of r.segment(e))for(const T of zj(k.segment,(o=k.isWordLike)!=null&&o,k.index,n)){let E=function(){m[U]!==null&&(c[U]=[r2(a,m,f,U)],m[U]=null),c[U].push(T.text),u[U]=u[U]||T.isWordLike,g[U]=g[U]||$,_[U]=_[U]||R,w[U]=W,y[U]=V,b[U]=l2(_[U],D)};const O=T.kind==="text",A=Fj(T.text,T.isWordLike,T.kind),$=Bi(T.text),R=s2(T.text),D=ih(T.text),W=F1(T.text),V=Hj(T.text),U=l-1;t.carryCJKAfterClosingQuote&&O&&l>0&&d[U]==="text"&&$&&g[U]&&w[U]||O&&l>0&&d[U]==="text"&&Rj(T.text)&&g[U]||O&&l>0&&d[U]==="text"&&y[U]?E():O&&l>0&&d[U]==="text"&&T.isWordLike&&R&&b[U]?(E(),u[U]=!0):A!==null&&l>0&&d[U]==="text"&&m[U]===A?f[U]=((s=f[U])!=null?s:1)+1:O&&!T.isWordLike&&l>0&&d[U]==="text"&&(Oj(T.text)||T.text==="-"&&u[U])?E():(a[l]=T.text,c[l]=[T.text],u[l]=T.isWordLike,d[l]=T.kind,h[l]=T.start,m[l]=A,f[l]=A===null?0:1,g[l]=$,_[l]=R,w[l]=W,y[l]=V,b[l]=l2(R,D),l++)}for(let k=0;k<l;k++)m[k]===null?a[k]=Is(c[k]):a[k]=r2(a,m,f,k);for(let k=1;k<l;k++)d[k]==="text"&&!u[k]&&k0(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 x=-1;for(let k=l-1;k>=0;k--){const T=a[k];if(T.length!==0){if(d[k]==="text"&&!u[k]&&Dj(T)&&x>=0&&d[x]==="text"){const E=(i=v[x])!=null?i:[];E.push(T),v[x]=E,h[x]=h[k],a[k]="";continue}x=k}}for(let k=0;k<l;k++){const T=v[k];T!=null&&(a[k]=qj(T,a[k]))}let L=0;for(let k=0;k<l;k++){const T=a[k];T.length!==0&&(L!==k&&(a[L]=T,u[L]=u[k],d[L]=d[k],h[L]=h[k]),L++)}a.length=L,u.length=L,d.length=L,h.length=L;const N=(function(k){const T=k.texts.slice(),E=k.isWordLike.slice(),O=k.kinds.slice(),A=k.starts.slice();for(let $=0;$<T.length-1;$++){if(O[$]!=="text"||O[$+1]!=="text"||!Bi(T[$])||!Bi(T[$+1]))continue;const R=Bj(T[$]);R!==null&&(T[$]=R.head,T[$+1]=R.tail+T[$+1],A[$+1]=A[$]+R.head.length)}return{len:T.length,texts:T,isWordLike:E,kinds:O,starts:A}})((function(k){const T=[],E=[],O=[],A=[];for(let $=0;$<k.len;$++){const R=k.texts[$],D=k.kinds[$],W=k.isWordLike[$];if(D==="text"&&W&&a2.test(R)){const V=[R];let U=c2.test(R),ee=$+1;for(;U&&ee<k.len&&k.kinds[ee]==="text"&&k.isWordLike[ee]&&a2.test(k.texts[ee]);){const K=k.texts[ee];V.push(K),U=c2.test(K),ee++}T.push(Is(V)),E.push(!0),O.push("text"),A.push(k.starts[$]),$=ee-1;continue}T.push(R),E.push(W),O.push(D),A.push(k.starts[$])}return{len:T.length,texts:T,isWordLike:E,kinds:O,starts:A}})((function(k){const T=[],E=[],O=[],A=[];for(let $=0;$<k.len;$++){const R=k.texts[$];if(k.kinds[$]==="text"&&R.includes("-")){const D=R.split("-");let W=D.length>1;for(let V=0;V<D.length;V++){const U=D[V];if(!W)break;U.length!==0&&u2(U)&&rf(U)||(W=!1)}if(W){let V=0;for(let U=0;U<D.length;U++){const ee=D[U],K=U<D.length-1?`${ee}-`:ee;T.push(K),E.push(!0),O.push("text"),A.push(k.starts[$]+V),V+=K.length}continue}}T.push(R),E.push(k.isWordLike[$]),O.push(k.kinds[$]),A.push(k.starts[$])}return{len:T.length,texts:T,isWordLike:E,kinds:O,starts:A}})((function(k){const T=[],E=[],O=[],A=[];for(let $=0;$<k.len;$++){const R=k.texts[$],D=k.kinds[$];if(D==="text"&&rf(R)&&u2(R)){const W=[R];let V=$+1;for(;V<k.len&&k.kinds[V]==="text"&&rf(k.texts[V]);)W.push(k.texts[V]),V++;T.push(Is(W)),E.push(!0),O.push("text"),A.push(k.starts[$]),$=V-1;continue}T.push(R),E.push(k.isWordLike[$]),O.push(D),A.push(k.starts[$])}return{len:T.length,texts:T,isWordLike:E,kinds:O,starts:A}})((function(k){const T=[],E=[],O=[],A=[];for(let $=0;$<k.len;$++){const R=k.texts[$];if(T.push(R),E.push(k.isWordLike[$]),O.push(k.kinds[$]),A.push(k.starts[$]),!Gj(R))continue;const D=$+1;if(D>=k.len||lg(k.kinds[D]))continue;const W=[],V=k.starts[D];let U=D;for(;U<k.len&&!lg(k.kinds[U]);)W.push(k.texts[U]),U++;W.length>0&&(T.push(Is(W)),E.push(!0),O.push("text"),A.push(V),$=U-1)}return{len:T.length,texts:T,isWordLike:E,kinds:O,starts:A}})((function(k){const T=k.texts.slice(),E=k.isWordLike.slice(),O=k.kinds.slice(),A=k.starts.slice();for(let R=0;R<k.len;R++){if(O[R]!=="text"||!Kj(k,R))continue;const D=[T[R]];let W=R+1;for(;W<k.len&&!lg(O[W]);){D.push(T[W]),E[R]=!0;const V=T[W].includes("?");if(O[W]="text",T[W]="",W++,V)break}T[R]=Is(D)}let $=0;for(let R=0;R<T.length;R++){const D=T[R];D.length!==0&&($!==R&&(T[$]=D,E[$]=E[R],O[$]=O[R],A[$]=A[R]),$++)}return T.length=$,E.length=$,O.length=$,A.length=$,{len:$,texts:T,isWordLike:E,kinds:O,starts:A}})((function(k){const T=[],E=[],O=[],A=[];let $=0;for(;$<k.len;){const R=[k.texts[$]];let D=k.isWordLike[$],W=k.kinds[$],V=k.starts[$];if(W==="glue"){const U=[R[0]],ee=V;for($++;$<k.len&&k.kinds[$]==="glue";)U.push(k.texts[$]),$++;const K=Is(U);if(!($<k.len&&k.kinds[$]==="text")){T.push(K),E.push(!1),O.push("glue"),A.push(ee);continue}R[0]=K,R.push(k.texts[$]),D=k.isWordLike[$],W="text",V=ee,$++}else $++;if(W==="text")for(;$<k.len&&k.kinds[$]==="glue";){const U=[];for(;$<k.len&&k.kinds[$]==="glue";)U.push(k.texts[$]),$++;const ee=Is(U);$<k.len&&k.kinds[$]==="text"?(R.push(ee,k.texts[$]),D=D||k.isWordLike[$],$++):R.push(ee)}T.push(Is(R)),E.push(D),O.push(W),A.push(V)}return{len:T.length,texts:T,isWordLike:E,kinds:O,starts:A}})({len:L,texts:a,isWordLike:u,kinds:d,starts:h})))))));for(let k=0;k<N.len-1;k++){const T=Wj(N.texts[k]);T!==null&&(N.kinds[k]!=="space"&&N.kinds[k]!=="preserved-space"||N.kinds[k+1]!=="text"||!s2(N.texts[k+1])||(N.texts[k]=T.space,N.isWordLike[k]=!1,N.kinds[k]=N.kinds[k]==="preserved-space"?"preserved-space":"space",N.texts[k+1]=T.marks+N.texts[k+1],N.starts[k+1]=N.starts[k]+T.space.length))}return N}function Xj(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let Xl=null;const f2=new Map;let Ql=null;const Qj=new RegExp("\\p{Emoji_Presentation}","u"),Zj=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let ag=null;const h2=new Map;function H1(){if(Xl!==null)return Xl;if(typeof OffscreenCanvas<"u")return Xl=new OffscreenCanvas(1,1).getContext("2d"),Xl;if(typeof document<"u")return Xl=document.createElement("canvas").getContext("2d"),Xl;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function lr(e,t){let n=t.get(e);return n===void 0&&(n={width:H1().measureText(e).width,containsCJK:Bi(e)},t.set(e,n)),n}function ep(){if(Ql!==null)return Ql;if(typeof navigator>"u")return Ql={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ql;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 Ql={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ql}function c3(){return ag===null&&(ag=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ag}function Jj(e){return Qj.test(e)||e.includes("️")}function sl(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(i){let r=0;const l=c3();for(const a of l.segment(i))Jj(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function eq(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 tq(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function p2(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i}=e;if(o.length===0)return 0;const r=t+ep().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,h=-1,m=0;function f(v=u,x=d,L=a){l++,a=0,c=!1,h=-1,m=0}function g(v,x){c=!0,u=v+1,d=0,a=x}function _(v,x,L){c=!0,u=v,d=x+1,a=L}function w(v,x){c?(a+=x,u=v+1,d=0):g(v,x)}function y(v,x){const L=i[v];for(let N=x;N<L.length;N++){const k=L[N];c?a+k>r?(f(),_(v,N,k)):(a+=k,u=v,d=N+1):_(v,N,k)}c&&u===v&&d===L.length&&(u=v+1,d=0)}let b=0;for(;b<o.length&&(c||(b=eq(e,b),!(b>=o.length)));){const v=o[b],x=s[b],L=x==="space"||x==="preserved-space"||x==="tab"||x==="zero-width-break"||x==="soft-hyphen";if(c)if(a+v>r){if(L){w(b,v),f(b+1,0,a-v),b++;continue}if(h>=0){if(u>h||u===h&&d>0){f();continue}f(h,0,m);continue}if(v>t&&i[b]!==null){f(),y(b,0),b++;continue}f()}else w(b,v),L&&(h=b+1,m=a-v),b++;else v>t&&i[b]!==null?y(b,0):g(b,v),L&&(h=b+1,m=a-v),b++}return c&&f(),l}let cg=null;function nq(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,h,m){o=[d],s=h,i=m,r=F1(d),l=Jh.has(d)}function u(d,h){o.push(d),i=i||h;const m=F1(d);r=d.length===1&&_l.has(d)&&r||m,l=!1}for(const d of(cg===null&&(cg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),cg).segment(e)){const h=d.segment,m=Bi(h);o.length!==0?l||v0.has(h)||_l.has(h)||t.carryCJKAfterClosingQuote&&m&&r?u(h,m):i||m?(a(),c(h,d.index,m)):u(h,m):c(h,d.index,m)}return a(),n}function oq(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],o=e[0].start,s=Bi(e[0].text),i=B1(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:o})}for(let l=1;l<e.length;l++){const a=e[l],c=Bi(a.text),u=B1(a.text);s&&i?(n.push(a.text),s=s||c,i=u):(r(),n=[a.text],o=a.start,s=c,i=u)}return r(),t}function sq(e,t,n,o){const s=ep(),{cache:i,emojiCorrection:r}=(function(N,k){H1().font=N;const T=(function(A){let $=f2.get(A);return $||($=new Map,f2.set(A,$)),$})(N),E=(function(A){const $=A.match(/(\d+(?:\.\d+)?)\s*px/);return $?parseFloat($[1]):16})(N),O=k?(function(A,$){let R=h2.get(A);if(R!==void 0)return R;const D=H1();D.font=A;const W=D.measureText("😀").width;if(R=0,W>$+.5&&typeof document<"u"&&document.body!==null){const V=document.createElement("span");V.style.font=A,V.style.display="inline-block",V.style.visibility="hidden",V.style.position="absolute",V.textContent="😀",document.body.appendChild(V);const U=V.getBoundingClientRect().width;document.body.removeChild(V),W-U>.5&&(R=W-U)}return h2.set(A,R),R})(N,E):0;return{cache:T,fontSize:E,emojiCorrection:O}})(t,(l=e.normalized,Zj.test(l)));var l;const a=sl("-",lr("-",i),r),c=8*sl(" ",lr(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],h=[],m=[];let f=e.chunks.length<=1;const g=null,_=[],w=n?[]:null,y=Array.from({length:e.len});function b(N,k,T,E,O,A,$){O!=="text"&&O!=="space"&&O!=="zero-width-break"&&(f=!1),u.push(k),d.push(T),h.push(E),m.push(O),_.push($),w!==null&&w.push(N)}function v(N,k,T,E,O){const A=lr(N,i),$=sl(N,A,r),R=k==="space"||k==="preserved-space"||k==="zero-width-break"?0:$,D=k==="space"||k==="zero-width-break"?0:$;if(O&&E&&N.length>1){let W="sum-graphemes";rf(N)?W="pair-context":s.preferPrefixWidthsForBreakableRuns&&(W="segment-prefixes");const V=(function(U,ee,K,G,X){if(ee.breakableFitAdvances!==void 0)return ee.breakableFitAdvances;const ke=c3(),le=[];for(const Pe of ke.segment(U))le.push(Pe.segment);if(le.length<=1)return ee.breakableFitAdvances=null,ee.breakableFitAdvances;if(X==="sum-graphemes"){const Pe=[];for(const Re of le){const Q=lr(Re,K);Pe.push(sl(Re,Q,G))}return ee.breakableFitAdvances=Pe,ee.breakableFitAdvances}if(X==="pair-context"||le.length>96){const Pe=[];let Re=null,Q=0;for(const ce of le){const Ce=sl(ce,lr(ce,K),G);if(Re===null)Pe.push(Ce);else{const q=Re+ce,te=lr(q,K);Pe.push(sl(q,te,G)-Q)}Re=ce,Q=Ce}return ee.breakableFitAdvances=Pe,ee.breakableFitAdvances}const He=[];let ue="",ve=0;for(const Pe of le){ue+=Pe;const Re=sl(ue,lr(ue,K),G);He.push(Re-ve),ve=Re}return ee.breakableFitAdvances=He,ee.breakableFitAdvances})(N,A,i,r,W);return void b(N,$,R,D,k,T,V)}b(N,$,R,D,k,T,null)}for(let N=0;N<e.len;N++){y[N]=u.length;const k=e.texts[N],T=e.isWordLike[N],E=e.kinds[N],O=e.starts[N];if(E==="soft-hyphen"){b(k,0,a,a,E,O,null);continue}if(E==="hard-break"){b(k,0,0,0,E,O,null);continue}if(E==="tab"){b(k,0,0,0,E,O,null);continue}const A=lr(k,i);if(E==="text"&&A.containsCJK){const $=nq(k,s),R=o==="keep-all"?oq($):$;for(let D=0;D<R.length;D++){const W=R[D];v(W.text,"text",O+W.start,T,o==="keep-all"||!Bi(W.text))}continue}v(k,E,O,T,!0)}const x=(function(N,k,T){const E=[];for(let O=0;O<N.length;O++){const A=N[O],$=A.startSegmentIndex<k.length?k[A.startSegmentIndex]:T,R=A.endSegmentIndex<k.length?k[A.endSegmentIndex]:T,D=A.consumedEndSegmentIndex<k.length?k[A.consumedEndSegmentIndex]:T;E.push({startSegmentIndex:$,endSegmentIndex:R,consumedEndSegmentIndex:D})}return E})(e.chunks,y,u.length),L=g===null?null:(function(N,k){const T=(function(O){const A=O.length;if(A===0)return null;const $=new Array(A);let R=!1;for(let K=0;K<A;){const G=O.charCodeAt(K);let X=G,ke=1;if(G>=55296&&G<=56319&&K+1<A){const He=O.charCodeAt(K+1);He>=56320&&He<=57343&&(X=He-56320+(G-55296<<10)+65536,ke=2)}const le=Tj(X);le!=="R"&&le!=="AL"&&le!=="AN"||(R=!0);for(let He=0;He<ke;He++)$[K+He]=le;K+=ke}if(!R)return null;let D=0;for(let K=0;K<A;K++){const G=$[K];if(G==="L"){D=0;break}if(G==="R"||G==="AL"){D=1;break}}const W=new Int8Array(A);for(let K=0;K<A;K++)W[K]=D;const V=1&D?"R":"L",U=V;let ee=U;for(let K=0;K<A;K++)$[K]==="NSM"?$[K]=ee:ee=$[K];ee=U;for(let K=0;K<A;K++){const G=$[K];G==="EN"?$[K]=ee==="AL"?"AN":"EN":G!=="R"&&G!=="L"&&G!=="AL"||(ee=G)}for(let K=0;K<A;K++)$[K]==="AL"&&($[K]="R");for(let K=1;K<A-1;K++)$[K]==="ES"&&$[K-1]==="EN"&&$[K+1]==="EN"&&($[K]="EN"),$[K]!=="CS"||$[K-1]!=="EN"&&$[K-1]!=="AN"||$[K+1]!==$[K-1]||($[K]=$[K-1]);for(let K=0;K<A;K++){if($[K]!=="EN")continue;let G;for(G=K-1;G>=0&&$[G]==="ET";G--)$[G]="EN";for(G=K+1;G<A&&$[G]==="ET";G++)$[G]="EN"}for(let K=0;K<A;K++){const G=$[K];G!=="WS"&&G!=="ES"&&G!=="ET"&&G!=="CS"||($[K]="ON")}ee=U;for(let K=0;K<A;K++){const G=$[K];G==="EN"?$[K]=ee==="L"?"L":"EN":G!=="R"&&G!=="L"||(ee=G)}for(let K=0;K<A;K++){if($[K]!=="ON")continue;let G=K+1;for(;G<A&&$[G]==="ON";)G++;const X=(K>0?$[K-1]:U)!=="L"?"R":"L";if(X===((G<A?$[G]:U)!=="L"?"R":"L"))for(let ke=K;ke<G;ke++)$[ke]=X;K=G-1}for(let K=0;K<A;K++)$[K]==="ON"&&($[K]=V);for(let K=0;K<A;K++){const G=$[K];1&W[K]?G!=="L"&&G!=="AN"&&G!=="EN"||W[K]++:G==="R"?W[K]++:G!=="AN"&&G!=="EN"||(W[K]+=2)}return W})(N);if(T===null)return null;const E=new Int8Array(k.length);for(let O=0;O<k.length;O++)E[O]=T[k[O]];return E})(e.normalized,g);return w!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:h,kinds:m,simpleLineWalkFastPath:f,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:x,segments:w}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:h,kinds:m,simpleLineWalkFastPath:f,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:x}}function iq(e,t,n){return(function(o,s,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return sq((function(c,u,d="normal",h="normal"){const m=(function(_){const w=_??"normal";return w==="pre-wrap"?{mode:w,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:w,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),f=m.mode==="pre-wrap"?(function(_){return/[\r\f]/.test(_)?_.replace(/\r\n/g,`
|
|
227
|
-
`).replace(/[\r\f]/g,`
|
|
228
|
-
`):_.replace(/\r\n/g,`
|
|
229
|
-
`)})(c):(function(_){if(!Mj.test(_))return _;let w=_.replace(Aj," ");return w.charCodeAt(0)===32&&(w=w.slice(1)),w.length>0&&w.charCodeAt(w.length-1)===32&&(w=w.slice(0,-1)),w})(c);if(f.length===0)return{normalized:f,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const g=h==="keep-all"?(function(_){if(_.len<=1)return _;const w=[],y=[],b=[],v=[];let x=null,L=!1,N=0,k=!1,T=!1;function E(){x!==null&&(w.push(Is(x)),y.push(L),b.push("text"),v.push(N),x=null)}for(let O=0;O<_.len;O++){const A=_.texts[O],$=_.kinds[O],R=_.isWordLike[O],D=_.starts[O];if($==="text"){const W=$j(A),V=B1(A);if(x!==null&&k&&T){x.push(A),L=L||R,k=k||W,T=V;continue}E(),x=[A],L=R,N=D,k=W,T=V;continue}E(),w.push(A),y.push(R),b.push($),v.push(D)}return E(),{len:w.length,texts:w,isWordLike:y,kinds:b,starts:v}})(d2(f,u,m)):d2(f,u,m);return et({normalized:f,chunks:Xj(g,m)},g)})(o,ep(),r?.whiteSpace,a),s,!1,a)})(e,t,0,n)}const ug="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Gn=(()=>{const e=globalThis;if(e[ug])return e[ug];const t={configs:{},controllers:{},revision:Sl(0),preparedCache:new Map,blockEstimateCache:new Map};return e[ug]=t,t})();let vc=null;const m2=Gn.revision;function g2(e){var t;return e&&(t=Gn.configs[e])!=null?t:null}function v2(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function rq(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function dg(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!rq(i))return null;i.type==="text"?s+=String((t=i.content)!=null?t:""):i.type==="emoji"?s+=String((o=(n=i.name)!=null?n:i.raw)!=null?o:""):i.type==="hardbreak"&&(s+=`
|
|
230
|
-
`)}return s.length>0?s:null}function fg(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(vc!=null)return vc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return vc=!!((i=r.getContext)!=null&&i.call(r,"2d")),vc}catch{return vc=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(o=n.whiteSpace)!=null?o:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Gn.blockEstimateCache.get(r);if(l)return Gn.blockEstimateCache.delete(r),Gn.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(m,f,g){const _=`${g}\0${f}\0${m}`,w=Gn.preparedCache.get(_);if(w)return Gn.preparedCache.delete(_),Gn.preparedCache.set(_,w),w.prepared;const y=iq(m,f,{whiteSpace:g});for(Gn.preparedCache.set(_,{prepared:y});Gn.preparedCache.size>240;){const b=Gn.preparedCache.keys().next().value;if(!b)break;Gn.preparedCache.delete(b)}return y})(e,n.font,a),u=(function(m,f,g){const _=(function(w,y){return w.simpleLineWalkFastPath?p2(w,y):(function(b,v){if(b.simpleLineWalkFastPath)return p2(b,v);const{widths:x,lineEndFitAdvances:L,lineEndPaintAdvances:N,kinds:k,breakableFitAdvances:T,discretionaryHyphenWidth:E,tabStopAdvance:O,chunks:A}=b;if(x.length===0||A.length===0)return 0;const $=ep(),R=$.lineFitEpsilon,D=v+R;let W=0,V=0,U=!1,ee=0,K=0,G=-1,X=0,ke=0,le=null;function He(){G=-1,X=0,ke=0,le=null}function ue(te=ee,pe=K,oe=V){W++,V=0,U=!1,He()}function ve(te,pe){U=!0,ee=te+1,K=0,V=pe}function Pe(te,pe,oe){U=!0,ee=te,K=pe+1,V=oe}function Re(te,pe){U?(V+=pe,ee=te+1,K=0):ve(te,pe)}function Q(te,pe,oe,fe){if(!pe)return;const H=te==="tab"?0:L[oe],Y=te==="tab"?fe:N[oe];G=oe+1,X=V-fe+H,ke=V-fe+Y,le=te}function ce(te,pe){const oe=T[te];for(let fe=pe;fe<oe.length;fe++){const H=oe[fe];U?V+H>D?(ue(),Pe(te,fe,H)):(V+=H,ee=te,K=fe+1):Pe(te,fe,H)}U&&ee===te&&K===oe.length&&(ee=te+1,K=0)}function Ce(te){if(le!=="soft-hyphen")return!1;const pe=T[te];if(pe==null)return!1;const{fitCount:oe,fittedWidth:fe}=(function(H,Y,re,ge,xe){let Ne=0,ie=Y;for(;Ne<H.length;){const ae=ie+H[Ne];if((Ne+1<H.length?ae+xe:ae)>re+ge)break;ie=ae,Ne++}return{fitCount:Ne,fittedWidth:ie}})(pe,V,v,R,E);return oe!==0&&(V=fe,ee=te,K=oe,He(),oe===pe.length?(ee=te+1,K=0,!0):(ue(te,oe,fe+E),ce(te,oe),!0))}function q(te){W++,He()}for(let te=0;te<A.length;te++){const pe=A[te];if(pe.startSegmentIndex===pe.endSegmentIndex){q();continue}U=!1,V=0,pe.startSegmentIndex,ee=pe.startSegmentIndex,K=0,He();let oe=pe.startSegmentIndex;for(;oe<pe.endSegmentIndex;){const fe=k[oe],H=fe==="space"||fe==="preserved-space"||fe==="tab"||fe==="zero-width-break"||fe==="soft-hyphen",Y=fe==="tab"?tq(V,O):x[oe];if(fe!=="soft-hyphen")if(U){if(V+Y>D){const re=V+(fe==="tab"?0:L[oe]),ge=V+(fe==="tab"?Y:N[oe]);if(le==="soft-hyphen"&&$.preferEarlySoftHyphenBreak&&X<=D){ue(G,0,ke);continue}if(le==="soft-hyphen"&&Ce(oe)){oe++;continue}if(H&&re<=D){Re(oe,Y),ue(oe+1,0,ge),oe++;continue}if(G>=0&&X<=D){if(ee>G||ee===G&&K>0){ue();continue}const xe=G;ue(xe,0,ke),oe=xe;continue}if(Y>v&&T[oe]!==null){ue(),ce(oe,0),oe++;continue}ue();continue}Re(oe,Y),Q(fe,H,oe,Y),oe++}else Y>v&&T[oe]!==null?ce(oe,0):ve(oe,Y),Q(fe,H,oe,Y),oe++;else U&&(ee=oe+1,K=0,G=oe+1,X=V+E,ke=V+E,le=fe),oe++}if(U){const fe=G===pe.consumedEndSegmentIndex?ke:V;ue(pe.consumedEndSegmentIndex,0,fe)}}return W})(w,y)})(m,f);return{lineCount:_,height:_*g}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),h=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Gn.blockEstimateCache.set(r,{height:h,contentHeight:Math.round(d)});Gn.blockEstimateCache.size>4e3;){const m=Gn.blockEstimateCache.keys().next().value;if(!m)break;Gn.blockEstimateCache.delete(m)}return{kind:"simple-text",height:h,contentHeight:Math.round(d)}}catch{return null}}function u3(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=dg(e.children);return i&&n.paragraph?fg(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=dg(e.children),l=n.headings[i];return r&&l?fg(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((o=i[0])==null?void 0:o.type)!=="paragraph"||!n.listItem)return null;const r=dg((s=i[0])==null?void 0:s.children);return r?fg(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=u3(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 Ld(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function lq(e,t){var n;if(!e||e.type!=="code_block")return null;const o=t.rendererKind,s=t.showHeader!==!1,i=(function(u){var d,h,m;return u.diff?Math.max(Ld(String((d=u.originalCode)!=null?d:"")),Ld(String((h=u.updatedCode)!=null?h:"")),Ld(String((m=u.code)!=null?m:""))):Ld((function(f,g){const _=String(f??"");return g?_:_.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(o==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(m,f){const g=typeof m?.fontSize=="number"&&m.fontSize>0?m.fontSize:f?13:12;return typeof m?.lineHeight=="number"&&m.lineHeight>0?m.lineHeight:f?30:Math.round(1.5*g)})(u,r),h=(function(m,f){var g,_;if(!f)return 0;const w=typeof((g=m?.padding)==null?void 0:g.top)=="number"?m.padding.top:10,y=typeof((_=m?.padding)==null?void 0:_.bottom)=="number"?m.padding.bottom:22;return Math.max(0,w)+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+h:i*(d+1.5))}else o==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(s?40:0)),contentHeight:c,rendererKind:o}}function aq(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function hg(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=v2(o.lineHeight,1.5*v2(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:aq(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const cq=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function y2(e,t={}){var n;const o={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return o;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))cq.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}const uq=!1;function age(){return uq}function k2(e,t,n,o){var s;const i=(function(h){return Math.max(0,Math.ceil(h.scrollHeight||0)-Math.ceil(h.clientHeight||0))})(e),r=(function(h,m){return Number.isFinite(h)?Math.min(Math.max(0,h),m):0})(n,i);if(!o.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const h of a){e.scrollTop=h;const m=o.getNormalizedScrollTop(e,t,!1),f=Math.abs(m-r);f<u&&(u=f,c=h)}e.scrollTop=c;const d=(s=o.epsilonPx)!=null?s:2;Math.abs(o.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const d3=Symbol("MarkstreamMathBlockMinHeightCache");function cge(){return Bt(d3,null)}const dq=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],fq=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],hq=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),f3=["raw","content","code","originalCode","updatedCode"],b2=new WeakMap,w2=new WeakMap;let pq=1;function zs(){return typeof performance<"u"?performance.now():Date.now()}function _2(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Ps(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=b2.get(t);return n||(n=pq++,b2.set(t,n)),String(n)}function C2(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:Ps(t),customMarkdownIt:Ps(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:Ps(e.validateLink),preTransformTokens:Ps(e.preTransformTokens),postTransformTokens:Ps(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function S2(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
|
|
231
|
-
`,t-1)+1;return e.slice(n,t).trim()}function x2(e){const t=h3(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function h3(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function p3(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 b0(e){const t=String(e??"");return`${t.length}:${p3(t)}`}function W1(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?b0(r):`${r.length}:${p3(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Ps(e)}`;if(typeof e!="object")return typeof e;const o=e,s=t.get(o);if(s)return`cycle:${s}`;if(n>=6)return`object:${Ps(o)}`;const i=Ps(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>W1(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(c=>`${c}:${W1(r[c],t,n+1)}`).join(";")}`}return typeof e}function rh(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function m3(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>rh(o)?Or(o,t,n+1):m3(o,t,n+1)).join(",")}`:rh(e)?Or(e,t,n):W1(e,t,n)}function mq(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!f3.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${b0(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${Ps(s)}`:hq.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${m3(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${Ps(s)}`:""}).filter(Boolean).join(";")}function gq(e){return f3.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${b0(n)}`:""}).filter(Boolean).join(";")}function Or(e,t=new WeakMap,n=0){const o=w2.get(e);if(o)return o;const s=e,i=t.get(s);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${Ps(s)}`;const r=Ps(s);t.set(s,r);const l=(function(a,c,u){const d=a,h=Array.isArray(d.children)?d.children:[],m=h.length?h.slice(0,200).map(f=>Or(f,c,u+1)).join("|"):"";return[a.type,gq(d),mq(d,c,u),h.length,m].join(":")})(e,t,n);return w2.set(s,l),l}function g3(e,t){return Or(e)===Or(t)}function w0(e,t,n){const o=zs(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=zs()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function T2(e,t,n){return w0(t,n,()=>Or(e))}function v3(e,t,n){return T2(e,n,"stabilizeSignatureMs")===T2(t,n,"stabilizeSignatureMs")}function pg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function A2(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function vq(e,t){return e.length===t.length&&e===t}function _0(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const h=o[d],m=s[d];if(typeof h!=typeof m)return!1;if(typeof h!="string"){if(typeof h!="number"&&typeof h!="boolean"&&h!=null)return null;if(!Object.is(h,m))return!1}else if(typeof m!="string"||!vq(h,m))return!1}const l=Object.prototype.hasOwnProperty.call(o,"children");if(l!==Object.prototype.hasOwnProperty.call(s,"children"))return!1;if(!l)return!0;const a=o.children,c=s.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],h=c[u];if(!rh(d)||!rh(h))return null;const m=_0(d,h,n+1);if(m==null)return null;if(!m)return!1}return!0}function yq(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=_0(e,t);return n??g3(e,t)}function kq(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return w0(n,"stabilizeSignatureMs",()=>{o=_0(e,t)}),o??v3(e,t,n)}function bq(e,t){const n={};for(const o of dq){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function wq(e,t){var n;const o=I_(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:F(()=>!1),r=ne(t.renderContent.value);let l,a=[],c="",u="",d="",h=0,m=0,f=zs();function g(){l&&(clearTimeout(l),l=void 0)}function _(){g();const T=t.renderContent.value;r.value!==T&&(r.value=T),f=zs()}ze([t.renderContent,t.effectiveFinal,i],([T,E,O])=>{r.value!==T&&(!O||E||(function(A,$){if(!A&&$||$.length<=80||$.length<A.length||!$.startsWith(A))return!0;const R=$.slice(A.length);return!!R&&(!!x2(S2($))||!(!R.includes(`
|
|
232
|
-
|
|
233
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(R))||R.endsWith(`
|
|
234
|
-
`)&&!(function(D){const W=S2(D);if(x2(W))return!1;const V=h3(W);return V.length>=2&&V.some(U=>U.trim())})($))})(r.value,T)?_():(function(){if(m+=1,l)return;const A=Math.max(0,(function($){const R=$.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(zs()-f));A<=0?_():l=setTimeout(_,A)})())},{flush:"sync",immediate:!0}),iv(g);const w=F(()=>{var T,E,O,A;return B7(e.customHtmlTags,(T=e.parseOptions)==null?void 0:T.customHtmlTags,(A=(O=(E=t.customComponentsMap)==null?void 0:E.value)!=null?O:{},Object.entries(A).map(([$,R])=>{const D=Hs($);return R==null||!D||Nu(D)||qT.has(D)||Eu.has(D)?"":D}).filter(Boolean)))}),y=F(()=>{const{key:T,tags:E}=F7(w.value);if(!T)return o;const O=s.get(T);if(O)return O;const A=I_(t.instanceMsgId,{customHtmlTags:E});return s.set(T,A),A}),b=F(()=>{const T=y.value;return e.customMarkdownIt?e.customMarkdownIt(T):T}),v=F(()=>{var T,E;const O=(T=e.parseOptions)!=null?T:{},A=t.effectiveFinal.value,$=w.value,R=A!=null,D=$.length>0;return R||D||O.streamParse==null?et(et(Mt(et({},O),{streamParse:(E=O.streamParse)==null||E}),R?{final:A}:{}),D?{customHtmlTags:$}:{}):O}),x=F(()=>{var T;return new Set(((T=v.value.customHtmlTags)!=null?T:[]).map(E=>String(E).trim().toLowerCase()).filter(Boolean))}),L=F(()=>C2(v.value,b.value,e.customMarkdownIt,{includeFinal:!0})),N=F(()=>C2(v.value,b.value,e.customMarkdownIt,{includeFinal:!1}));ze([L,N],([T,E],[O,A])=>{O&&(T===O&&E===A||(_(),E!==A&&(a=[],d="")))},{flush:"sync"});const k=F(()=>{var T,E,O,A,$,R,D,W;if((T=e.nodes)!=null&&T.length)return a=[],d="",kr(e.nodes.slice());const V=r.value;if(!V)return a=[],d="",[];const U=t.debugPerformanceEnabled.value,ee=U?zs():0,K=b.value,G=L.value,X=N.value;c&&G!==c&&(function(pe){var oe,fe;(fe=(oe=pe.stream)==null?void 0:oe.reset)==null||fe.call(oe)})(K),u&&X!==u&&(a=[],d="");const ke=a.length>0&&V.startsWith(d)&&X===u,le=U?_2(K):null,He=U?{}:void 0,ue=He?Mt(et({},v.value),{__timing:He}):v.value,ve=NA(V,K,ue),Pe=U?zs():0,Re=U?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Q,ce=U?pg(ve.length):void 0,Ce=0,q=0;if(ke){const pe=U?zs():0;if(Re){const oe=(function(fe,H,Y){if(!H.length)return{nodes:fe,metrics:pg(fe.length)};const re=(function(Ne,ie,ae){const we=Math.min(Ne.length,ie.length);for(let je=0;je<we;je++)if(!kq(ie[je],Ne[je],ae))return je;return Ne.length===ie.length?-1:we})(fe,H,Y);if(re<0)return{nodes:H,metrics:{reusedNodeCount:fe.length,dirtyStartIndex:re,stablePrefixNodeCount:fe.length,dirtyTailNodeCount:0}};const ge=fe.slice();let xe=re;for(let Ne=0;Ne<re;Ne++)ge[Ne]=H[Ne];for(let Ne=re;Ne<fe.length;Ne++){const ie=H[Ne],ae=fe[Ne];ie&&v3(ie,ae,Y)&&(ge[Ne]=ie,xe+=1)}return{nodes:ge,metrics:{reusedNodeCount:xe,dirtyStartIndex:re,stablePrefixNodeCount:re,dirtyTailNodeCount:A2(re,fe,H)}}})(ve,a,Re);Q=oe.nodes,ce=oe.metrics}else{const oe=(function(fe,H){if(!H.length)return{nodes:fe,metrics:pg(fe.length)};const Y=(function(xe,Ne){const ie=Math.min(xe.length,Ne.length);for(let ae=0;ae<ie;ae++)if(!yq(Ne[ae],xe[ae]))return ae;return xe.length===Ne.length?-1:ie})(fe,H);if(Y<0)return{nodes:H,metrics:{reusedNodeCount:fe.length,dirtyStartIndex:Y,stablePrefixNodeCount:fe.length,dirtyTailNodeCount:0}};const re=fe.slice();let ge=Y;for(let xe=0;xe<Y;xe++)re[xe]=H[xe];for(let xe=Y;xe<fe.length;xe++){const Ne=H[xe],ie=fe[xe];Ne&&g3(Ne,ie)&&(re[xe]=Ne,ge+=1)}return{nodes:re,metrics:{reusedNodeCount:ge,dirtyStartIndex:Y,stablePrefixNodeCount:Y,dirtyTailNodeCount:A2(Y,fe,H)}}})(ve,a);Q=oe.nodes,ce=oe.metrics}Ce=U?zs()-pe:0,q=ce?.dirtyStartIndex==null||ce.dirtyStartIndex<0?Q.length:ce.dirtyStartIndex}else Q=ve;Re?(function(pe,oe,fe=0){for(let H=Math.max(0,fe);H<pe.length;H++)w0(oe,"primeSignatureMs",()=>Or(pe[H]))})(Q,Re,q):(function(pe,oe=0){for(let fe=Math.max(0,oe);fe<pe.length;fe++)Or(pe[fe])})(Q,q);const te=U?zs()-Pe:0;if(h+=1,d=V,c=G,u=X,a=Q,U){const pe=_2(K),oe=typeof pe?.total=="number"&&pe.total>((E=le?.total)!=null?E:0);t.logPerf(oe?"parse(stream)":"parse(sync)",et(et(et({rendererId:t.instanceMsgId,ms:Math.round(zs()-ee),nodes:Q.length,contentLength:V.length,parseCommitCount:h,parseCoalescedCount:m,nodeReuseMs:te,signatureMs:(O=Re?.signatureMs)!=null?O:0,stabilizeSignatureMs:(A=Re?.stabilizeSignatureMs)!=null?A:0,primeSignatureMs:($=Re?.primeSignatureMs)!=null?$:0,signatureCallCount:(R=Re?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(D=Re?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(W=Re?.primeSignatureCallCount)!=null?W:0,stabilizeMs:Ce},ce??{}),He?Object.fromEntries(fq.map(fe=>{var H;return[fe,(H=He[fe])!=null?H:0]})):{}),pe?{streamMode:pe.lastMode,streamDelta:bq(pe,le),streamStats:pe}:{}))}return kr(Q)});return{effectiveCustomHtmlTags:w,effectiveCustomHtmlTagsSet:x,mdBase:y,mdInstance:b,mergedParseOptions:v,parsedNodes:k}}function _q(e){const{isClient:t}=e,n=ne(new Set),o=new Map,s=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(h,m){if((g=(f=e.shouldTrackVisibleNodeIndices)==null?void 0:f.call(e))!=null&&!g)return;var f,g;const _=n.value,w=_.has(h);if(m){if(w)return;const b=new Set(_);return b.add(h),void(n.value=b)}if(!w)return;const y=new Set(_);y.delete(h),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[h,m]of s.entries())h<c||(m(),s.delete(h));for(const[h,m]of o.entries())h<c||(m.destroy(),o.delete(h),r(h),(u=e.onNodeVisibilityCleaned)==null||u.call(e,h));for(const h of Array.from(i.keys()))h<c||r(h);if(!n.value.size)return;const d=new Set;for(const h of n.value)h<c&&d.add(h);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of s.values())c();s.clear();for(const c of o.values())c.destroy();o.clear(),l()}}}function Cq(e={}){const t=ne(""),n=ne(""),o=ne(!1),s=SW(e),i=()=>{const u=s.getSnapshot();t.value=u.source,n.value=u.visible,o.value=u.done},r=s.subscribe(i);i();const l=F(()=>Math.max(0,t.value.length-n.value.length)),a=F(()=>l.value===0),c=F(()=>o.value&&a.value);return sv()&&iv(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:c,caughtUp:a,pendingChars:l,enqueue:u=>s.enqueue(u),finish:u=>s.finish(u),flush:()=>s.flush(),reset:u=>s.reset(u),pause:()=>s.pause(),resume:()=>s.resume()}}const M2=/auto|scroll|overlay/i;function Sq(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return M2.test(t)||M2.test(n)}function xq(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 Tq=Qe({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,o;return A1((o=ua(e.estimatedPreviewHeightPx))!=null?o:x1(String((n=e.node.code)!=null?n:"")))});return()=>Zt("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?Zt("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)"}},[Zt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Zt("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Zt("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Zt("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},()=>Zt("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,Zt("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Zt("div",{class:"absolute inset-0"},[Zt("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),Aq=Qe({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,o;return T1((o=ua(e.estimatedPreviewHeightPx))!=null?o:S1(String((n=e.node.code)!=null?n:"")))});return()=>Zt("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?Zt("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)"}},[Zt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Zt("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Zt("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},()=>Zt("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Zt("span",{class:"action-icon block"})])))]):null,Zt("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)"}},[Zt("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"}})])])}}),Mq=["data-custom-id"],Eq={class:"m-0 p-0"},Iq=["data-probe"],$q=["data-node-index","data-node-type"],y3=Jt(Qe(Mt(et({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=ho(),r=Bt("markstreamNestedRendererProps",void 0);function l(M){var B,j;const z=o[M];return(function(Z){const me=i?.vnode.props;return!!me&&(Object.prototype.hasOwnProperty.call(me,Z)||Object.prototype.hasOwnProperty.call(me,String(Z).replace(/[A-Z]/g,ye=>`-${ye.toLowerCase()}`)))})(M)?z:(j=(B=r?.value)==null?void 0:B[M])!=null?j:z}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=F(()=>{return(M=l("mode"))==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),u=F(()=>{const M=l("renderCodeBlocksAsPre"),B=l("codeRenderer");return M===!0?"pre":B==="pre"||B==="shiki"||B==="monaco"?B:M===!1||c.value==="docs"?"monaco":"pre"}),d=F(()=>a[c.value]),h=F(()=>{var M;return(M=l("showTooltips"))!=null?M:d.value.showTooltips}),m=F(()=>{var M;return(M=l("fade"))!=null?M:d.value.fade}),f=F(()=>{var M;return(M=l("batchRendering"))!=null?M:d.value.batchRendering}),g=F(()=>{var M;return(M=l("initialRenderBatchSize"))!=null?M:d.value.initialRenderBatchSize}),_=F(()=>{var M;return(M=l("renderBatchSize"))!=null?M:d.value.renderBatchSize}),w=F(()=>{var M;return(M=l("renderBatchDelay"))!=null?M:d.value.renderBatchDelay}),y=F(()=>{var M;return(M=l("renderBatchBudgetMs"))!=null?M:d.value.renderBatchBudgetMs}),b=F(()=>{var M;return(M=l("renderBatchIdleTimeoutMs"))!=null?M:d.value.renderBatchIdleTimeoutMs}),v=F(()=>{var M;return(M=l("deferNodesUntilVisible"))!=null?M:d.value.deferNodesUntilVisible}),x=F(()=>{var M;return(M=l("maxLiveNodes"))!=null?M:d.value.maxLiveNodes}),L=F(()=>{var M;return(M=l("liveNodeBuffer"))!=null?M:d.value.liveNodeBuffer}),N=F(()=>{var M;return(M=l("nodeVirtual"))!=null?M:d.value.nodeVirtual}),k={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return h.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return o.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return m.value},get batchRendering(){return f.value},get initialRenderBatchSize(){return g.value},get renderBatchSize(){return _.value},get renderBatchDelay(){return w.value},get renderBatchBudgetMs(){return y.value},get renderBatchIdleTimeoutMs(){return b.value},get deferNodesUntilVisible(){return v.value},get maxLiveNodes(){return x.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return N.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function T(M){s("height-change",M)}function E(M){s("virtual-state-change",M)}function O(M){s("anchor-change",M)}const A=ne(),$=ne(null),R=ne(null),D=ne(null),W=ds({1:null,2:null,3:null,4:null,5:null,6:null}),V=ne(!1),U=new Map,ee=ne(0),K=ne(0),G=ne({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function X(){var M,B;if(((M=o.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const j=(B=o.virtualScroll)==null?void 0:B.scrollRoot;return ke(typeof j=="function"?j():j)}function ke(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?ke(M.value):typeof M=="object"&&"$el"in M?ke(M.$el):null:null}const{isClient:le,renderAsFragment:He,debugPerformanceEnabled:ue,resolvedShowTooltips:ve,resolvedHtmlPolicy:Pe,inheritedSmoothStreaming:Re,ownsTypewriterCursor:Q}=(function(M){const B=typeof window<"u",j=Su(),z=Bt("markstreamHtmlPolicy",void 0),Z=Bt("markstreamTypewriterCursor",void 0),me=Bt("markstreamSmoothStreaming",void 0),ye=F(()=>M.renderAsFragment===!0),_e=F(()=>!!(M.debugPerformance&&B&&typeof console<"u")),De=F(()=>{var Be;if(typeof M.showTooltips=="boolean")return M.showTooltips;const $e=(Be=j.showTooltips)!=null?Be:j["show-tooltips"];return $e===""||$e===!0||$e==="true"||$e!==!1&&$e!=="false"&&void 0}),Me=F(()=>{var Be,$e;return($e=(Be=M.htmlPolicy)!=null?Be:z?.value)!=null?$e:"safe"}),Ue=F(()=>Z?.value!==!0);return{isClient:B,renderAsFragment:ye,debugPerformanceEnabled:_e,resolvedShowTooltips:De,resolvedHtmlPolicy:Me,inheritedSmoothStreaming:me,inheritedTypewriterCursor:Z,ownsTypewriterCursor:Ue}})(k),{resolveViewportRoot:ce,resolveScrollContainer:Ce,isReverseFlexScrollRoot:q,getNormalizedScrollTop:te,getOffsetTopWithinRoot:pe}=(function(M,B){function j(){var _e,De;return(De=(_e=B.scrollRoot)==null?void 0:_e.call(B))!=null?De:null}function z(_e){if(typeof window>"u")return null;const De=j();if(De)return De;const Me=_e??M.value;if(!Me)return null;const Ue=Me.ownerDocument||document,Be=Ue.scrollingElement||Ue.documentElement;let $e=Me;for(;$e&&$e!==Ue.body&&$e!==Be;){if(Sq(window.getComputedStyle($e))&&xq($e))return $e;$e=$e.parentElement}return null}function Z(_e){if(!B.isClient)return!1;try{const De=window.getComputedStyle(_e);return!!(De.display||"").toLowerCase().includes("flex")&&(De.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function me(_e,De,Me){var Ue,Be;if(Me)return ye(De);const $e=_e.scrollTop;if(!Z(_e))return $e;const We=$e<0?-$e:$e;return Math.max(0,((Ue=_e.scrollHeight)!=null?Ue:0)-((Be=_e.clientHeight)!=null?Be:0))-We}function ye(_e){var De,Me,Ue,Be,$e;const We=Number((De=_e.scrollingElement)==null?void 0:De.scrollTop),Ke=Number((Ue=(Me=_e.documentElement)==null?void 0:Me.scrollTop)!=null?Ue:0),Ge=Number(($e=(Be=_e.body)==null?void 0:Be.scrollTop)!=null?$e:0);return Math.max(0,Number.isFinite(We)?We:0,Number.isFinite(Ke)?Ke:0,Number.isFinite(Ge)?Ge:0)}return{resolveViewportRoot:z,resolveScrollContainer:function(_e){var De,Me,Ue,Be;const $e=j();if($e)return $e;const We=z((De=_e??M.value)!=null?De:null);if(We)return We;const Ke=(Be=(Ue=_e?.ownerDocument)!=null?Ue:(Me=M.value)==null?void 0:Me.ownerDocument)!=null?Be:typeof document<"u"?document:null;return Ke?.scrollingElement||Ke?.documentElement||null},isReverseFlexScrollRoot:Z,getNormalizedScrollTop:me,getOffsetTopWithinRoot:function(_e,De){const Me=De.ownerDocument||_e.ownerDocument||document;if((function(We,Ke){return We===Ke.documentElement||We===Ke.body||We===Ke.scrollingElement})(De,Me))return _e.getBoundingClientRect().top+ye(Me);const Ue=De.getBoundingClientRect(),Be=_e.getBoundingClientRect(),$e=me(De,Me,!1);return Be.top-Ue.top+$e}}})(A,{isClient:le,scrollRoot:X});yn("markstreamShowTooltips",ve),yn("markstreamHtmlPolicy",Pe),yn("markstreamTypewriter",F(()=>k.typewriter!==!1)),yn("markstreamFade",F(()=>k.fade!==!1)),yn("markstreamTypewriterCursor",F(()=>!0)),yn("markstreamTextStreamState",U),yn("markstreamStreamVersion",ee),yn("markstreamParseOptions",F(()=>k.parseOptions)),yn("markstreamCustomMarkdownIt",F(()=>k.customMarkdownIt));const{smoothStreamingEnabled:oe,renderContent:fe,effectiveFinal:H}=(function(M,B){const j=Cq(M.smoothStreamingOptions),z=F(()=>{var Me,Ue,Be;return M.smoothStreaming!==!1&&!((Me=M.nodes)!=null&&Me.length)&&(M.smoothStreaming===!0||!((Ue=B.inheritedSmoothStreaming)!=null&&Ue.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((Be=M.maxLiveNodes)!=null?Be:0)<=0)}),Z=ne(!B.isClient||M.smoothStreaming===!0);sn(()=>{Z.value=!0});const me=F(()=>Z.value&&z.value),ye=F(()=>{var Me;return me.value?j.visible.value:(Me=M.content)!=null?Me:""}),_e=F(()=>{var Me,Ue;const Be=(Me=M.parseOptions)!=null?Me:{};return(Ue=M.final)!=null?Ue:Be.final}),De=F(()=>{const Me=_e.value;return me.value&&Me!=null?!!Me&&j.caughtUp.value:Me});return ze([()=>M.content,()=>M.nodes,me,_e],([Me,Ue,Be,$e])=>{if(Ue?.length)return void j.reset("");const We=Me??"";if(!Be)return j.reset(We),void($e&&j.finish({flush:!0}));const Ke=j.source.value;We?We===Ke||(We.startsWith(Ke)?j.enqueue(We.slice(Ke.length)):j.reset(We)):j.reset(""),$e&&j.finish()},{immediate:!0}),{smoothStream:j,smoothStreamingEligible:z,smoothStreamingEnabled:me,renderContent:ye,requestedFinal:_e,effectiveFinal:De}})(k,{isClient:le,inheritedSmoothStreaming:Re});yn("markstreamSmoothStreaming",oe);const Y=ne(!1);let re="",ge=!1,xe=null;function Ne(){le&&xe!=null&&(window.clearTimeout(xe),xe=null)}function ie(){Y.value=!1,Ne()}function ae(M,B){if(!ue.value)return;const j=(function(){if(!ue.value)return null;const z=_t(we),Z=_t(je),me=Math.max(ct,Z);if(z<=0&&me<=0)return null;const ye={total:z,maxPerFrame:me,byLabel:(_e=we,Object.fromEntries(Array.from(_e.entries()).sort((De,Me)=>Me[1]-De[1]||De[0].localeCompare(Me[0]))))};var _e;return we.clear(),je.clear(),ct=0,ye})();console.info(`[markstream-vue][perf] ${M}`,j?Mt(et({},B),{layoutReads:j}):B)}ze([fe,()=>o.nodes,H],([M,B,j])=>{const z=M??"";return B?.length||j===!0?(ie(),re=z,void(ge=!0)):ge?(re&&z.length>re.length&&z.startsWith(re)?(Y.value=!0,le&&(Ne(),xe=window.setTimeout(()=>{var Z;xe=null,H.value===!0||(Z=o.nodes)!=null&&Z.length||(Hl(),Y.value=!1,bi())},1200))):(z.length<re.length||!z.startsWith(re))&&ie(),void(re=z)):(re=z,void(ge=!0))},{flush:"sync",immediate:!0});const we=new Map,je=new Map;let nt=!1,ct=0;function _t(M){let B=0;for(const j of M.values())B+=j;return B}function $t(){ct=Math.max(ct,_t(je)),je.clear(),nt=!1}function lt(M,B){return(function(j){var z,Z;ue.value&&(we.set(j,((z=we.get(j))!=null?z:0)+1),je.set(j,((Z=je.get(j))!=null?Z:0)+1),nt||(nt=!0,le&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame($t):typeof queueMicrotask!="function"?setTimeout($t,0):queueMicrotask($t)))})(M),B()}const Rt=k.customId?`renderer-${k.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,fn=(function(M){const B=new Map;return{scope:M,cache:B,clear:()=>B.clear()}})(Rt),Mn=F(()=>`${Rt}:${ee.value}`);yn(d3,fn);const Nt=jn(()=>k.customId),{effectiveCustomHtmlTagsSet:Ft,mergedParseOptions:qn,parsedNodes:Je}=wq(k,{instanceMsgId:Rt,renderContent:fe,effectiveFinal:H,smoothStreamingEnabled:oe,debugPerformanceEnabled:ue,customComponentsMap:Nt,logPerf:ae});ze(Je,()=>{fn.clear(),ee.value+=1},{immediate:!0});const Qn=F(()=>({customId:k.customId,customHtmlTags:qn.value.customHtmlTags,parseOptions:k.parseOptions,customMarkdownIt:k.customMarkdownIt,htmlPolicy:Pe.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:ve.value,themes:k.themes,langs:k.langs,isDark:k.isDark,typewriter:k.typewriter,smoothStreamingOptions:k.smoothStreamingOptions,parseCoalesceMs:k.parseCoalesceMs,fade:k.fade}));yn("markstreamNestedRendererProps",Qn);const es=F(()=>Je.value),Ro=F(()=>Je.value.length),po=ne(null),Pn=ne(null),an=ne(null),wn=ne(null),On=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),zn=!On&&k.customId?g2(k.customId):null,Zn=F(()=>zn?(m2.value,g2(k.customId)):null),Jn=F(()=>{var M;return!!(le&&!He.value&&k.customId&&!On&&((M=Zn.value)!=null&&M.enabled))}),Do=F(()=>{var M;return!!(!He.value&&((M=o.virtualScroll)!=null&&M.enabled))}),Bo=ne(!1);sn(()=>{Bo.value=!0});const At=F(()=>!!(le&&Do.value));yn("markstreamHostScrollManaged",At);const Co=F(()=>!!(Bo.value&&At.value)),cn=F(()=>Jn.value||At.value),Fo=F(()=>Jn.value||Co.value),So=F(()=>{var M;return cn.value&&((M=Zn.value)==null?void 0:M.textEstimation)!==!1}),eo=F(()=>{var M;return cn.value&&((M=Zn.value)==null?void 0:M.codeBlockEstimation)!==!1});function Ye(){const M=K.value||lt("getMeasuredContainerWidth.clientWidth",()=>{var B;return((B=A.value)==null?void 0:B.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const qe=F(()=>{const M=Ye();return M>0?Math.max(1,Math.round(M)):640}),tt=F(()=>{var M;return Math.max(1,(M=k.maxLiveNodes)!=null?M:320)}),it=F(()=>{var M;return!He.value&&k.nodeVirtual!==!1&&!(((M=k.maxLiveNodes)!=null?M:0)<=0)&&(k.nodeVirtual===!0?Je.value.length>0:Je.value.length>tt.value)}),Ie=F(()=>it.value||Jn.value||At.value),be=F(()=>k.viewportPriority!==!1&&!V.value),Fe=cj(M=>{var B;return ce((B=M??A.value)!=null?B:null)},be),{requestFrame:xt,cancelFrame:Tt,hasIdleCallback:mn,isTestEnv:gn}=(function(M){const B=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,j=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,z=M.isClient&&typeof window.requestIdleCallback=="function",Z=(function(){var me;if(typeof globalThis>"u"||!("process"in globalThis))return;const ye=(me=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:me.value;return ye?.env})();return{requestFrame:B,cancelFrame:j,hasIdleCallback:z,isTestEnv:Z?.NODE_ENV==="test"}})({isClient:le}),{resolvedBatchSize:bs,resolvedInitialBatch:ts,batchingEnabled:Ki,incrementalRenderingActive:mi,renderedCount:Vn,previousRenderContext:gi,adaptiveBatchSize:de,previousBatchConfig:Te}=(function(M,B){var j;const z=F(()=>{var Be;const $e=Math.trunc((Be=M.renderBatchSize)!=null?Be:80);return Number.isFinite($e)?Math.max(0,$e):0}),Z=F(()=>{var Be;const $e=Math.trunc((Be=M.initialRenderBatchSize)!=null?Be:z.value);return Number.isFinite($e)?Math.max(0,$e):z.value}),me=F(()=>!B.renderAsFragment.value&&M.batchRendering!==!1&&z.value>0&&B.isClient&&!B.isTestEnv),ye=ne(0),_e=ne({key:M.indexKey,total:0}),De=ne(Math.max(1,z.value||1)),Me=F(()=>{var Be;return me.value&&((Be=M.maxLiveNodes)!=null?Be:0)<=0}),Ue=ne({batchSize:z.value,initial:Z.value,delay:(j=M.renderBatchDelay)!=null?j:16,enabled:Me.value});return{resolvedBatchSize:z,resolvedInitialBatch:Z,batchingEnabled:me,incrementalRenderingActive:Me,renderedCount:ye,previousRenderContext:_e,adaptiveBatchSize:De,previousBatchConfig:Ue}})(k,{isClient:le,isTestEnv:gn,renderAsFragment:He}),Ee=new Map,Ae=new Map,J=new WeakMap;let he=null;const yt=new WeakMap,Lt=new Map,to=ne(0),Ws=F(()=>(to.value,Array.from(Ee.entries()).sort((M,B)=>M[0]-B[0]))),hn=ne(null),Pt=ne(null);let pn=null,vi=0,Us=null;const{activeRestoreAnchor:ws,getRelativeScrollTopWithinContainer:Ml,setRelativeScrollTopWithinContainer:El,resolveAnchorOffset:pp,clearRestoreReconcile:Pu,scheduleRestoreReconcile:Ua,captureRestoreAnchor:F0,restoreAnchor:H0,getAnchorDrift:IM}=(function(M){const{isClient:B,containerRef:j,parsedNodeCount:z,requestFrame:Z,cancelFrame:me,resolveScrollContainer:ye,getNormalizedScrollTop:_e,getOffsetTopWithinRoot:De,isReverseFlexScrollRoot:Me,estimateIndexForOffset:Ue,estimateHeightRange:Be,getFallbackNodeHeight:$e,clamp:We}=M,Ke=ne(null);let Ge=null,pt=[];function ot(){const kt=ye(),It=j.value;if(!kt||!It)return null;const Et=kt.ownerDocument||It.ownerDocument||document;if(kt===Et.documentElement||kt===Et.body||kt===Et.scrollingElement){const Xt=It.getBoundingClientRect();return Math.max(0,-Xt.top)}return Math.max(0,_e(kt,Et,!1)-De(It,kt))}function st(kt){var It;const Et=ye(),Xt=j.value;if(!Et||!Xt)return;const is=Math.max(0,kt),xo=Et.ownerDocument||Xt.ownerDocument||document,js=xo.defaultView||(typeof window<"u"?window:null);if(Et===xo.documentElement||Et===xo.body||Et===xo.scrollingElement){const Ji=_e(Et,xo,!0)+Xt.getBoundingClientRect().top;return void((It=js?.scrollTo)==null||It.call(js,0,Math.max(0,Ji+is)))}k2(Et,xo,De(Xt,Et)+is,{isReverseFlexScrollRoot:Ji=>{var er;return(er=Me?.(Ji))!=null&&er},getNormalizedScrollTop:_e})}function gt(kt){const It=z.value,Et=We(kt.nodeIndex,0,Math.max(0,It-1));return Be(0,Et)+Math.max(0,kt.offsetWithinNodePx)}function mt(){if(Ge!=null&&(me?.(Ge),Ge=null),B)for(const kt of pt)window.clearTimeout(kt);pt=[]}function Ut(kt){const It=gt(kt),Et=ot();Et!=null&&Math.abs(Et-It)<=.5||st(It)}return{activeRestoreAnchor:Ke,getRelativeScrollTopWithinContainer:ot,setRelativeScrollTopWithinContainer:st,resolveAnchorOffset:gt,clearRestoreReconcile:mt,applyRestoreAnchor:Ut,scheduleRestoreReconcile:function(){Ke.value&&B&&Ge==null&&(Ge=Z?Z(()=>{Ge=null,Ke.value&&Ut(Ke.value)}):null,Ge==null&&Ke.value&&Ut(Ke.value))},captureRestoreAnchor:function(){const kt=ot(),It=z.value;if(kt==null||It<=0)return null;const Et=We(Ue(kt+1),0,It-1),Xt=Be(0,Et),is=$e(Et);return{nodeIndex:Et,offsetWithinNodePx:We(kt-Xt,0,Math.max(0,is-1))}},restoreAnchor:function(kt){const It=z.value;if(Ke.value={nodeIndex:We(kt.nodeIndex,0,Math.max(0,It-1)),offsetWithinNodePx:Math.max(0,kt.offsetWithinNodePx)},mt(),Ut(Ke.value),B)for(const Et of[0,120,280,480])pt.push(window.setTimeout(()=>{Ke.value&&Ut(Ke.value)},Et))},getAnchorDrift:function(kt){const It=ot();return It==null?null:It-gt(kt)}}})({isClient:le,containerRef:A,parsedNodeCount:Ro,requestFrame:xt,cancelFrame:Tt,resolveScrollContainer:()=>hn.value||Ce(),getNormalizedScrollTop:te,getOffsetTopWithinRoot:pe,isReverseFlexScrollRoot:q,estimateIndexForOffset:Jp,estimateHeightRange:Zi,getFallbackNodeHeight:qu,clamp:lo}),{nodeHeights:_s,heightStats:Cs,heightTreeSize:ja,heightSumTree:mp,heightKnownTree:gp,averageNodeHeight:Js,resetHeightMeasurements:$M,pruneHeightMeasurements:NM,rebuildHeightTrees:Ou,recordNodeHeight:LM,removeNodeHeights:PM,exportHeightCache:OM,importHeightCache:RM,fenwickRangeSum:Ru}=(function(M={}){const B=ds({}),j=ds({total:0,count:0}),z=ne(0),Z=ne([]),me=ne([]);function ye(){for(const $e of Object.keys(B))delete B[Number($e)];j.total=0,j.count=0,z.value=0,Z.value=[],me.value=[]}function _e($e,We,Ke){for(let Ge=We+1;Ge<$e.length;Ge+=Ge&-Ge)$e[Ge]+=Ke}function De($e,We){let Ke=0;for(let Ge=We+1;Ge>0;Ge-=Ge&-Ge)Ke+=$e[Ge];return Ke}function Me($e){z.value=$e;const We=new Array($e+1).fill(0),Ke=new Array($e+1).fill(0);for(const[Ge,pt]of Object.entries(B)){const ot=Number(Ge),st=Number(pt);!Number.isFinite(ot)||ot<0||ot>=$e||!Number.isFinite(st)||st<=0||(_e(We,ot,st),_e(Ke,ot,1))}Z.value=We,me.value=Ke}function Ue($e){if(!Number.isInteger($e)||$e<0)return!1;const We=B[$e];if(!Number.isFinite(We)||We<=0)return!1;if(delete B[$e],j.total=Math.max(0,j.total-We),j.count=Math.max(0,j.count-1),z.value>$e){const Ke=Z.value,Ge=me.value;Ke.length&&Ge.length&&(_e(Ke,$e,-We),_e(Ge,$e,-1))}return!0}const Be=F(()=>j.count>0?Math.max(12,j.total/j.count):32);return{nodeHeights:B,heightStats:j,heightTreeSize:z,heightSumTree:Z,heightKnownTree:me,averageNodeHeight:Be,resetHeightMeasurements:ye,pruneHeightMeasurements:function($e){if($e<=0)return void ye();let We=0,Ke=0;for(const[Ge,pt]of Object.entries(B)){const ot=Number(Ge),st=Number(pt);!Number.isFinite(ot)||ot<0||ot>=$e||!Number.isFinite(st)||st<=0?delete B[ot]:(We+=st,Ke++)}j.total=We,j.count=Ke},rebuildHeightTrees:Me,recordNodeHeight:function($e,We,Ke={}){(function(Ge,pt,ot={}){var st;if(!Number.isFinite(pt)||pt<=0)return!1;const gt=B[Ge];if(gt&&(ot.allowShrink===!1&&pt<gt||Math.abs(pt-gt)<=1))return!1;if(B[Ge]=pt,gt?j.total+=pt-gt:(j.total+=pt,j.count++),z.value>Ge){const mt=Z.value,Ut=me.value;if(mt.length&&Ut.length)if(gt){const kt=pt-gt;kt!==0&&_e(mt,Ge,kt)}else _e(mt,Ge,pt),_e(Ut,Ge,1)}ot.notify!==!1&&((st=M.onHeightRecorded)==null||st.call(M))})($e,We,Mt(et({},Ke),{notify:!0}))},removeNodeHeight:function($e,We={}){var Ke;const Ge=Ue($e);return Ge&&We.notify!==!1&&((Ke=M.onHeightRecorded)==null||Ke.call(M)),Ge},removeNodeHeights:function($e,We={}){var Ke;let Ge=0;for(const pt of $e)Ue(Number(pt))&&Ge++;return Ge>0&&We.notify!==!1&&((Ke=M.onHeightRecorded)==null||Ke.call(M)),Ge},exportHeightCache:function(){return Object.entries(B).map(([$e,We])=>({index:Number($e),height:Number(We)})).filter($e=>Number.isFinite($e.index)&&$e.index>=0&&Number.isFinite($e.height)&&$e.height>0).sort(($e,We)=>$e.index-We.index)},importHeightCache:function($e,We={}){var Ke;if(!Array.isArray($e))return;const Ge=z.value;let pt=!1;if(We.mode!=="merge"){const ot=Object.keys(B);if(ot.length>0){for(const st of ot)delete B[Number(st)];pt=!0}}for(const ot of $e){const st=Number(ot.index),gt=Number(ot.height);if(!Number.isInteger(st)||st<0||Ge>0&&st>=Ge||!Number.isFinite(gt)||gt<=0)continue;const mt=B[st];mt&&Math.abs(mt-gt)<=1||(B[st]=gt,pt=!0)}pt&&((function(){let ot=0,st=0;const gt=z.value;for(const[mt,Ut]of Object.entries(B)){const kt=Number(mt),It=Number(Ut);!Number.isFinite(kt)||kt<0||gt>0&&kt>=gt||!Number.isFinite(It)||It<=0?delete B[kt]:(ot+=It,st++)}j.total=ot,j.count=st})(),Ge>0&&Me(Ge),(Ke=M.onHeightRecorded)==null||Ke.call(M))},fenwickRangeSum:function($e,We,Ke){if(Ke<=We)return 0;const Ge=De($e,Ke-1);return We<=0?Ge:Ge-De($e,We-1)}}})({onHeightRecorded:()=>{xs(),At.value&&ic(),ws.value&&Ua(),Pt.value&&Dl(),un("node-resize")}});function Du(){$M(),Lt.clear()}function W0(M){!Number.isInteger(M)||M<0||M>=Je.value.length||Lt.set(M,Ga(M))}function U0(M,B,j={}){const z=_s[M];LM(M,B,j);const Z=_s[M];Z&&Z>0?W0(M):z&&Lt.delete(M)}function j0(M,B){const j=lt("getNodeLayoutHeight.slot.offsetHeight",()=>{var z,Z;return(Z=(z=Ee.get(M))==null?void 0:z.offsetHeight)!=null?Z:0});return j>0?j:lt("getNodeLayoutHeight.content.offsetHeight",()=>B.offsetHeight)}function q0(M,B={}){RM(M,B),qp()}const Gi=F(()=>{var M;return!He.value&&k.deferNodesUntilVisible!==!1&&!(((M=k.maxLiveNodes)!=null?M:0)<=0)&&!it.value&&!(Je.value.length>900)&&be.value}),z0=F(()=>!!Fe&&(Gi.value||it.value)),V0=F(()=>it.value||At.value),{liveNodeBufferResolved:qa,focusIndex:Ss,liveRange:ro,updateLiveRange:Wr}=(function(M,B){const{parsedNodeCount:j,virtualizationEnabled:z,maxLiveNodesResolved:Z,clamp:me}=B,ye=F(()=>{var Me;return Math.max(0,(Me=M.liveNodeBuffer)!=null?Me:60)}),_e=ne(0),De=ds({start:0,end:0});return{liveNodeBufferResolved:ye,focusIndex:_e,liveRange:De,updateLiveRange:function(){const Me=j.value;if(!z.value||Me===0)return De.start=0,void(De.end=Me);const Ue=Math.min(Z.value,Me),Be=ye.value,$e=me(_e.value-Be,0,Math.max(0,Me-Ue));De.start=$e,De.end=Math.min(Me,$e+Ue)}}})(k,{parsedNodeCount:Ro,virtualizationEnabled:it,maxLiveNodesResolved:tt,clamp:lo}),ei=new Map,Ur=new Map,Yi=new Map,Bu=[],yi=new Map,Xi=new Set,K0=ne(0);let vp=!1;const G0=F(()=>(K0.value,Xi.size)),ns=new Map,ti=new Map,Y0=ne(0),yp=F(()=>{Y0.value;let M=0;for(const B of ns.values())M+=Math.max(0,B);return M});let os=null,kp=!0,X0=[0],Q0="";function xs(){kp=!0}const Fu=F(()=>{if(!it.value)return Je.value.length;const M=qa.value,B=Math.max(ro.end+M,ts.value),j=Math.min(Je.value.length,B);return Math.max(Vn.value,j)});function Hu(){vp||(vp=!0,queueMicrotask(()=>{vp=!1,K0.value+=1}))}function Z0(M,B,j="node-resize"){if(!le||typeof window>"u")return null;const z=window.setTimeout(()=>{Xi.delete(z)&&Hu();try{B()}finally{un(j)}},Math.max(0,M));return Xi.add(z),Hu(),z}function Wu(M){le&&M!=null&&(Xi.delete(M)&&Hu(),window.clearTimeout(M))}function J0(){if(le&&typeof window<"u")for(const M of Xi)window.clearTimeout(M);Xi.size&&(Xi.clear(),Hu()),Bu.length=0,Yi.clear()}function DM(M){var B,j;return(j=(B=wn.value)==null?void 0:B[M])!=null?j:null}const{cancelScheduledFocusSync:bp,scheduleFocusSync:ni}=(function(M){const{isClient:B,containerRef:j,virtualizationEnabled:z,requestFrame:Z,cancelFrame:me,syncFocusToScroll:ye}=M;let _e=null;function De(){var Ue,Be,$e;return($e=(Be=(Ue=j.value)==null?void 0:Ue.ownerDocument)==null?void 0:Be.defaultView)!=null?$e:typeof window<"u"?window:null}function Me(){if(!_e)return;const Ue=De();_e.viaTimeout?Ue?Ue.clearTimeout(_e.id):clearTimeout(_e.id):me?.(_e.id),_e=null}return{cancelScheduledFocusSync:Me,scheduleFocusSync:function(Ue={}){if(!z.value)return;if(!B)return void ye(!0);if(Ue.immediate)return Me(),void ye(!0);if(_e)return;const Be=()=>{_e=null,ye()};if(Z)return void(_e={id:Z(Be),viaTimeout:!1});const $e=De();_e={id:$e?$e.setTimeout(Be,16):setTimeout(Be,16),viaTimeout:!0}}}})({isClient:le,containerRef:A,virtualizationEnabled:it,requestFrame:xt,cancelFrame:Tt,syncFocusToScroll:function(M=!1){var B;if(!it.value)return;const j=hn.value||Ce();if(!j)return;const z=j.ownerDocument||((B=A.value)==null?void 0:B.ownerDocument)||document,Z=z?.defaultView||(typeof window<"u"?window:null),me=j===z?.documentElement||j===z?.body,ye=Je.value.length;if(!me&&ye>0&&q(j)){const Ke=lt("syncFocusToScroll.clientHeight",()=>j.clientHeight||0),Ge=lt("syncFocusToScroll.scrollTop",()=>j.scrollTop),pt=Ge<0?-Ge:Ge,ot=(function(gt){var mt,Ut;const kt=Je.value;if(!kt.length)return 0;if(gt<=0)return Math.max(0,kt.length-1);if(cn.value){const Et=(mt=xp()[kt.length])!=null?mt:0;return ly(Math.max(0,Et-gt))}if(ja.value===kt.length){const Et=Zi(0,kt.length);return Jp(Math.max(0,Et-gt))}let It=gt;for(let Et=kt.length-1;Et>=0;Et--){const Xt=(Ut=_s[Et])!=null?Ut:Js.value;if(It<=Xt)return Et;It-=Xt}return 0})(Math.max(0,pt)+.5*Math.max(0,Ke)),st=lo(ot,0,Math.max(0,ye-1));return void((M||Math.abs(st-Ss.value)>1)&&(Ss.value=st,Wr()))}const _e=me?null:lt("syncFocusToScroll.root.getBoundingClientRect",()=>j.getBoundingClientRect()),De=me?0:_e.top,Me=me?lt("syncFocusToScroll.viewport.clientHeight",()=>{var Ke,Ge;return(Ge=(Ke=Z?.innerHeight)!=null?Ke:j.clientHeight)!=null?Ge:0}):_e.bottom,Ue=Ws.value;let Be=null,$e=null;for(const[Ke,Ge]of Ue){if(!Ge)continue;const pt=lt("syncFocusToScroll.slot.getBoundingClientRect",()=>Ge.getBoundingClientRect());pt.bottom<=De||pt.top>=Me||(Be==null&&(Be=Ke),$e=Ke)}if(Be==null||$e==null){const Ke=A.value;if(!Ke)return;const Ge=me?{top:0}:lt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>j.getBoundingClientRect()),pt=lt("syncFocusToScroll.fallback.scrollTop",()=>te(j,z,me)),ot=me?(()=>{const mt=lt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Ke.getBoundingClientRect()),Ut=(me?0:Ge.top)-mt.top;return Math.max(0,Ut)})():(()=>{const mt=pe(Ke,j);return Math.max(0,pt-mt)})(),st=me?lt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var mt,Ut,kt,It;return(It=(kt=(Ut=Z?.innerHeight)!=null?Ut:(mt=z?.documentElement)==null?void 0:mt.clientHeight)!=null?kt:j.clientHeight)!=null?It:0}):lt("syncFocusToScroll.fallback.root.clientHeight",()=>j.clientHeight),gt=Jp(ot+.5*Math.max(0,st));return Ss.value=lo(gt,0,Math.max(0,Je.value.length-1)),void Wr()}const We=Math.round((Be+$e)/2);!M&&Math.abs(We-Ss.value)<=1||(Ss.value=lo(We,0,Math.max(0,Je.value.length-1)),Wr())}}),{visibleNodeIndices:wp,nodeVisibilityHandles:Il,nodeVisibilityWatchStops:Uu,nodeVisibilityFallbackTimers:ey,clearVisibilityFallback:ju,markNodeVisible:Qi,cleanupNodeVisibility:BM,destroyNodeVisibilityState:_p}=_q({isClient:le,shouldTrackVisibleNodeIndices:()=>Gi.value,shouldCleanupNodeVisibility:()=>it.value,onNodeMarkedVisible:M=>{it.value?ni():Ss.value=lo(M,0,Math.max(0,Je.value.length-1))},onNodeVisibilityCleaned:M=>{Ee.delete(M)&&Ey()}}),{cleanupScrollListener:ty,setupScrollListener:FM}=(function(M){const{isClient:B,virtualizationEnabled:j,listenerEnabled:z,scrollRootElement:Z,resolveScrollContainer:me,scheduleFocusSync:ye,onScroll:_e}=M;let De=null,Me=null;function Ue(){De&&(De(),De=null),Me=null,Z.value=null}function Be($e){const We=M.getScrollTop?M.getScrollTop($e):$e.scrollTop;return Math.max(0,Number.isFinite(We)?Math.abs(We):0)}return{cleanupScrollListener:Ue,setupScrollListener:function(){if(!B)return;if(!(($e=z?.value)!=null?$e:j.value))return void Ue();var $e;const We=me();if(!We)return void Ue();if(Z.value===We&&De)return;Ue(),Me=Be(We);const Ke=()=>{if(_e?.(),j.value){const Ge=(function(pt){const ot=Be(pt),st=Me;Me=ot;const gt=Math.max(480,.75*(pt.clientHeight||0));return st==null?ot>gt?{immediate:!0}:void 0:Math.abs(ot-st)>gt?{immediate:!0}:void 0})(We);Ge?ye(Ge):ye()}};We.addEventListener("scroll",Ke,{passive:!0}),Z.value=We,De=()=>{We.removeEventListener("scroll",Ke)}}}})({isClient:le,virtualizationEnabled:it,listenerEnabled:V0,scrollRootElement:hn,resolveScrollContainer:Ce,scheduleFocusSync:ni,onScroll:function(){const M=Pt.value;if(!M)return;const B=Ka();if(!B||(function(z){if(Ja()>=vi)return Us=null,!1;const Z=Us;if(Z==null)return!0;const me=Math.abs(z.scrollTop-Z)<=2;return me||(Us=null),me})(B))return;const j=gy(B);j!=null?(j<-32||Math.abs(Math.max(0,j)-Math.max(0,M.distanceFromBottomPx))>32)&&Rl("restore"):Rl("restore")},getScrollTop:M=>{var B;const j=M.ownerDocument||((B=A.value)==null?void 0:B.ownerDocument)||document,z=M===j.documentElement||M===j.body||M===j.scrollingElement;return lt("scrollListener.getScrollTop",()=>te(M,j,z))}});function lo(M,B,j){return Math.min(Math.max(M,B),j)}function Cp(M){return M?.firstElementChild}function ny(M,B){var j;return M?(j=M.matches)!=null&&j.call(M,B)?M:M.querySelector(B):null}function oy(){if(!cn.value)return void(K.value=0);const M=lt("updateExperimentContainerWidth.clientWidth",()=>{var B,j;return(j=(B=A.value)==null?void 0:B.clientWidth)!=null?j:0});K.value=M>0?M:0}let za=null;function Sp(){za?.disconnect(),za=null}const sy=di({loader:()=>Cn(null,null,function*(){return(yield Vo(()=>import("./index8-D_LvlNqi.js"),__vite__mapDeps([5,4]))).default}),loadingComponent:s3,delay:0,suspensible:!1});function iy(M){return M===sy}const ry=F(()=>u.value==="pre"?ls:u.value==="shiki"?sy:ig),jr=F(()=>{const M=Je.value;if(!M.length||!cn.value)return M.map(()=>null);const B=K.value||lt("estimatedNodeHeights.clientWidth",()=>{var j;return((j=A.value)==null?void 0:j.clientWidth)||0});return!Number.isFinite(B)||B<=0?M.map(()=>null):M.map((j,z)=>{const Z=_s[z],me=typeof Z=="number"&&Z>0;if(So.value&&!me){const _e=u3(j,B,G.value);if(_e)return _e}if(eo.value&&j.type==="code_block"){const _e=(function(De){if(De.type!=="code_block")return null;const Me=Uy(De,Qu(De));return iy(Me)?"markdown":Me===ls?"pre":Me===ry.value||Me===ig?"monaco":null})(j);if(_e==="monaco"||_e==="markdown"||_e==="pre")return lq(j,{rendererKind:_e,monacoOptions:k.codeBlockMonacoOptions,showHeader:((ye=k.codeBlockProps)==null?void 0:ye.showHeader)!==!1})}var ye;return null})});function qu(M){var B;const j=_s[M];if(Number.isFinite(j)&&j>0)return j;const z=(B=jr.value[M])==null?void 0:B.height;return Number.isFinite(z)&&z>0?z:Math.max(Js.value,(function(Z){var me,ye,_e,De,Me,Ue,Be,$e,We,Ke,Ge,pt,ot;const st=Je.value[Z];if(!st||typeof st!="object")return 32;const gt=String((me=st.type)!=null?me:""),mt=Ye()||640;switch(gt){case"heading":return 44;case"paragraph":return $l(String((_e=(ye=st.raw)!=null?ye:st.content)!=null?_e:""),mt,34);case"list":{const Ut=Array.isArray(st.items)?st.items.length:1;return Math.max(48,30*Ut+12)}case"list_item":return $l(String((Me=(De=st.raw)!=null?De:st.content)!=null?Me:""),mt,34);case"blockquote":return $l(String((Be=(Ue=st.raw)!=null?Ue:st.content)!=null?Be:""),mt,56);case"table":{const Ut=Array.isArray(st.rows)?st.rows.length:Array.isArray(st.children)?st.children.length:3;return Math.max(120,38*Ut+48)}case"code_block":return $l(String((We=($e=st.code)!=null?$e:st.raw)!=null?We:""),mt,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return $l(String((Ge=(Ke=st.raw)!=null?Ke:st.content)!=null?Ge:""),mt,96);case"thematic_break":return 24;default:return $l(String((ot=(pt=st.raw)!=null?pt:st.content)!=null?ot:""),mt,40)}})(M))}function $l(M,B,j,z=22){const Z=String(M??"");if(!Z)return j;const me=Math.max(18,Math.floor(Math.max(320,B)/8)),ye=Z.split(/\r?\n/).length,_e=Math.ceil(Z.length/me),De=Math.max(1,ye,_e);return Math.max(j,Math.ceil(De*z+12))}function Va(M){const B=Number(M);return!Number.isFinite(B)||B<=0?-1:Math.round(B/32)}function xp(){var M,B;const j=Je.value.length,z=Va(K.value||lt("getFallbackHeightPrefix.clientWidth",()=>{var _e;return((_e=A.value)==null?void 0:_e.clientWidth)||0})),Z=((M=o.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(o.virtualScroll.measurementKey),me=[j,Cs.count,Math.round(Cs.total),Math.round(100*Js.value),Z,z,cn.value?1:0,m2.value,ee.value].join(":");if(!kp&&Q0===me)return X0;const ye=new Array(j+1);ye[0]=0;for(let _e=0;_e<j;_e++)ye[_e+1]=ye[_e]+(cn.value?qu(_e):(B=_s[_e])!=null?B:Js.value);return X0=ye,Q0=me,kp=!1,ye}function ly(M){var B,j;const z=Je.value.length;if(z<=0||M<=0)return 0;const Z=xp();if(M>=((B=Z[z])!=null?B:0))return z-1;let me=0,ye=z-1,_e=z-1;for(;me<=ye;){const De=me+ye>>1;((j=Z[De+1])!=null?j:0)>=M?(_e=De,ye=De-1):me=De+1}return _e}function Zi(M,B){var j,z;if(M>=B)return 0;if(cn.value)return(function(ye,_e){var De,Me;const Ue=Je.value.length,Be=lo(Math.trunc(ye),0,Ue),$e=lo(Math.trunc(_e),Be,Ue);if(Be>=$e)return 0;const We=xp();return((De=We[$e])!=null?De:0)-((Me=We[Be])!=null?Me:0)})(M,B);if(ja.value!==Je.value.length){let ye=0;for(let _e=M;_e<B;_e++)ye+=(j=_s[_e])!=null?j:Js.value;return ye}const Z=mp.value,me=gp.value;if(!Z.length||!me.length){let ye=0;for(let _e=M;_e<B;_e++)ye+=(z=_s[_e])!=null?z:Js.value;return ye}return Ru(Z,M,B)+(B-M-Ru(me,M,B))*Js.value}ze(()=>Je.value.length,M=>{xs(),M<=0?Du():(M<ja.value&&NM(M),M!==ja.value&&Ou(M))},{immediate:!0});const HM=F(()=>{if(!it.value)return Je.value.map((z,Z)=>({node:z,index:Z}));const M=Je.value.length,B=lo(ro.start,0,M),j=lo(ro.end,B,M);return Je.value.slice(B,j).map((z,Z)=>({node:z,index:B+Z}))}),Tp=F(()=>it.value?Zi(0,Math.min(ro.start,Je.value.length)):0),Ap=F(()=>{if(!it.value)return 0;const M=Je.value.length;return Zi(Math.min(ro.end,M),M)});function ay(){if(!cn.value)return 0;let M=0;const B=jr.value;for(let j=0;j<B.length;j++){if(!B[j])continue;const z=_s[j];Number.isFinite(z)&&z>0||M++}return M}function cy(){const M=Je.value.length;return{totalNodes:M,measuredCount:Cs.count,estimatedCount:ay(),averageNodeHeight:Js.value,topSpacerHeight:Tp.value,bottomSpacerHeight:Ap.value,estimatedTotalHeight:Zi(0,M),width:qr()}}function WM(){const M=Je.value,B=cy();return Mt(et({},B),{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:M.map((j,z)=>{var Z,me,ye,_e,De,Me,Ue,Be,$e;return{index:z,type:j.type,estimateKind:(me=(Z=jr.value[z])==null?void 0:Z.kind)!=null?me:null,rendererKind:(_e=(ye=jr.value[z])==null?void 0:ye.rendererKind)!=null?_e:null,estimatedHeight:(Me=(De=jr.value[z])==null?void 0:De.height)!=null?Me:null,estimatedContentHeight:(Be=(Ue=jr.value[z])==null?void 0:Ue.contentHeight)!=null?Be:null,measuredHeight:($e=_s[z])!=null?$e:null}})})}function Mp(){return o.indexKey!=null?String(o.indexKey):Do.value?`virtual-${vn()}`:"markdown-renderer"}function uy(M){const B=String(M),j=`${Mp()}-`;if(!B.startsWith(j))return null;const z=B.slice(j.length).match(/^(\d+)(?:$|-)/);if(!z)return null;const Z=Number(z[1]);return!Number.isInteger(Z)||Z<0||Z>=Je.value.length?null:Z}function vn(){var M,B,j;const z=(M=o.virtualScroll)==null?void 0:M.sessionKey;return String(z!=null&&z!==""?z:(j=(B=o.indexKey)!=null?B:k.customId)!=null?j:Rt)}function Kn(){var M;const B=(M=o.virtualScroll)==null?void 0:M.threadKey;return B==null||B===""?void 0:String(B)}function Ep(M){var B;return(M??"")===((B=Kn())!=null?B:"")}function UM(){var M;const B=(M=o.virtualScroll)==null?void 0:M.measurementKey;return B==null?"":String(B)}function jM(){var M,B;const j=u.value,z=j==="monaco"?k.codeBlockMonacoOptions:void 0,Z=k.codeBlockProps,me=j==="shiki";return[k.isDark?"dark":"light",j==="monaco"?"code-rich":j==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",no(k.codeBlockMinWidth),no(k.codeBlockMaxWidth),...me?[eh((M=Z?.themes)!=null?M:k.themes,(B=Z?.langs)!=null?B:k.langs)]:[],no(z?.fontSize),no(z?.lineHeight),no(z?.fontFamily),no(z?.tabSize),no(z?.MAX_HEIGHT),no(z?.wordWrap),no(z?.wrappingIndent),no(z?.padding),no(Z?.showHeader),no(Z?.showCopyButton),no(Z?.showExpandButton),no(Z?.showPreviewButton),no(Z?.showCollapseButton),no(Z?.showFontSizeButtons)].join("\0")}function ki(){return[UM(),jM()].join("\0")}function qr(){return Ye()}const zu=F(()=>Va(qr())),ss=F(()=>[ki(),zu.value].join("\0")),qM=F(()=>{var M;return Do.value?["virtual",(M=Kn())!=null?M:"",vn(),ss.value].join("\0"):o.indexKey});function Nl(){Y0.value+=1}function Ip(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=Je.value.length||M.sessionKey!==vn()||M.threadKey!==Kn()||M.layoutEpochKey!==ss.value)}function dy(M){const B=String(M),j=ti.get(B);return j?Ip(j)?j.index:null:uy(B)}function fy(M="async-node"){(ns.size||ti.size)&&(ns.clear(),ti.clear(),Nl(),un(M))}const Ll=Bt(w1,null),$p={reportHeight(M,B){if(!At.value)return;const j=dy(M);if(j==null)return;const z=ei.get(j);if(!z)return;const Z=Number(B),me=j0(j,z);U0(j,Number.isFinite(Z)&&Z>0?Math.max(Z,me||0):me)},markPending(M){if(!At.value)return;const B=uy(M);B!=null&&(function(j,z){var Z;const me=ti.get(j);if(me&&Ip(me))return ns.set(j,Math.max(0,(Z=ns.get(j))!=null?Z:0)+1),Nl(),void un("async-node");ns.set(j,1),ti.set(j,(function(ye){return{index:ye,sessionKey:vn(),threadKey:Kn(),layoutEpochKey:ss.value}})(z)),Nl(),un("async-node")})(String(M),B)},markSettled(M){if(!At.value)return;const B=String(M),j=dy(M);(j!=null||(function(z){return ns.has(String(z))})(B))&&(function(z){var Z;const me=(Z=ns.get(z))!=null?Z:0;return!(me<=0||(me<=1?(ns.delete(z),ti.delete(z)):ns.set(z,me-1),Nl(),me===1&&un("async-node"),0))})(B)&&j!=null&&bi()}};function zM(){let M=0;for(const B of ei.values())M+=lt("getVisibleDomHeight.offsetHeight",()=>{var j;return(j=B?.offsetHeight)!=null?j:0});return Math.ceil(Math.max(0,M))}yn(w1,{reportHeight(M,B){$p.reportHeight(M,B),Ll?.reportHeight(M,B)},markPending(M){$p.markPending(M),Ll?.markPending(M)},markSettled(M){$p.markSettled(M),Ll?.markSettled(M)}});let Np,Lp=null,Pl=null;function Vu(M){return M!==!1&&M!=null&&M!==""}function hy(){return it.value?(function(){if(!it.value)return!0;const M=Je.value.length,B=lo(ro.start,0,M),j=lo(ro.end,B,M);if(B>=j)return!0;for(let z=B;z<j;z++)if(!Ee.has(z)||em(z)&&!ei.has(z))return!1;return!0})():Vn.value>=Fu.value}function Pp(){return H.value===!0&&!Y.value&&yp.value===0&&Xi.size===0&&yi.size===0&&os==null&&hy()}function py(){var M,B;if(((M=o.virtualScroll)==null?void 0:M.settleMode)!=="manual"||Lp===vn()&&Np===Kn())return!0;const j=(B=o.virtualScroll)==null?void 0:B.settledToken;return!!Vu(j)&&Pl===rc(j)}function Op(){return Pp()&&py()}function VM(M,B){return B.totalNodes<=0?M==="final"?"final":"estimate":B.measuredCount>=B.totalNodes?M==="final"?"final":"measured":B.measuredCount>0||B.estimatedCount>0?"mixed":"estimate"}function zr(M="manual",B){const j=cy(),z=(function(Z){return Z||(H.value!==!0?Je.value.length>0?"streaming":"estimating":!hy()||yi.size>0||os!=null?"measuring":Op()?"settled":"settling")})(B);return{sessionKey:vn(),threadKey:Kn(),phase:z,nodeCount:j.totalNodes,liveRange:{start:ro.start,end:ro.end},renderedCount:Vn.value,measuredCount:j.measuredCount,estimatedCount:j.estimatedCount,averageNodeHeight:j.averageNodeHeight,topSpacerHeight:j.topSpacerHeight,bottomSpacerHeight:j.bottomSpacerHeight,visibleDomHeight:zM(),totalHeight:my(),width:j.width,final:H.value===!0,stable:Op(),confidence:VM(z,j),reason:M}}function Ka(){const M=hn.value||Ce(),B=A.value;if(!M||!B)return null;const j=M.ownerDocument||B.ownerDocument||document,z=M===j.documentElement||M===j.body||M===j.scrollingElement,Z=lt("getScrollBox.scrollTop",()=>te(M,j,z)),me=lt("getScrollBox.scrollHeight",()=>{var _e,De,Me,Ue,Be;return z?Math.max((De=(_e=j.documentElement)==null?void 0:_e.scrollHeight)!=null?De:0,(Ue=(Me=j.body)==null?void 0:Me.scrollHeight)!=null?Ue:0,(Be=M.scrollHeight)!=null?Be:0):M.scrollHeight}),ye=lt("getScrollBox.clientHeight",()=>{var _e;return z?((_e=j.documentElement)==null?void 0:_e.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:j,isViewportRoot:z,scrollTop:Z,scrollHeight:me,clientHeight:ye}}function my(){const M=Je.value.length,B=Math.max(0,Zi(0,M)),j=lt("getRendererLogicalHeight.offsetHeight",()=>{var Z,me;return(me=(Z=A.value)==null?void 0:Z.offsetHeight)!=null?me:0}),z=Math.max(0,j>0?j:lt("getRendererLogicalHeight.scrollHeight",()=>{var Z,me;return(me=(Z=A.value)==null?void 0:Z.scrollHeight)!=null?me:0}));return M<=0?Math.ceil(j):it.value?B>0?Math.max(1,Math.ceil(B),(function(){let Z=Tp.value+Ap.value;for(const me of Ee.values())me&&(Z+=Math.max(0,lt("getVirtualizedDomLogicalHeight.offsetHeight",()=>me.offsetHeight||0)));return Math.ceil(Math.max(0,Z))})(),(function(Z,me){return Z<=0||me<=0?0:me<=Z+Math.max(512,.05*Z)?Math.ceil(me):0})(B,z)):Math.max(1,Math.ceil(z)):At.value?B>0||Cs.count>0||ay()>0?(mi.value&&Vn.value,Math.max(1,Math.ceil(z),Math.ceil(B))):Math.ceil(z):Math.max(1,Math.ceil(z),Math.ceil(B))}function gy(M){const B=A.value;if(!B)return null;const j=lt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>B.getBoundingClientRect());return(function(Z){return Z.isViewportRoot?Z.clientHeight:lt("getViewportBottomInRoot.getBoundingClientRect",()=>Z.root.getBoundingClientRect().bottom)})(M)-j.bottom}function KM(M={}){const B=M.requireViewport!==!1,j=(function(me=64){const ye=Ka(),_e=A.value;if(!ye||!_e)return!1;const De=(function(Ue){if(Ue.isViewportRoot)return{top:0,bottom:Ue.clientHeight};const Be=lt("getVirtualViewportRect.getBoundingClientRect",()=>Ue.root.getBoundingClientRect());return{top:Be.top,bottom:Be.bottom}})(ye),Me=lt("isRendererNearVirtualViewport.getBoundingClientRect",()=>_e.getBoundingClientRect());return Me.bottom>=De.top-me&&Me.top<=De.bottom+me})();if(B&&!j)return null;const z=(function(){const me=Ka(),ye=A.value;if(!me||!ye||Math.max(0,me.scrollHeight-me.scrollTop-me.clientHeight)>64)return null;const _e=gy(me);return _e==null?null:_e>=-8&&_e<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,_e)}:null})();if(z)return{anchor:z,captured:!0};const Z=F0();if(Z)return{anchor:{type:"node",nodeIndex:Z.nodeIndex,offsetWithinNodePx:Z.offsetWithinNodePx},captured:j};if(M.allowFallback===!0){const me=(function(){const ye=Je.value.length;return ye<=0?null:{type:"node",nodeIndex:lo(Ss.value,0,Math.max(0,ye-1)),offsetWithinNodePx:0}})();return me?{anchor:me,captured:!1}:null}return null}function Rp(M){let B=2166136261;for(let j=0;j<M.length;j++)B^=M.charCodeAt(j),B=Math.imul(B,16777619);return(B>>>0).toString(36)}function GM(M,B){let j=M;for(let z=0;z<B.length;z++)j^=B.charCodeAt(z),j=Math.imul(j,16777619);return j^=31,j=Math.imul(j,16777619),j}const YM=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Ku(M,B=new WeakSet,j=0){if(M==null||typeof M=="number"||typeof M=="boolean")return String(M);if(typeof M=="string")return`s:${(function(z){const Z=z.length>8192?`${z.slice(0,8192)}...${z.length}`:z;return`${z.length}:${Rp(Z)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(B.has(M))return"cycle";if(j>=6)return"max-depth";B.add(M);try{if(Array.isArray(M)){if(M.length<=160){const Me=[];for(let Ue=0;Ue<M.length;Ue++)Me.push(Ku(M[Ue],B,j+1));return`a:${M.length}:${Me.join(",")}`}const me=[],ye=[],_e=Math.max(0,M.length-32);let De=2166136261;for(let Me=0;Me<M.length;Me++){const Ue=Ku(M[Me],B,j+1);De=GM(De,Ue),Me<32&&me.push(Ue),Me>=_e&&ye.push(Ue)}return[`a:${M.length}`,`h=${me.join(",")}`,`t=${ye.join(",")}`,`all=${(De>>>0).toString(36)}`].join(":")}const z=M,Z=Object.keys(z).filter(me=>{const ye=z[me];return me!=="parent"&&me!=="el"&&me!=="component"&&(ye==null||typeof ye=="string"||typeof ye=="number"||typeof ye=="boolean"||YM.has(me))}).sort();return`o:${Z.length}:${Z.map(me=>`${me}=${Ku(z[me],B,j+1)}`).join(";")}`}finally{B.delete(M)}}let vy=-1,Dp="";function Ga(M){const B=Je.value[M];return B?Rp(Ku(B)):""}function Bp(){const M=ee.value;if(vy===M)return Dp;let B=2166136261;for(let j=0;j<Je.value.length;j++){const z=Ga(j);for(let Z=0;Z<z.length;Z++)B^=z.charCodeAt(Z),B=Math.imul(B,16777619)}return Dp=(B>>>0).toString(36),vy=M,Dp}function Ol(M,B={}){var j;const z=B.includeHeightCache===!0,Z=(j=B.includeContentHash)!=null?j:z,me=z?(function(_e){const De=(function(){var Ge,pt;const ot=Number((pt=(Ge=o.virtualScroll)==null?void 0:Ge.heightCacheLimit)!=null?pt:5e3);return!Number.isFinite(ot)||ot<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(ot))})();if(!Number.isFinite(De)||_e.length<=De)return _e;const Me=new Map,Ue=Ge=>{!Ge||Me.size>=De||Me.set(Ge.index,Ge)},Be=Je.value.length,$e=lo(ro.start-2*qa.value,0,Be),We=lo(ro.end+2*qa.value,$e,Be);for(const Ge of _e)Ge.index>=$e&&Ge.index<We&&Ue(Ge);const Ke=Math.max(1,Math.ceil(_e.length/De));for(let Ge=0;Ge<_e.length&&Me.size<De;Ge+=Ke)Ue(_e[Ge]);for(let Ge=_e.length-1;Ge>=0&&Me.size<De;Ge-=Ke)Ue(_e[Ge]);return Array.from(Me.values()).sort((Ge,pt)=>Ge.index-pt.index).slice(0,De)})(OM().map(_e=>{var De;const Me=Je.value[_e.index];return Me?Mt(et({},_e),{nodeType:String((De=Me.type)!=null?De:""),signature:Ga(_e.index)}):null}).filter(_e=>!!_e)):[],ye=KM({allowFallback:B.allowAnchorFallback===!0,requireViewport:B.requireViewport});return ye||me.length||B.includeEmptyState===!0?Mt(et({sessionKey:M.sessionKey,threadKey:M.threadKey},ye?{anchor:ye.anchor,anchorCaptured:ye.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:Z?Bp():void 0,measurementKey:ki()||void 0,heightCache:me.length?me:void 0}):null}function Fp(M){var B,j;const z=Ka();if(!z)return;const Z=(function(_e){const De=A.value;if(!De)return null;const Me=pe(De,_e.root),Ue=Je.value.length,Be=lt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>De.offsetHeight||0),$e=Math.max(0,Be>0?Be:Ue>0?lt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>De.scrollHeight||0):0),We=my();return Me+Math.max($e,We)})(z);if(Z==null)return;const me=Math.max(0,M.distanceFromBottomPx),ye=Math.max(0,Z-z.clientHeight-me);(function(_e){vi=Ja()+120,Us=_e})(ye),z.isViewportRoot?(j=(B=z.doc.defaultView)==null?void 0:B.scrollTo)==null||j.call(B,0,ye):k2(z.root,z.doc,ye,{isReverseFlexScrollRoot:q,getNormalizedScrollTop:te})}const Hp=[];function yy(){if(le)for(pn!=null&&(Tt?.(pn),pn=null);Hp.length;){const M=Hp.pop();M!=null&&window.clearTimeout(M)}}function Rl(M){const B=!!Pt.value;Pt.value=null,vi=0,Us=null,yy(),B&&M&&un(M)}function Dl(){if(!Pt.value||!le||pn!=null)return;const M=()=>{pn=null;const B=Pt.value;B&&Fp(B)};pn=xt?xt(M):null,pn==null&&M()}function ky(M,B={}){const j=Je.value.length;return j<=0?[]:M.filter(z=>!(!Number.isInteger(z.index)||z.index<0||z.index>=j)&&!(!Number.isFinite(z.height)||z.height<=0)&&!(B.requireSignature&&!z.signature)&&!(B.requireCompatibilityMetadata&&!z.nodeType&&!z.signature)&&(function(Z){var me;const ye=Je.value[Z.index];return!(!ye||Z.nodeType&&Z.nodeType!==String((me=ye.type)!=null?me:"")||Z.signature&&Z.signature!==Ga(Z.index))})(z))}function by(M){const B=Va(qr()),j=Va(M);return B!==-1&&j!==-1&&B===j}function Wp(M){var B;const j=Number(M?.width);if(Number.isFinite(j)&&j>0)return j;const z=Number((B=M?.metrics)==null?void 0:B.width);return Number.isFinite(z)&&z>0?z:null}function wy(M){var B;return M.sessionKey===vn()&&!!Ep(M.threadKey)&&((B=M.measurementKey)!=null?B:"")===ki()&&!!by(Wp(M))&&!!(function(j){const z=j.heightCache;return!!z?.length&&(_y(j)?z.some(Z=>!!(Z.nodeType||Z.signature)):z.some(Z=>!!Z.signature))})(M)}function _y(M){return!!(M.contentHash&&M.contentHash===Bp())}function XM(M){return!_y(M)}let Vr=null,Kr=null,Gu=null,Ya=null,Xa=null;function Up(M){var B;const j=M.map(Z=>{var me,ye;return[Z.index,Math.round(10*Z.height),(me=Z.nodeType)!=null?me:"",(ye=Z.signature)!=null?ye:""].join("")}).join(""),z=Va(qr());return[(B=Kn())!=null?B:"",vn(),ki(),Je.value.length,z,M.length,Rp(j)].join(":")}function Cy(M=(B=>(B=o.virtualScroll)==null?void 0:B.heightCache)()){if(!At.value||!M?.length||Je.value.length<=0||!by((B=o.virtualScroll)==null?void 0:B.heightCacheWidth))return!1;var B;const j=ky(M,{requireSignature:!0});if(!j.length)return!1;const z=Up(j);return z===Vr?(Kr="standalone",!0):(q0(j,{mode:"merge"}),xs(),Vr=z,Kr="standalone",tc(),un("restore"),!0)}function jp(M,B={}){var j,z,Z;if(!At.value||!M||M.sessionKey!==vn()||!Ep(M.threadKey)||Je.value.length<=0)return!1;const me=!!((j=M.heightCache)!=null&&j.length)&&!Yu(),ye=!M.anchor||M.anchorCaptured===!1&&B.allowUncapturedAnchor!==!0?null:M.anchor,_e=B.restoreAnchor===!0&&!!ye&&!Yu()&&Number(Wp(M))>0;let De=!1;if((z=M.heightCache)!=null&&z.length&&wy(M)){const Ue=ky(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:XM(M)});Ue.length&&(q0(Ue,{mode:"merge"}),xs(),Vr=Up(Ue),Kr="restore",tc(),De=!0)}if(me||_e)return!1;if(!B.restoreAnchor||!ye)return De&&un("restore"),!0;const Me=(function(Ue,Be){var $e;const We=Ue.anchor,Ke=We?We.type==="bottom"?`bottom:${Math.round(We.distanceFromBottomPx)}`:`node:${We.nodeIndex}:${Math.round(We.offsetWithinNodePx)}`:"none";return[($e=Kn())!=null?$e:"",vn(),ki(),zu.value,Be,Ke].join(":")})(M,(Z=B.restoreToken)!=null?Z:"imperative");return Gu===Me?(De&&un("restore"),!0):(Gu=Me,(function(Ue){const Be=()=>{if(Ue.type==="node")return Rl(),void H0({nodeIndex:Ue.nodeIndex,offsetWithinNodePx:Ue.offsetWithinNodePx});if(Pu(),ws.value=null,Pt.value=Ue,yy(),Fp(Ue),le)for(const $e of[0,120,280,480])Hp.push(window.setTimeout(()=>{const We=Pt.value;We&&Fp(We)},$e))};(function($e){if(!it.value)return!1;const We=Je.value.length;return!(We<=0||(Ss.value=$e.type==="node"?lo($e.nodeIndex,0,We-1):We-1,Wr(),0))})(Ue)?ht(Be):Be()})(ye),un("restore"),!0)}function Yu(){const M=qr();return Number.isFinite(M)&&M>0}function Sy(M){var B;return M.sessionKey===vn()&&!!Ep(M.threadKey)&&(Je.value.length<=0||!(!((B=M.heightCache)!=null&&B.length)||Yu())||!(!(M.anchor&&Number(Wp(M))>0)||Yu()))}function qp(){Lt.clear();for(const M of Object.keys(_s)){const B=Number(M);Number.isInteger(B)&&B>=0&&B<Je.value.length&&W0(B)}}function Qa(){os!=null&&(Tt?.(os),os=null),tm()}function xy(){return!le||gn?Promise.resolve():new Promise(M=>{let B=!1,j=null;const z=()=>{B||(B=!0,j!=null&&window.clearTimeout(j),M())};if(xt)return xt(z),void(j=window.setTimeout(z,50));j=window.setTimeout(z,0)})}function zp(M,B=Kn(),j=ss.value){return vn()===M&&Kn()===B&&ss.value===j}function Vp(){return Cn(this,arguments,function*(M={}){var B,j,z,Z,me;const ye=vn(),_e=Kn(),De=ss.value,Me=(B=M.frames)!=null?B:2,Ue=(j=M.timeoutMs)!=null?j:120,Be=(z=M.reason)!=null?z:"manual",$e=M.expectedSettledTokenKey,We=M.flushPendingTimers===!0,Ke=zr(Be),Ge=()=>Mt(et({},Ke),{phase:Ke.final?"settling":Ke.phase,stable:!1,confidence:Ke.confidence==="final"?"mixed":Ke.confidence,reason:Be}),pt=()=>zp(ye,_e,De)&&($e==null||ec()===$e);for(let mt=0;mt<Me;mt++){if(yield ht(),!pt()||(yield xy(),!pt()))return Ge();bi(),Qa()}if(yield(function(mt){return!le||mt<=0?Promise.resolve():new Promise(Ut=>window.setTimeout(Ut,mt))})(Ue),!pt()||(We&&J0(),bi(),Qa(),!pt()))return Ge();const ot=Pp();ot&&(Lp=ye,Np=_e,((Z=o.virtualScroll)==null?void 0:Z.settleMode)==="manual"&&$e!=null&&Vu((me=o.virtualScroll)==null?void 0:me.settledToken)&&ec()===$e&&(Pl=rc(o.virtualScroll.settledToken)));const st=pt()&&ot&&py(),gt=zr(Be,st?"final":void 0);return Qp(gt,!0),gt})}let Kp="content",Gr=null,Yr=null,Gp=0,Za=null,Bl=null,Yp=null,Xp=null;function Ja(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Ty(M){var B,j;const z=Za;if(!z)return!0;const Z=(j=(B=o.virtualScroll)==null?void 0:B.heightDiffThresholdPx)!=null?j:1;return Math.abs(M.totalHeight-z.totalHeight)>Z||M.sessionKey!==z.sessionKey||M.phase!==z.phase||M.stable!==z.stable||M.final!==z.final||M.threadKey!==z.threadKey||M.nodeCount!==z.nodeCount||M.measuredCount!==z.measuredCount||M.width!==z.width}function no(M){if(M==null)return"";if(typeof M=="string"||typeof M=="number"||typeof M=="boolean")return String(M);try{return JSON.stringify(M)}catch{return String(M)}}function ec(M=(B=>(B=o.virtualScroll)==null?void 0:B.settledToken)()){return no(M)}function Ay(M,B){var j,z;return[M,B.sessionKey,(j=B.threadKey)!=null?j:"",ki(),Bp(),no((z=o.virtualScroll)==null?void 0:z.settledToken),Math.round(B.totalHeight),Math.round(B.width)].join("\0")}function tc(){Yp=null,Xp=null,Bl=null}function QM(M){const B=M.heightCache;return B?.length?Up(B):""}function nc(M){var B,j,z;const Z=M.metrics,me=M.anchor?(ye=M.anchor).type==="bottom"?`bottom:${Math.round(ye.distanceFromBottomPx)}`:`node:${ye.nodeIndex}:${Math.round(ye.offsetWithinNodePx)}`:"none";var ye;return[M.sessionKey,(B=M.threadKey)!=null?B:"",(j=M.measurementKey)!=null?j:ki(),(z=M.contentHash)!=null?z:"",QM(M),me,M.anchorCaptured?1:0,Z.liveRange.start,Z.liveRange.end,Z.renderedCount,Z.nodeCount,Math.round(Z.totalHeight),Math.round(Z.width),Z.phase,Z.stable?1:0].join("\0")}function Qp(M,B=!1){if(!At.value||(function(ye=!1){return!ye&&Do.value&&!Co.value})(B))return;const j=B||Ty(M),z=(function(ye,_e=!1){return _e||ye.stable||ye.phase==="final"?{state:Ol(ye,{includeHeightCache:!0})}:{state:Ol(ye)}})(M,B),Z=z.state,me=!!(Z&&(j||(function(ye,_e=!1){return!!_e||nc(ye)!==Bl})(Z,B)));if(j&&(T(M),Za=M,Gp=Ja()),Z&&me&&(E(Z),Z.anchor&&O(Z.anchor),Bl=nc(Z)),M.stable){const ye=Ay("settled",M);if(ye!==Yp){Yp=ye;const _e=Ol(M,{includeHeightCache:!0});_e&&(E(_e),Bl=nc(_e)),(function(De){s("render-settled",De)})(M)}}if(M.phase==="final"){const ye=Ay("final",M);if(ye!==Xp){Xp=ye;const _e=Ol(M,{includeHeightCache:!0});_e&&(E(_e),Bl=nc(_e)),(function(De){s("render-final",De)})(M)}}}function Zp(){Gr!=null&&(Tt?.(Gr),Gr=null),Yr!=null&&le&&(window.clearTimeout(Yr),Yr=null)}function My(){Gr=null,Yr=null,(function(M){if(yi.size>0||os!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Kp)&&(bi(),Qa()),Qp(zr(Kp))}function un(M){var B,j;if(!At.value||(Kp=M,Gr!=null||Yr!=null))return;const z=Math.max(0,(j=(B=o.virtualScroll)==null?void 0:B.emitIntervalMs)!=null?j:32),Z=Math.max(0,z-(Ja()-Gp)),me=()=>{Yr=null,Gr=xt?xt(My):null,Gr==null&&My()};le&&Z>0?Yr=window.setTimeout(me,Z):me()}function Jp(M){var B;if(M<=0)return 0;const j=Je.value;if(cn.value)return ly(M);if(ja.value===j.length&&mp.value.length&&gp.value.length){const Z=Js.value,me=mp.value,ye=gp.value,_e=Be=>Be<=0?0:Ru(me,0,Be)+(Be-Ru(ye,0,Be))*Z;let De=0,Me=j.length-1,Ue=j.length-1;for(;De<=Me;){const Be=De+Me>>1;_e(Be+1)>=M?(Ue=Be,Me=Be-1):De=Be+1}return Ue}let z=M;for(let Z=0;Z<j.length;Z++){const me=(B=_s[Z])!=null?B:Js.value;if(z<=me)return Z;z-=me}return Math.max(0,j.length-1)}function Ey(){to.value+=1}function em(M){return!(mi.value&&M>=Vn.value)&&(!Gi.value||M<ts.value||wp.value.has(M))}function Fl(M){const B=Uu.get(M);B&&(B(),Uu.delete(M));const j=Il.get(M);j&&(j.destroy(),Il.delete(M)),ju(M)}function Iy(M,B){let j=!1;if(B){const me=Ee.get(M);Ee.set(M,B),me!==B&&(j=!0)}else Ee.delete(M)&&(j=!0);if(j&&Ey(),B||ju(M),!z0.value||!Fe||!it.value&&Gi.value&&!V.value&&Il.size>=640&&(V.value||(V.value=!0,_p()),!z0.value||!Fe))return Fl(M),void(B&&Qi(M,!0));if(M<ts.value&&!it.value||wp.value.has(M))return Fl(M),void Qi(M,!0);if(!B)return void Fl(M);Fl(M);const z=Fe(B,{rootMargin:"400px"});if(!z)return;Il.set(M,z),Qi(M,z.isVisible.value),Gi.value&&(function(me){if(!le||!Gi.value)return;ju(me);const ye=me%17*23,_e=window.setTimeout(()=>{if(ey.delete(me),!Gi.value||wp.value.has(me))return;const De=Ee.get(me);if(!De)return;const Me=Ce(De),Ue=De.ownerDocument||document,Be=Ue.defaultView||window,$e=!Me||Me===Ue.documentElement||Me===Ue.body,We=!$e&&Me?lt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Me.getBoundingClientRect()):null,Ke=$e?0:We.top,Ge=$e?lt("nodeVisibilityFallback.clientHeight",()=>{var ot,st;return(st=(ot=Be.innerHeight)!=null?ot:Me?.clientHeight)!=null?st:0}):We.bottom,pt=lt("nodeVisibilityFallback.node.getBoundingClientRect",()=>De.getBoundingClientRect());pt.bottom>=Ke-500&&pt.top<=Ge+500&&Qi(me,!0)},1800+ye);ey.set(me,_e)})(M);let Z=null;Z=ze(()=>z.isVisible.value,me=>{if(me){ju(M),Qi(M,!0),Z?.(),Uu.delete(M),Il.get(M)===z&&Il.delete(M);try{z.destroy()}catch{}}},{immediate:!0}),Uu.set(M,Z),it.value&&ni()}function tm(){os=null;for(const[M,B]of yi)yi.delete(M),ei.get(M)===B.el&&Ur.get(M)===B.version&&U0(M,B.height,{allowShrink:B.allowShrink})}function Hl(){os!=null&&(Tt?.(os),os=null),yi.clear()}function Xu(M,B){(function(j,z,Z){var me;if(!Number.isFinite(Z)||Z<=0||ei.get(j)!==z)return;const ye=Ur.get(j);if(ye==null)return;const _e=Je.value[j],De=Y.value&&H.value!==!0&&!((me=o.nodes)!=null&&me.length)&&j>=Je.value.length-2,Me=!(_e?.loading===!0||De),Ue=yi.get(j),Be=Ue?Ue.allowShrink&&Me:Me,$e=Ue&&!Be?Math.max(Ue.height,Z):Z;yi.set(j,{height:$e,allowShrink:Be,version:ye,el:z}),os==null&&(os=xt?xt(tm):null,os==null&&tm())})(M,B,j0(M,B))}function bi(){for(const[M,B]of ei)B&&Xu(M,B)}function $y(){he?.disconnect(),he=null,Ae.clear()}function nm(){for(;Bu.length;)Wu(Bu.pop())}ze(Co,M=>{M&&un("content")},{flush:"post"}),t({getVirtualMetrics:zr,captureVirtualState:function(M={}){var B;return Ol(zr("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(B=M.includeEmptyState)==null||B})},restoreVirtualState:function(M,B={}){const j=B.restoreAnchor===!0,z=B.restoreToken==null?"imperative":String(B.restoreToken);Ya=M,Xa={restoreAnchor:j,restoreToken:z,allowUncapturedAnchor:B.allowUncapturedAnchor===!0},!jp(M,{restoreAnchor:j,restoreToken:z,allowUncapturedAnchor:B.allowUncapturedAnchor===!0})&&Sy(M)||(Ya=null,Xa=null)},forceMeasure:function(M="manual"){return Cn(this,null,function*(){yield ht(),yield xy(),bi(),Qa(),yield ht();const B=zr(M);return Qp(B,!0),B})},settle:Vp,scrollToNode:function(M,B="start"){Rl(),Pu();const j=Je.value.length;if(j<=0)return;const z=lo(M,0,j-1),Z=()=>{var me;const ye=pp({nodeIndex:z,offsetWithinNodePx:0}),_e=qu(z),De=Ka(),Me=(me=De?.clientHeight)!=null?me:0,Ue=Ml();let Be=ye;if(B==="center")Be=ye-Me/2+_e/2;else if(B==="end")Be=ye-Me+_e;else if(B==="nearest"&&Ue!=null){if(ye>=Ue&&ye+_e<=Ue+Me)return;Be=ye<Ue?ye:ye-Me+_e}El(Math.max(0,Be)),ni({immediate:!0}),it.value&&(Ss.value=z,Wr())};if(it.value)return Ss.value=z,Wr(),void ht(Z);Z()}}),ze(()=>Ie.value,M=>{if(!M){$y();for(const B of Yi.values())for(const j of B)Wu(j);Yi.clear(),Ur.clear(),nm(),Hl()}},{immediate:!0}),ze(H,M=>{M&&(function(){if(le&&H.value&&ei.size){nm();for(const B of[80,240,640]){const j=Z0(B,()=>{for(const[z,Z]of ei)Z&&Xu(z,Z)},"final");j!=null&&Bu.push(j)}}})(),un(M?"final":"content")}),ze([()=>Je.value.length,()=>Vn.value],()=>{Pt.value&&Dl(),un("content")},{flush:"post",immediate:!0}),ze([()=>ro.start,()=>ro.end],()=>{un("batch")},{flush:"post"});const{cleanupBatchScheduler:ZM}=(function(M){const{props:B,isClient:j,isTestEnv:z,parsedNodesIdentity:Z,parsedNodeCount:me,desiredRenderedCount:ye,datasetKey:_e,batchingEnabled:De,incrementalRenderingActive:Me,resolvedBatchSize:Ue,resolvedInitialBatch:Be,renderedCount:$e,adaptiveBatchSize:We,previousRenderContext:Ke,previousBatchConfig:Ge,requestFrame:pt,cancelFrame:ot,hasIdleCallback:st,cleanupNodeVisibility:gt,onDatasetKeyChanged:mt,onDatasetChanged:Ut}=M;let kt=null,It=null,Et=!1,Xt=null,is=null,xo=0,js=!1,Ji=!1;const er=new Set,Qr=new Set;function Yy(){if(j){kt!=null&&(ot?.(kt),kt=null),It!=null&&(window.clearTimeout(It),It=null),is!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(is),is=null),xo+=1;for(const mo of er)ot?.(mo);er.clear();for(const mo of Qr)window.clearTimeout(mo);Qr.clear(),Et=!1,Xt=null,js=!1,Ji=!1}}function od(){return typeof performance<"u"?performance.now():Date.now()}function Xy(mo){(function(wi){var tr;if(!Me.value)return;const _i=Math.max(2,(tr=B.renderBatchBudgetMs)!=null?tr:6),Ci=Math.max(1,Ue.value||1),qs=Math.max(1,Math.floor(Ci/4));wi>1.2*_i?We.value=Math.max(qs,Math.floor(.7*We.value)):wi<.5*_i&&We.value<Ci&&(We.value=Math.min(Ci,Math.ceil(1.2*We.value)))})(mo),js=!1;const Ho=Ji||$e.value<ye.value;Ji=!1,Ho&&Jy()}function Qy(mo,Ho={}){var wi,tr;if(!Me.value)return;const _i=ye.value;if($e.value>=_i)return;const Ci=Math.max(1,mo),qs=()=>{const jl=od();let ql=0;kt=null,It=null,is=null,Et=!1;const zl=Xt??Ci;Xt=null;const um=od();$e.value=Math.min(_i,$e.value+zl),gt($e.value),ql=od()-um,(function(dm,ek){if(!j)return void Xy(ek);js=!0;const tk=++xo;ht().then(()=>{var nk;if(tk!==xo)return;const yE=od(),kE=Math.max(ek,yE-dm),ok=()=>{tk===xo&&Xy(kE)};if(pt){let ik=!1,Si=null;const rk=()=>{ik||(ik=!0,ok())},sd=pt(()=>{er.delete(sd),Si!=null&&(window.clearTimeout(Si),Qr.delete(Si),Si=null),rk()});return er.add(sd),Si=window.setTimeout(()=>{Si!=null&&Qr.delete(Si),Si=null,ot?.(sd),er.delete(sd),rk()},Math.max(32,(nk=B.renderBatchIdleTimeoutMs)!=null?nk:120)),void Qr.add(Si)}const sk=window.setTimeout(()=>{Qr.delete(sk),ok()},0);Qr.add(sk)})})(jl,ql)};if(!j||Ho.immediate)return void qs();const nr=Math.max(0,(wi=B.renderBatchDelay)!=null?wi:16);if(Xt=Xt!=null?Math.max(Xt,Ci):Ci,!Et){if(Et=!0,!z&&st&&window.requestIdleCallback){const jl=Math.max(0,(tr=B.renderBatchIdleTimeoutMs)!=null?tr:120);return void(is=window.requestIdleCallback(()=>qs(),{timeout:jl}))}pt&&!z?kt=pt(()=>{nr!==0?It=window.setTimeout(()=>qs(),nr):qs()}):It=window.setTimeout(()=>qs(),nr)}}function Zy(mo,Ho={}){js?Ji=!0:mo==null?Jy():Qy(mo,Ho)}function Jy(){Me.value&&Qy(De.value?Math.max(1,Math.round(We.value)):Math.max(1,Ue.value))}return ze([Z,me,_e,Me,Ue,Be,()=>B.renderBatchDelay],()=>{var mo;const Ho=me.value,wi=Ke.value,tr=_e.value,_i=!Object.is(tr,wi.key),Ci=Ho!==wi.total,qs=_i||Ci;Ke.value={key:tr,total:Ho};const nr=Ge.value,jl=(mo=B.renderBatchDelay)!=null?mo:16,ql=nr.batchSize!==Ue.value||nr.initial!==Be.value||nr.delay!==jl||nr.enabled!==Me.value;Ge.value={batchSize:Ue.value,initial:Be.value,delay:jl,enabled:Me.value},_i&&mt(Ho),(qs||ql||!Me.value)&&Yy(),(qs||ql)&&(We.value=Math.max(1,Ue.value||1)),qs&&Ut();const zl=ye.value;if(!Ho)return $e.value=0,void gt(0);if(!Me.value)return $e.value=zl,void gt($e.value);const um=_i||wi.total===0;$e.value=um||ql?Math.min(zl,Be.value):Math.min($e.value,zl);const dm=Math.max(1,Be.value||Ue.value||Ho);$e.value<zl?Zy(dm,{immediate:!j}):gt($e.value)},{immediate:!0}),ze(ye,(mo,Ho)=>{Me.value&&(typeof Ho=="number"&&mo<=Ho||mo>$e.value&&Zy())}),{cleanupBatchScheduler:Yy}})({props:k,isClient:le,isTestEnv:gn,parsedNodesIdentity:es,parsedNodeCount:Ro,desiredRenderedCount:Fu,datasetKey:qM,batchingEnabled:Ki,incrementalRenderingActive:mi,resolvedBatchSize:bs,resolvedInitialBatch:ts,renderedCount:Vn,adaptiveBatchSize:de,previousRenderContext:gi,previousBatchConfig:Te,requestFrame:xt,cancelFrame:Tt,hasIdleCallback:mn,cleanupNodeVisibility:BM,onDatasetKeyChanged:M=>{Hl(),Du(),xs(),tc(),M>0&&Ou(M)},onDatasetChanged:()=>{it.value&&ni({immediate:!0})}});ze([V0,it,()=>A.value,()=>X()],([M,B])=>{if(!M)return ty(),void bp();FM(),B?ni({immediate:!0}):bp()},{flush:"post",immediate:!0}),ze([()=>Je.value.length,()=>it.value],M=>Cn(null,[M],function*([B,j]){j&&B&&le&&(yield ht(),ni({immediate:!0}))}),{flush:"post"}),ze(cn,M=>{M&&(function(){var B;if(po.value&&Pn.value&&an.value&&((B=wn.value)!=null&&B[1]))return;const j=kr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),z=kr({type:"list_item",children:[j],raw:"- Probe paragraph text"}),Z=kr({type:"list",ordered:!1,items:[z],raw:"- Probe paragraph text"});po.value=j,Pn.value=z,an.value=Z;const me={1:null,2:null,3:null,4:null,5:null,6:null};for(let ye=1;ye<=6;ye++)me[ye]=kr({type:"heading",level:ye,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ye)} Probe heading`});wn.value=me})()},{immediate:!0}),ze([()=>A.value,cn],()=>{if(!cn.value)return Sp(),void(K.value=0);oy(),Sp(),cn.value&&A.value&&typeof ResizeObserver<"u"&&(za=new ResizeObserver(()=>{oy(),ws.value&&Ua(),Pt.value&&Dl(),un("resize")}),za.observe(A.value))},{immediate:!0}),ze([cn,qe,ss],()=>Cn(null,null,function*(){if(!cn.value)return G.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void xs();yield ht(),(function(){if(!cn.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 xs();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},B=ny(Cp($.value),".paragraph-node");M.paragraph=hg($.value,B,"pre-wrap");const j=Cp(R.value),z=j?.querySelector(".paragraph-node");M.listItem=hg(R.value,z,"pre-wrap");const Z=lt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ye,_e;return(_e=(ye=D.value)==null?void 0:ye.offsetHeight)!=null?_e:0}),me=lt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ye,_e;return(_e=(ye=R.value)==null?void 0:ye.offsetHeight)!=null?_e:0});M.listWrapperOverhead=Math.max(0,Z-me);for(let ye=1;ye<=6;ye++){const _e=ny(Cp(W[ye]),`h${ye}`);M.headings[ye]=hg(W[ye],_e,"pre-wrap")}G.value=M,xs()})()}),{flush:"post",immediate:!0}),ze(()=>Je.value.length,()=>{it.value&&ni({immediate:!0})}),ze([cn,K],()=>{xs(),it.value&&ni({immediate:!0}),ws.value&&Ua(),Pt.value&&Dl(),un("resize")},{immediate:!1}),ze(()=>Gi.value,M=>{if(M)for(const[B,j]of Ee)Iy(B,j);else{_p();for(const[B,j]of Ee)j&&Qi(B,!0)}},{immediate:!1}),ze([()=>k.viewportPriority,()=>Je.value.length],([M,B])=>{M!==!1?V.value&&B<=200&&(V.value=!1):V.value=!1}),ze(()=>Vn.value,()=>{it.value&&ni({immediate:!0})}),ze([Ss,tt,qa,()=>Je.value.length,it],()=>{Wr()},{immediate:!0});let oc=null,sc=!1,Wl=null;function ic(){oc=null,Lp=null,Np=void 0,Pl=null,tc()}function om(){Hl(),Du(),xs(),Lt.clear();const M=Je.value.length;M>0&&Ou(M),qp()}function sm(){Zp(),J0(),Za=null,Vr=null,Kr=null,Gu=null,Ya=null,Xa=null,sc=!1,ic(),fy("restore"),Pu(),Rl()}function rc(M){var B;return[(B=Kn())!=null?B:"",vn(),ki(),zu.value,ec(M),Je.value.length,Math.round(Zi(0,Je.value.length)),Math.round(qr()),Cs.count,Math.round(Cs.total)].join(":")}function Ny(){return Cn(this,null,function*(){var M,B,j,z;const Z=(M=o.virtualScroll)==null?void 0:M.settledToken,me=ec(Z),ye=vn(),_e=Kn(),De=ss.value;if(At.value&&((B=o.virtualScroll)==null?void 0:B.settleMode)==="manual"&&Vu(Z))if(Pp()){if(rc(Z)!==Pl&&!sc){sc=!0;try{const Me=yield Vp({reason:"manual",expectedSettledTokenKey:me}),Ue=ec()===me;zp(ye,_e,De)&&Me.sessionKey===ye&&Me.threadKey===_e&&Ue&&Me.stable&&Me.phase==="final"&&(Pl=rc((j=o.virtualScroll)==null?void 0:j.settledToken))}finally{sc=!1,yield ht();const Me=(z=o.virtualScroll)==null?void 0:z.settledToken,Ue=Vu(Me)?rc(Me):"";zp(ye,_e,De)&&Ue&&Pl!==Ue&&Ny()}}}else un("manual")})}ze(At,(M,B)=>{if(M!==B){if(!M)return sm(),void Zp();sm(),om(),Wl=ss.value,un("content")}},{flush:"post"}),ze([At,ss],([M,B])=>{M?Wl!=null?Wl!==B&&(Wl=B,(function(j="resize"){Hl(),Du(),xs(),Lt.clear();const z=Je.value.length;z>0&&Ou(z),qp(),Vr=null,Kr=null,Gu=null,Za=null,sc=!1,ic(),Cy(),ht(()=>{bi(),ws.value&&Ua(),Pt.value&&Dl(),un(j)})})("resize")):Wl=B:Wl=null},{flush:"post",immediate:!0}),ze([At,()=>vn(),()=>Kn()],([M])=>{M&&(sm(),om(),fy("content"),un("content"))}),ze([At,()=>vn(),()=>Kn(),ss,()=>Je.value.length],([M])=>{M&&(function(B="async-node"){let j=!1;for(const[z,Z]of Array.from(ti.entries()))Ip(Z)||(ti.delete(z),ns.delete(z),j=!0);j&&(Nl(),un(B))})("async-node")},{flush:"post"}),ze([At,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>o.indexKey,()=>ee.value],([M])=>{M&&(tc(),(function(B="content"){if(!At.value)return;const j=[],z=Je.value.length;for(const Z of Array.from(Lt.keys())){if(Z>=z){j.push(Z);continue}const me=Ga(Z),ye=Lt.get(Z);ye!=null&&ye!==me&&j.push(Z),Lt.set(Z,me)}for(const Z of Array.from(Lt.keys()))Z>=z&&Lt.delete(Z);j.length&&((function(Z,me={}){const ye=Array.from(Z,Number);PM(ye,me)>0&&(function(De){for(const Me of De)Lt.delete(Me)})(ye)})(j,{notify:!1}),xs(),ic(),ws.value&&Ua(),Pt.value&&Dl(),un(B))})("content"))},{flush:"post",immediate:!0}),ze([At,()=>Je.value.length,()=>vn(),()=>Kn()],([M,B,j,z],[Z,me,ye,_e])=>{M&&Z&&j===ye&&z===_e&&B!==me&&ic()},{flush:"post"}),ze([At,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>Je.value.length,()=>vn(),K],()=>{Cy()},{flush:"post",immediate:!0}),ze([At,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>Je.value.length,()=>vn(),K],M=>Cn(null,[M],function*([B,j]){if(!B||!j)return;yield ht();const z=(function(){var Z;const me=(Z=o.virtualScroll)==null?void 0:Z.restoreAnchor;return me==null||me===!1?null:me===!0?"true":String(me)})();jp(j,{restoreAnchor:z!=null,restoreToken:z??void 0})}),{flush:"post",immediate:!0}),ze([At,K,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var B;if(!M)return;const j=(B=o.virtualScroll)==null?void 0:B.restoreState;j&&Vr&&Kr==="restore"&&(wy(j)||(om(),Vr=null,Kr=null,un("resize")))},{flush:"post"}),ze([At,()=>Je.value.length,()=>vn(),K],M=>Cn(null,[M],function*([B]){var j;const z=Ya,Z=Xa;B&&z&&(yield ht(),!jp(z,{restoreAnchor:Z?.restoreAnchor===!0,restoreToken:(j=Z?.restoreToken)!=null?j:"imperative",allowUncapturedAnchor:Z?.allowUncapturedAnchor===!0})&&Sy(z)||(Ya=null,Xa=null))}),{flush:"post",immediate:!0}),ze([At,H,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>vn(),()=>Kn(),ss,yp,G0,()=>Vn.value,Fu,()=>Cs.count,()=>Cs.total],([M,B,j])=>{if(!M||B!==!0||j==="manual"||!Op())return;const z=(function(){var Z;const me=Je.value.length;return[(Z=Kn())!=null?Z:"",vn(),ki(),zu.value,me,Math.round(Zi(0,me)),Math.round(qr()),Cs.count,Math.round(Cs.total)].join(":")})();oc!==z&&(oc=z,Vp({reason:"final"}).then(Z=>{Z.stable||oc!==z||(oc=null)}))},{flush:"post",immediate:!0}),ze([At,H,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settledToken},()=>vn(),()=>Kn(),ss,yp,G0,()=>Vn.value,Fu,()=>Je.value.length,()=>Cs.count,()=>Cs.total],()=>{Ny()},{flush:"post",immediate:!0}),ze([()=>Je.value.length,it,tt,qa,()=>ro.start,()=>ro.end],([M,B,j,z,Z,me])=>{ue.value&&ae("virtualization",{nodes:M,virtualization:B,maxLiveNodes:j,buffer:z,focusIndex:Ss.value,scroll:B?(()=>{const ye=hn.value||Ce();return ye?{reverse:q(ye),scrollTop:Math.round(ye.scrollTop),scrollTopAbs:Math.round(Math.abs(ye.scrollTop)),scrollHeight:Math.round(ye.scrollHeight),clientHeight:Math.round(ye.clientHeight)}:null})():null,liveRange:{start:Z,end:me},rendered:Vn.value})}),ze([()=>k.customId],([M],B,j)=>{if(!M||On)return;const z=(function(Z,me){return Z?(Gn.controllers[Z]=me,()=>{Gn.controllers[Z]===me&&delete Gn.controllers[Z]}):()=>{}})(M,{captureRestoreAnchor:F0,restoreAnchor:H0,getAnchorDrift:IM,getReport:WM});j(()=>{z()})},{immediate:!0}),Jo(()=>{(function(){if(At.value)try{bi(),Qa();const M=zr("manual");Ty(M)&&(T(M),Za=M,Gp=Ja());const B=Ol(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});B&&(E(B),B.anchor&&O(B.anchor),Bl=nc(B))}catch{}})(),ZM(),_p(),Ne(),$y();for(const M of Yi.values())for(const B of M)Wu(B);Yi.clear(),Ur.clear(),Lt.clear(),nm(),Hl(),Sp(),Pu(),Rl(),Zp(),ty(),bp()});const JM=di({loader:()=>Cn(null,null,function*(){try{return(yield Vo(()=>import("./index11-D6-PIcGb.js"),__vite__mapDeps([6,3]))).default}catch(M){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".',M),ls}}),loadingComponent:Aq,delay:0}),eE=di({loader:()=>Cn(null,null,function*(){try{return(yield Vo(()=>import("./index10-ChP4b_K8.js"),[])).default}catch(M){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.',M),ls}}),loadingComponent:Tq,delay:0}),tE=di(()=>Cn(null,null,function*(){try{return(yield Vo(()=>import("./index7-DX_J7I3Z.js"),[])).default}catch(M){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".',M),ls}})),Ly={text:Nn,paragraph:kl,heading:sh,code_block:ig,list:Ta,list_item:xa,blockquote:ef,table:zc,definition_list:tf,footnote:nf,footnote_reference:ms,footnote_anchor:jc,admonition:lf,vmr_container:sf,hardbreak:Ar,link:Po,image:Tr,thematic_break:of,math_inline:Qs,math_block:i3,strong:No,emphasis:Oo,strikethrough:Lo,highlight:vs,insert:Qo,subscript:Xo,superscript:Yo,emoji:Go,checkbox:ps,checkbox_input:ps,inline_code:_o,html_inline:gs,reference:$o,html_block:qc},nE=F(()=>Mp()),Py=F(()=>y2(k.codeBlockProps)),oE=F(()=>y2(k.codeBlockProps,{omit:["langs"]})),Oy=F(()=>et(et({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 ve.value=="boolean"?{showTooltips:ve.value}:{}),oE.value)),Ry=F(()=>et(Mt(et({},Oy.value),{langs:k.langs}),Py.value));function Dy(M){return typeof M=="boolean"?M:void 0}const sE=F(()=>{const M=k.codeBlockProps||{},B={},j=Dy(M.showLineNumbers);j!==void 0&&(B.showLineNumbers=j);const z=Dy(M.diffInline);z!==void 0&&(B.diffInline=z);const Z=(function(me){const ye=Number(me);return Number.isFinite(ye)&&ye>0?ye:void 0})(M.reservedHeightPx);return Z!==void 0&&(B.reservedHeightPx=Z),B}),iE=F(()=>et(et({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,themes:k.themes,langs:k.langs,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof ve.value=="boolean"?{showTooltips:ve.value}:{}),Py.value)),rE=F(()=>et({},k.mermaidProps||{})),By=F(()=>et({},k.d2Props||{})),lE=F(()=>et({},k.infographicProps||{})),lc=F(()=>({typewriter:k.typewriter,fade:k.fade,customHtmlTags:qn.value.customHtmlTags})),aE=F(()=>et(et({},lc.value),typeof ve.value=="boolean"?{showTooltip:ve.value}:{})),cE=F(()=>et(et({},lc.value),typeof ve.value=="boolean"?{showTooltips:ve.value}:{})),uE=F(()=>et(et({},lc.value),typeof ve.value=="boolean"?{showTooltips:ve.value}:{})),dE=F(()=>et(et({},lc.value),typeof ve.value=="boolean"?{showTooltips:ve.value}:{}));function fE(M){return Array.isArray(M.children)&&M.children.length>0}const im=F(()=>HM.value.map(M=>{var B,j,z,Z,me,ye,_e,De;let Me=(function(ot){var st,gt,mt,Ut,kt,It,Et;if(ot.type!=="code_block")return ot;const Xt=ot,is=[String((st=Xt.language)!=null?st:""),String((gt=Xt.loading)!=null?gt:""),String((mt=Xt.diff)!=null?mt:""),String((Ut=Xt.code)!=null?Ut:""),String((kt=Xt.originalCode)!=null?kt:""),String((It=Xt.updatedCode)!=null?It:""),String((Et=Xt.raw)!=null?Et:"")].join("\0"),xo=yt.get(Xt);if(xo&&xo.signature===is)return xo.node;const js=et({},Xt);return yt.set(Xt,{signature:is,node:js}),js})(M.node);const Ue=Qu(Me);let Be=Uy(Me,Ue);if((Me.type==="html_block"||Me.type==="html_inline")&&Be===Ly[Me.type]){const ot=Me,st=String((B=ot.tag)!=null?B:"").trim().toLowerCase()||YT(ot.content);if(st){const gt=Nt.value[st];if(Ft.value.has(st)&>)Be=gt,Me=Mt(et({},ot),{type:st,tag:st,content:W7(ot.content,st)});else if(XT((j=ot.content)!=null?j:ot.raw,st)){const mt=String((Z=(z=ot.content)!=null?z:ot.raw)!=null?Z:"");Me.type==="html_inline"?(Be=Nn,Me={type:"text",content:mt,raw:mt}):(Be=kl,Me={type:"paragraph",children:[{type:"text",content:mt,raw:mt}],raw:mt})}}}const $e=Me.type==="code_block"&&u.value==="pre"&&Be===ls&&!rm(Nt.value,Ue);let We=et({},(function(ot,st,gt){const mt=st??Qu(ot);if(ot.type==="code_block"){const Ut=mt?rm(Nt.value,mt):void 0;if(gt&&u.value==="pre"&&!Ut&>===ls)return sE.value;if(gt&&mt&>===Ut)return mt==="mermaid"?Hy(ot):mt==="infographic"?Wy(ot):mt==="d2"||mt==="d2lang"?By.value:Ry.value;if(gt&>===Nt.value.code_block)return Ry.value;if(iy(gt))return iE.value}return mt==="mermaid"?Hy(ot):mt==="infographic"?Wy(ot):mt==="d2"||mt==="d2lang"?By.value:ot.type==="link"?aE.value:ot.type==="list"?cE.value:ot.type==="blockquote"?uE.value:ot.type==="table"?dE.value:ot.type==="code_block"?Oy.value:lc.value})(Me,Ue,Be));const Ke=jr.value[M.index];Me.type==="code_block"&&Ke?.kind==="code-block"&&(We=Mt(et({},We),$e?{reservedHeightPx:(me=Ke.height)!=null?me:Ke.contentHeight}:{estimatedHeightPx:Ke.height,estimatedContentHeightPx:Ke.contentHeight})),$e||Me.type!=="code_block"||Ue!=="mermaid"||ua(We.estimatedPreviewHeightPx)!=null||(We=Mt(et({},We),{estimatedPreviewHeightPx:T1(S1(String((ye=Me.code)!=null?ye:"")))})),$e||Me.type!=="code_block"||Ue!=="infographic"||ua(We.estimatedPreviewHeightPx)!=null||(We=Mt(et({},We),{estimatedPreviewHeightPx:A1(x1(String((_e=Me.code)!=null?_e:"")))})),Me.type==="math_block"&&(We=Mt(et({},We),{cacheScope:Mn.value}));const Ge=(function(ot,st){const gt=String(ot.type);return!Nu(gt)&&Nt.value[gt]===st})(Me,Be),pt=Ge?g0(Me,Pe.value):void 0;return Mt(et({},M),{node:Me,component:Be,bindings:We,customBindings:et(et({},pt??{}),We),rendersCustomNode:Ge,hasSlotChildren:fE(Me),slotContent:String((De=Me.content)!=null?De:""),isCodeBlock:Me.type==="code_block",indexKey:`${nE.value}-${M.index}`})}));function Qu(M){var B;return M?.type==="code_block"?String((B=M.language)!=null?B:"").trim().toLowerCase():""}function rm(M,B){const j=B.trim().toLowerCase();if(j)for(const z of[j,c0(j),qA(j)]){const Z=z&&M[z];if(Z)return Z}}function Fy(M,B,j,z){var Z,me;const ye=et({},M.value);return ua(ye.estimatedPreviewHeightPx)==null&&(ye.estimatedPreviewHeightPx=z(j(String((Z=B?.code)!=null?Z:"")),void 0,ye.maxHeight==="none"?null:(me=ua(ye.maxHeight))!=null?me:void 0)),ye}function Hy(M){return Fy(rE,M,S1,T1)}function Wy(M){return Fy(lE,M,x1,A1)}function Uy(M,B){if(!M)return D1;const j=Nt.value,z=j[String(M.type)];if(M.type==="code_block"){const Z=B??Qu(M),me=Z?rm(j,Z):void 0;return me||(u.value==="pre"?j.code_block||ls:Z==="mermaid"?j.mermaid||JM:Z==="infographic"?j.infographic||eE:Z==="d2"||Z==="d2lang"?j.d2||tE:z||j.code_block||ry.value)}return z||Ly[String(M.type)]||D1}function lm(M){s("click",M)}function hE(M){var B;(B=M.target)!=null&&B.closest("[data-node-index]")&&s("mouseover",M)}function pE(M){var B;(B=M.target)!=null&&B.closest("[data-node-index]")&&s("mouseout",M)}function jy(M){s("mouseover",M)}function qy(M){s("mouseout",M)}const Xr=ne(null),oi=ne(!1);let ac,Ul=null,am=0,Zu=0,Ju=0;const zy=["code_block","admonition","table","math_block","html_block","image","thematic_break"],mE=new Set(zy),Vy=[".typewriter-cursor",".height-estimation-probes",...zy.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function Ky(M){if(!M||typeof M!="object")return!1;const B=M.type;return typeof B=="string"&&mE.has(B)}function ed(M){var B,j;if(!M||typeof M!="object")return 0;const z=M,Z=(j=(B=z.raw)!=null?B:z.content)!=null?j:z.code;if(typeof Z=="string")return Z.length;const me=z.children;if(Array.isArray(me))return me.reduce((_e,De)=>_e+ed(De),0);const ye=z.items;return Array.isArray(ye)?ye.reduce((_e,De)=>_e+ed(De),0):0}function td(){ac&&(clearTimeout(ac),ac=void 0)}function Gy(){am+=1,Ul!=null&&(Tt?.(Ul),Ul=null)}function nd(){Gy(),Xr.value&&(Xr.value.style.visibility="hidden")}function gE(M){var B;if(M.nodeType!==Node.TEXT_NODE||!((B=M.textContent)!=null?B:"").trim())return!1;const j=M.parentElement;return!!j&&!j.closest(Vy)}function vE(M){let B=M.lastChild;for(;B;){if(gE(B))return B;if(B.nodeType===Node.ELEMENT_NODE){const j=B;if(!j.matches(Vy)&&j.lastChild){B=j.lastChild;continue}}for(;B&&B!==M&&!B.previousSibling;)B=B.parentNode;if(!B||B===M)break;B=B.previousSibling}return null}function cm(){if(!le||!oi.value||Ul!=null)return;const M=am,B=()=>{Ul=null,M===am&&(function(){var j,z;if(!(le&&oi.value&&A.value&&Xr.value))return;const Z=A.value,me=Xr.value;me.style.visibility="hidden";const ye=(function(){const Be=im.value;for(let $e=Be.length-1;$e>=0;$e--){const We=Be[$e];if(!We||Ky(We.node)||!em(We.index))continue;const Ke=Ee.get(We.index);if(!Ke)continue;const Ge=vE(Ke);if(Ge)return Ge}return null})();if(!ye)return;let _e=0,De=0,Me=20,Ue=!1;if(ye?.textContent){const Be=ye.textContent.length,$e=document.createRange();$e.setStart(ye,Math.max(0,Be-1)),$e.setEnd(ye,Be);const We=typeof $e.getClientRects=="function"?$e.getClientRects():void 0,Ke=(z=We?.[We.length-1])!=null?z:(j=ye.parentElement)==null?void 0:j.getBoundingClientRect();if(Ke){const Ge=lt("typewriterCursor.root.getBoundingClientRect",()=>Z.getBoundingClientRect());_e=Ke.right-Ge.left+Z.scrollLeft,De=Ke.top-Ge.top+Z.scrollTop,Me=Ke.height||Me,Ue=!0}$e.detach()}Ue&&(me.style.transform=`translate(${Math.max(0,_e)}px, ${Math.max(0,De)}px)`,me.style.height=`${Me}px`,me.style.visibility="visible")})()};xt?Ul=xt(B):B()}return ze([fe,()=>o.content,()=>o.nodes,()=>k.typewriter,H],()=>Cn(null,null,function*(){var M,B;if(!le||He.value||!Q.value)return;if(H.value)return oi.value=!1,td(),void nd();if((M=o.nodes)!=null&&M.length)return oi.value=!1,td(),nd(),Zu=((B=o.content)!=null?B:"").length,void(Ju=fe.value.length);const j=(function(){var _e,De;return(_e=o.nodes)!=null&&_e.length?o.nodes.reduce((Me,Ue)=>Me+ed(Ue),0):((De=o.content)!=null?De:"").length})(),z=(function(){var _e;return(_e=o.nodes)!=null&&_e.length?o.nodes.reduce((De,Me)=>De+ed(Me),0):fe.value.length})(),Z=!Ky(Je.value[Je.value.length-1]),me=j>Zu,ye=z>Ju;if(k.typewriter===!1||!Z||!me&&!ye)return k.typewriter!==!1&&Z||(oi.value=!1,nd()),Zu=j,void(Ju=z);Zu=j,Ju=z,oi.value=!0,Xr.value&&(Xr.value.style.visibility="hidden"),td(),yield ht(),cm(),ac=setTimeout(()=>{ac=void 0,oi.value=!1},3e3)}),{flush:"post",immediate:!0}),ze(oi,M=>Cn(null,null,function*(){M?(yield ht(),cm()):nd()}),{flush:"post"}),ze([()=>Vn.value,()=>ro.start,()=>ro.end],()=>Cn(null,null,function*(){le&&!He.value&&Q.value&&oi.value&&(yield ht(),cm())}),{flush:"post"}),Jo(()=>{td(),Gy(),fn.clear()}),(M,B)=>{const j=qI("NodeRenderer",!0);return S(He)?(C(!0),I(Oe,{key:0},Xe(im.value,z=>(C(),I(Oe,{key:z.index},[z.rendersCustomNode?(C(),Ve(ko(z.component),en({key:0,ref_for:!0},z.customBindings,{node:z.node,loading:z.node.loading,"index-key":z.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onClick:lm,onMouseover:jy,onMouseout:qy,onCopy:B[0]||(B[0]=Z=>s("copy",Z)),onHandleArtifactClick:B[1]||(B[1]=Z=>s("handleArtifactClick",Z))}),{default:$n(()=>[z.hasSlotChildren?(C(),Ve(j,en({key:0,ref_for:!0},Qn.value,{nodes:z.node.children,"index-key":z.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):z.slotContent?(C(),Ve(j,en({key:1,ref_for:!0},Qn.value,{content:z.slotContent,final:!z.node.loading,"index-key":`${z.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):se("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),Ve(ko(z.component),en({key:1,node:z.node,loading:z.node.loading,"index-key":z.indexKey},{ref_for:!0},z.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onClick:lm,onMouseover:jy,onMouseout:qy,onCopy:B[2]||(B[2]=Z=>s("copy",Z)),onHandleArtifactClick:B[3]||(B[3]=Z=>s("handleArtifactClick",Z))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(C(),I("div",{key:1,ref_key:"containerRef",ref:A,class:Le(["markstream-vue markdown-renderer",[{dark:k.isDark},{virtualized:it.value},{"virtual-scroll-coordinated":Co.value}]]),"data-custom-id":k.customId,onClick:lm,onMouseover:hE,onMouseout:pE},[Fo.value||it.value?(C(),I(Oe,{key:0},[Fo.value?(C(),I("div",{key:0,class:"height-estimation-probes",style:Wt({width:`${qe.value}px`}),"aria-hidden":"true"},[p("div",{ref_key:"paragraphProbeWrapperRef",ref:$,class:"node-content","data-probe":"paragraph"},[vt(S(kl),{node:po.value,"index-key":"probe-paragraph"},null,8,["node"])],512),p("div",{ref_key:"listItemProbeWrapperRef",ref:R,class:"node-content","data-probe":"list-item"},[p("ul",Eq,[vt(S(xa),{node:Pn.value,"index-key":"probe-list-item"},null,8,["node"])])],512),p("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[vt(S(Ta),{node:an.value,"index-key":"probe-list"},null,8,["node"])],512),(C(),I(Oe,null,Xe(6,z=>p("div",{key:`probe-heading-${z}`,ref_for:!0,ref:Z=>(function(me,ye){me<1||me>6||(W[me]=ye)})(z,Z),class:"node-content","data-probe":`heading-${z}`},[vt(S(sh),{node:DM(z),"index-key":`probe-heading-${z}`},null,8,["node","index-key"])],8,Iq)),64))],4)):se("",!0),it.value?(C(),I("div",{key:1,class:"node-spacer",style:Wt({height:`${Tp.value}px`}),"aria-hidden":"true"},null,4)):se("",!0)],64)):se("",!0),(C(!0),I(Oe,null,Xe(im.value,z=>(C(),I("div",{key:z.index,ref_for:!0,ref:Z=>Iy(z.index,Z),class:"node-slot","data-node-index":z.index,"data-node-type":z.node.type},[em(z.index)?(C(),I("div",{key:0,ref_for:!0,ref:Z=>(function(me,ye){var _e;ye||(function(Be){const $e=`${Mp()}-${Be}`;let We=!1;for(const Ke of Array.from(ns.keys())){const Ge=ti.get(Ke);(Ge?.index===Be||Ke===$e||Ke.startsWith(`${$e}-`))&&(ns.delete(Ke),ti.delete(Ke),We=!0)}We&&(Nl(),un("async-node"))})(me),yi.delete(me),(function(Be){var $e;const We=(($e=Ur.get(Be))!=null?$e:0)+1;Ur.set(Be,We)})(me);const De=Yi.get(me);if(De){for(const Be of De)Wu(Be);Yi.delete(me)}if((function(Be){const $e=Ae.get(Be);$e&&(he?.unobserve($e),J.delete($e),Ae.delete(Be))})(me),!ye||!Ie.value)return ei.delete(me),void Ur.delete(me);ei.set(me,ye);const Me=()=>{Xu(me,ye)};queueMicrotask(Me);const Ue=(he||typeof ResizeObserver>"u"||(he=new ResizeObserver(Be=>{if(Be.length)for(const $e of Be){const We=J.get($e.target),Ke=Ae.get(We??-1);We!=null&&Ke&&Xu(We,Ke)}else bi()})),he);if(Ue&&(Ae.set(me,ye),J.set(ye,me),Ue.observe(ye)),typeof window<"u"){const Be=((_e=Je.value[me])==null?void 0:_e.type)==="code_block"?[16,80,240,800]:H.value?[80]:[];if(Be.length){const $e=Be.map(We=>Z0(We,Me,"node-resize")).filter(We=>We!=null);$e.length&&Yi.set(me,$e)}}})(z.index,Z),class:"node-content"},[z.isCodeBlock?z.rendersCustomNode?(C(),Ve(ko(z.component),en({key:1,ref_for:!0},z.customBindings,{node:z.node,loading:z.node.loading,"index-key":z.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[8]||(B[8]=Z=>s("copy",Z)),onHandleArtifactClick:B[9]||(B[9]=Z=>s("handleArtifactClick",Z))}),{default:$n(()=>[z.hasSlotChildren?(C(),Ve(j,en({key:0,ref_for:!0},Qn.value,{nodes:z.node.children,"index-key":z.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):z.slotContent?(C(),Ve(j,en({key:1,ref_for:!0},Qn.value,{content:z.slotContent,final:!z.node.loading,"index-key":`${z.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):se("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),Ve(ko(z.component),en({key:2,node:z.node,loading:z.node.loading,"index-key":z.indexKey},{ref_for:!0},z.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[10]||(B[10]=Z=>s("copy",Z)),onHandleArtifactClick:B[11]||(B[11]=Z=>s("handleArtifactClick",Z))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(C(),Ve(qi,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:$n(()=>[z.rendersCustomNode?(C(),Ve(ko(z.component),en({key:0,ref_for:!0},z.customBindings,{node:z.node,loading:z.node.loading,"index-key":z.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[4]||(B[4]=Z=>s("copy",Z)),onHandleArtifactClick:B[5]||(B[5]=Z=>s("handleArtifactClick",Z))}),{default:$n(()=>[z.hasSlotChildren?(C(),Ve(j,en({key:0,ref_for:!0},Qn.value,{nodes:z.node.children,"index-key":z.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):z.slotContent?(C(),Ve(j,en({key:1,ref_for:!0},Qn.value,{content:z.slotContent,final:!z.node.loading,"index-key":`${z.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):se("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),Ve(ko(z.component),en({key:1,node:z.node,loading:z.node.loading,"index-key":z.indexKey},{ref_for:!0},z.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[6]||(B[6]=Z=>s("copy",Z)),onHandleArtifactClick:B[7]||(B[7]=Z=>s("handleArtifactClick",Z))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(C(),I("div",{key:1,class:"node-placeholder",style:Wt({height:`${qu(z.index)}px`})},null,4))],8,$q))),128)),oi.value?(C(),I("span",{key:1,ref_key:"typewriterCursorRef",ref:Xr,class:"typewriter-cursor","aria-hidden":"true"},null,512)):se("",!0),it.value?(C(),I("div",{key:2,class:"node-spacer",style:Wt({height:`${Ap.value}px`}),"aria-hidden":"true"},null,4)):se("",!0)],42,Mq))}}})),[["__scopeId","data-v-2e8e6e17"]]),Zo=y3;Zo.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Zo.__name,Zo.name].filter(n=>!!n));for(const n of t)e.component(n,y3)};const C0=Object.freeze(Object.defineProperty({__proto__:null,default:Zo},Symbol.toStringTag,{value:"Module"})),Nq={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"},Lq={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"},Pq={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"},Oq={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"},Rq={class:"admonition-title"},Dq=["aria-expanded","aria-controls"],Bq=["id"],lf=Jt(Qe({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,s=t,i=F(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=ne(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(C(),I("div",{class:Le(["admonition",[`admonition-${o.node.kind}`]])},[p("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(C(),I("svg",Nq,[...u[1]||(u[1]=[p("circle",{cx:"12",cy:"12",r:"10"},null,-1),p("path",{d:"M12 16v-4"},null,-1),p("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(C(),I("svg",Lq,[...u[2]||(u[2]=[p("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),p("path",{d:"M9 18h6"},null,-1),p("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(C(),I("svg",Pq,[...u[3]||(u[3]=[p("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),p("path",{d:"M12 9v4"},null,-1),p("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(C(),I("svg",Oq,[...u[4]||(u[4]=[p("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),p("path",{d:"M12 8v4"},null,-1),p("path",{d:"M12 16h.01"},null,-1)])])):se("",!0),p("span",Rq,P(i.value),1),o.node.collapsible?(C(),I("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(C(),I("svg",{style:Wt({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]=[p("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Dq)):se("",!0)]),qt(p("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[vt(S(Zo),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:u[0]||(u[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,Bq),[[Ks,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);lf.install=e=>{e.component(lf.__name,lf)};const k3=()=>Vo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let Pd=null,Fq=k3;function uge(){return Cn(this,null,function*(){if(Pd)return Pd;const e=Fq;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===k3?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(Pd=(function(n){var o;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),Pd):null})}function dge(){return!1}function fge(){return Cn(this,null,function*(){return null})}const Od=ne(!1);let E2=!1;function mg(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Hq(){return!E2&&typeof window<"u"&&typeof document<"u"&&(E2=!0,Od.value=mg(),new MutationObserver(()=>{Od.value=mg()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Od.value=mg()})),Od}const b3=["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"],Wq=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),U1=[...b3].sort((e,t)=>t.length-e.length).join("|"),gg=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${U1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${U1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),w3=/[),.;!?,。;!?)]+$/;function Uq(e){const t=e.toLowerCase();return b3.some(n=>t.endsWith(`.${n}`))}function jq(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${U1}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=s.split("/").pop();i&&t.set(i,s)}return t}function qq(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(w3,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=Wq.has(i),a=Uq(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const c=o[2]??o[3],u=c?Number(c):void 0;return{path:s,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function zq(e,t={}){const n=[];gg.lastIndex=0;let o;for(;(o=gg.exec(e))!==null;){const s=o[0]??"",i=o[1]??"",r=s.indexOf(i);if(r<0)continue;const l=o[2]??o[3];let a=i+(l?s.slice(r+i.length):"");const c=a.replace(w3,""),u=a.length-c.length;a=c;const d=qq(a,t);if(!d)continue;const h=o.index+r,m=h+a.length;n.push({...d,start:h,end:m,text:a}),u>0&&(gg.lastIndex-=u)}return n}const Vq=12e4,Kq=6e4,Gq=32,Yq=3e4,I2=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Xq(e){let t=0,n=0,o=0;I2.lastIndex=0;let s;for(;(s=I2.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=Vq||n>=Kq||t>=Gq||o>=Yq?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Qq(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Zq(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const Jq={key:1,class:"diff-wrap"},ez={class:"diff-bar"},tz=["title","onClick"],nz={class:"diff-pre"},oz="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",$2="github-light",N2="github-dark",sz=Qe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){OW(),GW(),DW(),JW(),RW(new Qq),ZW(new Zq);function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=St(),o=Bt("resolveImage"),s=ne(null),i=e,r=F(()=>!i.streaming),l=F(()=>jq(i.text??"")),a=F(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Xq(i.text??"")),c=Hq(),u=F(()=>!i.streaming),d=ds(new Map),h=new Set,m=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,f=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function g(R){return!/^(https?:|data:|blob:)/i.test(R)}function _(R){if(!o)return;const D=[];for(const W of[m,f]){W.lastIndex=0;let V;for(;(V=W.exec(R))!==null;)D.push(V[2]??"")}for(const W of D)!W||!g(W)||d.has(W)||h.has(W)||(h.add(W),o(W).then(V=>{d.set(W,V!==W?V:"")}).catch(()=>{d.set(W,"")}).finally(()=>{h.delete(W)}))}function w(R){if(!o)return R;const D=W=>{if(!g(W))return null;const V=d.get(W);return V===void 0?oz:V===""?null:V};return R.replace(m,(W,V,U,ee)=>{const K=D(U);return K===null?W:`${V}${K}${ee}`}).replace(f,(W,V,U,ee)=>{const K=D(U);return K===null?W:`${V}${K}${ee}`})}ze(()=>i.text,R=>_(R??""),{immediate:!0});function y(){if(!s.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),D=[];let W=R.nextNode();for(;W;){const V=W,U=V.parentElement;U&&!U.closest("a, pre, .md-file-link, svg")&&V.data.trim().length>0&&D.push(V),W=R.nextNode()}for(const V of D){const U=zq(V.data,{aliases:l.value});if(U.length===0||!V.parentNode)continue;const ee=document.createDocumentFragment();let K=0;for(const G of U){G.start>K&&ee.append(document.createTextNode(V.data.slice(K,G.start)));const X=document.createElement("button");X.type="button",X.className="md-file-link",X.textContent=G.text,X.title=G.line?`${G.path}:${G.line}`:G.path,X.addEventListener("click",ke=>{ke.preventDefault(),ke.stopPropagation(),i.openFile?.({path:G.path,line:G.line})}),ee.append(X),K=G.end}K<V.data.length&&ee.append(document.createTextNode(V.data.slice(K))),V.parentNode.replaceChild(ee,V)}}function b(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function v(R){let D=R.length;for(const W of["#","?"]){const V=R.indexOf(W);V!==-1&&V<D&&(D=V)}return R.slice(0,D)}function x(){if(!s.value||!i.openFile||i.streaming)return;const R=s.value.querySelectorAll("a[href]");for(const D of R){if(D.dataset.mdLinkHandled==="true"||D.closest("svg"))continue;const W=D.getAttribute("href")??"";b(W)&&(D.dataset.mdLinkHandled="true",D.addEventListener("click",V=>{V.preventDefault(),V.stopPropagation(),i.openFile?.({path:v(W)})}))}}function L(){ht().then(()=>{y(),x()})}ze(()=>i.text,L),ze(()=>i.streaming,L);let N=null;sn(()=>{L(),s.value&&(N=new MutationObserver(L),N.observe(s.value,{childList:!0,subtree:!0}))}),Yt(()=>{N?.disconnect()});const k={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},T=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,E=F(()=>{const R=w(i.text??""),D=[];let W=0;T.lastIndex=0;let V;for(;(V=T.exec(R))!==null;){const ee=V[1]??"",K=R.slice(W,V.index)+(ee||"");K.trim()&&D.push({kind:"md",text:K}),D.push({kind:"diff",code:V[2]??""}),W=T.lastIndex}const U=R.slice(W);return(U.trim()||D.length===0)&&D.push({kind:"md",text:U}),D});function O(R){return R.split(`
|
|
235
|
-
`).map(D=>/^\+(?!\+\+)/.test(D)?{cls:"diff-add",text:D}:/^-(?!--)/.test(D)?{cls:"diff-del",text:D}:D.startsWith("@@")?{cls:"diff-hunk",text:D}:{cls:"diff-ctx",text:D})}const A=ne(null);function $(R,D){wo(R).then(W=>{W&&(A.value=D,setTimeout(()=>{A.value=null},1400))})}return(R,D)=>(C(),I("div",{ref_key:"mdRef",ref:s,class:"md"},[(C(!0),I(Oe,null,Xe(E.value,(W,V)=>(C(),I(Oe,{key:V},[W.kind==="md"?(C(),Ve(S(Zo),{key:0,content:W.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":S(c),"code-block-light-theme":$2,"code-block-dark-theme":N2,themes:[$2,N2],"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"])):(C(),I("div",Jq,[p("div",ez,[D[0]||(D[0]=p("span",{class:"diff-lang"},"diff",-1)),p("button",{class:"diff-copy",title:S(n)("filePreview.copyCode"),onClick:U=>$(W.code,V)},P(A.value===V?"✓":"⧉"),9,tz)]),p("pre",nz,[p("code",null,[(C(!0),I(Oe,null,Xe(O(W.code),(U,ee)=>(C(),I("span",{key:ee,class:Le(U.cls)},P(U.text),3))),128))])])]))],64))),128))],512))}}),gu=bt(sz,[["__scopeId","data-v-25c08f45"]]),iz={class:"tc-anim"},rz={class:"prev-anim"},lz={class:"prev"},az=Qe({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,o=t,s=F(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=F(()=>n.foldable&&s.value.length>1),r=F(()=>n.streaming||!i.value),l=F(()=>s.value.pop()??""),a=ne(null);return sn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),ze(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||ht(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(C(),I("div",{class:Le(["think",{mob:e.mobile}])},[i.value?(C(),I("div",{key:0,class:Le(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[p("div",iz,[p("pre",{ref_key:"bodyEl",ref:a,class:"tc"},P(e.text),513)]),p("div",rz,[p("span",lz,P(l.value),1)])],2)):(C(),I("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},P(e.text),513))],2))}}),L2=bt(az,[["__scopeId","data-v-42c6573c"]]),cz={class:"activity-notice",role:"status"},uz={class:"an-moon","aria-hidden":"true"},dz={class:"an-label"},fz=120,hz=Qe({__name:"ActivityNotice",props:{label:{}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"],n=ne(0);let o=null;return sn(()=>{o=setInterval(()=>{n.value=(n.value+1)%t.length},fz)}),Yt(()=>{o&&(clearInterval(o),o=null)}),(s,i)=>(C(),I("div",cz,[p("span",uz,P(t[n.value]),1),p("span",dz,P(e.label),1)]))}}),P2=bt(hz,[["__scopeId","data-v-dfa53d2b"]]),pz=["disabled"],mz={class:"agent-main"},gz={class:"agent-title-row"},vz={class:"agent-name"},yz={key:0,class:"agent-type"},kz={class:"agent-phase"},bz={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"},wz=Qe({__name:"AgentCard",props:{member:{},compact:{type:Boolean}},emits:["open"],setup(e,{emit:t}){const n=e,o=t,s=F(()=>(n.member.outputLines??[]).map(u=>u.trimEnd()).filter(u=>u.length>0).slice(-8)),i=F(()=>s.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||s.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&&o("open",n.member.id)}return(u,d)=>(C(),I("div",{class:Le(["agent-card",[`phase-${e.member.phase}`,{compact:e.compact}]])},[p("button",{class:"agent-head",type:"button",disabled:!l.value,onClick:c},[d[1]||(d[1]=p("span",{class:"agent-dot","aria-hidden":"true"},null,-1)),p("span",mz,[p("span",gz,[p("span",vz,P(e.member.name),1),e.member.subagentType?(C(),I("span",yz,P(e.member.subagentType),1)):se("",!0),r.value?(C(),I("span",{key:1,class:Le(["agent-live",{empty:!i.value}])},P(i.value),3)):se("",!0)])]),p("span",kz,P(a(e.member.phase)),1),l.value?(C(),I("svg",bz,[...d[0]||(d[0]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])])):se("",!0)],8,pz)],2))}}),j1=bt(wz,[["__scopeId","data-v-bb535d33"]]),_z={class:"agent-group"},Cz={class:"group-count"},Sz={key:0,class:"group-live"},xz={key:0,class:"group-body"},Tz=Qe({__name:"AgentGroup",props:{members:{}},emits:["open"],setup(e,{emit:t}){const n=e,o=t,s=ne(!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)=>(C(),I("section",_z,[p("button",{class:"group-head",type:"button",onClick:a[0]||(a[0]=c=>s.value=!s.value)},[a[3]||(a[3]=p("span",{class:"group-title"},"Agents",-1)),p("span",Cz,P(i.value)+"/"+P(e.members.length),1),r.value>0?(C(),I("span",Sz,P(r.value)+" running",1)):se("",!0),(C(),I("svg",{class:Le(["group-chevron",{open:s.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]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),s.value?(C(),I("div",xz,[(C(!0),I(Oe,null,Xe(e.members,c=>(C(),Ve(j1,{key:c.id,member:c,compact:"",onOpen:a[1]||(a[1]=u=>o("open",u))},null,8,["member"]))),128))])):se("",!0)]))}}),O2=bt(Tz,[["__scopeId","data-v-17ab3c41"]]),Az=["aria-label"],Mz=120,Ez=60,Iz=Qe({__name:"MoonSpinner",props:{fast:{type:Boolean},label:{default:"Working…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*Mz}ms`,"--moon-frame-fast-delay":`${o*Ez}ms`}}return(o,s)=>(C(),I("span",{class:Le(["moon-spin",{"moon-spin--fast":e.fast}]),"aria-label":e.label,role:"img"},[(C(),I(Oe,null,Xe(t,(i,r)=>p("span",{key:i,class:"moon-frame",style:Wt(n(r)),"aria-hidden":"true"},P(i),5)),64))],10,Az))}}),q1=bt(Iz,[["__scopeId","data-v-e7ccbb9a"]]);function $z(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),i=`${s(n.getHours())}:${s(n.getMinutes())}`,r=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(r&&l&&a)return i;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`}catch{return e}}function R2(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function D2(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 tp(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 Nz(e){return!(e.tool.status==="ok"&&e.tool.media)}function B2(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function F2(e){const t=tp(e),n=[];let o=[];const s=()=>{if(o.length===1){const[i]=o;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else o.length>1&&n.push({kind:"tool-stack",tools:o});o=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(Nz(i)){o.push({tool:i.tool,sourceIndex:r});return}s(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}s(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"?n.push({kind:"text",text:i.text,sourceIndex:r}):i.kind==="agent"?n.push({kind:"agent",member:i.member,sourceIndex:r}):n.push({kind:"agentGroup",members:i.members,sourceIndex:r})}),s(),n}function Lz(e){return tp(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
236
|
-
|
|
237
|
-
`)}function Pz(e){const t=[];for(const n of tp(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
238
|
-
> ${n.thinking.split(`
|
|
239
|
-
`).join(`
|
|
240
|
-
> `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const o=n.tool.output.join(`
|
|
241
|
-
`);t.push(`\`\`\`
|
|
242
|
-
[${n.tool.name}]
|
|
243
|
-
${o}
|
|
244
|
-
\`\`\``)}else n.kind==="agent"?t.push(`**Agent** ${n.member.name} (${n.member.phase})`):n.kind==="agentGroup"&&t.push(`**Agents**
|
|
245
|
-
|
|
246
|
-
${n.members.map(o=>`- ${o.name}: ${o.phase}`).join(`
|
|
247
|
-
`)}`);return t.join(`
|
|
248
|
-
|
|
249
|
-
`)}function z1(e){return e.tool.id||`tool-${e.sourceIndex}`}function H2(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?z1({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 Oz={key:0,class:"chat"},Rz={key:0,class:"chat-loading"},Dz={class:"chat-loading-text"},Bz={key:1,class:"chat-empty"},Fz={key:1,class:"top-sentinel-text"},Hz=["data-turn-id"],Wz={key:0,class:"u-imgs"},Uz=["src"],jz=["src","alt"],qz={key:1,class:"skill-act"},zz={class:"skill-act-head"},Vz={key:0,class:"skill-act-args"},Kz={key:2,class:"skill-act"},Gz={class:"skill-act-head"},Yz={key:0,class:"skill-act-args"},Xz={key:3,class:"u-text"},Qz={key:0,class:"u-meta"},Zz=["data-tooltip","onClick"],Jz={class:"u-edit-text"},eV=["onClick"],tV=["data-tooltip","onClick"],nV={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"},oV={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"},sV=["onClick"],iV=["data-turn-id"],rV=["onClick"],lV={class:"cd-view"},aV={key:1,class:"cd-label"},cV=["data-turn-id"],uV={key:1,class:"msg"},dV={key:2,class:"tool-stack"},fV={key:0,class:"a-msg-ft"},hV=["title"],pV=["onClick"],mV={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"},gV={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"},vV={class:"a-cpbtn-text"},yV={key:4,class:"sending-placeholder"},kV={key:1,class:"term"},bV={key:0,class:"chat-loading"},wV={class:"chat-loading-text"},_V={key:1,class:"chat-empty"},CV={key:1,class:"top-sentinel-text"},SV=["data-turn-id"],xV=["onClick"],TV={class:"cd-view"},AV={key:1,class:"cd-label"},MV=["data-turn-id"],EV={class:"no"},IV={class:"tx"},$V={class:"role-row"},NV=["onClick"],LV={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"},PV={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"},OV={class:"cpbtn-text"},RV=["title"],DV={key:0,class:"u-text"},BV={key:0,class:"skill-act"},FV={class:"skill-act-head"},HV={key:0,class:"skill-act-args"},WV={key:1,class:"skill-act"},UV={class:"skill-act-head"},jV={key:0,class:"skill-act-args"},qV={key:2,class:"tool-stack"},zV=["data-tooltip","onClick"],VV={class:"u-edit-text"},KV=["onClick"],GV={key:4,class:"ln sending-line"},YV={class:"tx"},XV=Qe({__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:o}=St();Yt(()=>{W!==null&&(clearTimeout(W),W=null),T!==null&&(clearTimeout(T),T=null),y!==null&&(clearTimeout(y),y=null)});const s=e,i=F(()=>s.bubble||s.mobile),r=ne(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(K=>{K[0]?.isIntersecting&&s.hasMoreMessages&&!s.loadingMore&&!s.loadingMoreError&&!s.sessionLoading&&!s.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}sn(a),Yt(()=>{l?.disconnect(),l=null}),ze(()=>[s.hasMoreMessages,s.loadingMore,s.loadingMoreError],()=>{ht().then(a)});const c=F(()=>{if(!s.running||s.turns.length===0)return null;const K=s.turns.at(-1);return K.role==="assistant"?K.id:null}),u=F(()=>s.sending||s.running),d=n,h=F(()=>{for(let K=s.turns.length-1;K>=0;K--)if(s.turns[K].role==="user")return s.turns[K].id;return null});function m(K){return K.role==="user"&&K.id===h.value&&!s.running&&!s.sending&&!K.skillActivation&&!K.pluginCommand}function f(K){const G=K.compaction,X=G?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof G?.tokensBefore=="number"&&typeof G?.tokensAfter=="number"?X+o("conversation.compactedTokens",{before:R2(G.tokensBefore),after:R2(G.tokensAfter)}):X}const g=ne(null),_=ne(null),w=ne(null);let y=null;const b=ne(new Set);function v(K){return b.value.has(K)}function x(K){const G=new Set(b.value);G.has(K)?G.delete(K):G.add(K),b.value=G}function L(K,G){if(v(G)){const X=new Date(K);if(Number.isNaN(X.getTime()))return K;const ke=le=>String(le).padStart(2,"0");return`${X.getFullYear()}-${ke(X.getMonth()+1)}-${ke(X.getDate())} ${ke(X.getHours())}:${ke(X.getMinutes())}`}return $z(K,o("conversation.yesterday"))}function N(K){w.value===null&&(_.value=null,w.value=K.id,y=setTimeout(()=>{y=null,d("editMessage",K.text),w.value=null},240))}const k=ne(!1);let T=null;function E(){if(s.turns.length===0)return;const K=[];for(const X of s.turns){if(X.role==="compaction")continue;const ke=X.role==="user"?"User":"Assistant",le=Pz(X);le.trim()&&K.push(`**${ke}**
|
|
250
|
-
|
|
251
|
-
${le}`)}const G=K.join(`
|
|
252
|
-
|
|
253
|
-
---
|
|
254
|
-
|
|
255
|
-
`);wo(G).then(X=>{X&&(k.value=!0,d("copyConversationCopied"),T!==null&&clearTimeout(T),T=setTimeout(()=>{T=null,k.value=!1},2e3))}).catch(()=>{})}function O(K){const G=[];for(let X=K;X>=0;X--){const ke=s.turns[X];if(!ke||ke.role!=="assistant")break;G.unshift(ke)}return G}function A(K){return O(K).map(G=>Lz(G)).filter(Boolean).join(`
|
|
256
|
-
|
|
257
|
-
`)}function $(){for(let K=s.turns.length-1;K>=0;K-=1)if(s.turns[K]?.role==="assistant")return A(K);return""}function R(){const K=$();K.trim()&&wo(K).then(G=>{G&&(k.value=!0,d("copyConversationCopied"),T!==null&&clearTimeout(T),T=setTimeout(()=>{T=null,k.value=!1},2e3))}).catch(()=>{})}t({copyConversation:E,copyFinalSummary:R});function D(K){const G=s.turns[K];if(!G||G.role!=="assistant")return!1;const X=s.turns[K+1];return!X||X.role!=="assistant"}let W=null;function V(K){const G=s.turns[K];if(!G)return;const X=A(K);X.trim()&&wo(X).then(ke=>{ke&&(g.value=G.id,W!==null&&clearTimeout(W),W=setTimeout(()=>{W=null,g.value=null},1400))}).catch(()=>{})}function U(K){const G=K.text;G.trim()&&wo(G).then(X=>{X&&(g.value=K.id,W!==null&&clearTimeout(W),W=setTimeout(()=>{W=null,g.value=null},1400))}).catch(()=>{})}function ee(K,G){return K.id!==c.value?!1:G.sourceIndex===tp(K).length-1}return(K,G)=>i.value?(C(),I("div",Oz,[e.sessionLoading?(C(),I("div",Rz,[G[18]||(G[18]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),p("span",Dz,P(S(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(C(),I("div",Bz)):se("",!0),e.hasMoreMessages||e.loadingMore?(C(),I("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Le(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(C(),I("span",Fz,[G[19]||(G[19]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),ut(" "+P(S(o)("conversation.loadingOlder")),1)])):(C(),I("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:G[0]||(G[0]=X=>d("loadOlderMessages"))},P(S(o)("conversation.loadOlder")),1))],2)):se("",!0),(C(!0),I(Oe,null,Xe(e.turns,(X,ke)=>(C(),I(Oe,{key:X.id},[X.role==="user"?(C(),I(Oe,{key:0},[p("div",{class:Le(["u-bub turn-anchor",{undoing:w.value===X.id}]),"data-turn-id":X.id},[X.images&&X.images.length>0?(C(),I("div",Wz,[(C(!0),I(Oe,null,Xe(X.images,(le,He)=>(C(),I(Oe,{key:He},[le.kind==="video"?(C(),I("video",{key:0,class:"u-img",src:le.url,controls:"",playsinline:"",preload:"metadata"},null,8,Uz)):(C(),I("img",{key:1,class:"u-img",src:le.url,alt:le.alt||"",loading:"lazy"},null,8,jz))],64))),128))])):se("",!0),X.skillActivation?(C(),I("div",qz,[p("div",zz,[G[20]||(G[20]=p("span",{class:"skill-act-arrow"},"▶",-1)),p("span",null,P(S(o)("conversation.activatedSkill",{name:X.skillActivation.name})),1)]),X.skillActivation.args?(C(),I("div",Vz,P(X.skillActivation.args),1)):se("",!0)])):X.pluginCommand?(C(),I("div",Kz,[p("div",Gz,[G[21]||(G[21]=p("span",{class:"skill-act-arrow"},"▶",-1)),p("span",null,"/"+P(X.pluginCommand.pluginId)+":"+P(X.pluginCommand.commandName),1)]),X.pluginCommand.args?(C(),I("div",Yz,P(X.pluginCommand.args),1)):se("",!0)])):(C(),I("div",Xz,P(X.text),1))],10,Hz),X.createdAt||m(X)?(C(),I("div",Qz,[m(X)?(C(),I("div",{key:0,class:Le(["u-edit-wrap",{undoing:w.value===X.id}])},[_.value!==X.id?(C(),I("button",{key:0,type:"button",class:"u-edit","data-tooltip":S(o)("conversation.undoTooltip"),onClick:le=>_.value=X.id},[p("span",Jz,P(S(o)("conversation.undo")),1),G[22]||(G[22]=p("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"},[p("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),p("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1))],8,Zz)):(C(),I("div",{key:1,class:"u-edit-confirm",onClick:G[2]||(G[2]=Ze(()=>{},["stop"]))},[p("span",null,P(S(o)("conversation.undoConfirm")),1),p("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ze(le=>N(X),["stop"])},P(S(o)("conversation.confirm")),9,eV),p("button",{type:"button",class:"u-edit-confirm-btn",onClick:G[1]||(G[1]=Ze(le=>_.value=null,["stop"]))},P(S(o)("conversation.cancel")),1)]))],2)):se("",!0),X.text.trim().length>0?(C(),I("button",{key:1,type:"button",class:"u-copy","data-tooltip":S(o)("filePreview.copy"),onClick:Ze(le=>U(X),["stop"])},[g.value!==X.id?(C(),I("svg",nV,[...G[23]||(G[23]=[p("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),p("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(C(),I("svg",oV,[...G[24]||(G[24]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])]))],8,tV)):se("",!0),X.createdAt?(C(),I("button",{key:2,type:"button",class:"u-time",onClick:Ze(le=>x(X.id),["stop"])},P(L(X.createdAt,X.id)),9,sV)):se("",!0)])):se("",!0)],64)):X.role==="compaction"?(C(),I("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":X.id,role:"separator"},[G[25]||(G[25]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1)),X.text?(C(),I("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:le=>d("openCompaction",{turnId:X.id})},[p("span",null,P(f(X)),1),p("span",lV,P(S(o)("conversation.viewSummary")),1)],8,rV)):(C(),I("span",aV,P(f(X)),1)),G[26]||(G[26]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,iV)):(C(),I("div",{key:2,class:"a-msg turn-anchor","data-turn-id":X.id},[(C(!0),I(Oe,null,Xe(S(F2)(X),(le,He)=>(C(),I(Oe,{key:S(H2)(le,He)},[le.kind==="thinking"?(C(),Ve(L2,{key:0,text:le.thinking,mobile:i.value,streaming:ee(X,le),onOpen:ue=>d("openThinking",{turnId:X.id,blockIndex:le.sourceIndex})},null,8,["text","mobile","streaming","onOpen"])):le.kind==="text"&&le.text?(C(),I("div",uV,[vt(gu,{text:le.text,streaming:ee(X,le),"open-file":ue=>d("openFile",ue)},null,8,["text","streaming","open-file"])])):le.kind==="tool-stack"?(C(),I("div",dV,[(C(!0),I(Oe,null,Xe(le.tools,(ue,ve)=>(C(),Ve(kd,{key:S(z1)(ue),tool:ue.tool,mobile:i.value,"stack-position":S(B2)(ve,le.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[3]||(G[3]=Pe=>d("openMedia",Pe)),onOpenFile:G[4]||(G[4]=Pe=>d("openFile",Pe)),onOpenToolDiff:G[5]||(G[5]=Pe=>d("openToolDiff",Pe))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])):le.kind==="agent"?(C(),Ve(j1,{key:3,member:le.member,onOpen:ue=>d("openAgent",{turnId:X.id,blockIndex:le.sourceIndex,memberId:ue})},null,8,["member","onOpen"])):le.kind==="agentGroup"?(C(),Ve(O2,{key:4,members:le.members,onOpen:ue=>d("openAgent",{turnId:X.id,blockIndex:le.sourceIndex,memberId:ue})},null,8,["members","onOpen"])):le.kind==="tool"?(C(),Ve(kd,{key:5,tool:le.tool,mobile:i.value,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[6]||(G[6]=ue=>d("openMedia",ue)),onOpenFile:G[7]||(G[7]=ue=>d("openFile",ue)),onOpenToolDiff:G[8]||(G[8]=ue=>d("openToolDiff",ue))},null,8,["tool","mobile","tool-diff-panel"])):se("",!0)],64))),128)),X.id!==c.value&&D(ke)&&(A(ke).trim().length>0||X.durationMs!==void 0)?(C(),I("div",fV,[X.durationMs!==void 0?(C(),I("span",{key:0,class:"a-duration",title:`${X.durationMs} ms`},P(S(D2)(X.durationMs)),9,hV)):se("",!0),A(ke).trim().length>0?(C(),I("button",{key:1,class:"a-cpbtn",tabindex:"-1",onClick:le=>V(ke)},[g.value!==X.id?(C(),I("svg",mV,[...G[27]||(G[27]=[p("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),p("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(C(),I("svg",gV,[...G[28]||(G[28]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),p("span",vV,P(S(o)("filePreview.copy")),1)],8,pV)):se("",!0)])):se("",!0)],8,cV))],64))),128)),e.compaction?(C(),Ve(P2,{key:3,label:S(o)("conversation.compacting")},null,8,["label"])):se("",!0),u.value?(C(),I("div",yV,[vt(q1,{fast:e.fastMoon},null,8,["fast"])])):se("",!0)])):(C(),I("div",kV,[e.sessionLoading?(C(),I("div",bV,[G[29]||(G[29]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),p("span",wV,P(S(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(C(),I("div",_V)):se("",!0),e.hasMoreMessages||e.loadingMore?(C(),I("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Le(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(C(),I("span",CV,[G[30]||(G[30]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),ut(" "+P(S(o)("conversation.loadingOlder")),1)])):(C(),I("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:G[9]||(G[9]=X=>d("loadOlderMessages"))},P(S(o)("conversation.loadOlder")),1))],2)):se("",!0),(C(!0),I(Oe,null,Xe(e.turns,(X,ke)=>(C(),I(Oe,{key:X.id},[X.role==="compaction"?(C(),I("div",{key:0,class:"compact-divider turn-anchor","data-turn-id":X.id,role:"separator"},[G[31]||(G[31]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1)),X.text?(C(),I("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:le=>d("openCompaction",{turnId:X.id})},[p("span",null,P(f(X)),1),p("span",TV,P(S(o)("conversation.viewSummary")),1)],8,xV)):(C(),I("span",AV,P(f(X)),1)),G[32]||(G[32]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,SV)):(C(),I("div",{key:1,class:Le(["ln turn-anchor",[X.role==="user"?"userline":"ai",{undoing:w.value===X.id}]]),"data-turn-id":X.id},[p("span",EV,P(X.no),1),p("div",IV,[p("div",$V,[X.role==="user"?(C(),I(Oe,{key:0},[G[33]||(G[33]=p("span",{class:"pr"},"user@kimi",-1)),G[34]||(G[34]=p("span",{class:"who"}," $ ",-1))],64)):(C(),I(Oe,{key:1},[G[35]||(G[35]=p("span",{class:"pr"},"kimi",-1)),G[36]||(G[36]=p("span",{class:"who"}," > ",-1))],64)),X.id!==c.value&&D(ke)&&A(ke).trim().length>0?(C(),I("button",{key:2,class:"cpbtn",onClick:le=>V(ke),tabindex:"-1"},[g.value!==X.id?(C(),I("svg",LV,[...G[37]||(G[37]=[p("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),p("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(C(),I("svg",PV,[...G[38]||(G[38]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),p("span",OV,P(S(o)("filePreview.copy")),1)],8,NV)):se("",!0),X.durationMs!==void 0&&X.role==="assistant"?(C(),I("span",{key:3,class:"turn-duration",title:`${X.durationMs} ms`},P(S(D2)(X.durationMs)),9,RV)):se("",!0)]),X.role==="user"?(C(),I("div",DV,[X.skillActivation?(C(),I("div",BV,[p("div",FV,[G[39]||(G[39]=p("span",{class:"skill-act-arrow"},"▶",-1)),p("span",null,P(S(o)("conversation.activatedSkill",{name:X.skillActivation.name})),1)]),X.skillActivation.args?(C(),I("div",HV,P(X.skillActivation.args),1)):se("",!0)])):X.pluginCommand?(C(),I("div",WV,[p("div",UV,[G[40]||(G[40]=p("span",{class:"skill-act-arrow"},"▶",-1)),p("span",null,"/"+P(X.pluginCommand.pluginId)+":"+P(X.pluginCommand.commandName),1)]),X.pluginCommand.args?(C(),I("div",jV,P(X.pluginCommand.args),1)):se("",!0)])):(C(),I(Oe,{key:2},[ut(P(X.text),1)],64))])):(C(!0),I(Oe,{key:1},Xe(S(F2)(X),(le,He)=>(C(),I(Oe,{key:S(H2)(le,He)},[le.kind==="thinking"?(C(),Ve(L2,{key:0,text:le.thinking,streaming:ee(X,le),onOpen:ue=>d("openThinking",{turnId:X.id,blockIndex:le.sourceIndex})},null,8,["text","streaming","onOpen"])):le.kind==="text"&&le.text?(C(),Ve(gu,{key:1,text:le.text,streaming:ee(X,le),"open-file":ue=>d("openFile",ue)},null,8,["text","streaming","open-file"])):le.kind==="tool-stack"?(C(),I("div",qV,[(C(!0),I(Oe,null,Xe(le.tools,(ue,ve)=>(C(),Ve(kd,{key:S(z1)(ue),tool:ue.tool,"stack-position":S(B2)(ve,le.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[10]||(G[10]=Pe=>d("openMedia",Pe)),onOpenFile:G[11]||(G[11]=Pe=>d("openFile",Pe)),onOpenToolDiff:G[12]||(G[12]=Pe=>d("openToolDiff",Pe))},null,8,["tool","stack-position","tool-diff-panel"]))),128))])):le.kind==="agent"?(C(),Ve(j1,{key:3,member:le.member,onOpen:ue=>d("openAgent",{turnId:X.id,blockIndex:le.sourceIndex,memberId:ue})},null,8,["member","onOpen"])):le.kind==="agentGroup"?(C(),Ve(O2,{key:4,members:le.members,onOpen:ue=>d("openAgent",{turnId:X.id,blockIndex:le.sourceIndex,memberId:ue})},null,8,["members","onOpen"])):le.kind==="tool"?(C(),Ve(kd,{key:5,tool:le.tool,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[13]||(G[13]=ue=>d("openMedia",ue)),onOpenFile:G[14]||(G[14]=ue=>d("openFile",ue)),onOpenToolDiff:G[15]||(G[15]=ue=>d("openToolDiff",ue))},null,8,["tool","tool-diff-panel"])):se("",!0)],64))),128))]),X.role==="user"&&m(X)?(C(),I("div",{key:0,class:Le(["u-edit-wrap ln-edit-wrap",{undoing:w.value===X.id}])},[_.value!==X.id?(C(),I("button",{key:0,type:"button",class:"u-edit","data-tooltip":S(o)("conversation.undoTooltip"),onClick:le=>_.value=X.id},[G[41]||(G[41]=p("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"},[p("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),p("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1)),p("span",VV,P(S(o)("conversation.undo")),1)],8,zV)):(C(),I("div",{key:1,class:"u-edit-confirm",onClick:G[17]||(G[17]=Ze(()=>{},["stop"]))},[p("span",null,P(S(o)("conversation.undoConfirm")),1),p("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ze(le=>N(X),["stop"])},P(S(o)("conversation.confirm")),9,KV),p("button",{type:"button",class:"u-edit-confirm-btn",onClick:G[16]||(G[16]=Ze(le=>_.value=null,["stop"]))},P(S(o)("conversation.cancel")),1)]))],2)):se("",!0)],10,MV))],64))),128)),e.compaction?(C(),Ve(P2,{key:3,label:S(o)("conversation.compacting")},null,8,["label"])):se("",!0),u.value?(C(),I("div",GV,[G[43]||(G[43]=p("span",{class:"no"},"—",-1)),p("div",YV,[G[42]||(G[42]=p("div",{class:"role-row"},[p("span",{class:"pr"},"kimi"),p("span",{class:"who"}," > ")],-1)),vt(q1,{fast:e.fastMoon,label:"Sending…"},null,8,["fast"])])])):se("",!0)]))}}),_3=bt(XV,[["__scopeId","data-v-3ba48bfd"]]),QV={class:"ch-id"},ZV={key:0,class:"ch-ws"},JV={key:1,class:"ch-sep"},eK=["onKeydown"],tK=["title"],nK=["title","aria-label","aria-expanded"],oK=["title"],sK=["title"],iK={key:0,class:"ch-pill ch-sync-pill"},rK={key:0,class:"ch-ahead"},lK={key:1,class:"ch-behind"},aK={key:1,class:"ch-pill ch-diff-pill"},cK={key:0,class:"ch-add"},uK={key:1,class:"ch-del"},dK=["title"],fK=Qe({__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}=St(),o=e,s=t,i=F(()=>o.ahead??0),r=F(()=>o.behind??0),l=F(()=>o.gitDiffStats?.totalAdditions??0),a=F(()=>o.gitDiffStats?.totalDeletions??0),c=F(()=>l.value>0||a.value>0),u=ne(!1),d=ne(null),h=ne(null),m=ne({});function f(V){const U=V.target;h.value?.contains(U)||d.value?.contains(U)||w()}function g(){w()}async function _(V){if(V.stopPropagation(),u.value){w();return}u.value=!0,document.addEventListener("mousedown",f),document.addEventListener("scroll",g,!0),window.addEventListener("resize",g),await ht();const U=d.value,ee=h.value;if(!U||!ee)return;const K=U.getBoundingClientRect(),G=4,X=8,ke=ee.offsetWidth,le=ee.offsetHeight;let He=K.bottom+G;He+le>window.innerHeight-X&&(He=Math.max(X,K.top-le-G));let ue=K.left;ue+ke>window.innerWidth-X&&(ue=Math.max(X,K.right-ke)),m.value={top:`${Math.round(He)}px`,left:`${Math.round(ue)}px`}}function w(){u.value=!1,D(),document.removeEventListener("mousedown",f),document.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}Yt(()=>{document.removeEventListener("mousedown",f),document.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)});function y(){s("copyAll"),w()}function b(){s("copyFinalSummary"),w()}const v=ne(!1);function x(){o.sessionId&&wo(o.sessionId).then(V=>{V&&(v.value=!0,setTimeout(()=>{v.value=!1},1200))})}const L=ne(!1),N=ne(""),k=ne(null);async function T(){if(w(),!!o.sessionId){L.value=!0,N.value=o.sessionTitle??"",await ht();try{k.value?.focus(),k.value?.select()}catch{}}}function E(){const V=N.value.trim();V&&o.sessionId&&V!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,V),L.value=!1}function O(){L.value=!1}function A(){o.sessionId&&(w(),s("forkSession",o.sessionId))}const $=ne(!1);let R;function D(){clearTimeout(R),$.value=!1}function W(){if(o.sessionId){if($.value){s("archiveSession",o.sessionId),w();return}$.value=!0,R=setTimeout(()=>{$.value=!1},2500)}}return(V,U)=>(C(),I("header",{class:Le(["chat-header",{"macos-desktop":S(Rx)}])},[p("div",QV,[e.workspaceName?(C(),I("span",ZV,P(e.workspaceName),1)):se("",!0),e.workspaceName&&e.sessionTitle?(C(),I("span",JV,"/")):se("",!0),L.value?qt((C(),I("input",{key:2,ref_key:"renameInputRef",ref:k,"onUpdate:modelValue":U[0]||(U[0]=ee=>N.value=ee),class:"ch-rename",type:"text",onKeydown:[Os(Ze(E,["stop"]),["enter"]),Os(Ze(O,["stop"]),["esc"])],onBlur:E,onClick:U[1]||(U[1]=Ze(()=>{},["stop"]))},null,40,eK)),[[Wn,N.value]]):e.sessionTitle?(C(),I("span",{key:3,class:"ch-ses",title:e.sessionTitle},P(e.sessionTitle),9,tK)):se("",!0)]),p("button",{ref_key:"kebabRef",ref:d,type:"button",class:Le(["ch-act ch-act-more",{open:u.value}]),title:S(n)("header.options"),"aria-label":S(n)("header.options"),"aria-expanded":u.value,"aria-haspopup":"menu",onClick:U[2]||(U[2]=Ze(ee=>_(ee),["stop"]))},[...U[6]||(U[6]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"3",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"13",cy:"8",r:"1.3"})],-1)])],10,nK),u.value?(C(),I("div",{key:0,ref_key:"menuRef",ref:h,class:"ch-menu",style:Wt(m.value),onClick:U[3]||(U[3]=Ze(()=>{},["stop"]))},[p("button",{type:"button",class:"chm-item",onClick:Ze(y,["stop"])},P(e.copied?S(n)("header.copied"):S(n)("header.copyAll")),1),p("button",{type:"button",class:"chm-item",onClick:Ze(b,["stop"])},P(S(n)("header.copyFinalSummary")),1),e.sessionId?(C(),I(Oe,{key:0},[U[7]||(U[7]=p("div",{class:"chm-divider"},null,-1)),p("button",{type:"button",class:"chm-item",onClick:Ze(x,["stop"])},[p("span",null,P(v.value?S(n)("header.copied"):S(n)("header.copySessionId")),1)]),p("button",{type:"button",class:"chm-item",onClick:Ze(T,["stop"])},P(S(n)("header.renameSession")),1),p("button",{type:"button",class:"chm-item",onClick:Ze(A,["stop"])},P(S(n)("header.forkSession")),1),p("button",{type:"button",class:"chm-item del",onClick:Ze(W,["stop"])},P($.value?S(n)("header.confirmArchive"):S(n)("header.archiveSession")),1)],64)):se("",!0)],4)):se("",!0),U[9]||(U[9]=p("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(C(),I("button",{key:1,type:"button",class:"ch-git",title:S(n)("header.gitTooltip"),onClick:U[4]||(U[4]=ee=>s("openChanges"))},[p("span",{class:Le(["ch-branch",{"ch-detached":!e.branch}]),title:e.branch||S(n)("header.detached")},P(e.branch||S(n)("header.detached")),11,sK),i.value>0||r.value>0?(C(),I("span",iK,[i.value>0?(C(),I("span",rK,"↑"+P(i.value),1)):se("",!0),r.value>0?(C(),I("span",lK,"↓"+P(r.value),1)):se("",!0)])):se("",!0),c.value?(C(),I("span",aK,[l.value>0?(C(),I("span",cK,"+"+P(l.value),1)):se("",!0),a.value>0?(C(),I("span",uK,"-"+P(a.value),1)):se("",!0)])):se("",!0)],8,oK)):se("",!0),e.pr?(C(),I("button",{key:2,type:"button",class:Le(["ch-pill ch-pr",`pr-${e.pr.state}`]),title:S(n)("header.openPr"),onClick:U[5]||(U[5]=ee=>e.pr&&s("openPr",e.pr.url))},[U[8]||(U[8]=Ir('<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-e1f86c03><circle cx="5" cy="6" r="3" data-v-e1f86c03></circle><path d="M5 9v12" data-v-e1f86c03></path><circle cx="19" cy="18" r="3" data-v-e1f86c03></circle><path d="m15 9-3-3 3-3" data-v-e1f86c03></path><path d="M12 6h5a2 2 0 0 1 2 2v7" data-v-e1f86c03></path></svg>',1)),p("span",null,"PR #"+P(e.pr.number)+" · "+P(e.pr.state),1)],10,dK)):se("",!0)],2))}}),hK=bt(fK,[["__scopeId","data-v-e1f86c03"]]),pK={key:0,class:"slash-menu",role:"listbox"},mK=["aria-selected","onMouseenter","onMousedown"],gK={class:"slash-name"},vK={class:"slash-desc"},yK=Qe({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=St(),o=e,s=t,i=ne([]);return ze(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(C(),I("div",pK,[(C(!0),I(Oe,null,Xe(e.items,(a,c)=>(C(),I("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Le(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:Ze(u=>s("select",a),["prevent"])},[p("span",gK,P(a.name),1),p("span",vK,P(a.isSkill?a.desc:S(n)(a.desc)),1)],42,mK))),128))])):se("",!0)}}),kK=bt(yK,[["__scopeId","data-v-738976e5"]]),bK={class:"mention-menu",role:"listbox"},wK={key:0,class:"mention-state dim"},_K={key:1,class:"mention-state dim"},CK=["aria-selected","onMouseenter","onMousedown"],SK=["innerHTML"],xK={class:"mention-name"},TK={class:"mention-path"},AK='<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>',MK='<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>',EK='<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>',IK='<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>',W2='<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>',$K=Qe({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=St(),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 AK;const d=c.name||u.split("/").pop()||u,h=d.lastIndexOf("."),m=h>0?d.slice(h+1).toLowerCase():"";return m?i.has(m)?MK:r.has(m)?EK:l.has(m)?IK:W2:W2}return(c,u)=>(C(),I("div",bK,[n.loading?(C(),I("div",wK,P(S(s)("mention.searching")),1)):n.items.length===0?(C(),I("div",_K,P(S(s)("mention.noMatch")),1)):(C(!0),I(Oe,{key:2},Xe(n.items,(d,h)=>(C(),I("div",{key:d.path,class:Le(["mention-item",{active:h===n.activeIndex}]),role:"option","aria-selected":h===n.activeIndex,onMouseenter:m=>o("hover",h),onMousedown:Ze(m=>o("select",d),["prevent"])},[p("span",{class:"mention-icon",innerHTML:a(d),"aria-hidden":"true"},null,8,SK),p("span",xK,P(d.name),1),p("span",TK,P(d.path),1)],42,CK))),128))]))}}),NK=bt($K,[["__scopeId","data-v-86e06bbf"]]),C3=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/permission",desc:"commands.permission.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/status",desc:"commands.status.desc"}];function LK(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 S3(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...C3,...t]}function PK(e,t=C3){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((o,s)=>{const i=o.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:o,index:s,score:r}}).filter(({score:o})=>o>0).sort((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function x3(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 U2(e,t){switch(x3(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const lh=100;function OK(e){const t=Oh(Ct.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>lh?n.slice(-lh):n,s={[e]:o};return Tu(Ct.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function RK(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=ne(OK(s())),r=F(()=>i.value[s()??""]??[]);let l=-1,a="";function c(w){const y=s();if(l=-1,!y)return;const b=w.trim();if(!b)return;const v=i.value[y]??[];if(v.at(-1)===b)return;const x=[...v,b],L=x.length>lh?x.slice(-lh):x;i.value={...i.value,[y]:L},Tu(Ct.inputHistory,i.value)}function u(){const w=n.value;if(!w)return!1;const y=w.selectionStart??0;return w.value.lastIndexOf(`
|
|
258
|
-
`,y-1)===-1}function d(w){t.value=w,ht(()=>{const y=n.value;if(!y)return;o();const b=w.length;y.setSelectionRange(b,b)})}function h(){const w=r.value;if(w.length!==0){if(l===-1)a=t.value,l=w.length-1;else if(l>0)l-=1;else return;d(w[l])}}function m(){if(l===-1)return;const w=r.value;l<w.length-1?(l+=1,d(w[l])):(l=-1,d(a))}function f(){l=-1}function g(){return l!==-1}function _(){return r.value.length>0}return ze(s,()=>{l=-1}),{push:c,caretAtFirstLine:u,recallOlder:h,recallNewer:m,resetBrowsing:f,isBrowsing:g,hasHistory:_}}function DK(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=ne(!1),c=ne([]),u=ne(0);function d(){const m=t.value;m.startsWith("/")&&!m.includes(" ")?(c.value=PK(m,S3(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function h(m){if(a.value=!1,m.acceptsInput){t.value=`${m.name} `,ht(()=>{const f=n.value;if(!f)return;const g=t.value.length;f.setSelectionRange(g,g),f.focus(),o()});return}t.value="",l?.(),r(m.name),i(m.name)}return{open:a,items:c,active:u,update:d,select:h}}function BK(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=ne(!1),r=ne([]),l=ne(0),a=ne(!1);let c=null;function u(){const m=t.value,f=n.value?.selectionStart??m.length;let g=f-1;for(;g>=0&&!/\s/.test(m[g]);)g--;g++;const _=m.slice(g,f);return _.startsWith("@")?{token:_.slice(1),start:g,end:f}:null}function d(){const m=u(),f=s();if(!m||!f){i.value=!1;return}const g=m.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await f(g)}catch{r.value=[]}finally{a.value=!1}},200)}function h(m){const f=u();if(!f)return;const g=t.value;t.value=g.slice(0,f.start)+m.path+g.slice(f.end),i.value=!1,ht(()=>{const _=n.value;if(!_)return;const w=f.start+m.path.length;_.setSelectionRange(w,w),_.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:h}}function FK(e){const{sessionId:t}=e;function n(c){return bn(Ab(c))??""}function o(c,u){const d=Ab(c);u?An(d,u):ru(d)}const s=ne(n(t())),i=ne(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}ze(s,c=>{ht(r),o(t(),c)}),ze(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),ht(r))});function l(c){s.value=c,ht(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function HK(e){const{uploadImage:t,sessionId:n}=e,o=ne({}),s=F(()=>o.value[n()??""]??[]),i=ne(null),r=ne(null),l=ne(!1);let a=0;function c(){return`att_${++a}`}function u(k,T){o.value={...o.value,[k]:T}}function d(k){try{URL.revokeObjectURL(k.previewUrl)}catch{}}function h(k){return k.startsWith("image/")?"image":k.startsWith("video/")?"video":null}async function m(k){const T=t();if(!T)return;const E=n()??"",O=k.map(A=>({file:A,kind:h(A.type)})).filter(A=>A.kind!==null);if(O.length!==0)for(const{file:A,kind:$}of O){const R=c(),D=URL.createObjectURL(A),W={localId:R,name:A.name,kind:$,previewUrl:D,uploading:!0};u(E,[...o.value[E]??[],W]),T(A,A.name).then(V=>{const U=o.value[E]??[];u(E,U.map(ee=>ee.localId===R?{...ee,uploading:!1,fileId:V?.fileId,error:V===null}:ee))}).catch(()=>{const V=o.value[E]??[];u(E,V.map(U=>U.localId===R?{...U,uploading:!1,error:!0}:U))})}}function f(k){const T=n()??"",E=o.value[T]??[],O=E.find(A=>A.localId===k);i.value?.localId===k&&(i.value=null),O&&d(O),u(T,E.filter(A=>A.localId!==k))}function g(k){i.value=k}function _(){i.value=null}function w(){r.value?.click()}function y(k){const T=k.target,E=Array.from(T.files??[]);m(E),T.value=""}function b(k){if(!t())return;const T=k.clipboardData;if(!T)return;const E=[],O=new Set,A=($,R)=>{const D=`${$.size}:${$.type}:${R}`;if(O.has(D))return;O.add(D);const W=$.type.split("/")[1]??"png",V=R.includes(".")?R:`paste-${Date.now()}.${W}`;E.push($ instanceof File?$:new File([$],V,{type:$.type}))};for(const $ of Array.from(T.items))if($.kind==="file"&&h($.type)){const R=$.getAsFile();R&&A(R,R.name||`paste-${Date.now()}.${$.type.split("/")[1]??"png"}`)}for(const $ of Array.from(T.files))h($.type)&&A($,$.name);E.length!==0&&(k.preventDefault(),m(E))}function v(k){!t()||!Array.from(k.dataTransfer?.items??[]).some(E=>E.kind==="file")||(k.preventDefault(),l.value=!0)}function x(){l.value=!1}function L(k){if(l.value=!1,!t())return;k.preventDefault();const T=Array.from(k.dataTransfer?.files??[]);m(T)}function N(){const k=n()??"";for(const T of o.value[k]??[])d(T);u(k,[])}return ze(n,()=>{i.value=null}),sn(()=>{document.addEventListener("paste",b)}),Yt(()=>{document.removeEventListener("paste",b);for(const k of Object.values(o.value))for(const T of k)d(T);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:f,openAttachmentPreview:g,closeAttachmentPreview:_,openFilePicker:w,handleFileInputChange:y,handleDragOver:v,handleDragLeave:x,handleDrop:L,clearAfterSubmit:N}}const WK={key:0,class:"att-strip"},UK=["title","onClick"],jK=["src"],qK=["src","alt"],zK={key:2,class:"att-video-badge","aria-hidden":"true"},VK={class:"att-name"},KK=["aria-label"],GK=["title"],YK=["title","onClick"],XK={class:"att-lightbox-card"},QK=["title"],ZK=["src"],JK=["src","alt"],eG={class:"att-lightbox-name"},tG={class:"composer-card"},nG={class:"cin-wrap"},oG={class:"input-row"},sG=["placeholder"],iG={class:"send-col"},rG=["aria-label","title"],lG={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"},aG={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"},cG=["aria-label","title"],uG={class:"toolbar-left"},dG=["title"],fG=["title","onKeydown"],hG=["onClick"],pG={class:"pd-check"},mG={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"},gG={class:"pd-info"},vG={class:"pd-desc"},yG=["title"],kG={class:"mode-label"},bG={key:0,class:"mode-tag"},wG={key:1,class:"mode-tag"},_G={key:2,class:"mode-tag"},CG={class:"mode-row-name"},SG={class:"mode-row-name"},xG={class:"mode-row-name"},TG={key:0,class:"mode-row-actions"},AG={class:"toolbar-right"},MG=["title"],EG={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},IG=["stroke-dasharray","stroke-dashoffset"],$G={class:"ctx-num"},NG=["title","onKeydown"],LG={key:0,class:"think-suffix"},PG={key:0,class:"md-section"},OG=["onClick"],RG={class:"md-check"},DG={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"},BG={class:"md-name"},FG={class:"md-provider"},HG={key:1,class:"md-divider"},WG={key:2,class:"md-section"},UG=["onClick"],jG={class:"md-check"},qG={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"},zG={class:"md-name"},VG={key:0,class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},KG={key:3,class:"md-divider"},GG=["disabled"],YG={class:"md-check"},XG={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"},QG={class:"md-name"},ZG={key:0,class:"md-note"},JG={key:1,class:"md-note"},eY={class:"md-name"},j2=56,tY=Qe({__name:"Composer",props:{running:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const o=e,s=F(()=>o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=St(),{text:l,textareaRef:a,autosize:c,loadForEdit:u,clearDraft:d}=FK({sessionId:()=>o.sessionId}),h=ne(!1);function m(){h.value=!h.value,ht(()=>{c(),w(),a.value?.focus()})}function f(){h.value&&(h.value=!1,ht(c))}function g(Ye){if(typeof getComputedStyle>"u")return j2;const qe=Number.parseFloat(getComputedStyle(Ye).minHeight);return Number.isFinite(qe)&&qe>0?qe:j2}const _=ne(!1);function w(){const Ye=a.value;_.value=!!Ye&&Ye.scrollHeight>g(Ye)}ze(l,()=>{ht(w)}),ze(()=>o.sessionId,()=>{h.value=!1});const y=RK({text:l,textareaRef:a,autosize:c,sessionId:()=>o.sessionId}),{open:b,items:v,active:x,update:L,select:N}=DK({text:l,textareaRef:a,autosize:c,skills:()=>o.skills,emitCommand:Ye=>i("command",Ye),historyPush:Ye=>y.push(Ye),clearDraft:d}),{open:k,items:T,active:E,loading:O,update:A,select:$}=BK({text:l,textareaRef:a,autosize:c,searchFiles:()=>o.searchFiles});function R(){y.resetBrowsing(),L(),A()}const{attachments:D,previewAttachment:W,fileInputRef:V,isDragOver:U,removeAttachment:ee,openAttachmentPreview:K,closeAttachmentPreview:G,openFilePicker:X,handleFileInputChange:ke,handleDragOver:le,handleDragLeave:He,handleDrop:ue,clearAfterSubmit:ve}=HK({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});sn(()=>{l.value&&ht(()=>{c(),w()})}),Yt(()=>{document.removeEventListener("mousedown",On),q()});function Pe(){a.value?.focus({preventScroll:!0})}t({loadForEdit:u,focus:Pe});function Re(){const Ye=l.value.trim();if(D.value.some(it=>it.uploading))return;const qe=D.value.filter(it=>!it.uploading&&!it.error&&it.fileId);if(!Ye&&qe.length===0)return;if(y.push(Ye),Ye){const it=LK(Ye),Ie=it?S3(o.skills).some(be=>be.name===it.cmd):!1;if(it&&Ie){l.value="",d(),b.value=!1,f(),i("command",it.arg?`${it.cmd} ${it.arg}`:it.cmd);return}}const tt={text:Ye,attachments:qe.map(it=>({fileId:it.fileId,kind:it.kind}))};W.value=null,ve(),l.value="",d(),b.value=!1,k.value=!1,f(),i("submit",tt)}function Q(){if(!o.running||D.value.some(it=>it.uploading))return;const Ye=l.value.trim(),qe=D.value.filter(it=>!it.uploading&&!it.error&&it.fileId);if(!Ye&&qe.length===0&&o.queued.length===0)return;const tt={text:Ye,attachments:qe.map(it=>({fileId:it.fileId,kind:it.kind}))};ve(),y.push(Ye),l.value="",d(),b.value=!1,k.value=!1,f(),i("steer",tt)}let ce=!1,Ce=null;function q(){Ce!==null&&(clearTimeout(Ce),Ce=null)}function te(){q(),ce=!0}function pe(){q(),Ce=setTimeout(()=>{Ce=null,ce=!1},0)}function oe(Ye){return ce||Ye.isComposing||Ye.keyCode===229}function fe(Ye){if(!oe(Ye)){if(Ye.key==="Escape"){if(re.value){Ye.preventDefault(),ie();return}if(ge.value){Ye.preventDefault(),we();return}}if(b.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),x.value=(x.value+1)%v.value.length;return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),x.value=(x.value-1+v.value.length)%v.value.length;return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const qe=v.value[x.value];qe&&N(qe);return}if(Ye.key==="Escape"){Ye.preventDefault(),b.value=!1;return}}if(k.value&&!O.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),E.value=(E.value+1)%Math.max(1,T.value.length);return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),E.value=(E.value-1+Math.max(1,T.value.length))%Math.max(1,T.value.length);return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const qe=T.value[E.value];qe&&$(qe);return}if(Ye.key==="Escape"){Ye.preventDefault(),k.value=!1;return}}if(Ye.key==="s"&&(Ye.ctrlKey||Ye.metaKey)&&!Ye.shiftKey&&!Ye.altKey){o.running&&(Ye.preventDefault(),Q());return}if(!b.value&&!k.value&&!Ye.shiftKey&&!Ye.altKey&&!Ye.metaKey&&!Ye.ctrlKey){const qe=y.isBrowsing();if(Ye.key==="ArrowUp"&&y.hasHistory()&&(qe||y.caretAtFirstLine())){Ye.preventDefault(),y.recallOlder();return}if(Ye.key==="ArrowDown"&&qe){Ye.preventDefault(),y.recallNewer();return}}if(Ye.key==="Enter"&&!Ye.shiftKey){if(h.value&&!(Ye.metaKey||Ye.ctrlKey))return;Ye.preventDefault(),Re()}}}const H=F(()=>o.running?r("composer.interrupt"):r("composer.send")),Y=F(()=>!!o.uploadImage),re=ne(!1),ge=ne(!1),xe=ne(null);function Ne(){re.value=!re.value,re.value?(ge.value=!1,document.addEventListener("click",je,!0)):document.removeEventListener("click",je,!0)}function ie(){re.value=!1,ge.value||document.removeEventListener("click",je,!0)}function ae(){ge.value=!ge.value,ge.value?(re.value=!1,document.addEventListener("click",je,!0)):document.removeEventListener("click",je,!0)}function we(){ge.value=!1,re.value||document.removeEventListener("click",je,!0)}function je(Ye){xe.value&&!xe.value.contains(Ye.target)&&(ie(),we())}Yt(()=>{document.removeEventListener("click",je,!0)});const nt=Ye=>`${Math.round(Ye/1e3)}k`,ct=F(()=>{const Ye=o.status?.ctxMax??0;return Ye<=0?0:Math.min(100,Math.max(0,Math.round((o.status?.ctxUsed??0)/Ye*100)))}),_t=F(()=>{const Ye=(o.status?.ctxUsed??0).toLocaleString(),qe=(o.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Ye,max:qe,pct:ct.value})}),$t=F(()=>ct.value>=80),lt=F(()=>{const Ye=o.status?.modelId??o.status?.model??"";return o.models?.find(qe=>qe.id===Ye||qe.model===Ye||qe.displayName===o.status?.model)}),Rt=F(()=>x3(lt.value)),fn=F(()=>Rt.value==="toggle"),Mn=F(()=>Rt.value==="always-on"?!0:Rt.value==="unsupported"?!1:(o.thinking??"off")!=="off");function Nt(){fn.value&&i("setThinking",Mn.value?"off":"high")}const Ft=F(()=>o.planMode===!0),qn=F(()=>o.swarmMode===!0),Je=F(()=>o.activationBadges?.goal!==null),Qn=F(()=>Je.value||o.goalMode===!0),es=ne(!1),Ro=ne(null),po=ne(null),Pn=ne({}),an=F(()=>Ft.value||qn.value||Qn.value);function wn(){es.value=!1,document.removeEventListener("mousedown",On)}function On(Ye){const qe=Ye.target;Ro.value?.contains(qe)||po.value?.contains(qe)||wn()}function zn(){if(es.value){wn();return}const Ye=Ro.value?.getBoundingClientRect();Ye&&(Pn.value={left:`${Math.round(Ye.left)}px`,bottom:`${Math.round(window.innerHeight-Ye.top+8)}px`}),es.value=!0,setTimeout(()=>document.addEventListener("mousedown",On),0)}const Zn=[{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 Jn(Ye){i("setPermission",Ye),we()}const Do=F(()=>Zn.find(Ye=>Ye.mode===o.status?.permission)),Bo=F(()=>Do.value?r(Do.value.labelKey):""),At=F(()=>lt.value?.provider??""),Co=F(()=>!At.value||!o.models?.length?[]:o.models.filter(Ye=>Ye.provider===At.value)),cn=F(()=>new Set(o.starredIds??[]));function Fo(Ye){return cn.value.has(Ye)}const So=F(()=>o.models?.length?o.models.filter(Ye=>Fo(Ye.id)&&Ye.provider!==At.value):[]);function eo(Ye){i("selectModel",Ye),ie()}return(Ye,qe)=>(C(),I("div",{class:Le(["composer",{"drag-over":S(U),expanded:h.value}]),onDragover:qe[18]||(qe[18]=(...tt)=>S(le)&&S(le)(...tt)),onDragleave:qe[19]||(qe[19]=(...tt)=>S(He)&&S(He)(...tt)),onDrop:qe[20]||(qe[20]=(...tt)=>S(ue)&&S(ue)(...tt))},[S(D).length>0?(C(),I("div",WK,[(C(!0),I(Oe,null,Xe(S(D),tt=>(C(),I("div",{key:tt.localId,class:Le(["att-chip",{"att-error":tt.error}])},[p("button",{type:"button",class:"att-preview",title:S(r)("composer.previewAttachment",{name:tt.name}),onClick:it=>S(K)(tt)},[tt.kind==="video"?(C(),I("video",{key:0,class:"att-thumb",src:tt.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,jK)):(C(),I("img",{key:1,class:"att-thumb",src:tt.previewUrl,alt:tt.name},null,8,qK)),tt.kind==="video"?(C(),I("span",zK,[...qe[21]||(qe[21]=[p("svg",{viewBox:"0 0 16 16",width:"9",height:"9",fill:"currentColor"},[p("path",{d:"M5 3.5v9l7-4.5z"})],-1)])])):se("",!0)],8,UK),p("span",VK,P(tt.name),1),tt.uploading?(C(),I("span",{key:0,class:"att-spinner","aria-label":S(r)("composer.uploading")},[...qe[22]||(qe[22]=[p("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"},[p("circle",{cx:"8",cy:"8",r:"6","stroke-opacity":"0.25"}),p("path",{d:"M8 2 A6 6 0 0 1 14 8","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"0.8s",repeatCount:"indefinite"})])],-1)])],8,KK)):tt.error?(C(),I("span",{key:1,class:"att-err-icon",title:S(r)("composer.uploadFailed")},[...qe[23]||(qe[23]=[p("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"},[p("circle",{cx:"6",cy:"6",r:"5"}),p("line",{x1:"6",y1:"3.5",x2:"6",y2:"6.5"}),p("circle",{cx:"6",cy:"8.5",r:"0.5",fill:"currentColor"})],-1)])],8,GK)):se("",!0),p("button",{class:"att-rm",title:S(r)("composer.removeNamed",{name:tt.name}),onClick:it=>S(ee)(tt.localId)},[...qe[24]||(qe[24]=[p("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"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,YK)],2))),128))])):se("",!0),S(W)?(C(),I("div",{key:1,class:"att-lightbox",onClick:qe[1]||(qe[1]=Ze((...tt)=>S(G)&&S(G)(...tt),["self"]))},[p("div",XK,[p("button",{type:"button",class:"att-lightbox-close",title:S(r)("model.close"),onClick:qe[0]||(qe[0]=(...tt)=>S(G)&&S(G)(...tt))},"✕",8,QK),S(W).kind==="video"?(C(),I("video",{key:0,class:"att-lightbox-media",src:S(W).previewUrl,controls:"",playsinline:""},null,8,ZK)):(C(),I("img",{key:1,class:"att-lightbox-media",src:S(W).previewUrl,alt:S(W).name},null,8,JK)),p("div",eG,P(S(W).name),1)])])):se("",!0),p("div",tG,[p("div",nG,[S(b)?(C(),Ve(kK,{key:0,items:S(v),"active-index":S(x),onSelect:S(N),onHover:qe[2]||(qe[2]=tt=>x.value=tt)},null,8,["items","active-index","onSelect"])):se("",!0),S(k)?(C(),Ve(NK,{key:1,items:S(T),"active-index":S(E),loading:S(O),onSelect:S($),onHover:qe[3]||(qe[3]=tt=>E.value=tt)},null,8,["items","active-index","loading","onSelect"])):se("",!0),p("div",oG,[qt(p("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":qe[4]||(qe[4]=tt=>Ln(l)?l.value=tt:null),class:"ph",placeholder:s.value,rows:"1",onKeydown:fe,onCompositionstart:te,onCompositionend:pe,onInput:R},null,40,sG),[[Wn,S(l)]]),p("div",iG,[h.value||_.value?(C(),I("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?S(r)("composer.collapseTitle"):S(r)("composer.expandTitle"),title:h.value?S(r)("composer.collapseTitle"):S(r)("composer.expandTitle"),onClick:m},[h.value?(C(),I("svg",lG,[...qe[25]||(qe[25]=[p("path",{d:"M4 14h6v6"},null,-1),p("path",{d:"M20 10h-6V4"},null,-1),p("path",{d:"M14 10l7-7"},null,-1),p("path",{d:"M3 21l7-7"},null,-1)])])):(C(),I("svg",aG,[...qe[26]||(qe[26]=[p("path",{d:"M15 3h6v6"},null,-1),p("path",{d:"M9 21H3v-6"},null,-1),p("path",{d:"M21 3l-7 7"},null,-1),p("path",{d:"M3 21l7-7"},null,-1)])]))],8,rG)):se("",!0),p("button",{class:Le(["send",{aborting:e.running}]),"aria-label":H.value,title:e.running?S(r)("composer.interruptTitle"):H.value,onClick:qe[5]||(qe[5]=tt=>e.running?i("interrupt"):Re())},[(C(),I("svg",{class:Le(["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"},[...qe[27]||(qe[27]=[p("path",{d:"M8 3l6 5.5M8 3L2 8.5M8 3v10"},null,-1)])],2)),(C(),I("svg",{class:Le(["send-icon",{hidden:!e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[...qe[28]||(qe[28]=[p("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1.5"},null,-1)])],2))],10,cG)])])]),Y.value?(C(),I("input",{key:0,ref_key:"fileInputRef",ref:V,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:qe[6]||(qe[6]=(...tt)=>S(ke)&&S(ke)(...tt))},null,544)):se("",!0),p("div",{ref_key:"toolbarRef",ref:xe,class:"toolbar"},[p("div",uG,[Y.value?(C(),I("button",{key:0,class:"attach-btn",title:S(r)("composer.attachImage"),type:"button",onClick:qe[7]||(qe[7]=(...tt)=>S(X)&&S(X)(...tt))},[...qe[29]||(qe[29]=[p("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"},[p("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),p("circle",{cx:"5",cy:"6",r:"1.2"}),p("path",{d:"M2 10.5l3-2.5L8 11l2.5-2L14 11"})],-1)])],8,dG)):se("",!0),e.status?(C(),I("span",{key:1,class:Le(["perm-pill",["perm-"+e.status.permission,{open:ge.value}]]),role:"button",tabindex:"0",title:S(r)("status.permissionTooltip"),onClick:Ze(ae,["stop"]),onKeydown:[Os(ae,["enter"]),Os(Ze(ae,["prevent"]),["space"])]},P(Bo.value),43,fG)):se("",!0),ge.value&&e.status?(C(),I("div",{key:2,class:"perm-dropdown",role:"menu",onClick:qe[8]||(qe[8]=Ze(()=>{},["stop"]))},[(C(),I(Oe,null,Xe(Zn,tt=>p("button",{key:tt.mode,class:Le(["pd-row",{"is-current":tt.mode===e.status.permission}]),role:"menuitem",onClick:it=>Jn(tt.mode)},[p("span",pG,[tt.mode===e.status.permission?(C(),I("svg",mG,[...qe[30]||(qe[30]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):se("",!0)]),p("span",gG,[p("span",{class:"pd-name",style:Wt({color:tt.color})},P(S(r)(tt.labelKey)),5),p("span",vG,P(S(r)(tt.descKey)),1)])],10,hG)),64))])):se("",!0),e.status?(C(),I("div",{key:3,ref_key:"modesRef",ref:Ro,class:"modes"},[p("button",{type:"button",class:Le(["mode-pill",{on:an.value}]),title:S(r)("status.modesTooltip"),onClick:Ze(zn,["stop"])},[p("span",kG,P(S(r)("status.modesLabel")),1),Ft.value?(C(),I("span",bG,P(S(r)("status.planLabel")),1)):se("",!0),qn.value?(C(),I("span",wG,P(S(r)("status.swarmLabel")),1)):se("",!0),Qn.value?(C(),I("span",_G,P(S(r)("status.goalLabel")),1)):se("",!0)],10,yG),es.value?(C(),I("div",{key:0,ref_key:"modesMenuRef",ref:po,class:"modes-menu",style:Wt(Pn.value)},[p("button",{type:"button",class:Le(["mode-row",{on:Ft.value}]),onClick:qe[9]||(qe[9]=tt=>i("togglePlan"))},[p("span",CG,P(S(r)("status.planLabel")),1),p("span",{class:Le(["mode-switch",{on:Ft.value}])},[...qe[31]||(qe[31]=[p("span",{class:"mode-knob"},null,-1)])],2)],2),p("button",{type:"button",class:Le(["mode-row",{on:qn.value}]),onClick:qe[10]||(qe[10]=tt=>i("toggleSwarm"))},[p("span",SG,P(S(r)("status.swarmLabel")),1),p("span",{class:Le(["mode-switch",{on:qn.value}])},[...qe[32]||(qe[32]=[p("span",{class:"mode-knob"},null,-1)])],2)],2),p("div",{class:Le(["mode-row mode-row-goal",{on:Je.value||o.goalMode}])},[p("button",{type:"button",class:"mode-row-main",onClick:qe[11]||(qe[11]=tt=>Je.value?i("controlGoal","cancel"):i("toggleGoal"))},[p("span",xG,P(S(r)("status.goalLabel")),1),Je.value?se("",!0):(C(),I("span",{key:0,class:Le(["mode-switch",{on:o.goalMode}])},[...qe[33]||(qe[33]=[p("span",{class:"mode-knob"},null,-1)])],2))]),Je.value?(C(),I("div",TG,[p("button",{type:"button",class:"mode-row-action",onClick:qe[12]||(qe[12]=tt=>i("controlGoal","pause"))},P(S(r)("status.goalPause")),1),p("button",{type:"button",class:"mode-row-action",onClick:qe[13]||(qe[13]=tt=>i("controlGoal","resume"))},P(S(r)("status.goalResume")),1)])):se("",!0)],2)],4)):se("",!0)],512)):se("",!0)]),p("div",AG,[$t.value?(C(),I("button",{key:0,class:"compact-chip",onClick:qe[14]||(qe[14]=Ze(tt=>i("compact"),["stop"]))},"/compact")):se("",!0),e.status&&!e.hideContext?(C(),I("span",{key:1,class:"ctx-group",title:_t.value},[(C(),I("svg",EG,[qe[34]||(qe[34]=p("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5"},null,-1)),p("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-ct.value/100)}`},null,8,IG)])),p("span",$G,P(nt(e.status.ctxUsed))+"/"+P(nt(e.status.ctxMax)),1)],8,MG)):se("",!0),e.status?(C(),I("span",{key:2,class:Le(["model-pill",{open:re.value}]),role:"button",tabindex:"0",title:S(r)("status.modelTooltip"),onClick:Ze(Ne,["stop"]),onKeydown:[Os(Ne,["enter"]),Os(Ze(Ne,["prevent"]),["space"])]},[p("b",null,P(e.status.model),1),Mn.value?(C(),I("span",LG,P(S(r)("composer.thinkingSuffix")),1)):se("",!0),qe[35]||(qe[35]=p("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"},[p("path",{d:"M4 6l4 4 4-4"})],-1))],42,NG)):se("",!0)]),re.value&&e.status?(C(),I("div",{key:0,class:"model-dropdown",role:"menu",onClick:qe[17]||(qe[17]=Ze(()=>{},["stop"]))},[So.value.length>0?(C(),I("div",PG,P(S(r)("status.starredModels")),1)):se("",!0),(C(!0),I(Oe,null,Xe(So.value,tt=>(C(),I("button",{key:tt.id,class:Le(["md-row",{"is-current":tt.id===e.status.modelId}]),role:"menuitem",onClick:it=>eo(tt.id)},[p("span",RG,[tt.id===e.status.model||tt.model===e.status.model||tt.displayName===e.status.model?(C(),I("svg",DG,[...qe[36]||(qe[36]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):se("",!0)]),p("span",BG,P(tt.displayName??tt.model),1),p("span",FG,P(tt.provider),1),qe[37]||(qe[37]=p("svg",{class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},[p("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,OG))),128)),So.value.length>0?(C(),I("div",HG)):se("",!0),Co.value.length>0?(C(),I("div",WG,P(At.value),1)):se("",!0),(C(!0),I(Oe,null,Xe(Co.value,tt=>(C(),I("button",{key:tt.id,class:Le(["md-row",{"is-current":tt.id===e.status.modelId}]),role:"menuitem",onClick:it=>eo(tt.id)},[p("span",jG,[tt.id===e.status.model||tt.model===e.status.model||tt.displayName===e.status.model?(C(),I("svg",qG,[...qe[38]||(qe[38]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):se("",!0)]),p("span",zG,P(tt.displayName??tt.model),1),Fo(tt.id)?(C(),I("svg",VG,[...qe[39]||(qe[39]=[p("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)])])):se("",!0)],10,UG))),128)),Co.value.length>0?(C(),I("div",KG)):se("",!0),p("button",{class:Le(["md-row md-row-toggle",{"is-on":Mn.value,"is-disabled":!fn.value}]),role:"menuitem",disabled:!fn.value,onClick:qe[15]||(qe[15]=tt=>Nt())},[p("span",YG,[Mn.value?(C(),I("svg",XG,[...qe[40]||(qe[40]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):se("",!0)]),p("span",QG,P(S(r)("status.thinkingLabel")),1),Rt.value==="always-on"?(C(),I("span",ZG,P(S(r)("status.planOn")),1)):Rt.value==="unsupported"?(C(),I("span",JG,P(S(r)("status.modeNotSupported")),1)):se("",!0)],10,GG),qe[41]||(qe[41]=p("div",{class:"md-divider"},null,-1)),p("button",{class:"md-row md-row-more",role:"menuitem",onClick:qe[16]||(qe[16]=tt=>{ie(),i("pickModel")})},[p("span",eY,P(S(r)("status.moreModels")),1)])])):se("",!0)],512)])],34))}}),T3=bt(tY,[["__scopeId","data-v-02652603"]]),nY=["id"],oY={class:"swarm-head"},sY={class:"swarm-count"},iY={class:"swarm-grid"},rY={class:"member-top"},lY={class:"member-name"},aY={class:"member-phase"},cY={class:"member-mid"},uY={class:"member-bar"},dY={key:0,class:"member-type"},fY={key:0,class:"member-bottom"},hY=Qe({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=F(()=>t.group.members.length),o=F(()=>t.group.counts.completed+t.group.counts.failed);function s(l){switch(l){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function i(l){switch(l.phase){case"queued":return"......";case"working":return":::...";case"suspended":return"::....";case"completed":return"::::::";case"failed":return"!!...."}}function r(l){return l.outputLines?.map(a=>a.trimEnd()).filter(Boolean).at(-1)}return(l,a)=>(C(),I("section",{class:"swarm-card",id:`swarm-${e.group.id}`},[p("header",oY,[a[0]||(a[0]=p("div",{class:"swarm-title"},[p("span",{class:"swarm-mark","aria-hidden":"true"}),p("span",null,"Swarm")],-1)),p("div",sY,P(o.value)+"/"+P(n.value),1)]),p("div",iY,[(C(!0),I(Oe,null,Xe(e.group.members,c=>(C(),I("article",{key:c.id,class:Le(["swarm-member",`phase-${c.phase}`])},[p("div",rY,[p("span",lY,P(c.name),1),p("span",aY,P(s(c.phase)),1)]),p("div",cY,[p("span",uY,P(i(c)),1),c.subagentType?(C(),I("span",dY,P(c.subagentType),1)):se("",!0)]),c.suspendedReason||r(c)||c.summary?(C(),I("div",fY,P(c.suspendedReason||r(c)||c.summary),1)):se("",!0)],2))),128))])],8,nY))}}),pY=bt(hY,[["__scopeId","data-v-2cfb7bcf"]]),mY={class:"goal-progress","aria-hidden":"true"},gY={key:0,class:"goal-body"},vY={class:"goal-full"},yY={key:0,class:"goal-criterion"},kY={class:"goal-stats"},bY={key:0},wY={class:"goal-actions"},_Y=Qe({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=St(),i=ne(!1);ze(()=>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)=>(C(),I("section",{class:Le(["goal-strip",{expanded:i.value}])},[p("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[5]||(c[5]=p("span",{class:"goal-kicker"},"Goal",-1)),p("span",{class:Le(["goal-objective",{"expanded-hidden":i.value}])},P(e.goal.objective),3),p("span",{class:Le(["goal-status",`status-${e.goal.status}`])},P(e.goal.status),3),p("span",mY,[p("span",{class:"goal-progress-fill",style:Wt({width:`${r.value}%`})},null,4)]),(C(),I("svg",{class:Le(["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]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),i.value?(C(),I("div",gY,[p("div",vY,P(e.goal.objective),1),e.goal.completionCriterion?(C(),I("div",yY,[c[6]||(c[6]=p("span",null,"Done when",-1)),p("p",null,P(e.goal.completionCriterion),1)])):se("",!0),p("div",kY,[p("span",null,P(e.goal.turnsUsed)+" turns",1),p("span",null,P(e.goal.tokensUsed.toLocaleString())+" tokens",1),p("span",null,P(l(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(C(),I("span",bY,P(r.value)+"% token budget",1)):se("",!0)]),p("div",wY,[e.goal.status!=="paused"?(C(),I("button",{key:0,type:"button",class:"goal-action",onClick:c[1]||(c[1]=Ze(u=>o("controlGoal","pause"),["stop"]))},P(S(s)("status.goalPause")),1)):se("",!0),e.goal.status==="paused"?(C(),I("button",{key:1,type:"button",class:"goal-action primary",onClick:c[2]||(c[2]=Ze(u=>o("controlGoal","resume"),["stop"]))},P(S(s)("status.goalResume")),1)):se("",!0),p("button",{type:"button",class:"goal-action danger",onClick:c[3]||(c[3]=Ze(u=>o("controlGoal","cancel"),["stop"]))},P(S(s)("status.goalCancel")),1)])])):se("",!0)],2))}}),CY=bt(_Y,[["__scopeId","data-v-dcbae4b7"]]),SY={class:"qh"},xY={class:"qtitle"},TY={key:0,class:"qstep"},AY={key:1,class:"qmin-peek"},MY=["title","aria-label"],EY={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"},IY={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"},$Y={key:0,class:"qbody"},NY=["aria-label"],LY=["aria-selected","aria-label","onClick"],PY={class:"qstep-num"},OY={key:1,class:"qheader-chip"},RY={class:"qtext"},DY={class:"qopts"},BY=["onClick"],FY={class:"qopt-key"},HY={class:"qopt-glyph"},WY={key:0,class:"chk"},UY={key:1,class:"rad"},jY={class:"qopt-text"},qY={class:"qopt-label"},zY={key:0,class:"qopt-desc"},VY={class:"qopt-glyph"},KY={key:0,class:"chk"},GY={key:1,class:"rad"},YY={class:"qopt-label"},XY=["placeholder"],QY={key:1,class:"qfooter"},ZY=["disabled"],JY=["disabled"],eX=["disabled"],tX=Qe({__name:"QuestionCard",props:{question:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=St(),s=t,i=ne(0),r=ne(!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++}function d(O){O>=0&&O<a.value&&(i.value=O)}function h(O){const A=f.value[O];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 m(){return h(l.value.id)}const f=ne({});function g(O){return O.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${O.label} ${O.description??""}`.toLowerCase())}function _(){const O={...f.value};let A=!1;for(const $ of n.question.questions){if(O[$.id])continue;const R=$.options.filter(g);R.length!==0&&(O[$.id]=$.multiSelect?{kind:"multi",optionIds:R.map(D=>D.id)}:{kind:"single",optionId:R[0].id},A=!0)}A&&(f.value=O)}ze(()=>n.question.questionId,()=>{i.value=0,r.value=!1,f.value={},b.value={}}),ze(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),_()},{immediate:!0,deep:!0});function w(O,A){const $=f.value[O];if($&&$.kind==="single"&&$.optionId===A){const R={...f.value};delete R[O],f.value=R}else f.value={...f.value,[O]:{kind:"single",optionId:A}}}function y(O,A){const $=f.value[O],R=$&&($.kind==="multi"||$.kind==="multiWithOther")?$.kind==="multi"?[...$.optionIds]:[...$.optionIds]:[],D=R.indexOf(A);D>=0?R.splice(D,1):R.push(A);const W=f.value[O],V=W&&W.kind==="multiWithOther"?W.otherText:"";V?f.value={...f.value,[O]:{kind:"multiWithOther",optionIds:R,otherText:V}}:f.value={...f.value,[O]:{kind:"multi",optionIds:R}}}const b=ne({});function v(O){const A=n.question.questions.find(R=>R.id===O),$=b.value[O]??"";if(A.multiSelect){const R=f.value[O],D=R&&(R.kind==="multi"||R.kind==="multiWithOther")?R.kind==="multi"?[...R.optionIds]:[...R.optionIds]:[];f.value={...f.value,[O]:{kind:"multiWithOther",optionIds:D,otherText:$}}}else f.value={...f.value,[O]:{kind:"other",text:$}}}function x(O,A){const $=f.value[O];return $?$.kind==="single"?$.optionId===A:$.kind==="multi"||$.kind==="multiWithOther"?$.optionIds.includes(A):!1:!1}function L(O){const A=f.value[O];return!!(A&&(A.kind==="other"||A.kind==="multiWithOther"))}function N(){return n.question.questions.every(O=>h(O.id))}function k(){if(!N())return;const O={answers:f.value,method:"click"};s("answer",n.question.questionId,O)}function T(){s("dismiss",n.question.questionId)}function E(O){const A=(document.activeElement?.tagName??"").toLowerCase();if(A==="input"||A==="textarea"||r.value&&O.key!=="Escape")return;if(O.key==="Escape"){O.preventDefault(),T();return}if(O.key==="Enter"){O.preventDefault(),i.value<a.value-1&&m()?u():N()&&k();return}const $=parseInt(O.key,10);if(!isNaN($)&&$>=1&&$<=9){O.preventDefault();const R=l.value,D=$-1,W=R.options[D];W&&(R.multiSelect?y(R.id,W.id):w(R.id,W.id))}}return sn(()=>document.addEventListener("keydown",E)),Yt(()=>document.removeEventListener("keydown",E)),(O,A)=>(C(),I("div",{class:Le(["qcard",{minimized:r.value}])},[p("div",SY,[p("span",xY,P(S(o)("question.title")),1),a.value>1&&!r.value?(C(),I("span",TY,P(S(o)("question.step",{current:i.value+1,total:a.value})),1)):se("",!0),r.value?(C(),I("span",AY,P(l.value.question),1)):se("",!0),p("button",{class:"qmin",title:r.value?S(o)("question.expand"):S(o)("question.minimize"),"aria-label":r.value?S(o)("question.expand"):S(o)("question.minimize"),onClick:A[0]||(A[0]=$=>r.value=!r.value)},[r.value?(C(),I("svg",EY,[...A[4]||(A[4]=[p("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(C(),I("svg",IY,[...A[5]||(A[5]=[p("path",{d:"M3 8h10"},null,-1)])]))],8,MY)]),r.value?se("",!0):(C(),I("div",$Y,[a.value>1?(C(),I("div",{key:0,class:"qsteps",role:"tablist","aria-label":S(o)("question.step",{current:i.value+1,total:a.value})},[(C(!0),I(Oe,null,Xe(n.question.questions,($,R)=>(C(),I("button",{key:$.id,type:"button",class:Le(["qstep-dot",{active:R===i.value,answered:h($.id)}]),"aria-selected":R===i.value,"aria-label":S(o)("question.step",{current:R+1,total:a.value}),onClick:D=>d(R)},[p("span",PY,P(R+1),1)],10,LY))),128))],8,NY)):se("",!0),l.value.header?(C(),I("div",OY,P(l.value.header),1)):se("",!0),p("div",RY,P(l.value.question),1),l.value.body?(C(),Ve(gu,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):se("",!0),p("div",DY,[(C(!0),I(Oe,null,Xe(l.value.options,($,R)=>(C(),I("label",{key:$.id,class:Le(["qopt",{selected:x(l.value.id,$.id)}]),onClick:Ze(D=>l.value.multiSelect?y(l.value.id,$.id):w(l.value.id,$.id),["prevent"])},[p("span",FY,P(R+1),1),p("span",HY,[l.value.multiSelect?(C(),I("span",WY,P(x(l.value.id,$.id)?"■":"□"),1)):(C(),I("span",UY,P(x(l.value.id,$.id)?"●":"○"),1))]),p("span",jY,[p("span",qY,P($.label),1),$.description?(C(),I("span",zY,P($.description),1)):se("",!0)])],10,BY))),128)),l.value.allowOther?(C(),I("label",{key:0,class:Le(["qopt",{selected:L(l.value.id)}]),onClick:Ze(()=>{},["prevent"])},[A[6]||(A[6]=p("span",{class:"qopt-key"},null,-1)),p("span",VY,[l.value.multiSelect?(C(),I("span",KY,P(L(l.value.id)?"■":"□"),1)):(C(),I("span",GY,P(L(l.value.id)?"●":"○"),1))]),p("span",YY,P(l.value.otherLabel??S(o)("question.otherDefault")),1),qt(p("input",{"onUpdate:modelValue":A[1]||(A[1]=$=>b.value[l.value.id]=$),class:"other-input",type:"text",placeholder:l.value.otherLabel??S(o)("question.otherDefault"),onInput:A[2]||(A[2]=$=>v(l.value.id)),onFocus:A[3]||(A[3]=$=>v(l.value.id))},null,40,XY),[[Wn,b.value[l.value.id]]])],2)):se("",!0)])])),r.value?se("",!0):(C(),I("div",QY,[i.value<a.value-1?(C(),I("button",{key:0,type:"button",class:"qbtn pri qfooter-main",disabled:!m(),onClick:u},P(S(o)("question.nextQuestion")),9,ZY)):(C(),I("button",{key:1,type:"button",class:"qbtn pri qfooter-main",disabled:!N(),onClick:k},P(S(o)("question.submit")),9,JY)),a.value>1?(C(),I("button",{key:2,type:"button",class:"qbtn",disabled:i.value===0,onClick:c},P(S(o)("question.back")),9,eX)):se("",!0),p("button",{type:"button",class:"qbtn qbtn-text",onClick:T},P(S(o)("question.dismiss")),1)]))],2))}}),nX=bt(tX,[["__scopeId","data-v-8babd5ae"]]),oX={class:"ah"},sX={class:"akind"},iX={class:"apath"},rX={key:0,class:"abadge"},lX={key:1,class:"aw"},aX=["title","aria-label"],cX={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"},uX={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"},dX=["title"],fX={key:1,class:"diff"},hX={class:"dg"},pX={class:"dc"},mX={key:2,class:"body-shell"},gX={class:"shell-cmd"},vX={key:0,class:"shell-cwd"},yX={key:1,class:"shell-danger"},kX={key:3,class:"body-file"},bX={class:"file-bar"},wX={class:"file-lang"},_X={class:"file-content"},CX={class:"file-ln"},SX={class:"file-text"},xX={key:4,class:"body-chip"},TX={class:"chip-label"},AX={class:"chip-value"},MX={key:0,class:"chip-detail"},EX={key:5,class:"body-chip"},IX={key:0,class:"chip-label"},$X={class:"chip-value"},NX={key:6,class:"body-chip"},LX={class:"chip-label"},PX={class:"chip-value"},OX={key:0,class:"chip-detail"},RX={key:7,class:"body-chip"},DX={class:"chip-label"},BX={class:"chip-value"},FX={key:0,class:"chip-detail"},HX={key:8,class:"body-todo"},WX={class:"todo-glyph"},UX={key:9,class:"body-plan"},jX={key:10,class:"body-generic"},qX={class:"gen-text"},zX={key:11,class:"feedback-wrap"},VX=["placeholder"],KX={class:"feedback-hint"},GX={key:12,class:"plan-actions"},YX=["title","onClick"],XX={class:"k"},QX={key:0,class:"k"},ZX={key:0,class:"k"},JX={key:13,class:"abtn"},eQ=Qe({__name:"ApprovalCard",props:{block:{},agentName:{}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=St(),i=F(()=>{const k=n.block;return k.kind!=="plan_review"?null:{plan:k.plan,path:k.path,options:k.options??[]}}),r=ne(!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 s(`approval.title.${k}`)}const c=ne(!1),u=ne(""),d=ne(null);function h(){c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0)}function m(){const k=u.value.trim();i.value?o("decide",{decision:"rejected",selectedLabel:"Revise",feedback:k||void 0}):o("decide",{decision:"rejected",feedback:k||void 0}),c.value=!1,u.value=""}function f(){c.value=!1,u.value=""}function g(k){k.key==="Enter"&&!k.shiftKey?(k.preventDefault(),m()):k.key==="Escape"&&(k.preventDefault(),f())}function _(){o("decide",{decision:"approved"})}function w(){o("decide",{decision:"approved",scope:"session"})}function y(){o("decide",{decision:"rejected"})}function b(){o("decide",{decision:"approved"})}function v(k){o("decide",{decision:"approved",selectedLabel:k})}function x(){h()}function L(){o("decide",{decision:"rejected",selectedLabel:"Reject and Exit"})}function N(k){const T=(document.activeElement?.tagName??"").toLowerCase();if(T==="input"||T==="textarea"||r.value)return;const E=i.value;if(E){if(E.options.length===0){k.key==="1"?(k.preventDefault(),b()):k.key==="2"?(k.preventDefault(),x()):k.key==="3"&&(k.preventDefault(),L());return}k.key==="1"&&E.options[0]?(k.preventDefault(),v(E.options[0].label)):k.key==="2"&&E.options[1]?(k.preventDefault(),v(E.options[1].label)):k.key==="3"&&E.options[2]&&(k.preventDefault(),v(E.options[2].label));return}k.key==="1"?(k.preventDefault(),_()):k.key==="2"?(k.preventDefault(),w()):k.key==="3"?(k.preventDefault(),y()):k.key==="4"&&(k.preventDefault(),h())}return sn(()=>document.addEventListener("keydown",N)),Yt(()=>document.removeEventListener("keydown",N)),(k,T)=>(C(),I("div",{class:Le(["appr",{minimized:r.value}])},[p("div",oX,[p("span",sX,P(a()),1),p("span",iX,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(C(),I(Oe,{key:0},[ut(P(e.block.path),1)],64)):e.block.kind==="shell"?(C(),I(Oe,{key:1},[ut(P(e.block.command),1)],64)):e.block.kind==="url"?(C(),I(Oe,{key:2},[ut(P(e.block.url),1)],64)):e.block.kind==="search"?(C(),I(Oe,{key:3},[ut(P(e.block.query),1)],64)):e.block.kind==="invocation"?(C(),I(Oe,{key:4},[ut(P(e.block.name),1)],64)):e.block.kind==="generic"?(C(),I(Oe,{key:5},[ut(P(e.block.summary),1)],64)):se("",!0)]),e.agentName&&!r.value?(C(),I("span",rX,P(S(s)("approval.subagentBadge",{name:e.agentName})),1)):se("",!0),r.value?se("",!0):(C(),I("span",lX,P(S(s)("approval.required")),1)),p("button",{class:"amin",title:r.value?S(s)("question.expand"):S(s)("question.minimize"),"aria-label":r.value?S(s)("question.expand"):S(s)("question.minimize"),onClick:T[0]||(T[0]=E=>r.value=!r.value)},[r.value?(C(),I("svg",cX,[...T[2]||(T[2]=[p("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(C(),I("svg",uX,[...T[3]||(T[3]=[p("path",{d:"M3 8h10"},null,-1)])]))],8,aX)]),r.value?se("",!0):(C(),I(Oe,{key:0},[e.block.kind==="plan_review"&&e.block.path?(C(),I("div",{key:0,class:"ah-path",title:e.block.path},P(e.block.path),9,dX)):se("",!0),e.block.kind==="diff"?(C(),I("div",fX,[(C(!0),I(Oe,null,Xe(e.block.diff,(E,O)=>(C(),I("div",{key:O,class:Le(["dl",E.kind==="add"?"add":E.kind==="rem"?"del":""])},[p("span",hX,P(E.gutter),1),p("span",pX,P(E.text),1)],2))),128))])):e.block.kind==="shell"?(C(),I("div",mX,[p("div",gX,[T[4]||(T[4]=p("span",{class:"shell-dollar"},"$",-1)),ut(" "+P(e.block.command),1)]),e.block.cwd?(C(),I("div",vX,"cwd: "+P(e.block.cwd),1)):se("",!0),e.block.danger?(C(),I("div",yX,P(S(s)("approval.danger",{detail:e.block.danger})),1)):se("",!0)])):e.block.kind==="file"?(C(),I("div",kX,[p("div",bX,[p("span",wX,P(e.block.language??""),1)]),p("div",_X,[(C(!0),I(Oe,null,Xe(e.block.content.split(`
|
|
259
|
-
`),(E,O)=>(C(),I("div",{key:O,class:"file-line"},[p("span",CX,P(O+1),1),p("span",SX,P(E),1)]))),128))])])):e.block.kind==="fileop"?(C(),I("div",xX,[p("span",TX,P(e.block.op),1),p("span",AX,P(e.block.path),1),e.block.detail?(C(),I("span",MX,P(e.block.detail),1)):se("",!0)])):e.block.kind==="url"?(C(),I("div",EX,[e.block.method?(C(),I("span",IX,P(e.block.method),1)):se("",!0),p("span",$X,P(e.block.url),1)])):e.block.kind==="search"?(C(),I("div",NX,[p("span",LX,P(S(s)("approval.searchQueryLabel")),1),p("span",PX,P(e.block.query),1),e.block.scope?(C(),I("span",OX,P(S(s)("approval.searchScope",{scope:e.block.scope})),1)):se("",!0)])):e.block.kind==="invocation"?(C(),I("div",RX,[p("span",DX,P(e.block.kind2),1),p("span",BX,P(e.block.name),1),e.block.description?(C(),I("span",FX,P(e.block.description),1)):se("",!0)])):e.block.kind==="todo"?(C(),I("div",HX,[(C(!0),I(Oe,null,Xe(e.block.items,(E,O)=>(C(),I("div",{key:O,class:"todo-item"},[p("span",WX,P(E.status==="done"||E.status==="completed"?"✓":"○"),1),p("span",{class:Le(["todo-title",{"todo-done":E.status==="done"||E.status==="completed"}])},P(E.title),3)]))),128))])):e.block.kind==="plan_review"?(C(),I("div",UX,[vt(gu,{text:e.block.plan},null,8,["text"])])):(C(),I("div",jX,[p("span",qX,P(e.block.summary),1)])),c.value?(C(),I("div",zX,[qt(p("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":T[1]||(T[1]=E=>u.value=E),class:"feedback-ta",placeholder:S(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:g},null,40,VX),[[Wn,u.value]]),p("div",KX,P(S(s)("approval.feedbackHint")),1)])):se("",!0),i.value?(C(),I("div",GX,[i.value.options.length>0?(C(!0),I(Oe,{key:0},Xe(i.value.options,(E,O)=>(C(),I("div",{key:O,class:"kbtn pri",title:E.description,onClick:A=>v(E.label)},[ut(P(E.label),1),p("span",XX,"["+P(O+1)+"]",1)],8,YX))),128)):(C(),I("div",{key:1,class:"kbtn pri",onClick:b},[ut(P(S(s)("approval.approvePlan")),1),T[5]||(T[5]=p("span",{class:"k"},"[1]",-1))])),p("div",{class:"kbtn",onClick:x},[ut(P(S(s)("approval.revise")),1),i.value.options.length===0?(C(),I("span",QX,"[2]")):se("",!0)]),p("div",{class:"kbtn danger",onClick:L},[ut(P(S(s)("approval.rejectAndExit")),1),i.value.options.length===0?(C(),I("span",ZX,"[3]")):se("",!0)])])):(C(),I("div",JX,[p("div",{class:"kbtn pri",onClick:_},[ut(P(S(s)("approval.approve")),1),T[6]||(T[6]=p("span",{class:"k"},"[1]",-1))]),p("div",{class:"kbtn",onClick:w},[ut(P(S(s)("approval.approveSession")),1),T[7]||(T[7]=p("span",{class:"k"},"[2]",-1))]),p("div",{class:"kbtn",onClick:y},[ut(P(S(s)("approval.reject")),1),T[8]||(T[8]=p("span",{class:"k"},"[3]",-1))]),p("div",{class:"kbtn",onClick:h},[ut(P(S(s)("approval.feedback")),1),T[9]||(T[9]=p("span",{class:"k"},"[4]",-1))])]))],64))],2))}}),tQ=bt(eQ,[["__scopeId","data-v-341cf3fd"]]),nQ={class:"taskspane"},oQ={class:"tp-head"},sQ={class:"tp-title"},iQ={class:"tp-count"},rQ={class:"tp-list"},lQ={key:0,class:"tp-empty"},aQ=["role","onClick"],cQ={class:"tp-name"},uQ={class:"tp-kind"},dQ={class:"tp-time"},fQ=["onClick"],hQ={key:0,class:"tp-detail"},pQ={key:0,class:"tp-codebox"},mQ=["onClick"],gQ={class:"tp-pre"},vQ={class:"tp-cmd"},yQ={key:1,class:"tp-codebox"},kQ=["onClick"],bQ={class:"tp-pre"},wQ=Qe({__name:"TasksPane",props:{tasks:{}},emits:["cancel"],setup(e,{emit:t}){const n=t,{t:o}=St(),s=ds(new Set),i=ds(new Set),r=ds(new Set);function l(f){return!!(f.output&&f.output.length>0||f.meta)}function a(f){l(f)&&(s.has(f.id)?s.delete(f.id):s.add(f.id))}function c(f){switch(f){case"run":return"●";case"done":return"✓";case"fail":return"✗";default:return"○"}}function u(f){switch(f){case"run":return"s-run";case"done":return"s-done";case"fail":return"s-fail";default:return"s-pending"}}async function d(f,g,_){await wo(f)&&(_.add(g),setTimeout(()=>_.delete(g),1500))}async function h(f){f.meta&&await d(f.meta,f.id,i)}async function m(f){const g=f.output?.join(`
|
|
260
|
-
`)??"";g&&await d(g,f.id,r)}return(f,g)=>(C(),I("div",nQ,[p("div",oQ,[p("span",sQ,P(S(o)("tasks.tag")),1),p("span",iQ,P(e.tasks.length),1)]),p("div",rQ,[e.tasks.length===0?(C(),I("div",lQ,P(S(o)("tasks.emptyTasks")),1)):(C(!0),I(Oe,{key:1},Xe(e.tasks,_=>(C(),I("div",{key:_.id,class:Le(["tp-row",{done:_.state==="done",fail:_.state==="fail",expandable:l(_)}])},[p("div",{class:"tp-main",role:l(_)?"button":void 0,onClick:w=>a(_)},[p("span",{class:Le(["tp-glyph",u(_.state)])},P(c(_.state)),3),p("span",cQ,P(_.name),1),p("span",uQ,P(_.kind),1),p("span",dQ,P(_.timing),1),_.state==="run"?(C(),I("button",{key:0,class:"tp-stop",onClick:Ze(w=>n("cancel",_.id),["stop"])},P(S(o)("tasks.stop")),9,fQ)):se("",!0),l(_)?(C(),I("svg",{key:1,class:Le(["tp-chevron",{open:s.has(_.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]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])],2)):se("",!0)],8,aQ),s.has(_.id)&&l(_)?(C(),I("div",hQ,[_.meta?(C(),I("div",pQ,[p("button",{class:Le(["tp-copy",{copied:i.has(_.id)}]),onClick:Ze(w=>h(_),["stop"])},P(i.has(_.id)?"已复制":"复制"),11,mQ),p("pre",gQ,[p("code",null,[p("span",vQ,P(_.meta),1)])])])):se("",!0),_.output&&_.output.length>0?(C(),I("div",yQ,[p("button",{class:Le(["tp-copy",{copied:r.has(_.id)}]),onClick:Ze(w=>m(_),["stop"])},P(r.has(_.id)?"已复制":"复制"),11,kQ),p("pre",bQ,[p("code",null,[g[1]||(g[1]=ut(`
|
|
261
|
-
`,-1)),(C(!0),I(Oe,null,Xe(_.output,(w,y)=>(C(),I("span",{key:y,class:"tp-line"},P(w),1))),128)),g[2]||(g[2]=ut(`
|
|
262
|
-
`,-1))])])])):se("",!0)])):se("",!0)],2))),128))])]))}}),q2=bt(wQ,[["__scopeId","data-v-bdbdc201"]]),_Q={class:"tc-title"},CQ={key:0,class:"tc-count"},SQ={key:0,class:"tc-list"},xQ={key:0,class:"tc-empty"},TQ={class:"tc-name"},AQ=Qe({__name:"TodoCard",props:{todos:{},inline:{type:Boolean}},setup(e){const t=e,{t:n}=St(),o=ne(!1),s=F(()=>!t.inline),i=F(()=>t.inline||!o.value);function r(){s.value&&(o.value=!o.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)=>(C(),I("div",{class:Le(["todo-card",{"tab-mode":e.inline}])},[(C(),Ve(ko(s.value?"button":"div"),{class:Le(["tc-head",{static:!s.value}]),type:s.value?"button":void 0,onClick:r},{default:$n(()=>[u[1]||(u[1]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.4","aria-hidden":"true"},[p("polyline",{points:"2,4.5 3.5,6 5.5,3"}),p("polyline",{points:"2,11 3.5,12.5 5.5,9.5"}),p("line",{x1:"8",y1:"4.5",x2:"14",y2:"4.5"}),p("line",{x1:"8",y1:"11",x2:"14",y2:"11"})],-1)),p("span",_Q,P(S(n)("tasks.todoTag")),1),e.todos.length>0?(C(),I("span",CQ,P(l.value)+"/"+P(e.todos.length),1)):se("",!0),s.value&&e.todos.length>0?(C(),I("svg",{key:1,class:Le(["tc-chev",{open:!o.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]=[p("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2)):se("",!0)]),_:1},8,["class","type"])),i.value?(C(),I("div",SQ,[e.todos.length===0?(C(),I("div",xQ,P(S(n)("tasks.emptyTodo")),1)):se("",!0),(C(!0),I(Oe,null,Xe(e.todos,(d,h)=>(C(),I("div",{key:h,class:Le(["tc-row",`s-${d.status}`])},[p("span",{class:Le(["tc-glyph",`g-${a(d.status)}`])},null,2),p("span",TQ,P(d.title),1)],2))),128))])):se("",!0)],2))}}),MQ=bt(AQ,[["__scopeId","data-v-26afda08"]]),EQ={key:0,class:"queue-head"},IQ={class:"queue-label"},$Q=["title"],NQ={class:"queue-list"},LQ=["disabled","title","onClick"],PQ={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"},OQ=["title","onClick"],RQ=Qe({__name:"QueuePane",props:{queued:{},running:{type:Boolean},inline:{type:Boolean}},emits:["steer","unqueue","editQueued"],setup(e,{emit:t}){const n=t,{t:o}=St();function s(i,r){r.attachmentCount>0||n("editQueued",i)}return(i,r)=>(C(),I("div",{class:Le(["queue-pane",{"tab-mode":e.inline}])},[e.inline?se("",!0):(C(),I("div",EQ,[p("span",IQ,P(S(o)("composer.queueLabel"))+" · "+P(e.queued.length),1),e.running?(C(),I("button",{key:0,class:"queue-steer",type:"button",title:S(o)("composer.steerTitle"),onClick:r[0]||(r[0]=l=>n("steer"))},P(S(o)("composer.steerNow")),9,$Q)):se("",!0)])),p("div",NQ,[(C(!0),I(Oe,null,Xe(e.queued,(l,a)=>(C(),I("div",{key:a,class:"queue-item"},[p("button",{class:"queue-text",type:"button",disabled:l.attachmentCount>0,title:l.attachmentCount>0?S(o)("composer.queuedHasImage",{n:l.attachmentCount}):S(o)("composer.editQueued"),onClick:c=>s(a,l)},[l.attachmentCount>0?(C(),I("svg",PQ,[...r[1]||(r[1]=[p("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},null,-1),p("circle",{cx:"5.5",cy:"6.5",r:"1.2"},null,-1),p("path",{d:"M2.5 12l3.5-3.5 2.5 2.5 3-3 2 2"},null,-1)])])):se("",!0),p("span",{class:Le(["queue-text-inner",{placeholder:!l.text}])},P(l.text||S(o)("composer.queuedImageOnly",{n:l.attachmentCount})),3)],8,LQ),p("button",{class:"queue-rm",title:S(o)("composer.remove"),onClick:c=>n("unqueue",a)},[...r[2]||(r[2]=[p("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"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,OQ)]))),128))])],2))}}),DQ=bt(RQ,[["__scopeId","data-v-b5832f1f"]]),BQ={class:"dock-work-head"},FQ={key:0,class:"dock-work-tab static"},HQ={key:1,class:"dock-work-tab static"},WQ={key:2,class:"dock-work-tab static"},UQ={key:3,class:"dock-work-tab static"},jQ=["title"],qQ={class:"dock-work-body"},zQ=["aria-pressed"],VQ={class:"dw-count"},KQ=["aria-pressed"],GQ={class:"dw-count"},YQ=["aria-pressed"],XQ={class:"dw-count"},QQ=["aria-pressed"],ZQ={class:"dw-count"},JQ=Qe({__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 o=e,s=n,{t:i}=St(),r=ne(null),l=ne(null),a=ne(null);function c(m){r.value?.loadForEdit(m)}function u(){r.value?.focus()}function d(m){const f=o.queued?.[m]?.text??"";f&&c(f),s("editQueued",m)}function h(m){if(!o.dockPanel)return;const f=m.target;f&&(l.value?.contains(f)||a.value?.contains(f)||s("close-dock-panel"))}return ze(()=>o.dockPanel,m=>{typeof document>"u"||(document.removeEventListener("mousedown",h,!0),m&&document.addEventListener("mousedown",h,!0))},{immediate:!0}),Yt(()=>{typeof document<"u"&&document.removeEventListener("mousedown",h,!0)}),t({loadForEdit:c,focus:u}),(m,f)=>(C(),I("div",{class:Le(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:f[31]||(f[31]=Ze(()=>{},["stop"]))},[vt(qi,{name:"dock-panel"},{default:$n(()=>[e.dockPanel?(C(),I("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:f[5]||(f[5]=Ze(()=>{},["stop"]))},[p("div",BQ,[e.dockPanel==="bash"?(C(),I("span",FQ,P(S(i)("tasks.dockBash"))+" · "+P(e.bashRunning)+" "+P(S(i)("tasks.running")),1)):e.dockPanel==="subagent"?(C(),I("span",HQ,P(S(i)("tasks.dockSubagent"))+" · "+P(e.subagentRunning)+" "+P(S(i)("tasks.running")),1)):e.dockPanel==="todos"?(C(),I("span",WQ,P(S(i)("tasks.dockTodos"))+" · "+P(e.todoDoneCount)+"/"+P(e.todos?.length??0),1)):e.dockPanel==="queue"?(C(),I("span",UQ,P(S(i)("tasks.dockQueue"))+" · "+P(e.queued?.length??0),1)):se("",!0),e.dockPanel==="queue"&&e.running?(C(),I("button",{key:4,type:"button",class:"dock-queue-steer",title:S(i)("composer.steerTitle"),onClick:f[0]||(f[0]=g=>s("steer",{text:"",attachments:[]}))},P(S(i)("composer.steerNow")),9,jQ)):se("",!0)]),p("div",qQ,[e.dockPanel==="bash"?(C(),Ve(q2,{key:0,tasks:e.bashTasks,onCancel:f[1]||(f[1]=g=>s("cancelTask",g))},null,8,["tasks"])):e.dockPanel==="subagent"?(C(),Ve(q2,{key:1,tasks:e.subagentTasks,onCancel:f[2]||(f[2]=g=>s("cancelTask",g))},null,8,["tasks"])):e.dockPanel==="todos"?(C(),Ve(MQ,{key:2,todos:e.todos??[],inline:""},null,8,["todos"])):(C(),Ve(DQ,{key:3,queued:e.queued??[],running:e.running,inline:"",onSteer:f[3]||(f[3]=g=>s("steer",{text:"",attachments:[]})),onUnqueue:f[4]||(f[4]=g=>s("unqueue",g)),onEditQueued:d},null,8,["queued","running"]))])],512)):se("",!0)]),_:1}),e.goal?(C(),Ve(CY,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:f[6]||(f[6]=g=>s("controlGoal",g))},null,8,["goal","force-expanded"])):se("",!0),e.hasDockWork?(C(),I("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(C(),I("button",{key:0,type:"button",class:Le(["dock-work-chip",{on:e.dockPanel==="bash"}]),"aria-pressed":e.dockPanel==="bash",onClick:f[7]||(f[7]=g=>s("toggle-dock-panel","bash"))},[f[34]||(f[34]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[p("circle",{cx:"8",cy:"8",r:"5.5"}),p("path",{d:"M8 4.5V8l2.5 1.5"})],-1)),p("span",null,P(S(i)("tasks.dockBash")),1),p("span",VQ,[f[32]||(f[32]=ut("(",-1)),p("b",null,P(e.bashTasks.length),1),f[33]||(f[33]=ut(")",-1))])],10,zQ)):se("",!0),e.subagentTasks.length>0?(C(),I("button",{key:1,type:"button",class:Le(["dock-work-chip",{on:e.dockPanel==="subagent"}]),"aria-pressed":e.dockPanel==="subagent",onClick:f[8]||(f[8]=g=>s("toggle-dock-panel","subagent"))},[f[37]||(f[37]=p("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"},[p("path",{d:"M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z"})],-1)),p("span",null,P(S(i)("tasks.dockSubagent")),1),p("span",GQ,[f[35]||(f[35]=ut("(",-1)),p("b",null,P(e.subagentTasks.length),1),f[36]||(f[36]=ut(")",-1))])],10,KQ)):se("",!0),(e.todos?.length??0)>0?(C(),I("button",{key:2,type:"button",class:Le(["dock-work-chip",{on:e.dockPanel==="todos"}]),"aria-pressed":e.dockPanel==="todos",onClick:f[9]||(f[9]=g=>s("toggle-dock-panel","todos"))},[f[40]||(f[40]=Ir('<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" data-v-b7c4b6e1><path d="M3 4.5l1.5 1.5L7 3.5" data-v-b7c4b6e1></path><path d="M8.5 5h4" data-v-b7c4b6e1></path><path d="M3 11l1.5 1.5L7 10" data-v-b7c4b6e1></path><path d="M8.5 11.5h4" data-v-b7c4b6e1></path></svg>',1)),p("span",null,P(S(i)("tasks.dockTodos")),1),p("span",XQ,[f[38]||(f[38]=ut("(",-1)),p("b",null,P(e.todoDoneCount)+"/"+P(e.todos?.length??0),1),f[39]||(f[39]=ut(")",-1))])],10,YQ)):se("",!0),(e.queued?.length??0)>0?(C(),I("button",{key:3,type:"button",class:Le(["dock-work-chip",{on:e.dockPanel==="queue"}]),"aria-pressed":e.dockPanel==="queue",onClick:f[10]||(f[10]=g=>s("toggle-dock-panel","queue"))},[f[43]||(f[43]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[p("path",{d:"M2 4l6 4 6-4"}),p("rect",{x:"2",y:"4",width:"12",height:"8",rx:"1.5"})],-1)),p("span",null,P(S(i)("tasks.dockQueue")),1),p("span",ZQ,[f[41]||(f[41]=ut("(",-1)),p("b",null,P(e.queued?.length??0),1),f[42]||(f[42]=ut(")",-1))])],10,QQ)):se("",!0)],512)):se("",!0),e.pendingQuestion?(C(),Ve(nX,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,onAnswer:f[11]||(f[11]=(g,_)=>s("answer",g,_)),onDismiss:f[12]||(f[12]=g=>s("dismiss",g))},null,8,["question"])):e.pendingApproval?(C(),Ve(tQ,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,onDecide:f[13]||(f[13]=g=>s("approval",e.pendingApproval.approvalId,g))},null,8,["block","agent-name"])):(C(),Ve(T3,{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:f[14]||(f[14]=g=>s("submit",g)),onSteer:f[15]||(f[15]=g=>s("steer",g)),onCommand:f[16]||(f[16]=g=>s("command",g)),onInterrupt:f[17]||(f[17]=g=>s("interrupt")),onSetPermission:f[18]||(f[18]=g=>s("setPermission",g)),onSetThinking:f[19]||(f[19]=g=>s("setThinking",g)),onTogglePlan:f[20]||(f[20]=g=>s("togglePlan")),onToggleSwarm:f[21]||(f[21]=g=>s("toggleSwarm")),onToggleGoal:f[22]||(f[22]=g=>s("toggleGoal")),onOpenBtw:f[23]||(f[23]=g=>s("openBtw")),onCreateGoal:f[24]||(f[24]=g=>s("createGoal",g)),onControlGoal:f[25]||(f[25]=g=>s("controlGoal",g)),onFocusGoal:f[26]||(f[26]=g=>s("focusGoal")),onFocusSwarm:f[27]||(f[27]=g=>s("focusSwarm")),onCompact:f[28]||(f[28]=g=>s("compact")),onPickModel:f[29]||(f[29]=g=>s("pickModel")),onSelectModel:f[30]||(f[30]=g=>s("selectModel",g))},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))}}),eZ=bt(JQ,[["__scopeId","data-v-b7c4b6e1"]]),tZ=["aria-label"],nZ={class:"toc-track"},oZ=["aria-label","onMouseenter","onClick"],sZ={class:"toc-no"},iZ=Qe({__name:"ConversationToc",props:{items:{},metrics:{},activeTurnId:{},viewport:{},mobile:{type:Boolean},sessionLoading:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=St(),i=F(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1),r=ne({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?(C(),I("nav",{key:0,class:"conversation-toc","aria-label":S(s)("conversation.toc")},[p("div",nZ,[(C(!0),I(Oe,null,Xe(e.items,(d,h)=>(C(),I("button",{key:d.id,type:"button",class:Le(["toc-bubble",[d.role,{active:e.activeTurnId===d.id}]]),style:Wt({height:e.metrics[h]?.height+"px"}),"aria-label":`#${d.no} ${d.title}`,onMouseenter:m=>l(d.title,m),onMouseleave:a,onClick:m=>o("select",d.id)},[p("span",sZ,P(d.no),1)],46,oZ))),128)),e.viewport?(C(),I("div",{key:0,class:"toc-viewport",style:Wt({top:e.viewport.top+"px",height:e.viewport.height+"px"})},null,4)):se("",!0)]),vt(qi,{name:"toc-tip"},{default:$n(()=>[qt(p("div",{class:"toc-tooltip",style:Wt({top:r.value.top+"px"})},P(r.value.text),5),[[Ks,r.value.visible]])]),_:1})],8,tZ)):se("",!0)}}),rZ=bt(iZ,[["__scopeId","data-v-dc54da9a"]]),lZ=5;function aZ(e,t,n,o=lZ){if(n||e.length<=o)return e;const s=e.slice(0,o);if(t&&!s.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(s[o-1]=i)}return s}const cZ={class:"chat-layout"},uZ={class:"empty-hint"},dZ={class:"empty-hint-title"},fZ={class:"empty-hint-text"},hZ={key:0,class:"ws-pick"},pZ=["title"],mZ={class:"ws-pick-name"},gZ={key:1,class:"ws-pick-menu"},vZ=["onClick"],yZ={class:"ws-pick-item-name"},kZ={class:"ws-pick-item-path"},bZ={key:0,class:"swarm-stack"},wZ=["aria-label"],_Z={key:0,class:"abort-toast",role:"status","aria-live":"polite"},CZ={class:"abort-toast-text"},Rd=10,SZ=56,xZ=420,z2=80,TZ=1e3,AZ=3e3,MZ=Qe({__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 o=e,s=n,i=ne(!1),r=ne(!1),l=F(()=>o.workspaces?.find(be=>be.id===o.activeWorkspaceId)?.name??o.workspaceName??""),a=F(()=>(o.workspaces?.length??0)>0),c=F(()=>aZ(o.workspaces??[],o.activeWorkspaceId,r.value)),u=F(()=>(o.workspaces?.length??0)-c.value.length);ze(i,Ie=>{Ie||(r.value=!1)});const d=F(()=>o.swarms?.filter(Ie=>Ie.members.some(be=>be.phase!=="completed"&&be.phase!=="failed"))??[]);function h(Ie){i.value=!1,Ie!==o.activeWorkspaceId&&s("selectWorkspace",Ie)}const{t:m}=St();ru(Ct.contentAlign);const f=ne(null),g=ne(null),_=ne(null),w=ne(!1),y=ne(0);let b=null;function v(Ie){(_.value??g.value)?.loadForEdit(Ie)}function x(){w.value=!0,b!==null&&clearTimeout(b),b=setTimeout(()=>{b=null,w.value=!1},2e3)}function L(){y.value++}function N(){ht(()=>{Re.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const k=F(()=>o.mobile===!0||o.modern===!0),T=F(()=>o.tasks.filter(Ie=>Ie.kind!=="subagent")),E=F(()=>o.tasks.filter(Ie=>Ie.kind==="subagent")),O=F(()=>T.value.filter(Ie=>Ie.state==="run").length),A=F(()=>E.value.filter(Ie=>Ie.state==="run").length),$=F(()=>(o.todos??[]).filter(Ie=>Ie.status==="done").length),R=F(()=>o.tasks.length>0||(o.todos?.length??0)>0||(o.queued?.length??0)>0),D=ne(null),W=F(()=>o.gitInfo?o.changes?.length??0:0);function V(Ie){D.value=D.value===Ie?null:Ie}function U(){D.value=null}ze(R,Ie=>{Ie||U()});function ee(Ie){if(Ie.role==="compaction")return m("conversation.compactedPlain");if(Ie.role==="user"){if(Ie.skillActivation)return`/${Ie.skillActivation.name}`;if(Ie.pluginCommand)return`/${Ie.pluginCommand.pluginId}:${Ie.pluginCommand.commandName}`;const Fe=Ie.text.trim().replaceAll(/\s+/g," ");return Fe.length>0?Fe:"user"}const be=(Ie.text||Ie.thinking||"").trim().replaceAll(/\s+/g," ");return be.length>0?be:(Ie.tools?.length??0)>0?`${Ie.tools.length} tools`:"kimi"}const K=F(()=>o.turns.map((Ie,be)=>({id:Ie.id,role:Ie.role,no:Ie.no||be+1,title:ee(Ie)})));function G(Ie){return Ie.role==="compaction"?20:Ie.role==="user"?(Ie.text?.length??0)+(Ie.skillActivation?20:0):(Ie.text?.length??0)+(Ie.thinking?.length??0)+(Ie.tools?.reduce((be,Fe)=>be+Fe.name.length+(Fe.arg?.length??0)+(Fe.output?.join("").length??0),0)??0)}const X=F(()=>{const Ie=K.value,be=Ie.map(xt=>{const Tt=o.turns.find(mn=>mn.id===xt.id);return Tt?G(Tt):Rd}),Fe=be.reduce((xt,Tt)=>xt+Tt,0)||Ie.length*Rd;return Ie.map((xt,Tt)=>{const mn=be[Tt]??Rd,gn=Fe>0?mn/Fe:0,bs=Math.max(Rd,Math.min(SZ,gn*xZ));return{id:xt.id,height:Math.round(bs)}})}),ke=F(()=>X.value.reduce((Ie,be)=>Ie+be.height,0)+(K.value.length-1)*4),le=ne(null),He=ne(null);function ue(){const Ie=Re.value;if(!Ie)return;const be=Ie.querySelectorAll(".turn-anchor[data-turn-id]");if(be.length===0)return;const Fe=Ie.getBoundingClientRect(),xt=Fe.height/2;let Tt=null,mn=1/0;be.forEach(Vn=>{const gi=Vn.getBoundingClientRect(),de=gi.top-Fe.top,Te=Math.abs(de+gi.height/2-xt);Te<mn&&(mn=Te,Tt=Vn.dataset.turnId??null)}),le.value=Tt;const gn=Ie.scrollHeight-Ie.clientHeight,bs=gn>0?Ie.scrollTop/gn:0,ts=ke.value,Ki=bs*ts,mi=Ie.scrollHeight>0?Ie.clientHeight/Ie.scrollHeight*ts:ts;He.value={top:Math.max(0,Ki),height:Math.max(8,Math.min(mi,ts-Ki))}}const ve=F(()=>o.questions&&o.questions.length>0?o.questions[0]:void 0),Pe=F(()=>o.approvals&&o.approvals.length>0?o.approvals[0]:void 0),Re=ne(null),Q=ne(null),ce=ne(0),Ce=ne(0),q=F(()=>({"--panes-scrollbar-width":`${ce.value}px`}));function te(Ie){return Ie instanceof HTMLElement?Ie:Ie&&"$el"in Ie&&Ie.$el instanceof HTMLElement?Ie.$el:null}function pe(){const Ie=Re.value;ce.value=Ie?Math.max(0,Ie.offsetWidth-Ie.clientWidth):0,Ce.value=Q.value?.offsetHeight??0}function oe(Ie){const be=te(Ie);Re.value=be,be&&Co()}function fe(Ie){const be=te(Ie);Q.value=be??null,Ie&&"loadForEdit"in Ie&&typeof Ie.loadForEdit=="function"&&"focus"in Ie&&typeof Ie.focus=="function"?_.value={loadForEdit:Ie.loadForEdit.bind(Ie),focus:Ie.focus.bind(Ie)}:_.value=null,At()}const H=ne(!0),Y=ne(!1);function re(){const Ie=Re.value;return Ie?Ie.scrollHeight-Ie.scrollTop-Ie.clientHeight:0}let ge=0,xe=0,Ne=0,ie=0,ae=0;function we(){return Date.now()<xe}function je(){const Ie=Re.value;if(!Ie)return;const be=Ie.scrollTop;if(performance.now()-Ne<100){ge=be;return}const Fe=re();if(we()){H.value=!0,Y.value=!1,ge=be;return}be<ge-1&&Fe>1?H.value=!1:Fe<=z2&&be>ge+1&&(H.value=!0,Y.value=!1),ge=be,ue()}function nt(Ie=!1){const be=Re.value;be&&(Ie&&typeof be.scrollTo=="function"?(Ne=performance.now(),be.scrollTo({top:be.scrollHeight,behavior:"smooth"})):be.scrollTop=be.scrollHeight,ge=be.scrollTop,H.value=!0,Y.value=!1)}function ct(Ie,be){const Fe=Ie.querySelectorAll(".turn-anchor");for(const xt of Fe)if(xt.offsetTop>=be){const Tt=xt.dataset.turnId;if(Tt)return{id:Tt,top:xt.offsetTop}}return null}async function _t(){if(!o.sessionId||!o.loadOlderMessages||o.loadingMore||!o.hasMoreMessages)return;const Ie=o.sessionId,be=Re.value,Fe=be?.scrollTop??0,xt=be?.scrollHeight??0,Tt=be?ct(be,Fe):null;Jn.value=!0;try{await o.loadOlderMessages(Ie),await ht()}finally{Jn.value=!1}if(o.sessionId!==Ie)return;const mn=Re.value;if(!mn)return;let gn=0;if(Tt){const bs=mn.querySelector(`.turn-anchor[data-turn-id="${$t(Tt.id)}"]`);bs&&(gn=bs.offsetTop-Tt.top)}gn===0&&(gn=mn.scrollHeight-xt),mn.scrollTop=Fe+gn}function $t(Ie){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ie):Ie.replaceAll(/["\\]/g,"\\$&")}function lt(Ie){const be=Re.value;if(!be)return;const Fe=be.querySelector(`.turn-anchor[data-turn-id="${$t(Ie)}"]`);Fe&&(H.value=!1,Y.value=re()>z2,Fe.scrollIntoView({behavior:"smooth",block:"center"}))}function Rt(){const Ie=Re.value;if(!Ie)return"none";const be=Ie.firstElementChild,Fe=be instanceof HTMLElement?be.offsetHeight:0,xt=Q.value?.offsetHeight??0;return`${Ie.scrollHeight}:${Ie.clientHeight}:${Fe}:${xt}`}function fn(Ie){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ie):setTimeout(Ie,16)}function Mn(Ie){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ie):clearTimeout(Ie)}function Nt(Ie=36){if(!H.value&&!we())return;const be=++ae;let Fe="",xt=0,Tt=0;ie&&(Mn(ie),ie=0);const mn=()=>{if(ie=0,be!==ae||!H.value&&!we())return;nt(!1);const gn=Rt();xt=gn===Fe?xt+1:0,Fe=gn,Tt++,xt<3&&Tt<Ie&&(ie=fn(mn))};ie=fn(mn)}function Ft(Ie,be){return Ie!==void 0&&Ie.length>0&&be.length>=Ie.length&&Ie.firstId!==be.firstId&&Ie.lastId===be.lastId&&Ie.lastTextLen===be.lastTextLen&&Ie.lastThinkingLen===be.lastThinkingLen&&Ie.lastToolsLen===be.lastToolsLen&&Ie.approvalIds===be.approvalIds}const qn=F(()=>{const Ie=(o.approvals??[]).map(mn=>mn.approvalId).join(","),be=o.turns,Fe=be.at(-1),xt=Fe?.thinking?.length??0,Tt=Fe?.tools?.reduce((mn,gn)=>mn+gn.name.length+(gn.arg?.length??0)+(gn.output?.join("").length??0),0)??0;return{length:be.length,firstId:be[0]?.id??"",lastId:Fe?.id??"",lastTextLen:Fe?.text.length??0,lastThinkingLen:xt,lastToolsLen:Tt,approvalIds:Ie}});ze(qn,async(Ie,be)=>{if(Jn.value&&Ft(be,Ie)){ue();return}await ht(),H.value||we()?nt(!1):Y.value=!0,ue()}),ze(Q,()=>{At()}),ze(()=>o.mobile,async()=>{await ht(),pe()});const Je=new Map;ze(()=>o.fileReloadKey,async(Ie,be)=>{const Fe=Re.value;be&&Fe&&Je.set(String(be),{top:Fe.scrollTop,following:H.value}),await ht();const xt=Re.value,Tt=Ie?Je.get(String(Ie)):void 0;Tt&&xt?(H.value=Tt.following,xt.scrollTop=Tt.top,ge=Tt.top,Tt.following&&Nt()):(H.value=!0,ge=0,nt(!1),Nt()),ue()}),ze(()=>o.sessionLoading,async(Ie,be)=>{Ie||!be||(H.value=!0,await ht(),Nt(),ue())}),ze(()=>o.running,async(Ie,be)=>{Ie||!be||!H.value&&!we()||(await ht(),Nt(48),ue())});function Qn(){H.value=!0,Y.value=!1,xe=Date.now()+TZ,ht(()=>{nt(!1),Nt(16)})}function es(Ie){Qn(),s("submit",Ie)}function Ro(Ie,be){Qn(),s("answer",Ie,be)}function po(Ie,be){!Ie||!be||s("approval",Ie,be)}let Pn=null,an=null,wn=null,On=null,zn=0,Zn=!1;const Jn=ne(!1);function Do(Ie){if(Jn.value||(Zn=Zn||Ie,zn))return;zn=(typeof requestAnimationFrame=="function"?requestAnimationFrame:Fe=>setTimeout(Fe,16))(()=>{zn=0;const Fe=Zn;Zn=!1,H.value||we()?nt(!1):Fe&&(Y.value=!0)})}function Bo(){if(!an)return;const Ie=Re.value?.firstElementChild??null;Ie!==wn&&(wn&&an.unobserve(wn),wn=Ie,Ie&&an.observe(Ie))}function At(){if(!an)return;const Ie=Q.value;Ie!==On&&(On&&an.unobserve(On),On=Ie,Ie&&an.observe(Ie))}function Co(){const Ie=Re.value;pe(),Pn&&(Pn.disconnect(),Ie&&Pn.observe(Ie,{childList:!0,subtree:!0,characterData:!0})),an&&(an.disconnect(),wn=null,On=null,Ie&&an.observe(Ie),Bo(),At())}function cn(){Bo(),Do(!0)}function Fo(){typeof document>"u"||document.visibilityState==="visible"&&H.value&&Nt()}const So=ne(!1);let eo=null;function Ye(){So.value=!0,eo!==null&&clearTimeout(eo),eo=setTimeout(()=>{So.value=!1},AZ)}function qe(){Ye(),s("interrupt")}function tt(Ie){Ie.key==="Escape"&&(o.running||o.sending)&&(Ie.preventDefault(),qe())}sn(()=>{ht(()=>{typeof MutationObserver=="function"&&(Pn=new MutationObserver(cn)),typeof ResizeObserver=="function"&&(an=new ResizeObserver(()=>{pe(),Do(!1)})),Co(),Nt(48),ue(),typeof document<"u"&&(document.addEventListener("visibilitychange",Fo),document.addEventListener("keydown",tt))})}),Yt(()=>{Pn&&Pn.disconnect(),an&&an.disconnect(),zn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(zn),ie&&Mn(ie),eo!==null&&clearTimeout(eo),b!==null&&(clearTimeout(b),b=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Fo),document.removeEventListener("keydown",tt))});function it(){(_.value??g.value)?.focus()}return t({loadComposerForEdit:v,focusComposer:it}),(Ie,be)=>(C(),I("section",{class:Le(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(C(),Ve(hK,{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:w.value,onOpenChanges:be[0]||(be[0]=Fe=>s("openChanges")),onCopyAll:be[1]||(be[1]=Fe=>f.value?.copyConversation()),onCopyFinalSummary:be[2]||(be[2]=Fe=>f.value?.copyFinalSummary()),onOpenPr:be[3]||(be[3]=Fe=>e.pr&&s("openPr",e.pr.url)),onRenameSession:be[4]||(be[4]=(Fe,xt)=>s("renameSession",Fe,xt)),onForkSession:be[5]||(be[5]=Fe=>s("forkSession",Fe)),onArchiveSession:be[6]||(be[6]=Fe=>s("archiveSession",Fe))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):se("",!0),e.betaToc?(C(),Ve(rZ,{key:1,items:K.value,metrics:X.value,"active-turn-id":le.value,viewport:He.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:lt},null,8,["items","metrics","active-turn-id","viewport","mobile","session-loading"])):se("",!0),p("div",cZ,[p("div",{ref:oe,class:"panes chat-scroll",onScrollPassive:je},[p("div",{class:Le(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(C(),I(Oe,{key:0},[be[59]||(be[59]=p("div",{class:"empty-spacer"},null,-1)),p("div",uZ,[p("span",dZ,P(S(m)("composer.emptyConversationTitle")),1),p("span",fZ,P(S(m)("composer.emptyConversation")),1),a.value?(C(),I("div",hZ,[p("button",{type:"button",class:"ws-pick-btn",title:S(m)("conversation.switchWorkspace"),onClick:be[7]||(be[7]=Ze(Fe=>i.value=!i.value,["stop"]))},[be[55]||(be[55]=p("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},[p("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"}),p("path",{d:"M1 5.5h12"})],-1)),p("span",mZ,P(l.value),1),(C(),I("svg",{class:Le(["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"},[...be[54]||(be[54]=[p("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2))],8,pZ),i.value?(C(),I("div",{key:0,class:"ws-pick-backdrop",onClick:be[8]||(be[8]=Fe=>i.value=!1)})):se("",!0),i.value?(C(),I("div",gZ,[(C(!0),I(Oe,null,Xe(c.value,Fe=>(C(),I("button",{key:Fe.id,type:"button",class:Le(["ws-pick-item",{on:Fe.id===e.activeWorkspaceId}]),onClick:Ze(xt=>h(Fe.id),["stop"])},[p("span",yZ,P(Fe.name),1),p("span",kZ,P(Fe.shortPath),1)],10,vZ))),128)),u.value>0?(C(),I("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:be[9]||(be[9]=Ze(Fe=>r.value=!r.value,["stop"]))},[p("span",null,P(S(m)("conversation.moreWorkspaces",{count:u.value})),1)])):se("",!0),be[57]||(be[57]=p("div",{class:"ws-pick-divider"},null,-1)),p("button",{type:"button",class:"ws-pick-action",onClick:be[10]||(be[10]=Ze(Fe=>{i.value=!1,s("addWorkspace")},["stop"]))},[be[56]||(be[56]=p("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("path",{d:"M8 3v10M3 8h10"})],-1)),p("span",null,P(S(m)("conversation.addWorkspace")),1)])])):se("",!0)])):(C(),I("button",{key:1,type:"button",class:"empty-add-workspace",onClick:be[11]||(be[11]=Fe=>s("addWorkspace"))},[be[58]||(be[58]=p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("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"}),p("path",{d:"M1 5.5h12"}),p("path",{d:"M8 7.25v4.5M5.75 9.5h4.5"})],-1)),p("span",null,P(S(m)("conversation.addWorkspace")),1)]))]),vt(T3,{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:es,onSteer:be[12]||(be[12]=Fe=>s("steer",Fe)),onCommand:be[13]||(be[13]=Fe=>s("command",Fe)),onInterrupt:qe,onUnqueue:be[14]||(be[14]=Fe=>s("unqueue",Fe)),onEditQueued:be[15]||(be[15]=Fe=>s("editQueued",Fe)),onSetPermission:be[16]||(be[16]=Fe=>s("setPermission",Fe)),onSetThinking:be[17]||(be[17]=Fe=>s("setThinking",Fe)),onTogglePlan:be[18]||(be[18]=Fe=>s("togglePlan")),onToggleSwarm:be[19]||(be[19]=Fe=>s("toggleSwarm")),onToggleGoal:be[20]||(be[20]=Fe=>s("toggleGoal")),onOpenBtw:be[21]||(be[21]=Fe=>s("command","/btw")),onCreateGoal:be[22]||(be[22]=Fe=>s("createGoal",Fe)),onControlGoal:be[23]||(be[23]=Fe=>s("controlGoal",Fe)),onFocusGoal:L,onFocusSwarm:N,onCompact:be[24]||(be[24]=Fe=>s("compact")),onPickModel:be[25]||(be[25]=Fe=>s("pickModel")),onSelectModel:be[26]||(be[26]=Fe=>s("selectModel",Fe))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),be[60]||(be[60]=p("div",{class:"empty-spacer"},null,-1))],64)):(C(),I(Oe,{key:1},[(C(),Ve(_3,{ref_key:"chatPaneRef",ref:f,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:be[27]||(be[27]=Fe=>s("openFile",Fe)),onOpenMedia:be[28]||(be[28]=Fe=>s("openMedia",Fe)),onCopyConversationCopied:x,onOpenThinking:be[29]||(be[29]=Fe=>s("openThinking",Fe)),onOpenCompaction:be[30]||(be[30]=Fe=>s("openCompaction",Fe)),onOpenAgent:be[31]||(be[31]=Fe=>s("openAgent",Fe)),onOpenToolDiff:be[32]||(be[32]=Fe=>s("openToolDiff",Fe)),onEditMessage:be[33]||(be[33]=Fe=>s("editMessage",Fe)),onLoadOlderMessages:_t},null,8,["turns","approvals","bubble","mobile","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following"])),d.value.length>0?(C(),I("div",bZ,[(C(!0),I(Oe,null,Xe(d.value,Fe=>(C(),Ve(pY,{key:Fe.id,group:Fe},null,8,["group"]))),128))])):se("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?se("",!0):(C(),Ve(eZ,{key:0,ref:fe,style:Wt(q.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":D.value,"bash-tasks":T.value,"subagent-tasks":E.value,"bash-running":O.value,"subagent-running":A.value,"todo-done-count":$.value,"has-dock-work":R.value,todos:e.todos,"pending-question":ve.value,"pending-approval":Pe.value,mobile:e.mobile,onToggleDockPanel:be[34]||(be[34]=Fe=>V(Fe)),onCloseDockPanel:be[35]||(be[35]=Fe=>U()),onAnswer:Ro,onDismiss:be[36]||(be[36]=Fe=>s("dismiss",Fe)),onApproval:po,onCancelTask:be[37]||(be[37]=Fe=>s("cancelTask",Fe)),onControlGoal:be[38]||(be[38]=Fe=>s("controlGoal",Fe)),onSubmit:es,onSteer:be[39]||(be[39]=Fe=>s("steer",Fe)),onCommand:be[40]||(be[40]=Fe=>s("command",Fe)),onInterrupt:qe,onUnqueue:be[41]||(be[41]=Fe=>s("unqueue",Fe)),onEditQueued:be[42]||(be[42]=Fe=>s("editQueued",Fe)),onSetPermission:be[43]||(be[43]=Fe=>s("setPermission",Fe)),onSetThinking:be[44]||(be[44]=Fe=>s("setThinking",Fe)),onTogglePlan:be[45]||(be[45]=Fe=>s("togglePlan")),onToggleSwarm:be[46]||(be[46]=Fe=>s("toggleSwarm")),onToggleGoal:be[47]||(be[47]=Fe=>s("toggleGoal")),onOpenBtw:be[48]||(be[48]=Fe=>s("command","/btw")),onCreateGoal:be[49]||(be[49]=Fe=>s("createGoal",Fe)),onFocusGoal:L,onFocusSwarm:N,onCompact:be[50]||(be[50]=Fe=>s("compact")),onPickModel:be[51]||(be[51]=Fe=>s("pickModel")),onSelectModel:be[52]||(be[52]=Fe=>s("selectModel",Fe))},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"]))]),vt(qi,{name:"pill"},{default:$n(()=>[Y.value?(C(),I("button",{key:0,class:"newmsg-pill",style:Wt({bottom:`${Ce.value+12}px`}),"aria-label":S(m)("conversation.jumpToLatestAria"),onClick:be[53]||(be[53]=Fe=>nt(!0))},[be[61]||(be[61]=p("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"},[p("polyline",{points:"4,6 8,10 12,6"})],-1)),ut(" "+P(S(m)("conversation.newMessages")),1)],12,wZ)):se("",!0)]),_:1}),vt(qi,{name:"abort-toast"},{default:$n(()=>[So.value?(C(),I("div",_Z,[p("span",CZ,P(S(m)("conversation.manuallyAborted")),1)])):se("",!0)]),_:1})],2))}}),EZ=bt(MZ,[["__scopeId","data-v-afc326d6"]]),IZ={key:0,class:"fp-empty fp-error"},$Z={key:1,class:"fp-empty"},NZ={key:2,class:"fp-loading"},LZ={class:"fp-header"},PZ={class:"fp-title"},OZ=["title"],RZ={class:"fp-meta"},DZ={key:0,class:"fp-lines"},BZ={class:"fp-size"},FZ=["aria-label"],HZ=["aria-label"],WZ=["aria-label"],UZ={key:3,class:"fp-search"},jZ=["placeholder"],qZ={key:0,class:"fp-search-count"},zZ=["disabled","title"],VZ=["disabled","title"],KZ=["title"],GZ={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"},YZ={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"},XZ=["title"],QZ=["title"],ZZ=["href","title"],JZ=["title"],eJ={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"},tJ={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"},nJ=["title","aria-label"],oJ={key:1,class:"fp-code"},sJ={class:"fp-line-table"},iJ=["data-line"],rJ={class:"fp-gutter"},lJ=["innerHTML"],aJ={key:1,class:"fp-body fp-code"},cJ={class:"fp-line-table"},uJ=["data-line"],dJ={class:"fp-gutter"},fJ=["innerHTML"],hJ={key:2,class:"fp-body"},pJ=["srcdoc","title"],mJ={key:1,class:"fp-code"},gJ={class:"fp-line-table"},vJ=["data-line"],yJ={class:"fp-gutter"},kJ=["innerHTML"],bJ={key:3,class:"fp-body fp-pdf-wrap"},wJ=["src","title"],_J={key:1,class:"fp-binary-card"},CJ={class:"fp-binary-label"},SJ={key:4,class:"fp-body fp-table-wrap"},xJ={class:"fp-table"},TJ=["data-line"],AJ={key:5,class:"fp-body fp-image-wrap"},MJ=["src","alt"],EJ={key:1,class:"fp-binary-card"},IJ={class:"fp-binary-label"},$J={key:6,class:"fp-body fp-code"},NJ={class:"fp-line-table"},LJ=["data-line"],PJ={class:"fp-gutter"},OJ=["innerHTML"],RJ={key:7,class:"fp-body fp-binary-wrap"},DJ={class:"fp-binary-card"},BJ={class:"fp-binary-label"},FJ=Qe({__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}=St();function o(ue,ve){const Pe=ve?ve.split("/").filter(Boolean):[];for(const Re of ue.split("/"))Re===""||Re==="."||(Re===".."?Pe.pop():Pe.push(Re));return Pe.join("/")}const s=Bt("resolveImage",async ue=>ue),i=F(()=>{const ue=c.file?.path??"",ve=ue.lastIndexOf("/");return ve>0?ue.slice(0,ve):""});function r(ue){if(/^(https?:|data:|blob:)/i.test(ue)||ue.startsWith("/"))return ue;const ve=i.value;return ve?o(ue,ve):ue}async function l(ue){const ve=r(ue);return s?s(ve):ve}yn("resolveImage",l);function a(ue){let ve=ue.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(ve)||ve.startsWith("/"))return ue;for(const Re of["#","?"]){const Q=ve.indexOf(Re);Q!==-1&&(ve=ve.slice(0,Q))}const Pe=i.value;return{...ue,path:o(ve,Pe)}}const c=e,u=t;function d(ue){c.openFile?.(a(ue))}const h=ne(null),m=F(()=>{const ue=c.file;if(!ue)return"binary";const ve=ue.mime??"",Pe=ue.languageId??"",Re=ue.path.toLowerCase();return ve==="text/markdown"||Pe==="markdown"||Pe==="md"||Re.endsWith(".mdx")?"markdown":ve==="application/json"||Pe==="json"?"json":ve==="text/html"||Pe==="html"||Re.endsWith(".html")||Re.endsWith(".htm")?"html":ve==="application/pdf"||Re.endsWith(".pdf")?"pdf":ve==="text/csv"||Pe==="csv"||Re.endsWith(".csv")?"csv":ve.startsWith("image/")?"image":ue.isBinary?"binary":ve.startsWith("text/")||Pe!==""?"text":"binary"});function f(ue){const ve=atob(ue),Pe=Uint8Array.from(ve,Re=>Re.charCodeAt(0));return new TextDecoder().decode(Pe)}const g=F(()=>{const ue=c.file;if(!ue)return"";if(ue.encoding==="base64")try{return f(ue.content)}catch{return ue.content}return ue.content}),_=F(()=>{if(m.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(g.value),null,2)}catch{return g.value}}),w=F(()=>c.file?(m.value==="json"?_.value:g.value).split(`
|
|
263
|
-
`):[]),y=F(()=>c.file?m.value==="json"?_.value:g.value:""),b=ne(""),v=ne(0),x=F(()=>{const ue=b.value.trim().toLowerCase();if(!ue)return[];const ve=[];return w.value.forEach((Pe,Re)=>{Pe.toLowerCase().includes(ue)&&ve.push(Re+1)}),ve});ze(b,()=>{v.value=0});function L(ue,ve=!1){ue&&ht(()=>{const Pe=h.value?.querySelector(".fp-body"),Re=Pe?.querySelector(`[data-line="${ue}"]`);if(!Pe||!Re)return;ve&&(Pe.scrollTop=0);const Q=Pe.getBoundingClientRect(),ce=Re.getBoundingClientRect(),Ce=ce.top-Q.top+Pe.scrollTop;Pe.scrollTop=Ce-Pe.clientHeight/2+ce.height/2})}ze(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function N(ue){const ve=x.value;ve.length!==0&&(v.value=(v.value+ue+ve.length)%ve.length,L(ve[v.value]))}function k(ue){const ve=x.value;return{target:c.line===ue,hit:ve.includes(ue),active:ve[v.value]===ue}}function T(ue){return ue<1024?`${ue} B`:ue<1024*1024?`${(ue/1024).toFixed(1)} KB`:`${(ue/(1024*1024)).toFixed(1)} MB`}const E=ne(!1),O=ne(!1);function A(){c.file&&wo(y.value).then(ue=>{ue&&(E.value=!0,setTimeout(()=>{E.value=!1},1400))})}function $(){c.file&&wo(c.file.path).then(ue=>{ue&&(O.value=!0,setTimeout(()=>{O.value=!1},1400))})}const R=ne("preview"),D=ne("preview"),W=ne("fit");ze(m,ue=>{R.value=ue==="html"?"preview":"source",D.value="preview",W.value="fit"});const V=F(()=>{const ue=c.file;return!ue||m.value!=="image"?null:ue.sourceUrl?ue.sourceUrl:ue.encoding==="base64"?`data:${ue.mime};base64,${ue.content}`:ue.mime==="image/svg+xml"?`data:${ue.mime};charset=utf-8,${encodeURIComponent(ue.content)}`:null}),U=F(()=>{const ue=c.file;return!ue||m.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ue.encoding==="base64"?`data:${ue.mime};base64,${ue.content}`:null}),ee=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 K(ue){const ve=[];let Pe="",Re=!1;for(let Q=0;Q<ue.length;Q++){const ce=ue[Q];ce==='"'&&ue[Q+1]==='"'?(Pe+='"',Q++):ce==='"'?Re=!Re:ce===","&&!Re?(ve.push(Pe),Pe=""):Pe+=ce}return ve.push(Pe),ve}const G=F(()=>w.value.slice(0,200).map(K));function X(ue){return ue.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function ke(){const ue=c.file;if(!ue)return"";const ve=ue.languageId?.toLowerCase();return ve||(ue.path.split(".").pop()?.toLowerCase()??"")}function le(ue){const ve=ke();let Pe=X(ue);return m.value==="json"||ve==="json"||ve==="jsonc"?(Pe=Pe.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),Pe=Pe.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),Pe=Pe.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),Pe=Pe.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),Pe):m.value==="html"||ve==="html"||ve==="xml"||ve==="svg"?(Pe=Pe.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),Pe=Pe.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),Pe=Pe.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),Pe):(Pe=Pe.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>'),Pe=Pe.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),Pe=Pe.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),Pe)}function He(ue,ve=55){return!ue||ue.length<=ve?ue:"…"+ue.slice(ue.length-ve+1)}return(ue,ve)=>(C(),I("div",{ref_key:"rootRef",ref:h,class:"file-preview"},[e.error&&!e.loading?(C(),I("div",IZ,[p("span",null,P(e.error),1),e.closable?(C(),I("button",{key:0,type:"button",class:"fp-action",onClick:ve[0]||(ve[0]=Pe=>u("close"))},P(S(n)("filePreview.close")),1)):se("",!0)])):!e.file&&!e.loading?(C(),I("div",$Z,P(S(n)("filePreview.empty")),1)):e.loading?(C(),I("div",NZ,[ve[13]||(ve[13]=p("span",{class:"spinner"},null,-1)),p("span",null,P(S(n)("filePreview.loading")),1)])):e.file?(C(),I(Oe,{key:3},[p("div",LZ,[p("span",PZ,P(S(n)("common.preview")),1),p("span",{class:"fp-path",title:e.file.path},P(He(e.file.path)),9,OZ),p("span",RZ,[e.file.lineCount?(C(),I("span",DZ,P(S(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):se("",!0),p("span",BZ,P(T(e.file.size)),1)]),m.value==="html"?(C(),I("div",{key:0,class:"fp-seg",role:"group","aria-label":S(n)("filePreview.htmlMode")},[p("button",{type:"button",class:Le(["fp-seg-btn",{on:R.value==="preview"}]),onClick:ve[1]||(ve[1]=Pe=>R.value="preview")},P(S(n)("filePreview.preview")),3),p("button",{type:"button",class:Le(["fp-seg-btn",{on:R.value==="source"}]),onClick:ve[2]||(ve[2]=Pe=>R.value="source")},P(S(n)("filePreview.source")),3)],8,FZ)):se("",!0),m.value==="markdown"?(C(),I("div",{key:1,class:"fp-seg",role:"group","aria-label":S(n)("filePreview.markdownMode")},[p("button",{type:"button",class:Le(["fp-seg-btn",{on:D.value==="preview"}]),onClick:ve[3]||(ve[3]=Pe=>D.value="preview")},P(S(n)("filePreview.preview")),3),p("button",{type:"button",class:Le(["fp-seg-btn",{on:D.value==="source"}]),onClick:ve[4]||(ve[4]=Pe=>D.value="source")},P(S(n)("filePreview.source")),3)],8,HZ)):se("",!0),m.value==="image"?(C(),I("div",{key:2,class:"fp-seg",role:"group","aria-label":S(n)("filePreview.imageFit")},[p("button",{type:"button",class:Le(["fp-seg-btn",{on:W.value==="fit"}]),onClick:ve[5]||(ve[5]=Pe=>W.value="fit")},P(S(n)("filePreview.fit")),3),p("button",{type:"button",class:Le(["fp-seg-btn",{on:W.value==="actual"}]),onClick:ve[6]||(ve[6]=Pe=>W.value="actual")},P(S(n)("filePreview.actual")),3)],8,WZ)):se("",!0),m.value==="text"||m.value==="json"||m.value==="html"||m.value==="csv"?(C(),I("div",UZ,[qt(p("input",{"onUpdate:modelValue":ve[7]||(ve[7]=Pe=>b.value=Pe),class:"fp-search-input",type:"search",placeholder:S(n)("filePreview.search")},null,8,jZ),[[Wn,b.value]]),b.value.trim()?(C(),I("span",qZ,P(x.value.length),1)):se("",!0),p("button",{type:"button",class:"fp-icon-btn",disabled:x.value.length===0,title:S(n)("filePreview.prevMatch"),onClick:ve[8]||(ve[8]=Pe=>N(-1))},"↑",8,zZ),p("button",{type:"button",class:"fp-icon-btn",disabled:x.value.length===0,title:S(n)("filePreview.nextMatch"),onClick:ve[9]||(ve[9]=Pe=>N(1))},"↓",8,VZ)])):se("",!0),p("button",{type:"button",class:Le(["fp-action fp-act-icon",{copied:O.value}]),title:O.value?S(n)("filePreview.copied"):S(n)("filePreview.copyPath"),onClick:$},[O.value?(C(),I("svg",YZ,[...ve[15]||(ve[15]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(C(),I("svg",GZ,[...ve[14]||(ve[14]=[p("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),p("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,KZ),e.externalActions?(C(),I("button",{key:4,type:"button",class:"fp-action fp-act-icon",title:S(n)("filePreview.openInEditor"),onClick:ve[10]||(ve[10]=Pe=>u("openExternal"))},[...ve[16]||(ve[16]=[p("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"},[p("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"}),p("path",{d:"M9.5 2.5h4v4"}),p("path",{d:"M13.5 2.5 7.5 8.5"})],-1)])],8,XZ)):se("",!0),e.externalActions?(C(),I("button",{key:5,type:"button",class:"fp-action fp-act-icon",title:S(n)("filePreview.reveal"),onClick:ve[11]||(ve[11]=Pe=>u("reveal"))},[...ve[17]||(ve[17]=[p("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"},[p("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,QZ)):se("",!0),e.downloadUrl?(C(),I("a",{key:6,class:"fp-action fp-act-icon",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"",title:S(n)("filePreview.download")},[...ve[18]||(ve[18]=[p("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"},[p("path",{d:"M8 2v8"}),p("path",{d:"M4.5 6.5 8 10l3.5-3.5"}),p("path",{d:"M2.5 13.5h11"})],-1)])],8,ZZ)):se("",!0),!e.file.isBinary&&m.value!=="image"?(C(),I("button",{key:7,type:"button",class:Le(["fp-action fp-act-icon",{copied:E.value}]),title:E.value?S(n)("filePreview.copied"):S(n)("filePreview.copy"),onClick:A},[E.value?(C(),I("svg",tJ,[...ve[20]||(ve[20]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(C(),I("svg",eJ,[...ve[19]||(ve[19]=[p("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),p("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])]))],10,JZ)):se("",!0),e.closable?(C(),I("button",{key:8,type:"button",class:"fp-close",title:S(n)("filePreview.close"),"aria-label":S(n)("filePreview.close"),onClick:ve[12]||(ve[12]=Pe=>u("close"))}," × ",8,nJ)):se("",!0)]),m.value==="markdown"?(C(),I("div",{key:0,class:Le(["fp-body",{"fp-markdown":D.value==="preview"}])},[D.value==="preview"?(C(),Ve(gu,{key:0,text:g.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(C(),I("div",oJ,[p("div",sJ,[(C(!0),I(Oe,null,Xe(w.value,(Pe,Re)=>(C(),I("div",{key:Re,class:Le(["fp-line-row",k(Re+1)]),"data-line":Re+1},[p("span",rJ,P(Re+1),1),p("span",{class:"fp-line-text",innerHTML:le(Pe)},null,8,lJ)],10,iJ))),128))])]))],2)):m.value==="json"?(C(),I("div",aJ,[p("div",cJ,[(C(!0),I(Oe,null,Xe(w.value,(Pe,Re)=>(C(),I("div",{key:Re,class:Le(["fp-line-row",k(Re+1)]),"data-line":Re+1},[p("span",dJ,P(Re+1),1),p("span",{class:"fp-line-text",innerHTML:le(Pe)},null,8,fJ)],10,uJ))),128))])])):m.value==="html"?(C(),I("div",hJ,[R.value==="preview"?(C(),I("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:ee.value,title:e.file.path},null,8,pJ)):(C(),I("div",mJ,[p("div",gJ,[(C(!0),I(Oe,null,Xe(w.value,(Pe,Re)=>(C(),I("div",{key:Re,class:Le(["fp-line-row",k(Re+1)]),"data-line":Re+1},[p("span",yJ,P(Re+1),1),p("span",{class:"fp-line-text",innerHTML:le(Pe)},null,8,kJ)],10,vJ))),128))])]))])):m.value==="pdf"?(C(),I("div",bJ,[U.value?(C(),I("iframe",{key:0,class:"fp-pdf-frame",src:U.value,title:e.file.path},null,8,wJ)):(C(),I("div",_J,[p("span",CJ,P(S(n)("filePreview.pdfNoPreview")),1)]))])):m.value==="csv"?(C(),I("div",SJ,[p("table",xJ,[p("tbody",null,[(C(!0),I(Oe,null,Xe(G.value,(Pe,Re)=>(C(),I("tr",{key:Re,class:Le(k(Re+1)),"data-line":Re+1},[p("th",null,P(Re+1),1),(C(!0),I(Oe,null,Xe(Pe,(Q,ce)=>(C(),I("td",{key:ce},P(Q),1))),128))],10,TJ))),128))])])])):m.value==="image"?(C(),I("div",AJ,[V.value?(C(),I("img",{key:0,src:V.value,alt:e.file.path,class:Le(["fp-image",{actual:W.value==="actual"}])},null,10,MJ)):(C(),I("div",EJ,[ve[21]||(ve[21]=p("span",{class:"fp-binary-icon"},[p("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[p("rect",{x:"2",y:"2",width:"16",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),p("path",{d:"M7 10h6M10 7v6",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),p("span",IJ,P(S(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:T(e.file.size)})),1)]))])):m.value==="text"?(C(),I("div",$J,[p("div",NJ,[(C(!0),I(Oe,null,Xe(w.value,(Pe,Re)=>(C(),I("div",{key:Re,class:Le(["fp-line-row",k(Re+1)]),"data-line":Re+1},[p("span",PJ,P(Re+1),1),p("span",{class:"fp-line-text",innerHTML:le(Pe)},null,8,OJ)],10,LJ))),128))])])):(C(),I("div",RJ,[p("div",DJ,[ve[22]||(ve[22]=p("span",{class:"fp-binary-icon"},[p("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[p("path",{d:"M5 3h7l4 4v10H5V3z",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),p("path",{d:"M12 3v4h4",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),p("span",BJ,P(S(n)("filePreview.binaryNoPreview",{mime:e.file.mime||S(n)("filePreview.unknownType"),size:T(e.file.size)})),1)])]))],64)):se("",!0)],512))}}),HJ=bt(FJ,[["__scopeId","data-v-93380983"]]),WJ={class:"tp"},UJ={class:"tp-header"},jJ={class:"tp-title"},qJ={class:"tp-sub"},zJ=["title","aria-label"],VJ=Qe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=St(),i=ne(null);return ze(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||ht(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(C(),I("div",WJ,[p("div",UJ,[p("span",jJ,P(S(s)("common.preview")),1),p("span",qJ,P(e.subtitle??S(s)("thinking.panelTitle")),1),p("button",{type:"button",class:"tp-close",title:S(s)("thinking.close"),"aria-label":S(s)("thinking.close"),onClick:l[0]||(l[0]=a=>o("close"))},[...l[1]||(l[1]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,zJ)]),p("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},P(e.text),513)]))}}),V2=bt(VJ,[["__scopeId","data-v-2f5e8c0f"]]),KJ={class:"ap"},GJ={class:"ap-header"},YJ={class:"ap-title"},XJ={class:"ap-sub"},QJ=["title","aria-label"],ZJ={key:0,class:"ap-type"},JJ={key:1,class:"ap-reason"},eee={key:2,class:"ap-field"},tee={class:"ap-field-body"},nee={key:3,class:"ap-field"},oee={class:"ap-field-body ap-progress"},see={key:0,class:"ap-call"},iee={key:1,class:"ap-output"},ree=["onClick"],lee={key:4,class:"ap-field"},aee={class:"ap-field-body"},cee=8,K2=5,G2=2,uee=Qe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=St(),i=F(()=>(n.member.outputLines??[]).map(f=>f.trimEnd()).filter(f=>f.length>0));function r(f){const g=[];let _=null,w=0;for(const y of f)y.startsWith("Calling ")?(_={key:`g${w++}`,call:y,output:[]},g.push(_)):_?_.output.push(y):(_={key:`g${w++}`,call:"",output:[y]},g.push(_));return g}const l=F(()=>r(i.value)),a=ne(new Set);function c(f){return a.value.has(f)}function u(f){const g=new Set(a.value);g.has(f)?g.delete(f):g.add(f),a.value=g}function d(f){return f.output.length-K2-G2}function h(f){switch(f){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const m=ne(null);return ze(()=>i.value.length,()=>{const f=m.value;!f||!(f.scrollHeight-f.scrollTop-f.clientHeight<24)||ht(()=>{m.value&&(m.value.scrollTop=m.value.scrollHeight)})},{immediate:!0}),(f,g)=>(C(),I("div",KJ,[p("div",GJ,[p("span",YJ,P(S(s)("common.preview")),1),p("span",XJ,P(e.member.name),1),p("span",{class:Le(["ap-phase",`phase-${e.member.phase}`])},P(h(e.member.phase)),3),p("button",{type:"button",class:"ap-close",title:S(s)("thinking.close"),"aria-label":S(s)("thinking.close"),onClick:g[0]||(g[0]=_=>o("close"))},[...g[1]||(g[1]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,QJ)]),p("div",{ref_key:"bodyEl",ref:m,class:"ap-body"},[e.member.subagentType?(C(),I("div",ZJ,P(e.member.subagentType),1)):se("",!0),e.member.suspendedReason?(C(),I("div",JJ,P(e.member.suspendedReason),1)):se("",!0),e.member.prompt?(C(),I("div",eee,[g[2]||(g[2]=p("span",{class:"ap-field-label"},"Task",-1)),p("div",tee,P(e.member.prompt),1)])):se("",!0),l.value.length>0?(C(),I("div",nee,[g[4]||(g[4]=p("span",{class:"ap-field-label"},"Progress",-1)),p("div",oee,[(C(!0),I(Oe,null,Xe(l.value,_=>(C(),I("div",{key:_.key,class:"ap-group"},[_.call?(C(),I("div",see,[g[3]||(g[3]=p("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),ut(" "+P(_.call),1)])):se("",!0),_.output.length>0?(C(),I("div",iee,[_.output.length<=cee||c(_.key)?(C(!0),I(Oe,{key:0},Xe(_.output,(w,y)=>(C(),I("div",{key:y,class:"ap-out-line"},P(w),1))),128)):(C(),I(Oe,{key:1},[(C(!0),I(Oe,null,Xe(_.output.slice(0,K2),(w,y)=>(C(),I("div",{key:y,class:"ap-out-line"},P(w),1))),128)),p("button",{type:"button",class:"ap-fold",onClick:w=>u(_.key)}," … ("+P(d(_))+" more) ",9,ree),(C(!0),I(Oe,null,Xe(_.output.slice(-G2),(w,y)=>(C(),I("div",{key:"t"+y,class:"ap-out-line"},P(w),1))),128))],64))])):se("",!0)]))),128))])])):se("",!0),e.member.summary?(C(),I("div",lee,[g[5]||(g[5]=p("span",{class:"ap-field-label"},"Result",-1)),p("div",aee,P(e.member.summary),1)])):se("",!0)],512)]))}}),dee=bt(uee,[["__scopeId","data-v-66bf53d2"]]),fee={class:"diff-lines"},hee={key:0,class:"hunk-text"},pee={class:"dl-gutter old"},mee={class:"dl-gutter new"},gee={class:"dl-sign"},vee={class:"dl-text"},yee=Qe({__name:"DiffLines",props:{lines:{}},setup(e){function t(s){return s.oldNo!==void 0?String(s.oldNo):""}function n(s){return s.newNo!==void 0?String(s.newNo):""}function o(s){return`dl-${s.type}`}return(s,i)=>(C(),I("div",fee,[(C(!0),I(Oe,null,Xe(e.lines,(r,l)=>(C(),I("div",{key:l,class:Le(["dl",o(r)])},[r.type==="hunk"?(C(),I("span",hee,P(r.text),1)):(C(),I(Oe,{key:1},[p("span",pee,P(t(r)),1),p("span",mee,P(n(r)),1),p("span",gee,P(r.type==="add"?"+":r.type==="del"?"-":" "),1),p("span",vee,P(r.text),1)],64))],2))),128))]))}}),A3=bt(yee,[["__scopeId","data-v-b73eaacc"]]),kee={class:"tdp"},bee={class:"tdp-header"},wee={class:"tdp-title"},_ee=["title"],Cee=["title","aria-label"],See={class:"tdp-body"},xee={key:1,class:"tdp-output"},Tee={key:2,class:"tdp-empty"},Aee=Qe({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=St();return(s,i)=>(C(),I("div",kee,[p("div",bee,[p("span",wee,P(e.target.title),1),e.target.path?(C(),I("span",{key:0,class:"tdp-sub",title:e.target.path},P(e.target.path),9,_ee)):se("",!0),p("button",{type:"button",class:"tdp-close",title:S(o)("thinking.close"),"aria-label":S(o)("thinking.close"),onClick:i[0]||(i[0]=r=>n("close"))},[...i[1]||(i[1]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,Cee)]),p("div",See,[e.target.lines&&e.target.lines.length>0?(C(),Ve(A3,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(C(),I("div",xee,[(C(!0),I(Oe,null,Xe(e.target.output,(r,l)=>(C(),I("div",{key:l},P(r),1))),128))])):(C(),I("div",Tee,P(S(o)("diff.noDiff")),1))])]))}}),Mee=bt(Aee,[["__scopeId","data-v-9d022f5b"]]),Eee={class:"sc"},Iee={class:"sc-header"},$ee={class:"sc-title"},Nee=["title"],Lee=["title","aria-label"],Pee={key:0,class:"sc-empty"},Oee={key:2,class:"sc-loading","aria-hidden":"true"},Ree={class:"sc-composer"},Dee=["placeholder"],Bee=["disabled","title"],Fee=Qe({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=St(),i=F(()=>n.turns.find(y=>y.role==="user")?.text?.trim()??""),r=F(()=>n.title?.trim()||s("sideChat.title")),l=F(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=ne(""),c=ne(null),u=ne(null);function d(){const w=a.value.trim();w&&(o("send",w),a.value="",ht(()=>{c.value&&(c.value.style.height="auto"),h()}))}function h(){const w=u.value;w&&(w.scrollTop=w.scrollHeight)}const m=F(()=>{const w=n.turns;if(w.length===0)return"0";const y=w.at(-1),b=y.thinking?.length??0,v=y.tools?.reduce((x,L)=>x+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${w.length}:${y.text.length}:${b}:${v}`});ze(m,async()=>{!n.running&&!n.sending||(await ht(),h())});const f=F(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function g(w){w.key==="Enter"&&!w.shiftKey&&!w.isComposing&&(w.preventDefault(),d())}function _(){const w=c.value;w&&(w.style.height="auto",w.style.height=`${Math.min(w.scrollHeight,160)}px`)}return(w,y)=>(C(),I("div",Eee,[p("div",Iee,[p("span",$ee,P(r.value),1),p("span",{class:"sc-subtitle",title:l.value},P(l.value),9,Nee),p("button",{type:"button",class:"sc-close",title:S(s)("thinking.close"),"aria-label":S(s)("thinking.close"),onClick:y[0]||(y[0]=b=>o("close"))},[...y[2]||(y[2]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,Lee)]),p("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(C(),I("div",Pee,P(S(s)("sideChat.empty")),1)):(C(),Ve(_3,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending,bubble:""},null,8,["turns","running","sending"])),f.value?(C(),I("div",Oee,[vt(q1)])):se("",!0)],512),p("div",Ree,[qt(p("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":y[1]||(y[1]=b=>a.value=b),class:"sc-input",rows:"1",placeholder:S(s)("sideChat.placeholder"),onInput:_,onKeydown:g},null,40,Dee),[[Wn,a.value]]),p("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),title:S(s)("sideChat.send"),onClick:d},[...y[3]||(y[3]=[p("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"},[p("path",{d:"M2 8h10"}),p("path",{d:"M8 4l4 4-4 4"})],-1)])],8,Bee)])]))}}),Hee=bt(Fee,[["__scopeId","data-v-5d7c220f"]]),Wee={class:"changes-pane"},Uee={class:"dv-panel-head"},jee={class:"dv-title"},qee=["title"],zee=["title","aria-label"],Vee={class:"diff-head"},Kee=["title"],Gee={class:"back-label"},Yee={key:0,class:"empty-state"},Xee={key:1,class:"dv-lines-wrap"},Qee={key:2,class:"empty-state"},Zee={class:"dv-panel-head"},Jee={class:"dv-title"},ete={class:"dv-change-count"},tte=["aria-label"],nte=["aria-pressed"],ote=["aria-pressed"],ste=["title","aria-label"],ite={class:"ch-head"},rte={class:"br-label"},lte={class:"br-name"},ate={key:0,class:"sync-info"},cte=["title"],ute=["title"],dte={key:1,class:"empty-head"},fte={key:0,class:"ch-list"},hte=["title","onClick"],pte={class:"fpath"},mte={key:1,class:"ch-list ch-tree"},gte={class:"tree-list"},vte=["onClick"],yte={class:"tree-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},kte=["d"],bte={class:"tree-name"},wte=["title","onClick"],_te={class:"tree-name"},Cte={key:2,class:"empty-state"},Ste={key:3,class:"empty-state"},xte=Qe({__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}=St(),o=e,s=t;function i(A){const $=A.toLowerCase();return $==="modified"?"modified":$==="added"?"added":$==="deleted"?"deleted":$==="renamed"?"renamed":$==="untracked"?"untracked":$==="conflicted"?"conflicted":$==="ignored"?"ignored":$==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(A){return r[i(A)]??"?"}function a(A,$=60){return A.length<=$?A:"…"+A.slice(A.length-$+1)}const c=F(()=>o.gitInfo!==null),u=F(()=>o.changes.length>0),d=F(()=>(o.selectedDiffPath??null)!==null),h=F(()=>o.mode==="detail"||o.mode==="full"&&d.value),m=F(()=>o.fileDiff??[]),f=F(()=>o.fileDiffLoading===!0);function g(A){s("open",A)}function _(){s("back")}function w(){s("close")}const y=ne("list");function b(A){y.value=A}function v(A){const $={children:[]},R=[...A].sort((D,W)=>D.path.localeCompare(W.path));for(const D of R){const W=D.path.split("/");let V=$;for(let U=0;U<W.length;U++){const ee=W[U],K=U===W.length-1,G=W.slice(0,U+1).join("/");let X=V.children.find(ke=>ke.name===ee&&ke.kind===(K?"file":"folder"));X||(X={name:ee,path:G,kind:K?"file":"folder",status:K?D.status:void 0,children:[]},V.children.push(X)),V=X}}return $.children}const x=F(()=>v(o.changes)),L=ne(new Set);function N(A){return!L.value.has(A)}const k=F(()=>{const A=[];function $(R,D){for(const W of R)A.push({node:W,depth:D}),W.kind==="folder"&&N(W.path)&&$(W.children,D+1)}return $(x.value,0),A});function T(A){const $=new Set(L.value);$.has(A.path)?$.delete(A.path):$.add(A.path),L.value=$}const E=A=>"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 O(A){return`${16+A*16}px`}return(A,$)=>(C(),I("div",Wee,[h.value?(C(),I(Oe,{key:0},[p("div",Uee,[p("span",jee,P(S(n)("diff.title")),1),p("span",{class:"dv-path",title:e.selectedDiffPath??""},P(a(e.selectedDiffPath??"",50)),9,qee),e.closable?(C(),I("button",{key:0,type:"button",class:"dv-close",title:S(n)("diff.close"),"aria-label":S(n)("diff.close"),onClick:w},[...$[2]||($[2]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,zee)):se("",!0)]),p("div",Vee,[e.hideBack?se("",!0):(C(),I("button",{key:0,class:"back-btn",type:"button",onClick:_,title:S(n)("diff.back")},[$[3]||($[3]=p("span",{"aria-hidden":"true"},"←",-1)),p("span",Gee,P(S(n)("diff.back")),1)],8,Kee))]),f.value?(C(),I("div",Yee,P(S(n)("diff.loading")),1)):m.value.length>0?(C(),I("div",Xee,[vt(A3,{lines:m.value},null,8,["lines"])])):(C(),I("div",Qee,P(S(n)("diff.noDiff")),1))],64)):(C(),I(Oe,{key:1},[p("div",Zee,[p("span",Jee,P(S(n)("diff.title")),1),p("span",ete,P(S(n)("diff.changeCount",{count:e.changes.length})),1),p("div",{class:"dv-toggle",role:"group","aria-label":S(n)("diff.list")+" / "+S(n)("diff.tree")},[p("button",{type:"button",class:Le(["dv-toggle-btn",{active:y.value==="list"}]),"aria-pressed":y.value==="list",onClick:$[0]||($[0]=R=>b("list"))},P(S(n)("diff.list")),11,nte),p("button",{type:"button",class:Le(["dv-toggle-btn",{active:y.value==="tree"}]),"aria-pressed":y.value==="tree",onClick:$[1]||($[1]=R=>b("tree"))},P(S(n)("diff.tree")),11,ote)],8,tte),e.closable?(C(),I("button",{key:0,type:"button",class:"dv-close",title:S(n)("diff.close"),"aria-label":S(n)("diff.close"),onClick:w},[...$[4]||($[4]=[p("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[p("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),p("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,ste)):se("",!0)]),p("div",ite,[c.value?(C(),I(Oe,{key:0},[p("span",rte,P(S(n)("diff.branch")),1),p("span",lte,P(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(C(),I("span",ate,[e.gitInfo.ahead>0?(C(),I("span",{key:0,class:"ahead",title:S(n)("diff.aheadTitle")},"↑"+P(e.gitInfo.ahead),9,cte)):se("",!0),e.gitInfo.behind>0?(C(),I("span",{key:1,class:"behind",title:S(n)("diff.behindTitle")},"↓"+P(e.gitInfo.behind),9,ute)):se("",!0)])):se("",!0)],64)):(C(),I("span",dte,P(S(n)("diff.empty")),1))]),u.value&&y.value==="list"?(C(),I("div",fte,[(C(!0),I(Oe,null,Xe(e.changes,R=>(C(),I("button",{key:R.path,type:"button",class:"ch-row",title:R.path,onClick:D=>g(R.path)},[p("span",{class:Le(["badge",i(R.status)])},P(l(R.status)),3),p("span",pte,P(a(R.path)),1)],8,hte))),128))])):u.value&&y.value==="tree"?(C(),I("div",mte,[p("ul",gte,[(C(!0),I(Oe,null,Xe(k.value,({node:R,depth:D})=>(C(),I("li",{key:R.path,class:"tree-node"},[R.kind==="folder"?(C(),I("button",{key:0,type:"button",class:"tree-row tree-folder",style:Wt({paddingLeft:O(D)}),onClick:W=>T(R)},[(C(),I("svg",yte,[p("path",{d:E(N(R.path))},null,8,kte)])),p("span",bte,P(R.name),1)],12,vte)):(C(),I("button",{key:1,type:"button",class:"tree-row tree-file",style:Wt({paddingLeft:O(D)}),title:R.path,onClick:W=>g(R.path)},[p("span",{class:Le(["badge",i(R.status)])},P(l(R.status)),3),p("span",_te,P(R.name),1)],12,wte))]))),128))])])):c.value?(C(),I("div",Cte,P(S(n)("diff.clean")),1)):(C(),I("div",Ste,P(S(n)("diff.empty")),1))],64))]))}}),Tte=bt(xte,[["__scopeId","data-v-bb3f7593"]]);function np(e,t){let n=null;sn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,ht(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),Jo(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const Ate=["aria-label"],Mte={class:"dh"},Ete={class:"dtitle"},Ite=["title"],$te={class:"search-wrap"},Nte=["placeholder"],Lte=["aria-label"],Pte=["aria-selected","onClick"],Ote={key:1,class:"loading-state"},Rte={key:2,class:"unavail-state"},Dte={key:3,class:"model-list"},Bte=["aria-selected","onClick","onMouseenter"],Fte={class:"check"},Hte={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"},Wte={class:"model-main"},Ute={class:"model-name"},jte={class:"model-id"},qte={class:"model-provider"},zte={class:"model-ctx"},Vte={key:0,class:"caps"},Kte=["title","onClick"],Gte={viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true"},Yte=["fill"],Xte={key:0,class:"empty"},Qte={class:"footer-hint"},Zte=Qe({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=St(),o=e,s=t,i=F(()=>new Set(o.starredIds??[]));function r(b){return i.value.has(b)}const l=ne(""),a=ne(null),c=ne(null),u=ne("all");np(c,a);const d=F(()=>{const b=new Set,v=[{id:"all",label:n("model.allTab")}];for(const x of o.models)b.has(x.provider)||(b.add(x.provider),v.push({id:x.provider,label:x.provider}));return v}),h=F(()=>{const b=l.value.toLowerCase().trim(),v=o.models.filter(x=>{if(u.value!=="all"&&x.provider!==u.value)return!1;const L=(x.displayName??x.model).toLowerCase().includes(b),N=x.provider.toLowerCase().includes(b),k=x.id.toLowerCase().includes(b);return!b||L||N||k});return u.value!=="all"?v:v.sort((x,L)=>{const N=r(x.id)?1:0;return(r(L.id)?1:0)-N})}),m=F(()=>h.value),f=ne(0);ze([l,u],()=>{f.value=0}),ze(d,b=>{b.some(v=>v.id===u.value)||(u.value="all")}),ze(m,b=>{f.value=Math.min(f.value,Math.max(b.length-1,0))});function g(b){if(b.key==="Escape"){s("close");return}if(b.key==="ArrowDown")b.preventDefault(),f.value=Math.min(f.value+1,m.value.length-1);else if(b.key==="ArrowUp")b.preventDefault(),f.value=Math.max(f.value-1,0);else if(b.key==="Enter"){const v=m.value[f.value];v&&s("select",v.id)}}sn(()=>{document.addEventListener("keydown",g)}),Yt(()=>{document.removeEventListener("keydown",g)});function _(b){s("select",b)}function w(b){return m.value.indexOf(b)}function y(b){u.value=b}return(b,v)=>(C(),I("div",{class:"backdrop",onClick:v[3]||(v[3]=Ze(x=>s("close"),["self"]))},[p("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":S(n)("model.dialogLabel")},[p("div",Mte,[p("span",Ete,P(S(n)("model.title")),1),p("button",{class:"close-btn",title:S(n)("model.close"),onClick:v[0]||(v[0]=x=>s("close"))},"✕",8,Ite)]),p("div",$te,[qt(p("input",{ref_key:"searchRef",ref:a,"onUpdate:modelValue":v[1]||(v[1]=x=>l.value=x),class:"search-input",type:"text",placeholder:S(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Nte),[[Wn,l.value]])]),d.value.length>1?(C(),I("div",{key:0,class:"tab-strip",role:"tablist","aria-label":S(n)("model.providerTabs")},[(C(!0),I(Oe,null,Xe(d.value,x=>(C(),I("button",{key:x.id,type:"button",class:Le(["tab-btn",{on:x.id===u.value}]),role:"tab","aria-selected":x.id===u.value,onClick:L=>y(x.id)},P(x.label),11,Pte))),128))],8,Lte)):se("",!0),e.loading?(C(),I("div",Ote,[v[4]||(v[4]=p("svg",{class:"spin-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[p("circle",{cx:"8",cy:"8",r:"6","stroke-dasharray":"24 12","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"1s",repeatCount:"indefinite"})])],-1)),p("span",null,P(S(n)("model.loading")),1)])):e.unavailable?(C(),I("div",Rte,[v[5]||(v[5]=p("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[p("path",{d:"M10 2 L19 18 H1 Z"}),p("line",{x1:"10",y1:"9",x2:"10",y2:"13"}),p("circle",{cx:"10",cy:"16",r:"0.8",fill:"var(--warn)"})],-1)),p("span",null,P(S(n)("model.unavailable")),1)])):(C(),I("div",Dte,[(C(!0),I(Oe,null,Xe(m.value,x=>(C(),I("div",{key:x.id,class:Le(["model-row",{"is-current":x.id===e.current,"is-selected":w(x)===f.value}]),role:"option","aria-selected":x.id===e.current,onClick:L=>_(x.id),onMouseenter:L=>f.value=w(x)},[p("span",Fte,[x.id===e.current?(C(),I("svg",Hte,[...v[6]||(v[6]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):se("",!0)]),p("span",Wte,[p("span",Ute,P(x.displayName??x.model),1),p("span",jte,P(x.id),1)]),p("span",qte,P(x.provider),1),p("span",zte,P(S(n)("model.contextSuffix",{size:Math.round(x.maxContextSize/1e3)})),1),x.capabilities&&x.capabilities.length>0?(C(),I("span",Vte,P(x.capabilities.join(", ")),1)):se("",!0),p("button",{type:"button",class:Le(["star-btn",{starred:r(x.id)}]),title:r(x.id)?S(n)("model.unstarTitle"):S(n)("model.starTitle"),onClick:Ze(L=>s("toggle-star",x.id),["stop"]),onMouseenter:v[2]||(v[2]=Ze(()=>{},["stop"]))},[(C(),I("svg",Gte,[p("path",{fill:r(x.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,Yte)]))],42,Kte)],42,Bte))),128)),m.value.length===0&&!e.loading&&!e.unavailable?(C(),I("div",Xte,P(o.models.length===0?S(n)("model.emptyNoModels"):S(n)("model.emptyNoMatch")),1)):se("",!0)])),p("div",Qte,P(S(n)("model.footerHint")),1)],8,Ate)]))}}),Jte=bt(Zte,[["__scopeId","data-v-34f036d8"]]),ene=["aria-label"],tne={class:"dh"},nne={class:"dtitle"},one=["title"],sne={class:"prov-list"},ine={key:0,class:"state-row"},rne={key:1,class:"state-row unavail"},lne={key:2,class:"empty"},ane=["title"],cne={key:0,width:"8",height:"8",viewBox:"0 0 8 8"},une=["fill"],dne={key:1,width:"8",height:"8",viewBox:"0 0 8 8"},fne=["fill"],hne={key:2,width:"8",height:"8",viewBox:"0 0 8 8"},pne={class:"prov-info"},mne={class:"prov-type"},gne={key:0,class:"prov-url"},vne={class:"prov-meta"},yne={key:0},kne={key:0,class:"confirm-row"},bne={class:"confirm-text"},wne={key:1,class:"prov-actions"},_ne=["title","onClick"],Cne=["title","onClick"],Sne={key:0,class:"add-section"},xne={key:0,class:"add-btns"},Tne={key:1,class:"add-form"},Ane={class:"form-row"},Mne={class:"flabel"},Ene=["value"],Ine={class:"form-row"},$ne={class:"flabel"},Nne={class:"form-row"},Lne={class:"flabel"},Pne=["placeholder"],One={class:"form-row"},Rne={class:"flabel"},Dne=["placeholder"],Bne={key:0,class:"add-error"},Fne={class:"form-btns"},Hne={class:"footer-hint"},Wne=Qe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=St(),o=ne(null);np(o);const s=t,i=ne(null);function r(b){i.value=b}function l(){i.value&&(s("delete",i.value),i.value=null)}function a(){i.value=null}const c=ne(!1),u=ds({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),d=ne(""),h=["moonshot","anthropic","openai","custom"];function m(){u.type="moonshot",u.apiKey="",u.baseUrl="",u.defaultModel="",d.value="",c.value=!0}function f(){c.value=!1}function g(){if(!u.apiKey.trim()){d.value=n("providers.apiKeyRequired");return}d.value="",s("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 _(b){if(b.key==="Escape"){if(c.value){f();return}if(i.value){a();return}s("close")}}sn(()=>document.addEventListener("keydown",_)),Yt(()=>document.removeEventListener("keydown",_));function w(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)=>(C(),I("div",{class:"backdrop",onClick:v[7]||(v[7]=Ze(x=>s("close"),["self"]))},[p("div",{ref_key:"dialogRef",ref:o,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":S(n)("providers.dialogLabel")},[p("div",tne,[p("span",nne,P(S(n)("providers.title")),1),p("button",{class:"close-btn",title:S(n)("providers.close"),onClick:v[0]||(v[0]=x=>s("close"))},"✕",8,one)]),p("div",sne,[e.loading?(C(),I("div",ine,[v[8]||(v[8]=p("svg",{class:"spin-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[p("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)),p("span",null,P(S(n)("providers.loading")),1)])):e.unavailable?(C(),I("div",rne,[v[9]||(v[9]=p("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[p("path",{d:"M8 1.5 L15.5 14.5 H0.5 Z"}),p("line",{x1:"8",y1:"7",x2:"8",y2:"10.5"}),p("circle",{cx:"8",cy:"12.5",r:"0.7",fill:"var(--warn)"})],-1)),p("span",null,P(S(n)("providers.unavailable")),1)])):e.providers.length===0?(C(),I("div",lne,P(S(n)("providers.empty")),1)):(C(!0),I(Oe,{key:3},Xe(e.providers,x=>(C(),I("div",{key:x.id,class:"prov-row"},[p("span",{class:"status-dot",style:Wt({color:w(x.status)}),title:y(x.status)},[x.status==="connected"?(C(),I("svg",cne,[p("circle",{cx:"4",cy:"4",r:"3.5",fill:w(x.status)},null,8,une)])):x.status==="error"?(C(),I("svg",dne,[p("circle",{cx:"4",cy:"4",r:"3.5",fill:w(x.status)},null,8,fne)])):(C(),I("svg",hne,[...v[10]||(v[10]=[p("circle",{cx:"4",cy:"4",r:"3",fill:"none",stroke:"var(--faint)","stroke-width":"1"},null,-1)])]))],12,ane),p("div",pne,[p("span",mne,P(x.type),1),x.baseUrl?(C(),I("span",gne,P(x.baseUrl),1)):se("",!0),p("span",vne,[p("span",{class:Le(["prov-key-state",x.hasApiKey?"has-key":"no-key"])},P(x.hasApiKey?S(n)("providers.keySet"):S(n)("providers.keyNotSet")),3),x.models&&x.models.length>0?(C(),I("span",yne," · "+P(S(n)("providers.modelCount",{count:x.models.length})),1)):se("",!0)])]),i.value===x.id?(C(),I("div",kne,[p("span",bne,P(S(n)("providers.confirmDelete")),1),p("button",{class:"act-btn danger",onClick:l},P(S(n)("providers.confirm")),1),p("button",{class:"act-btn",onClick:a},P(S(n)("providers.cancel")),1)])):(C(),I("div",wne,[p("button",{class:"act-btn",title:S(n)("providers.refreshTitle",{type:x.type}),onClick:L=>s("refresh",x.id)},P(S(n)("providers.refresh")),9,_ne),p("button",{class:"act-btn danger",title:S(n)("providers.deleteTitle",{type:x.type}),onClick:L=>r(x.id)},P(S(n)("providers.delete")),9,Cne)]))]))),128))]),e.unavailable?se("",!0):(C(),I("div",Sne,[c.value?(C(),I("div",Tne,[p("div",Ane,[p("label",Mne,P(S(n)("providers.fieldType")),1),qt(p("select",{"onUpdate:modelValue":v[3]||(v[3]=x=>u.type=x),class:"finput fselect"},[(C(),I(Oe,null,Xe(h,x=>p("option",{key:x,value:x},P(x),9,Ene)),64))],512),[[Af,u.type]])]),p("div",Ine,[p("label",$ne,P(S(n)("providers.fieldApiKey")),1),qt(p("input",{"onUpdate:modelValue":v[4]||(v[4]=x=>u.apiKey=x),class:"finput",type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,512),[[Wn,u.apiKey]])]),p("div",Nne,[p("label",Lne,P(S(n)("providers.fieldBaseUrl")),1),qt(p("input",{"onUpdate:modelValue":v[5]||(v[5]=x=>u.baseUrl=x),class:"finput",type:"text",placeholder:S(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Pne),[[Wn,u.baseUrl]])]),p("div",One,[p("label",Rne,P(S(n)("providers.fieldDefaultModel")),1),qt(p("input",{"onUpdate:modelValue":v[6]||(v[6]=x=>u.defaultModel=x),class:"finput",type:"text",placeholder:S(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,Dne),[[Wn,u.defaultModel]])]),d.value?(C(),I("div",Bne,P(d.value),1)):se("",!0),p("div",Fne,[p("button",{class:"act-btn primary",onClick:g},P(S(n)("providers.add")),1),p("button",{class:"act-btn",onClick:f},P(S(n)("providers.cancel")),1)])])):(C(),I("div",xne,[p("button",{class:"add-btn-oauth",onClick:v[1]||(v[1]=x=>s("openLogin","moonshot"))},[v[11]||(v[11]=p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("circle",{cx:"5",cy:"3",r:"2"}),p("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),ut(" "+P(S(n)("providers.loginKimi")),1)]),p("button",{class:"add-btn-oauth",onClick:v[2]||(v[2]=x=>s("openLogin","anthropic"))},[v[12]||(v[12]=p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("circle",{cx:"5",cy:"3",r:"2"}),p("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),ut(" "+P(S(n)("providers.loginAnthropic")),1)]),p("button",{class:"add-btn add-btn-key",onClick:m},[v[13]||(v[13]=p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"5",y1:"1",x2:"5",y2:"9"}),p("line",{x1:"1",y1:"5",x2:"9",y2:"5"})],-1)),ut(" "+P(S(n)("providers.enterApiKey")),1)])]))])),p("div",Hne,P(S(n)("providers.escClose")),1)],8,ene)]))}}),Une=bt(Wne,[["__scopeId","data-v-28ec3774"]]),jne={class:"backdrop"},qne=["aria-label"],zne={class:"dh"},Vne={class:"dtitle"},Kne=["title"],Gne={key:0,class:"center-body"},Yne={class:"center-text"},Xne={key:1,class:"nb"},Qne={class:"nb-lead"},Zne=["href"],Jne={class:"nb-or"},eoe={class:"nb-fallback"},toe={class:"nb-fb-text"},noe=["href"],ooe={class:"nb-code-row"},soe={class:"nb-code"},ioe={class:"nb-status"},roe=["aria-label"],loe={class:"nb-status-text"},aoe={class:"nb-countdown"},coe={key:2,class:"center-body"},uoe={class:"center-text success-text"},doe={class:"center-hint"},foe={class:"center-body"},hoe={class:"center-text err-text"},poe={class:"center-hint"},moe={class:"actions"},goe={class:"center-body"},voe={class:"center-text warn-text"},yoe={class:"center-hint"},koe={class:"actions"},boe=Qe({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=St(),o=ne(null);np(o);const s=t,i=e,r=ne("starting"),l=ne(null),a=ne(0),c=ne(!1);let u=null,d=null;sn(async()=>{document.addEventListener("keydown",b),await h()}),Yt(()=>{document.removeEventListener("keydown",b),g()});async function h(){g(),l.value=null,r.value="starting";const x=await i.onStartOAuthLogin();if(!x){r.value="error";return}l.value={flowId:x.flowId,verificationUri:x.verificationUri,verificationUriComplete:x.verificationUriComplete,userCode:x.userCode,expiresIn:x.expiresIn,interval:x.interval},a.value=x.expiresIn,r.value="device-code",m(),f(x.interval)}function m(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function f(x){u&&clearTimeout(u),u=setTimeout(async()=>{const L=await i.onPollOAuthLogin();L?.status==="authenticated"?(g(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):L?.status==="expired"||L?.status==="cancelled"?(g(),r.value="expired"):f(x)},x*1e3)}function g(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function _(){await h()}async function w(){!l.value||!await wo(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function y(){g(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function b(x){x.key==="Escape"&&y()}function v(x){const L=Math.floor(x/60),N=x%60;return`${L}:${String(N).padStart(2,"0")}`}return(x,L)=>(C(),I("div",jne,[p("div",{ref_key:"dialogRef",ref:o,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":S(n)("login.title")},[p("div",zne,[p("span",Vne,P(S(n)("login.title")),1),p("button",{class:"close-btn",title:S(n)("login.close"),onClick:y},[...L[0]||(L[0]=[p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Kne)]),r.value==="starting"?(C(),I("div",Gne,[L[1]||(L[1]=p("svg",{class:"spin-icon",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[p("circle",{cx:"11",cy:"11",r:"8","stroke-dasharray":"30 18","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 11 11",to:"360 11 11",dur:"0.9s",repeatCount:"indefinite"})])],-1)),p("span",Yne,P(S(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(C(),I("div",Xne,[p("div",Qne,P(S(n)("login.lead")),1),p("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[ut(P(S(n)("login.authorizeInBrowser"))+" ",1),L[2]||(L[2]=p("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.6"},[p("path",{d:"M6 2H2.5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8"}),p("path",{d:"M9.5 1.5h3v3M12.5 1.5 7 7"})],-1))],8,Zne),p("div",Jne,P(S(n)("login.orDivider")),1),p("div",eoe,[p("div",toe,[ut(P(S(n)("login.fallbackPrefix")),1),p("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},P(l.value.verificationUri),9,noe),ut(P(S(n)("login.fallbackSuffix")),1)]),p("div",ooe,[p("span",soe,P(l.value.userCode),1),p("button",{class:Le(["nb-copy",{"is-copied":c.value}]),onClick:w},[c.value?(C(),I(Oe,{key:0},[L[3]||(L[3]=p("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2"},[p("polyline",{points:"1,6 4,9 11,2"})],-1)),ut(" "+P(S(n)("login.copied")),1)],64)):(C(),I(Oe,{key:1},[L[4]||(L[4]=p("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),p("path",{d:"M8 4V2a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h2"})],-1)),ut(" "+P(S(n)("login.copy")),1)],64))],2)])]),p("div",ioe,[p("span",{class:"nb-spinner","aria-label":S(n)("login.waitingAuth")},[...L[5]||(L[5]=[p("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[p("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[p("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)])],8,roe),p("span",loe,P(S(n)("login.waitingAutoClose")),1),p("span",aoe,P(v(a.value)),1)])])):r.value==="success"?(C(),I("div",coe,[L[6]||(L[6]=p("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--ok)","stroke-width":"2"},[p("circle",{cx:"18",cy:"18",r:"15"}),p("polyline",{points:"10,18 15,24 26,12"})],-1)),p("span",uoe,P(S(n)("login.success")),1),p("span",doe,P(S(n)("login.successHint")),1)])):r.value==="expired"?(C(),I(Oe,{key:3},[p("div",foe,[L[7]||(L[7]=p("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--err)","stroke-width":"1.5"},[p("circle",{cx:"14",cy:"14",r:"12"}),p("line",{x1:"14",y1:"8",x2:"14",y2:"15"}),p("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--err)"})],-1)),p("span",hoe,P(S(n)("login.expiredTitle")),1),p("span",poe,P(S(n)("login.expiredHint")),1)]),p("div",moe,[p("button",{class:"act-btn primary",onClick:_},P(S(n)("login.retry")),1),p("button",{class:"act-btn",onClick:y},P(S(n)("login.closeBtn")),1)])],64)):r.value==="error"?(C(),I(Oe,{key:4},[p("div",goe,[L[8]||(L[8]=p("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[p("path",{d:"M14 3 L26 24 H2 Z"}),p("line",{x1:"14",y1:"12",x2:"14",y2:"18"}),p("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--warn)"})],-1)),p("span",voe,P(S(n)("login.errorTitle")),1),p("span",yoe,P(S(n)("login.errorHint")),1)]),p("div",koe,[p("button",{class:"act-btn primary",onClick:_},P(S(n)("login.retry")),1),p("button",{class:"act-btn",onClick:y},P(S(n)("login.closeBtn")),1)])],64)):se("",!0)],8,qne)]))}}),woe=bt(boe,[["__scopeId","data-v-98c6ec96"]]),_oe={class:"lang-switch",role:"group","aria-label":"Language"},Coe=["aria-pressed","onClick"],Soe=Qe({__name:"LanguageSwitcher",setup(e){const{locale:t}=St();function n(o){t.value!==o&&Bx(o)}return(o,s)=>(C(),I("div",_oe,[(C(!0),I(Oe,null,Xe(S(Dx),i=>(C(),I("button",{key:i.code,type:"button",class:Le(["lang-opt",{on:S(t)===i.code}]),"aria-pressed":S(t)===i.code,onClick:Ze(r=>n(i.code),["stop"])},P(i.label),11,Coe))),128))]))}}),M3=bt(Soe,[["__scopeId","data-v-907613b6"]]),Y2=1e3,vg=16384,yg=500,kg=50,xoe=6,Toe=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Aoe=/^[A-Za-z0-9+/=_-]{200,}$/;let bg=null;function Zs(){if(bg!==null)return bg;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=bn(Ct.debug)==="1"),bg=e,e}const _r=[];let Moe=1;const S0=ne(0),Sc=Sl(!1);function Eoe(){return _r}function Ioe(){_r.length=0,S0.value++}function Hr(e){Sc.value||(_r.push({id:Moe++,ts:Date.now(),...e}),_r.length>Y2&&_r.splice(0,_r.length-Y2),S0.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 s=e;return Aoe.test(s)?`[base64-like, ${s.length} chars omitted]`:s.length>yg?`${s.slice(0,yg)}… [+${s.length-yg} chars]`:s}if(n!=="object")return String(e);if(t>=xoe)return"[max depth]";if(Array.isArray(e)){const s=e.slice(0,kg).map(i=>V1(i,t+1));return e.length>kg&&s.push(`[+${e.length-kg} more items]`),s}const o={};for(const[s,i]of Object.entries(e))o[s]=Toe.test(s)?"[redacted]":V1(i,t+1);return o}function Al(e){if(e===void 0)return;const t=V1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>vg)return{_truncated:`detail JSON was ${n.length} chars; first ${vg} kept`,preview:n.slice(0,vg)}}catch{return"[unserializable detail]"}return t}function X2(e){Zs()&&Hr({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Al(e.body)}})}function Q2(e){if(!Zs())return;const t=e.code!==0;Hr({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:Al(e.data)}})}function Dd(e){Zs()&&Hr({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 Zl(e,t){Zs()&&Hr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Al(t)})}function $oe(e){if(!Zs())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;Hr({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:Al(e)})}function Noe(e){if(!Zs())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[o,s!==void 0?`seq=${s}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);Hr({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Al(t.payload)})}const Loe={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function wg(e,t,n){Zs()&&Hr({source:"client",kind:`client:${e}`,label:`${Loe[e]} ${t}`,detail:Al(n)})}function mr(e,t){Zs()&&Hr({source:"client",kind:"client:event",label:`· ${e}`,detail:Al(t)})}let Z2=!1;function Poe(){if(!(Z2||!Zs())){Z2=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{wg("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;wg("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{wg(e,n.map(Ooe).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function Ooe(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 E3(e=_r){if(typeof document>"u")return;const t=new Blob([Roe(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=`kimi-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}function Roe(e=_r){return e.map(t=>JSON.stringify(t)).join(`
|
|
264
|
-
`)}const Doe=["aria-label"],Boe={class:"dh"},Foe={class:"dtitle"},Hoe=["title"],Woe={class:"settings-layout"},Uoe=["aria-label"],joe=["aria-selected","aria-controls","id","onClick"],qoe={class:"body"},zoe={id:"settings-panel-general",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-general"},Voe={class:"sec"},Koe={class:"sec-title"},Goe={class:"row"},Yoe={class:"rlabel"},Xoe=["aria-label"],Qoe=["aria-pressed"],Zoe=["aria-pressed"],Joe={class:"row"},ese={class:"rlabel"},tse=["aria-label"],nse=["aria-pressed"],ose=["aria-pressed"],sse=["aria-pressed"],ise={class:"row"},rse={class:"rlabel"},lse={class:"num-field"},ase=["value","aria-label"],cse={class:"row"},use={class:"rlabel"},dse={class:"sec"},fse={class:"sec-title"},hse={class:"row"},pse={class:"rlabel"},mse={key:0,class:"hint"},gse=["aria-checked","disabled"],vse={class:"row"},yse={class:"rlabel"},kse={key:0,class:"hint"},bse=["aria-checked","disabled"],wse={class:"row"},_se={class:"rlabel"},Cse=["aria-checked"],Sse={class:"sec"},xse={class:"sec-title"},Tse={class:"row"},Ase={class:"rlabel"},Mse=["title"],Ese={class:"actions"},Ise={class:"sec"},$se={class:"sec-title"},Nse={class:"row"},Lse={class:"rlabel"},Pse={class:"rvalue mono"},Ose={id:"settings-panel-agent",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-agent"},Rse={class:"sec"},Dse={class:"sec-head"},Bse={class:"sec-title"},Fse={key:0,class:"saving"},Hse={class:"row"},Wse={class:"rlabel"},Use={class:"hint"},jse=["value","disabled","aria-label"],qse={key:0,value:"",disabled:""},zse=["label"],Vse=["value"],Kse={key:1,class:"rvalue mono"},Gse={class:"row"},Yse={class:"rlabel"},Xse={class:"hint"},Qse=["aria-label"],Zse=["aria-pressed","disabled","onClick"],Jse={class:"row"},eie={class:"rlabel"},tie={class:"hint"},nie=["aria-checked","disabled"],oie={class:"row"},sie={class:"rlabel"},iie={class:"hint"},rie=["aria-checked","disabled"],lie={class:"row"},aie={class:"rlabel"},cie={class:"hint"},uie=["aria-checked","disabled"],die={class:"row"},fie={class:"rlabel"},hie={class:"hint"},pie={class:"hint"},mie=["aria-checked","disabled"],gie={key:0,class:"provider-list"},vie={class:"provider-main"},yie={class:"provider-id"},kie={class:"provider-type"},bie={class:"provider-meta"},wie={key:0,class:"provider-model"},_ie={key:1,class:"empty-config"},Cie={id:"settings-panel-advanced",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-advanced"},Sie={class:"sec"},xie={class:"sec-title"},Tie={class:"row"},Aie={class:"rlabel"},Mie={class:"rvalue mono"},Eie={class:"row"},Iie={class:"rlabel"},$ie={key:0,class:"hint"},Nie={id:"settings-panel-experimental",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-experimental"},Lie={class:"sec"},Pie={class:"sec-title"},Oie={class:"row"},Rie={class:"rlabel"},Die={class:"hint"},Bie=["aria-checked"],Fie=Qe({__name:"SettingsDialog",props:{theme:{},colorScheme:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyPermission:{},sound:{type:Boolean},betaToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setTheme","setColorScheme","setUiFontSize","setNotify","setNotifyQuestion","setSound","setBetaToc","login","logout","openOnboarding","updateConfig","close"],setup(e,{emit:t}){const{t:n}=St(),o=e,s=t,i=ne("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=T5(),a=["manual","auto","yolo"],c=ne(null);np(c);function u(k){k.key==="Escape"&&s("close")}sn(()=>document.addEventListener("keydown",u)),Yt(()=>document.removeEventListener("keydown",u));function d(){E3()}const h=F(()=>{const k=new Map;for(const T of o.models??[])k.set(T.id,{id:T.id,label:T.displayName??T.model??T.id,provider:T.provider});for(const[T,E]of Object.entries(o.config?.models??{})){if(k.has(T))continue;const O=_(E);k.set(T,{id:T,label:w(T,E,O),provider:O??T})}return Array.from(k.values())}),m=F(()=>{const k=new Map;for(const T of h.value){const E=k.get(T.provider)??[];E.push(T),k.set(T.provider,E)}for(const T of k.values())T.sort((E,O)=>E.label.localeCompare(O.label));return Array.from(k.entries()).toSorted(([T],[E])=>T.localeCompare(E)).map(([T,E])=>({provider:T,options:E}))}),f=F(()=>Object.entries(o.config?.providers??{}).map(([k,T])=>({id:k,provider:T})).sort((k,T)=>k.id.localeCompare(T.id))),g=F(()=>{const k=o.config?.defaultPermissionMode;return k==="auto"||k==="yolo"||k==="manual"?k:"manual"});function _(k){if(!k||typeof k!="object")return;const T=k;return typeof T.provider=="string"?T.provider:void 0}function w(k,T,E){if(!T||typeof T!="object")return k;const O=T,A=typeof O.model=="string"?O.model:void 0,$=E??_(T);return A&&$?`${k} (${$}/${A})`:A?`${k} (${A})`:k}function y(k){return k===!0}function b(k){const T=k.target.value;!T||T===o.config?.defaultModel||s("updateConfig",{defaultModel:T})}function v(k){k!==g.value&&s("updateConfig",{defaultPermissionMode:k})}function x(k){const T=o.config?.[k];s("updateConfig",{[k]:!y(T)})}function L(){const k=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!k})}function N(k){i.value=k}return(k,T)=>(C(),I("div",{class:"backdrop",onClick:T[18]||(T[18]=Ze(E=>s("close"),["self"]))},[p("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":S(n)("settings.title")},[p("div",Boe,[p("span",Foe,P(S(n)("settings.title")),1),p("button",{class:"close-btn",title:S(n)("settings.close"),onClick:T[0]||(T[0]=E=>s("close"))},[...T[19]||(T[19]=[p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Hoe)]),p("div",Woe,[p("nav",{class:"settings-tabs",role:"tablist","aria-label":S(n)("settings.title")},[(C(),I(Oe,null,Xe(r,E=>p("button",{key:E.id,type:"button",class:Le(["tab",{on:i.value===E.id}]),role:"tab","aria-selected":i.value===E.id,"aria-controls":`settings-panel-${E.id}`,id:`settings-tab-${E.id}`,onClick:O=>N(E.id)},P(S(n)(E.labelKey)),11,joe)),64))],8,Uoe),p("div",qoe,[qt(p("section",zoe,[p("section",Voe,[p("h3",Koe,P(S(n)("settings.appearance")),1),p("div",Goe,[p("span",Yoe,P(S(n)("theme.label")),1),p("div",{class:"seg",role:"group","aria-label":S(n)("theme.label")},[p("button",{type:"button",class:Le(["opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:T[1]||(T[1]=E=>s("setTheme","modern"))},P(S(n)("theme.modern")),11,Qoe),p("button",{type:"button",class:Le(["opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:T[2]||(T[2]=E=>s("setTheme","kimi"))},P(S(n)("theme.kimi")),11,Zoe)],8,Xoe)]),p("div",Joe,[p("span",ese,P(S(n)("theme.colorSchemeLabel")),1),p("div",{class:"seg",role:"group","aria-label":S(n)("theme.colorSchemeLabel")},[p("button",{type:"button",class:Le(["opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:T[3]||(T[3]=E=>s("setColorScheme","light"))},P(S(n)("theme.light")),11,nse),p("button",{type:"button",class:Le(["opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:T[4]||(T[4]=E=>s("setColorScheme","dark"))},P(S(n)("theme.dark")),11,ose),p("button",{type:"button",class:Le(["opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:T[5]||(T[5]=E=>s("setColorScheme","system"))},P(S(n)("theme.system")),11,sse)],8,tse)]),p("div",ise,[p("span",rse,P(S(n)("settings.uiFontSize")),1),p("label",lse,[p("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":S(n)("settings.uiFontSize"),onInput:T[6]||(T[6]=E=>s("setUiFontSize",Number(E.target.value)))},null,40,ase),T[20]||(T[20]=p("span",{class:"num-unit"},"px",-1))])]),p("div",cse,[p("span",use,P(S(n)("sidebar.language")),1),vt(M3)])]),p("section",dse,[p("h3",fse,P(S(n)("settings.notifications")),1),p("div",hse,[p("span",pse,[ut(P(S(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(C(),I("span",mse,P(S(n)("settings.notifyDenied")),1)):se("",!0)]),p("button",{type:"button",class:Le(["switch",{on:e.notify}]),role:"switch","aria-checked":e.notify,disabled:e.notifyPermission==="denied",onClick:T[7]||(T[7]=E=>s("setNotify",!e.notify))},[...T[21]||(T[21]=[p("span",{class:"knob"},null,-1)])],10,gse)]),p("div",vse,[p("span",yse,[ut(P(S(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(C(),I("span",kse,P(S(n)("settings.notifyDenied")),1)):se("",!0)]),p("button",{type:"button",class:Le(["switch",{on:e.notifyQuestion}]),role:"switch","aria-checked":e.notifyQuestion,disabled:e.notifyPermission==="denied",onClick:T[8]||(T[8]=E=>s("setNotifyQuestion",!e.notifyQuestion))},[...T[22]||(T[22]=[p("span",{class:"knob"},null,-1)])],10,bse)]),p("div",wse,[p("span",_se,P(S(n)("settings.soundOnComplete")),1),p("button",{type:"button",class:Le(["switch",{on:e.sound}]),role:"switch","aria-checked":e.sound,onClick:T[9]||(T[9]=E=>s("setSound",!e.sound))},[...T[23]||(T[23]=[p("span",{class:"knob"},null,-1)])],10,Cse)])]),p("section",Sse,[p("h3",xse,P(S(n)("settings.account")),1),p("div",Tse,[p("span",Ase,P(e.authReady?"managed:kimi-code":S(n)("sidebar.notSignedIn")),1),e.authReady&&e.accountModel?(C(),I("span",{key:0,class:"rvalue",title:e.accountModel},P(e.accountModel),9,Mse)):se("",!0)]),p("div",Ese,[p("button",{type:"button",class:"act",onClick:T[10]||(T[10]=E=>{s("openOnboarding"),s("close")})},P(S(n)("onboarding.reopen")),1),e.authReady?(C(),I("button",{key:0,type:"button",class:"act danger",onClick:T[11]||(T[11]=E=>s("logout"))},P(S(n)("sidebar.signOut")),1)):(C(),I("button",{key:1,type:"button",class:"act signin",onClick:T[12]||(T[12]=E=>s("login"))},P(S(n)("sidebar.signIn")),1))])]),p("section",Ise,[p("h3",$se,P(S(n)("settings.build")),1),p("div",Nse,[p("span",Lse,P(S(n)("settings.serverVersion")),1),p("span",Pse,P(e.serverVersion||"-"),1)])])],512),[[Ks,i.value==="general"]]),qt(p("section",Ose,[p("section",Rse,[p("div",Dse,[p("h3",Bse,P(S(n)("settings.agentDefaults")),1),e.configSaving?(C(),I("span",Fse,P(S(n)("settings.saving")),1)):se("",!0)]),e.config?(C(),I(Oe,{key:0},[p("div",Hse,[p("span",Wse,[ut(P(S(n)("settings.defaultModel"))+" ",1),p("span",Use,P(S(n)("settings.defaultModelHint")),1)]),m.value.length>0?(C(),I("select",{key:0,class:"select-field",value:e.config.defaultModel??"",disabled:e.configSaving,"aria-label":S(n)("settings.defaultModel"),onChange:b},[e.config.defaultModel?se("",!0):(C(),I("option",qse,P(S(n)("settings.noDefaultModel")),1)),(C(!0),I(Oe,null,Xe(m.value,E=>(C(),I("optgroup",{key:E.provider,label:E.provider},[(C(!0),I(Oe,null,Xe(E.options,O=>(C(),I("option",{key:O.id,value:O.id},P(O.label),9,Vse))),128))],8,zse))),128))],40,jse)):(C(),I("span",Kse,P(e.config.defaultModel??S(n)("settings.noDefaultModel")),1))]),p("div",Gse,[p("span",Yse,[ut(P(S(n)("settings.defaultPermission"))+" ",1),p("span",Xse,P(S(n)("settings.defaultPermissionHint")),1)]),p("div",{class:"seg",role:"group","aria-label":S(n)("settings.defaultPermission")},[(C(),I(Oe,null,Xe(a,E=>p("button",{key:E,type:"button",class:Le(["opt",{on:g.value===E}]),"aria-pressed":g.value===E,disabled:e.configSaving,onClick:O=>v(E)},P(S(n)(`settings.permission.${E}`)),11,Zse)),64))],8,Qse)]),p("div",Jse,[p("span",eie,[ut(P(S(n)("settings.defaultThinking"))+" ",1),p("span",tie,P(S(n)("settings.defaultThinkingHint")),1)]),p("button",{type:"button",class:Le(["switch",{on:y(e.config.defaultThinking)}]),role:"switch","aria-checked":y(e.config.defaultThinking),disabled:e.configSaving,onClick:T[13]||(T[13]=E=>x("defaultThinking"))},[...T[24]||(T[24]=[p("span",{class:"knob"},null,-1)])],10,nie)]),p("div",oie,[p("span",sie,[ut(P(S(n)("settings.defaultPlanMode"))+" ",1),p("span",iie,P(S(n)("settings.defaultPlanModeHint")),1)]),p("button",{type:"button",class:Le(["switch",{on:y(e.config.defaultPlanMode)}]),role:"switch","aria-checked":y(e.config.defaultPlanMode),disabled:e.configSaving,onClick:T[14]||(T[14]=E=>x("defaultPlanMode"))},[...T[25]||(T[25]=[p("span",{class:"knob"},null,-1)])],10,rie)]),p("div",lie,[p("span",aie,[ut(P(S(n)("settings.mergeSkills"))+" ",1),p("span",cie,P(S(n)("settings.mergeSkillsHint")),1)]),p("button",{type:"button",class:Le(["switch",{on:y(e.config.mergeAllAvailableSkills)}]),role:"switch","aria-checked":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,onClick:T[15]||(T[15]=E=>x("mergeAllAvailableSkills"))},[...T[26]||(T[26]=[p("span",{class:"knob"},null,-1)])],10,uie)]),p("div",die,[p("span",fie,[ut(P(S(n)("settings.telemetry"))+" ",1),p("span",hie,P(S(n)("settings.telemetryHint")),1),p("span",pie,P(S(n)("settings.telemetryRestartHint")),1)]),p("button",{type:"button",class:Le(["switch",{on:e.config.telemetry!==!1}]),role:"switch","aria-checked":e.config.telemetry!==!1,disabled:e.configSaving,onClick:T[16]||(T[16]=E=>L())},[...T[27]||(T[27]=[p("span",{class:"knob"},null,-1)])],10,mie)]),f.value.length>0?(C(),I("div",gie,[(C(!0),I(Oe,null,Xe(f.value,({id:E,provider:O})=>(C(),I("div",{key:E,class:"provider-row"},[p("div",vie,[p("span",yie,P(E),1),p("span",kie,P(O.type),1)]),p("div",bie,[p("span",{class:Le(["provider-badge",O.hasApiKey?"ok":"warn"])},P(O.hasApiKey?S(n)("settings.credentialReady"):S(n)("settings.credentialMissing")),3),O.defaultModel?(C(),I("span",wie,P(O.defaultModel),1)):se("",!0)])]))),128))])):se("",!0)],64)):(C(),I("div",_ie,P(S(n)("settings.configUnavailable")),1))])],512),[[Ks,i.value==="agent"]]),qt(p("section",Cie,[p("section",Sie,[p("h3",xie,P(S(n)("settings.advanced")),1),p("div",Tie,[p("span",Aie,P(S(n)("sidebar.daemon")),1),p("span",Mie,P(S(l)),1)]),p("div",Eie,[p("span",Iie,[ut(P(S(n)("settings.exportLog"))+" ",1),S(Zs)()?se("",!0):(C(),I("span",$ie,P(S(n)("settings.logHint")),1))]),p("button",{type:"button",class:"act",onClick:d},P(S(n)("settings.exportLogBtn")),1)])])],512),[[Ks,i.value==="advanced"]]),qt(p("section",Nie,[p("section",Lie,[p("h3",Pie,P(S(n)("settings.beta")),1),p("div",Oie,[p("span",Rie,[ut(P(S(n)("settings.betaToc"))+" ",1),p("span",Die,P(S(n)("settings.betaTocHint")),1)]),p("button",{type:"button",class:Le(["switch",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc,onClick:T[17]||(T[17]=E=>s("setBetaToc",!e.betaToc))},[...T[28]||(T[28]=[p("span",{class:"knob"},null,-1)])],10,Bie)])])],512),[[Ks,i.value==="experimental"]])])])],8,Doe)]))}}),Hie=bt(Fie,[["__scopeId","data-v-8ad39025"]]),Wie=["aria-label"],Uie={class:"dh"},jie={class:"dtitle"},qie=["aria-label"],zie={class:"crumbbar"},Vie=["disabled","title","aria-label"],Kie={class:"crumbs"},Gie={key:0,class:"crumb-sep"},Yie=["onClick"],Xie={key:0,class:"filterbar"},Qie=["placeholder"],Zie={key:0,class:"search-spin","aria-hidden":"true"},Jie={class:"folder-list"},ere={key:0,class:"fl-loading"},tre=["onClick"],nre={class:"folder-name search-rel"},ore={key:0,class:"git-tag"},sre={key:0,class:"git-branch"},ire={key:0,class:"fl-empty"},rre={key:1,class:"fl-loading"},lre=["onClick"],are={class:"folder-name"},cre={key:0,class:"git-tag"},ure={key:0,class:"git-branch"},dre={key:0,class:"fl-empty"},fre={class:"paste-label",for:"aw-path"},hre=["placeholder","onKeydown"],pre=["disabled","title"],mre={key:1,class:"add-error",role:"alert"},gre={class:"actions"},vre=["disabled","title"],yre={class:"footer-hint"},kre=600,bre=6,J2=150,wre=Qe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=St(),o=e,s=t,i=ne(!1),r=ne(!1),l=ne(""),a=ne(null),c=ne([]),u=ne(""),d=ne(!1),h=ne([]),m=F(()=>u.value.trim().length>0);let f=0,g=null;function _($,R){const D=$.toLowerCase(),W=R.toLowerCase();let V=0;for(let U=0;U<W.length&&V<D.length;U++)W[U]===D[V]&&V++;return V===D.length}async function w($){const R=l.value,D=$.trim();if(!R||D===""){h.value=[],d.value=!1;return}const W=++f;d.value=!0;const V=[],U=[{path:R,depth:0}];let ee=0;for(;U.length>0&&ee<kre&&V.length<J2;){if(W!==f)return;const K=U.shift();ee++;let G;try{G=await o.browseFs(K.path)}catch{continue}if(W!==f)return;for(const X of G.entries){if(!X.isDir)continue;const ke=X.path.startsWith(R)?X.path.slice(R.length).replace(/^\/+/,""):X.path;if(_(D,ke||X.name)&&(V.push({path:X.path,name:X.name,rel:ke||X.name,isGitRepo:X.isGitRepo,branch:X.branch}),V.length>=J2))break;K.depth+1<bre&&U.push({path:X.path,depth:K.depth+1})}W===f&&(h.value=[...V])}W===f&&(d.value=!1)}ze(u,$=>{if(g&&clearTimeout(g),$.trim()===""){f++,h.value=[],d.value=!1;return}g=setTimeout(()=>void w($),220)});const y=ne(!1),b=ne(""),v=F(()=>b.value.trim()),x=F(()=>{const $=l.value;if(!$)return[];const R=$.split("/").filter(Boolean),D=[{label:"/",path:"/"}];let W="";for(const V of R)W+=`/${V}`,D.push({label:V,path:W});return D}),L=F(()=>l.value.length>0);async function N($){i.value=!0;try{const R=await o.browseFs($);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($){$.isDir&&N($.path)}function T(){a.value&&N(a.value)}function E(){L.value&&s("add",l.value)}function O(){v.value.length!==0&&s("add",v.value)}sn(async()=>{i.value=!0;try{if(o.defaultPath&&(await N(o.defaultPath),!r.value))return;const $=await o.getFsHome();$.home?await N($.home):r.value=!0}catch{r.value=!0}finally{i.value=!1}});function A($){$.key==="Escape"&&s("close")}return sn(()=>document.addEventListener("keydown",A)),Yt(()=>{document.removeEventListener("keydown",A),g&&clearTimeout(g)}),($,R)=>(C(),I("div",{class:"backdrop",onClick:R[6]||(R[6]=Ze(D=>s("close"),["self"]))},[p("div",{class:"dialog",role:"dialog","aria-label":S(n)("workspace.addTitle")},[p("div",Uie,[p("span",jie,P(S(n)("workspace.addTitle")),1),p("button",{class:"close-btn","aria-label":S(n)("workspace.cancel"),onClick:R[0]||(R[0]=D=>s("close"))},[...R[7]||(R[7]=[p("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[p("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),p("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,qie)]),r.value?se("",!0):(C(),I(Oe,{key:0},[p("div",zie,[p("button",{class:"up-btn",disabled:!a.value,title:S(n)("workspace.up"),"aria-label":S(n)("workspace.up"),onClick:T},[...R[8]||(R[8]=[p("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[p("path",{d:"M8 12V4M4 7l4-3 4 3"})],-1)])],8,Vie),p("div",Kie,[(C(!0),I(Oe,null,Xe(x.value,(D,W)=>(C(),I(Oe,{key:D.path},[W>1?(C(),I("span",Gie,"/")):se("",!0),p("button",{class:Le(["crumb",{last:W===x.value.length-1}]),onClick:V=>N(D.path)},P(D.label),11,Yie)],64))),128))])]),i.value?se("",!0):(C(),I("div",Xie,[R[9]||(R[9]=p("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"},[p("circle",{cx:"7",cy:"7",r:"4.5"}),p("path",{d:"M11 11l3 3"})],-1)),qt(p("input",{"onUpdate:modelValue":R[1]||(R[1]=D=>u.value=D),class:"filter-input",type:"text",placeholder:S(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:R[2]||(R[2]=Ze(()=>{},["stop"]))},null,40,Qie),[[Wn,u.value]]),d.value?(C(),I("span",Zie)):se("",!0)])),p("div",Jie,[i.value?(C(),I("div",ere,P(S(n)("workspace.browsing")),1)):m.value?(C(),I(Oe,{key:1},[(C(!0),I(Oe,null,Xe(h.value,D=>(C(),I("button",{key:D.path,class:"folder-row",onClick:W=>N(D.path)},[R[10]||(R[10]=p("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[p("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),p("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),p("span",nre,P(D.rel),1),D.isGitRepo?(C(),I("span",ore,[ut(P(S(n)("workspace.gitTag")),1),D.branch?(C(),I("span",sre,P(D.branch),1)):se("",!0)])):se("",!0)],8,tre))),128)),!d.value&&h.value.length===0?(C(),I("div",ire,P(S(n)("workspace.noFilterMatch",{q:u.value.trim()})),1)):d.value&&h.value.length===0?(C(),I("div",rre,P(S(n)("workspace.searching")),1)):se("",!0)],64)):(C(),I(Oe,{key:2},[(C(!0),I(Oe,null,Xe(c.value,D=>(C(),I("button",{key:D.path,class:"folder-row",onClick:W=>k(D)},[R[11]||(R[11]=p("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[p("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),p("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),p("span",are,P(D.name),1),D.isGitRepo?(C(),I("span",cre,[ut(P(S(n)("workspace.gitTag")),1),D.branch?(C(),I("span",ure,P(D.branch),1)):se("",!0)])):se("",!0)],8,lre))),128)),c.value.length===0?(C(),I("div",dre,P(S(n)("workspace.noSubfolders")),1)):se("",!0)],64))])],64)),p("div",{class:Le(["paste-section",{"paste-only":r.value}])},[!r.value&&!y.value?(C(),I("button",{key:0,type:"button",class:"paste-toggle",onClick:R[3]||(R[3]=D=>y.value=!0)},P(S(n)("workspace.pasteToggle")),1)):(C(),I(Oe,{key:1},[p("label",fre,P(S(n)("workspace.pathLabel")),1),qt(p("input",{id:"aw-path","onUpdate:modelValue":R[4]||(R[4]=D=>b.value=D),class:"paste-input",type:"text",placeholder:S(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:Os(Ze(O,["stop"]),["enter"])},null,40,hre),[[Wn,b.value]]),p("button",{class:"paste-add",disabled:v.value.length===0,title:S(n)("workspace.add"),onClick:O},[...R[12]||(R[12]=[p("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"},[p("path",{d:"M8 3v10M3 8h10"})],-1)])],8,pre)],64))],2),e.error?(C(),I("div",mre,P(e.error),1)):se("",!0),p("div",gre,[r.value?se("",!0):(C(),I("button",{key:0,class:"act-btn primary",disabled:!L.value,title:l.value,onClick:E},P(S(n)("workspace.openThisFolder")),9,vre)),p("button",{class:"act-btn",onClick:R[5]||(R[5]=D=>s("close"))},P(S(n)("workspace.cancel")),1)]),p("div",yre,P(S(n)("workspace.browseHint")),1)],8,Wie)]))}}),_re=bt(wre,[["__scopeId","data-v-8bf63bb9"]]),Cre=["aria-label"],Sre={class:"dh"},xre={class:"dtitle"},Tre=["title"],Are={class:"rows"},Mre={class:"row"},Ere={class:"row"},Ire={class:"row"},$re={class:"row"},Nre={class:"row"},Lre={class:"row"},Pre={class:"ctx-text"},Ore={key:0,class:"bar"},Rre={class:"row"},Dre=Qe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=St(),o=e,s=t,i=F(()=>o.status.ctxMax>0?Math.round(o.status.ctxUsed/o.status.ctxMax*100):0),r=F(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:o.status.ctxUsed.toLocaleString(),max:o.status.ctxMax.toLocaleString(),pct:i.value}):n("status.statusNone"));function l(f){return n(f==="yolo"?"status.permissionYolo":f==="auto"?"status.permissionAuto":"status.permissionManual")}const a=F(()=>{const f=o.status.permission;return f==="yolo"?"var(--err)":f==="auto"?"var(--warn)":"var(--ink)"}),c=F(()=>o.planMode?n("status.planOn"):n("status.planOff")),u=F(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),d=F(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=F(()=>d.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));function m(f){f.key==="Escape"&&s("close")}return sn(()=>document.addEventListener("keydown",m)),Yt(()=>document.removeEventListener("keydown",m)),(f,g)=>(C(),I("div",{class:"backdrop",onClick:g[1]||(g[1]=Ze(_=>s("close"),["self"]))},[p("div",{class:"dialog",role:"dialog","aria-label":S(n)("status.statusPanelTitle")},[p("div",Sre,[p("span",xre,P(S(n)("status.statusPanelTitle")),1),p("button",{class:"close-btn",title:S(n)("status.statusPanelClose"),onClick:g[0]||(g[0]=_=>s("close"))},"✕",8,Tre)]),p("dl",Are,[p("div",Mre,[p("dt",null,P(S(n)("status.statusModel")),1),p("dd",null,P(e.status.model),1)]),p("div",Ere,[p("dt",null,P(S(n)("status.statusThinking")),1),p("dd",null,P(e.thinking),1)]),p("div",Ire,[p("dt",null,P(S(n)("status.statusPermission")),1),p("dd",{style:Wt({color:a.value})},P(l(e.status.permission)),5)]),p("div",$re,[p("dt",null,P(S(n)("status.statusPlanMode")),1),p("dd",{class:Le({"plan-on":e.planMode})},P(c.value),3)]),p("div",Nre,[p("dt",null,P(S(n)("status.statusSwarmMode")),1),p("dd",{class:Le({"swarm-on":e.swarmMode})},P(u.value),3)]),p("div",Lre,[p("dt",null,P(S(n)("status.statusContext")),1),p("dd",null,[p("span",Pre,P(r.value),1),e.status.ctxMax>0?(C(),I("span",Ore,[p("i",{style:Wt({width:i.value+"%"})},null,4)])):se("",!0)])]),p("div",Rre,[p("dt",null,P(S(n)("status.statusCost")),1),p("dd",null,P(h.value),1)])])],8,Cre)]))}}),Bre=bt(Dre,[["__scopeId","data-v-230d4b38"]]),Fre={key:0,class:"toasts",role:"status","aria-live":"polite"},Hre=["onPointerenter","onPointerleave"],Wre={class:"body"},Ure={class:"title"},jre={key:0,class:"msg"},qre={key:1,class:"actions"},zre=["onClick"],Vre=["onClick"],Kre={key:2,class:"details"},Gre=["aria-label","onClick"],Yre=Qe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=St();function i(k){return typeof k=="object"&&k!==null}function r(k){return i(k)?k.title:k}function l(k){return i(k)?k.message??"":""}function a(k){return i(k)?k.details:void 0}function c(k){return i(k)?k.severity==="error":k.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(k)}function u(k){return i(k)?`notice:${k.severity}:${k.title}:${k.message??""}:${JSON.stringify(k.details??[])}`:`text:${k}`}function d(k){if(!i(k))return k;const T=[k.title];k.message&&T.push(k.message);const E=k.details??[];if(E.length>0){T.push("",`${s("warnings.diagnostics")}:`);for(const O of E)T.push(`${O.label}: ${O.value}`)}return T.join(`
|
|
265
|
-
`)}let h=1;const m=ne([]),f=new Map,g=new Map;function _(k){const T=c(k)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?T+5e3:T}function w(k,T){const E=f.get(k)??{handle:null,deadline:0,remaining:0};E.handle=setTimeout(()=>N(k),T),E.deadline=Date.now()+T,f.set(k,E)}function y(k){const T=f.get(k);T&&T.handle!==null&&clearTimeout(T.handle),f.delete(k)}function b(k){const T=f.get(k);!T||T.handle===null||(clearTimeout(T.handle),T.handle=null,T.remaining=Math.max(0,T.deadline-Date.now()))}function v(k){if(m.value.find(O=>O.id===k)?.detailsOpen)return;const E=f.get(k);!E||E.handle!==null||w(k,E.remaining)}function x(k){k.detailsOpen=!k.detailsOpen,k.detailsOpen?b(k.id):v(k.id)}async function L(k){if(!await wo(d(k.warning)))return;k.copied=!0;const E=g.get(k.id);E&&clearTimeout(E),g.set(k.id,setTimeout(()=>{k.copied=!1,g.delete(k.id)},1400))}function N(k){y(k);const T=g.get(k);T&&clearTimeout(T),g.delete(k);const E=m.value.findIndex(O=>O.id===k);E!==-1&&(m.value=m.value.filter(O=>O.id!==k),o("dismiss",E))}return ze(()=>n.warnings,k=>{const T=[...m.value];m.value=k.map(E=>{const O=u(E),A=T.findIndex(D=>D.key===O),$=A===-1?void 0:T.splice(A,1)[0];if($)return $.warning=E,$;const R={id:h++,key:O,warning:E,detailsOpen:!1,copied:!1};return w(R.id,_(E)),R});for(const E of T){y(E.id);const O=g.get(E.id);O&&clearTimeout(O),g.delete(E.id)}},{immediate:!0,flush:"post"}),Yt(()=>{f.forEach(k=>{k.handle!==null&&clearTimeout(k.handle)}),f.clear(),g.forEach(k=>clearTimeout(k)),g.clear()}),(k,T)=>m.value.length?(C(),I("div",Fre,[(C(!0),I(Oe,null,Xe(m.value,E=>(C(),I("div",{key:E.id,class:Le(["toast",{err:c(E.warning)}]),onPointerenter:O=>b(E.id),onPointerleave:O=>v(E.id)},[T[1]||(T[1]=p("span",{class:"dot","aria-hidden":"true"},null,-1)),p("div",Wre,[p("div",Ure,P(r(E.warning)),1),l(E.warning)?(C(),I("div",jre,P(l(E.warning)),1)):se("",!0),a(E.warning)?.length?(C(),I("div",qre,[p("button",{class:"link",type:"button",onClick:O=>x(E)},P(E.detailsOpen?S(s)("warnings.hideDetails"):S(s)("warnings.showDetails")),9,zre),p("button",{class:"link",type:"button",onClick:O=>L(E)},P(E.copied?S(s)("warnings.copied"):S(s)("warnings.copyDetails")),9,Vre)])):se("",!0),E.detailsOpen&&a(E.warning)?.length?(C(),I("dl",Kre,[(C(!0),I(Oe,null,Xe(a(E.warning),O=>(C(),I("div",{key:`${O.label}:${O.value}`,class:"detail-row"},[p("dt",null,P(O.label),1),p("dd",null,P(O.value),1)]))),128))])):se("",!0)]),p("button",{class:"x",type:"button","aria-label":S(s)("warnings.dismiss"),onClick:O=>N(E.id)},[...T[0]||(T[0]=[p("svg",{viewBox:"0 0 16 16",width:"12",height:"12"},[p("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round"})],-1)])],8,Gre)],42,Hre))),128))])):se("",!0)}}),Xre=bt(Yre,[["__scopeId","data-v-45432ab6"]]),Qre={class:"topbar"},Zre={class:"wsq"},Jre=["aria-label"],ele={class:"tb-path"},tle={class:"ws"},nle={class:"se"},ole={class:"tb-sub"},sle=["aria-label"],ile=Qe({__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}=St(),o=e,s=t,i=F(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=F(()=>o.workspace?.name??n("workspace.noWorkspace")),l=F(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(C(),I("div",Qre,[p("span",Zre,P(i.value),1),p("button",{type:"button",class:"tb-mid","aria-label":S(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[p("span",ele,[p("span",tle,P(r.value),1),e.sessionTitle?(C(),I(Oe,{key:0},[c[2]||(c[2]=p("span",{class:"sl"},"/",-1)),p("span",nle,P(e.sessionTitle),1)],64)):se("",!0),c[3]||(c[3]=p("span",{class:"cv"},"⌄",-1))]),p("span",ole,[p("span",{class:Le(["rd",{on:e.running}])},null,2),p("span",null,P(l.value),1),e.branch?(C(),I(Oe,{key:0},[ut(" · "+P(e.branch),1)],64)):se("",!0),e.sessionCount>0?(C(),I(Oe,{key:1},[ut(" · "+P(S(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):se("",!0)])],8,Jre),p("button",{type:"button",class:"tb-set","aria-label":S(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},[...c[4]||(c[4]=[Ir('<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,sle)]))}}),rle=bt(ile,[["__scopeId","data-v-135bd6bf"]]),lle={key:0,class:"sheet-root"},ale=["aria-label"],cle=["aria-label"],ule={key:0,class:"sheet-head"},dle={class:"sheet-title"},fle={class:"sheet-body"},hle=Qe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=St(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return ze(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),Yt(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(C(),Ve(qi,{name:"sheet"},{default:$n(()=>[e.modelValue?(C(),I("div",lle,[p("div",{class:"sheet-scrim",onClick:i}),p("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||S(n)("mobile.sheetLabel")},[p("button",{type:"button",class:"sheet-grab","aria-label":S(n)("mobile.closeSheet"),onClick:i},null,8,cle),e.title?(C(),I("div",ule,[p("span",dle,P(e.title),1)])):se("",!0),p("div",fle,[ga(l.$slots,"default",{},void 0,!0)])],8,ale)])):se("",!0)]),_:3}))}}),I3=bt(hle,[["__scopeId","data-v-aa55810a"]]),ple={class:"mlist"},mle={key:0,class:"mempty"},gle=["onClick"],vle={class:"mgh-folder",width:"15",height:"15",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},yle={class:"mgh-main"},kle={class:"mgh-name"},ble=["title"],wle={key:0,class:"att"},_le=["title","aria-label","onClick"],Cle=["title","aria-label","onClick"],Sle=["onClick"],xle=["onClick"],Tle={key:0,class:"mempty small"},Ale=["onClick"],Mle={class:"m"},Ele={class:"s"},Ile={key:0,class:"att"},$le=["title","onClick"],Nle=["onClick"],Lle=["onClick"],Ple=["disabled","onClick"],Ole=Qe({__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}=St(),o=e,s=t;function i(){s("update:modelValue",!1)}function r(E){s("select",E),i()}function l(E){s("createInWorkspace",E),i()}function a(){s("create"),i()}function c(){s("addWorkspace"),i()}const u=ne(new Set);function d(E){return u.value.has(E)}function h(E){const O=new Set(u.value);O.has(E)?O.delete(E):O.add(E),u.value=O,f.value=null,v.value=null}function m(E){return o.attentionByWorkspace[E]??0}const f=ne(null),g=ne(null);let _;function w(E){f.value=f.value===E?null:E,v.value=null,clearTimeout(_),g.value=null}function y(E){f.value=null;const A=(typeof window<"u"?window.prompt(n("sidebar.rename"),E.title):null)?.trim();A&&s("rename",E.id,A)}function b(E){if(g.value===E){clearTimeout(_),g.value=null,f.value=null,s("archive",E);return}clearTimeout(_),g.value=E,_=setTimeout(()=>{g.value=null},2500)}const v=ne(null),x=ne(null);let L;function N(E){v.value=v.value===E?null:E,f.value=null,clearTimeout(L),x.value=null}function k(E){wo(E.root),v.value=null}function T(E){if(x.value===E){clearTimeout(L),x.value=null,v.value=null,s("deleteWorkspace",E);return}clearTimeout(L),x.value=E,L=setTimeout(()=>{x.value=null},2500)}return Yt(()=>{clearTimeout(_),clearTimeout(L)}),(E,O)=>(C(),Ve(I3,{"model-value":e.modelValue,"onUpdate:modelValue":O[2]||(O[2]=A=>s("update:modelValue",A))},{default:$n(()=>[p("button",{type:"button",class:"newrow",onClick:a},[O[3]||(O[3]=p("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"},[p("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)),ut(" "+P(S(n)("sidebar.newChat")),1)]),p("button",{type:"button",class:"newrow secondary",onClick:c},[O[4]||(O[4]=p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[p("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"}),p("path",{d:"M1 5.5h12"})],-1)),ut(" "+P(S(n)("sidebar.newWorkspace")),1)]),p("div",ple,[e.groups.length===0?(C(),I("div",mle,P(S(n)("workspace.noWorkspace")),1)):se("",!0),(C(!0),I(Oe,null,Xe(e.groups,A=>(C(),I("div",{key:A.workspace.id,class:"mgroup"},[p("div",{class:Le(["mgh",{on:A.workspace.id===e.activeWorkspaceId}]),onClick:$=>h(A.workspace.id)},[(C(),I("svg",vle,[d(A.workspace.id)?(C(),I(Oe,{key:0},[O[5]||(O[5]=p("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),O[6]||(O[6]=p("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(C(),I(Oe,{key:1},[O[7]||(O[7]=p("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)),O[8]||(O[8]=p("path",{d:"M1 5.5h12"},null,-1))],64))])),p("div",yle,[p("span",kle,P(A.workspace.name),1),p("span",{class:"mgh-path",title:A.workspace.root},P(A.workspace.branch||A.workspace.shortPath),9,ble)]),d(A.workspace.id)&&m(A.workspace.id)>0?(C(),I("span",wle,P(m(A.workspace.id)),1)):se("",!0),p("button",{type:"button",class:"mgh-more",title:S(n)("sidebar.options"),"aria-label":S(n)("sidebar.options"),onClick:Ze($=>N(A.workspace.id),["stop"])},[...O[9]||(O[9]=[p("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"8",cy:"3",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,_le),p("button",{type:"button",class:"mgh-add",title:S(n)("workspace.newInGroup"),"aria-label":S(n)("workspace.newInGroup"),onClick:Ze($=>l(A.workspace.id),["stop"])},"+",8,Cle),v.value===A.workspace.id?(C(),I("div",{key:1,class:"kmenu wsmenu",onClick:O[0]||(O[0]=Ze(()=>{},["stop"]))},[p("button",{class:"kitem",onClick:Ze($=>k(A.workspace),["stop"])},P(S(n)("sidebar.copyPath")),9,Sle),p("button",{class:"kitem archive",onClick:Ze($=>T(A.workspace.id),["stop"])},P(x.value===A.workspace.id?S(n)("sidebar.confirm"):S(n)("sidebar.delete")),9,xle)])):se("",!0)],10,gle),qt(p("div",null,[A.sessions.length===0?(C(),I("div",Tle,P(S(n)("sidebar.noSessions")),1)):se("",!0),(C(!0),I(Oe,null,Xe(A.sessions,$=>(C(),I("div",{key:$.id,class:Le(["srow",{cur:$.id===e.activeId}]),onClick:R=>r($.id)},[p("div",Mle,[p("div",{class:Le(["t",{run:$.busy,aborted:$.status==="aborted"}])},P($.title),3),p("div",Ele,P($.time),1)]),(e.attentionBySession[$.id]??0)>0?(C(),I("span",Ile,P(e.attentionBySession[$.id]),1)):se("",!0),p("button",{type:"button",class:"kb",title:S(n)("sidebar.options"),onClick:Ze(R=>w($.id),["stop"])},[...O[10]||(O[10]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[p("circle",{cx:"8",cy:"3",r:"1.3"}),p("circle",{cx:"8",cy:"8",r:"1.3"}),p("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,$le),f.value===$.id?(C(),I("div",{key:1,class:"kmenu",onClick:O[1]||(O[1]=Ze(()=>{},["stop"]))},[p("button",{class:"kitem",onClick:Ze(R=>y($),["stop"])},P(S(n)("sidebar.rename")),9,Nle),p("button",{class:"kitem archive",onClick:Ze(R=>b($.id),["stop"])},P(g.value===$.id?S(n)("sidebar.archiveConfirm"):S(n)("sidebar.archive")),9,Lle)])):se("",!0)],10,Ale))),128)),A.hasMore||A.loadingMore?(C(),I("button",{key:1,type:"button",class:"mshow-more",disabled:A.loadingMore,onClick:Ze($=>s("loadMore",A.workspace.id),["stop"])},P(A.loadingMore?S(n)("sidebar.loadingMore"):S(n)("sidebar.showMore",{count:Math.max(0,A.workspace.sessionCount-A.sessions.length)})),9,Ple)):se("",!0)],512),[[Ks,!d(A.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),Rle=bt(Ole,[["__scopeId","data-v-d8b693db"]]),Dle={class:"srow-main"},Ble={class:"srow-label"},Fle={class:"srow-sub"},Hle={class:"srow-main"},Wle={class:"srow-label"},Ule={class:"srow-val"},jle={class:"srow-main"},qle={class:"srow-label"},zle={class:"srow-sub"},Vle=["aria-checked"],Kle={class:"srow-main"},Gle={class:"srow-label"},Yle={class:"srow-sub"},Xle=["aria-checked"],Qle={class:"srow-main"},Zle={class:"srow-label"},Jle={class:"srow read-only"},eae={class:"srow-main"},tae={class:"srow-label"},nae={class:"srow-sub"},oae=["aria-label"],sae={class:"srow read-only pref"},iae={class:"srow-main"},rae={class:"srow-label"},lae=["aria-label"],aae=["aria-pressed"],cae=["aria-pressed"],uae={class:"srow read-only pref"},dae={class:"srow-main"},fae={class:"srow-label"},hae=["aria-label"],pae=["aria-pressed"],mae=["aria-pressed"],gae=["aria-pressed"],vae={class:"srow read-only pref"},yae={class:"srow-main"},kae={class:"srow-label"},bae={class:"srow read-only pref"},wae={class:"srow-main"},_ae={class:"srow-label"},Cae={class:"num-field"},Sae=["value","aria-label"],xae={class:"srow-main"},Tae={class:"srow-label"},Aae={class:"srow-sub"},Mae=["aria-checked"],Eae={class:"srow-main"},Iae={class:"srow-label"},$ae={class:"srow-main"},Nae={class:"srow-label"},Lae={key:2,class:"srow read-only"},Pae={class:"srow-main"},Oae={class:"srow-label"},Rae={class:"srow-val dim"},Dae=Qe({__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}=St(),o=e,s=t,i=["manual","auto","yolo"],r=F(()=>o.thinking??"high"),l=F(()=>o.planMode===!0),a=F(()=>o.swarmMode===!0),c=F(()=>{const b=o.status.permission;return b==="yolo"?"var(--err)":b==="auto"?"var(--warn)":"var(--faint)"}),u=F(()=>{const b=o.status.permission,v=n(b==="yolo"?"mobile.permYoloSub":b==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${b} · ${v}`}),d=b=>`${Math.round(b/1e3)}k`,h=F(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(o.status.ctxUsed/o.status.ctxMax*100))):0),m=F(()=>o.status.ctxMax>0?`${d(o.status.ctxUsed)}/${d(o.status.ctxMax)}`:n("status.statusNone"));function f(){s("setThinking",r.value==="off"?"high":"off")}function g(){const b=i.indexOf(o.status.permission),v=i[(b+1)%i.length];s("setPermission",v)}function _(){s("pickModel"),s("update:modelValue",!1)}function w(){s("login"),s("update:modelValue",!1)}function y(){s("logout"),s("update:modelValue",!1)}return(b,v)=>(C(),Ve(I3,{"model-value":e.modelValue,title:S(n)("mobile.settingsTitle"),"onUpdate:modelValue":v[9]||(v[9]=x=>s("update:modelValue",x))},{default:$n(()=>[p("button",{type:"button",class:"srow",onClick:_},[p("span",Dle,[p("span",Ble,P(S(n)("status.statusModel")),1),p("span",Fle,P(e.status.model),1)]),v[10]||(v[10]=p("span",{class:"chev"},"›",-1))]),p("button",{type:"button",class:"srow",onClick:f},[p("span",Hle,[p("span",Wle,P(S(n)("status.statusThinking")),1)]),p("span",Ule,P(r.value==="off"?S(n)("status.planOff"):S(n)("status.planOn")),1),v[11]||(v[11]=p("span",{class:"chev"},"›",-1))]),p("button",{type:"button",class:"srow",onClick:v[0]||(v[0]=x=>s("togglePlan"))},[p("span",jle,[p("span",qle,P(S(n)("status.statusPlanMode")),1),p("span",zle,P(S(n)("mobile.planModeSub")),1)]),p("span",{class:Le(["toggle",{on:l.value}]),role:"switch","aria-checked":l.value},null,10,Vle)]),p("button",{type:"button",class:"srow",onClick:v[1]||(v[1]=x=>s("toggleSwarm"))},[p("span",Kle,[p("span",Gle,P(S(n)("status.statusSwarmMode")),1),p("span",Yle,P(S(n)("mobile.swarmModeSub")),1)]),p("span",{class:Le(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,Xle)]),p("button",{type:"button",class:"srow",onClick:g},[p("span",Qle,[p("span",Zle,P(S(n)("status.statusPermission")),1),p("span",{class:"srow-sub",style:Wt({color:c.value})},P(u.value),5)]),v[12]||(v[12]=p("span",{class:"chev"},"›",-1))]),p("div",Jle,[p("span",eae,[p("span",tae,P(S(n)("status.statusContext")),1),p("span",nae,P(m.value),1)]),p("span",{class:"ctx-meter","aria-label":m.value},[p("i",{style:Wt({width:h.value+"%"})},null,4)],8,oae)]),p("div",sae,[p("span",iae,[p("span",rae,P(S(n)("theme.label")),1)]),p("div",{class:"seg",role:"group","aria-label":S(n)("theme.label")},[p("button",{type:"button",class:Le(["seg-opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:v[2]||(v[2]=x=>s("setTheme","modern"))},P(S(n)("theme.modern")),11,aae),p("button",{type:"button",class:Le(["seg-opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:v[3]||(v[3]=x=>s("setTheme","kimi"))},P(S(n)("theme.kimi")),11,cae)],8,lae)]),p("div",uae,[p("span",dae,[p("span",fae,P(S(n)("theme.colorSchemeLabel")),1)]),p("div",{class:"seg",role:"group","aria-label":S(n)("theme.colorSchemeLabel")},[p("button",{type:"button",class:Le(["seg-opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:v[4]||(v[4]=x=>s("setColorScheme","light"))},P(S(n)("theme.light")),11,pae),p("button",{type:"button",class:Le(["seg-opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:v[5]||(v[5]=x=>s("setColorScheme","dark"))},P(S(n)("theme.dark")),11,mae),p("button",{type:"button",class:Le(["seg-opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:v[6]||(v[6]=x=>s("setColorScheme","system"))},P(S(n)("theme.system")),11,gae)],8,hae)]),p("div",vae,[p("span",yae,[p("span",kae,P(S(n)("sidebar.language")),1)]),vt(M3)]),p("div",bae,[p("span",wae,[p("span",_ae,P(S(n)("settings.uiFontSize")),1)]),p("label",Cae,[p("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":S(n)("settings.uiFontSize"),onInput:v[7]||(v[7]=x=>s("setUiFontSize",Number(x.target.value)))},null,40,Sae),v[13]||(v[13]=p("span",{class:"num-unit"},"px",-1))])]),p("button",{type:"button",class:"srow",onClick:v[8]||(v[8]=x=>s("setBetaToc",!e.betaToc))},[p("span",xae,[p("span",Tae,P(S(n)("settings.betaToc")),1),p("span",Aae,P(S(n)("settings.betaTocHint")),1)]),p("span",{class:Le(["toggle",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc},null,10,Mae)]),e.authReady?(C(),I("button",{key:0,type:"button",class:"srow acct out",onClick:y},[p("span",Eae,[p("span",Iae,P(S(n)("sidebar.signOut")),1)])])):(C(),I("button",{key:1,type:"button",class:"srow acct in",onClick:w},[p("span",$ae,[p("span",Nae,P(S(n)("sidebar.signIn")),1)])])),e.serverVersion?(C(),I("div",Lae,[p("span",Pae,[p("span",Oae,P(S(n)("settings.serverVersion")),1)]),p("span",Rae,P(e.serverVersion),1)])):se("",!0)]),_:1},8,["model-value","title"]))}}),Bae=bt(Dae,[["__scopeId","data-v-33721a82"]]),Fae={class:"ob-backdrop"},Hae=["aria-label"],Wae=["aria-label"],Uae={class:"ob-brand"},jae={class:"ob-title"},qae={class:"ob-sub"},zae={class:"ob-sec"},Vae={class:"ob-label"},Kae={class:"ob-seg",role:"group"},Gae=["aria-pressed","onClick"],Yae={class:"ob-sec"},Xae={class:"ob-label"},Qae={class:"ob-themes"},Zae=["aria-pressed"],Jae={class:"ob-theme-name"},ece={class:"ob-theme-desc"},tce=["aria-pressed"],nce={class:"ob-theme-name"},oce={class:"ob-theme-desc"},sce=Qe({__name:"Onboarding",props:{theme:{}},emits:["setTheme","complete","skip"],setup(e,{emit:t}){const n=e,o=t,{t:s,locale:i}=St();function r(c){i.value!==c&&Bx(c)}const l=ne(n.theme);function a(){l.value!==n.theme&&o("setTheme",l.value),o("complete")}return(c,u)=>(C(),I("div",Fae,[p("div",{class:"ob-card",role:"dialog","aria-modal":"true","aria-label":S(s)("onboarding.title")},[p("button",{type:"button",class:"ob-close","aria-label":S(s)("onboarding.skip"),onClick:u[0]||(u[0]=d=>o("skip"))},[...u[3]||(u[3]=[p("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[p("path",{d:"M4 4l8 8M12 4l-8 8"})],-1)])],8,Wae),p("div",Uae,[u[4]||(u[4]=p("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[p("defs",null,[p("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[p("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),p("g",{class:"ob-eyes",fill:"#000"},[p("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),p("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),p("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--blue)",mask:"url(#obKimiEyes)"})],-1)),p("div",null,[p("div",jae,P(S(s)("onboarding.title")),1),p("div",qae,P(S(s)("onboarding.subtitle")),1)])]),p("section",zae,[p("div",Vae,P(S(s)("onboarding.languageLabel")),1),p("div",Kae,[(C(!0),I(Oe,null,Xe(S(Dx),d=>(C(),I("button",{key:d.code,type:"button",class:Le(["ob-seg-btn",{on:S(i)===d.code}]),"aria-pressed":S(i)===d.code,onClick:h=>r(d.code)},P(d.label),11,Gae))),128))])]),p("section",Yae,[p("div",Xae,P(S(s)("onboarding.themeLabel")),1),p("div",Qae,[p("button",{type:"button",class:Le(["ob-theme",{on:l.value==="modern"}]),"aria-pressed":l.value==="modern",onClick:u[1]||(u[1]=d=>l.value="modern")},[u[5]||(u[5]=p("span",{class:"ob-theme-prev modern","aria-hidden":"true"},[p("span",{class:"bub u"}),p("span",{class:"bub a"})],-1)),p("span",Jae,P(S(s)("theme.modern")),1),p("span",ece,P(S(s)("onboarding.modernDesc")),1)],10,Zae),p("button",{type:"button",class:Le(["ob-theme",{on:l.value==="kimi"}]),"aria-pressed":l.value==="kimi",onClick:u[2]||(u[2]=d=>l.value="kimi")},[u[6]||(u[6]=p("span",{class:"ob-theme-prev kimi","aria-hidden":"true"},[p("span",{class:"kb u"}),p("span",{class:"kb a"})],-1)),p("span",nce,P(S(s)("theme.kimi")),1),p("span",oce,P(S(s)("onboarding.kimiDesc")),1)],10,tce)])]),p("button",{type:"button",class:"ob-start",onClick:a},P(S(s)("onboarding.start")),1)],8,Hae)]))}}),ice=bt(sce,[["__scopeId","data-v-0527a631"]]),rce=["aria-label"],lce={class:"gload-box"},ace={class:"gload-text"},cce=Qe({__name:"GlobalLoading",setup(e){const{t}=St();return(n,o)=>(C(),I("div",{class:"gload",role:"status","aria-label":S(t)("app.connecting")},[p("div",lce,[o[0]||(o[0]=Ir('<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)),p("div",ace,P(S(t)("app.connecting")),1)])],8,rce))}}),uce=bt(cce,[["__scopeId","data-v-d8748888"]]),dce={class:"kap-root"},fce={class:"kap-head"},hce={class:"kap-count"},pce={class:"kap-head-actions"},mce={class:"kap-filters"},gce=["value"],vce={class:"kap-check"},yce={class:"kap-check"},kce={class:"kap-view-toggle",role:"group"},bce={key:0,class:"kap-empty"},wce=["onClick"],_ce={class:"kap-ts"},Cce={class:"kap-label"},Sce={key:0,class:"kap-detail"},xce={class:"kap-detail-actions"},Tce=["onClick"],Ace={key:1,class:"kap-agg"},Mce={class:"mono"},Ece={class:"mono"},Ice={class:"num"},$ce={class:"num"},Nce={key:0},Lce={class:"mono"},Pce={class:"num"},Oce={class:"num"},Rce={key:0},Dce=Qe({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=ne("all"),s=ne(""),i=ne(""),r=ne(!1),l=ne("timeline"),a=F(()=>(S0.value,[...Eoe()])),c=F(()=>{const T=new Set;for(const E of a.value)E.sessionId&&T.add(E.sessionId);return[...T].sort()});function u(T){return T.kind==="rest:error"||T.code!==void 0&&T.code!==0||T.eventType==="error"||T.eventType==="parse-error"}const d=F(()=>{const T=s.value.trim().toLowerCase();return a.value.filter(E=>!(o.value!=="all"&&E.source!==o.value||i.value&&E.sessionId!==i.value||r.value&&!u(E)||T&&!`${E.label} ${E.kind} ${E.eventType??""} ${E.sessionId??""} ${E.requestId??""}`.toLowerCase().includes(T)))}),h=F(()=>{const T=new Map;for(const E of d.value){if(E.kind!=="ws:in"&&E.kind!=="ws:out")continue;const O=E.kind==="ws:in"?"←":"→",A=`${O} ${E.eventType??"?"} @ ${E.sessionId??"-"}`,$=T.get(A)??{key:A,sessionId:E.sessionId??"-",eventType:E.eventType??"?",dir:O,count:0};$.count++,E.seq!==void 0&&($.lastSeq=E.seq),T.set(A,$)}return[...T.values()].sort((E,O)=>O.count-E.count)}),m=F(()=>{const T=new Map;for(const E of d.value){if(E.source!=="rest"||E.kind==="rest:request")continue;const O=`${E.method??"?"} ${E.path??"?"}`,A=T.get(O)??{count:0,errors:0,totalMs:0,timed:0};A.count++,u(E)&&A.errors++,E.durationMs!==void 0&&(A.totalMs+=E.durationMs,A.timed++),T.set(O,A)}return[...T.entries()].map(([E,O])=>({key:E,count:O.count,errors:O.errors,avgMs:O.timed>0?Math.round(O.totalMs/O.timed):0})).sort((E,O)=>O.count-E.count)}),f=ne(null),g=ne(!0),_=ne(null),w=ne(null);ze(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await ht();const T=_.value;T&&(T.scrollTop=T.scrollHeight)});function y(T){f.value=f.value===T?null:T}function b(T){const E=new Date(T),O=(A,$=2)=>String(A).padStart($,"0");return`${O(E.getHours())}:${O(E.getMinutes())}:${O(E.getSeconds())}.${O(E.getMilliseconds(),3)}`}function v(T){return JSON.stringify(T,null,2)}async function x(T){await wo(v(T))&&(w.value=T.id,setTimeout(()=>{w.value===T.id&&(w.value=null)},1500))}function L(){E3(d.value)}function N(T){return u(T)||T.source==="client"?"b-err":T.source==="rest"?"b-rest":T.kind==="ws:lifecycle"?"b-life":T.kind==="ws:out"?"b-out":"b-in"}function k(T){return T.source==="rest"?"REST":T.source==="client"?"APP":"WS"}return(T,E)=>(C(),I("section",dce,[p("header",fce,[E[11]||(E[11]=p("strong",null,"KAP debug",-1)),p("span",hce,P(d.value.length)+"/"+P(a.value.length),1),p("div",pce,[p("button",{type:"button",class:Le({on:S(Sc)}),onClick:E[0]||(E[0]=O=>Sc.value=!S(Sc))},P(S(Sc)?"resume":"pause"),3),p("button",{type:"button",onClick:E[1]||(E[1]=O=>S(Ioe)())},"clear"),p("button",{type:"button",onClick:E[2]||(E[2]=O=>L())},"export jsonl"),p("button",{type:"button",title:"Close window",onClick:E[3]||(E[3]=O=>n("close"))},"✕")])]),p("div",mce,[qt(p("select",{"onUpdate:modelValue":E[4]||(E[4]=O=>o.value=O),"aria-label":"Source filter"},[...E[12]||(E[12]=[p("option",{value:"all"},"rest + ws + app",-1),p("option",{value:"rest"},"rest",-1),p("option",{value:"ws"},"ws",-1),p("option",{value:"client"},"app errors",-1)])],512),[[Af,o.value]]),qt(p("select",{"onUpdate:modelValue":E[5]||(E[5]=O=>i.value=O),"aria-label":"Session filter"},[E[13]||(E[13]=p("option",{value:""},"all sessions",-1)),(C(!0),I(Oe,null,Xe(c.value,O=>(C(),I("option",{key:O,value:O},P(O),9,gce))),128))],512),[[Af,i.value]]),qt(p("input",{"onUpdate:modelValue":E[6]||(E[6]=O=>s.value=O),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[Wn,s.value]]),p("label",vce,[qt(p("input",{"onUpdate:modelValue":E[7]||(E[7]=O=>r.value=O),type:"checkbox"},null,512),[[Tf,r.value]]),E[14]||(E[14]=ut(" errors",-1))]),p("label",yce,[qt(p("input",{"onUpdate:modelValue":E[8]||(E[8]=O=>g.value=O),type:"checkbox"},null,512),[[Tf,g.value]]),E[15]||(E[15]=ut(" follow",-1))]),p("div",kce,[p("button",{type:"button",class:Le({on:l.value==="timeline"}),onClick:E[9]||(E[9]=O=>l.value="timeline")},"timeline",2),p("button",{type:"button",class:Le({on:l.value==="aggregate"}),onClick:E[10]||(E[10]=O=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(C(),I("div",{key:0,ref_key:"listRef",ref:_,class:"kap-list"},[d.value.length===0?(C(),I("div",bce," No trace entries yet. REST calls and WS frames will appear here. ")):se("",!0),(C(!0),I(Oe,null,Xe(d.value,O=>(C(),I("div",{key:O.id,class:"kap-row-wrap"},[p("button",{type:"button",class:Le(["kap-row",{expanded:f.value===O.id}]),onClick:A=>y(O.id)},[p("span",_ce,P(b(O.ts)),1),p("span",{class:Le(["kap-badge",N(O)])},P(k(O)),3),p("span",Cce,P(O.label),1)],10,wce),f.value===O.id?(C(),I("div",Sce,[p("div",xce,[p("button",{type:"button",onClick:A=>x(O)},P(w.value===O.id?"copied ✓":"copy json"),9,Tce)]),p("pre",null,P(v(O)),1)])):se("",!0)]))),128))],512)):(C(),I("div",Ace,[E[20]||(E[20]=p("h4",null,"WS frames by session / type",-1)),p("table",null,[E[17]||(E[17]=p("thead",null,[p("tr",null,[p("th",null,"dir"),p("th",null,"type"),p("th",null,"session"),p("th",null,"count"),p("th",null,"last seq")])],-1)),p("tbody",null,[(C(!0),I(Oe,null,Xe(h.value,O=>(C(),I("tr",{key:O.key},[p("td",null,P(O.dir),1),p("td",Mce,P(O.eventType),1),p("td",Ece,P(O.sessionId),1),p("td",Ice,P(O.count),1),p("td",$ce,P(O.lastSeq??"—"),1)]))),128)),h.value.length===0?(C(),I("tr",Nce,[...E[16]||(E[16]=[p("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):se("",!0)])]),E[21]||(E[21]=p("h4",null,"REST by endpoint",-1)),p("table",null,[E[19]||(E[19]=p("thead",null,[p("tr",null,[p("th",null,"endpoint"),p("th",null,"count"),p("th",null,"errors"),p("th",null,"avg ms")])],-1)),p("tbody",null,[(C(!0),I(Oe,null,Xe(m.value,O=>(C(),I("tr",{key:O.key},[p("td",Lce,P(O.key),1),p("td",Pce,P(O.count),1),p("td",{class:Le(["num",{err:O.errors>0}])},P(O.errors),3),p("td",Oce,P(O.avgMs),1)]))),128)),m.value.length===0?(C(),I("tr",Rce,[...E[18]||(E[18]=[p("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):se("",!0)])])]))]))}}),Bce=bt(Dce,[["__scopeId","data-v-79eb55ae"]]),Fce=["title"],Hce=Qe({__name:"DebugPanel",setup(e){const t=ne(!1);let n=null,o=null,s=null;const i=["data-theme","data-color-scheme","data-accent"];function r(u){const d=document.documentElement,h=u.documentElement;for(const m of i){const f=d.getAttribute(m);f!==null?h.setAttribute(m,f):h.removeAttribute(m)}}function l(u){const d=u.document;d.title="KAP debug";const h=d.createElement("base");h.href=location.href,d.head.appendChild(h);for(const f of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(f.cloneNode(!0));r(d),d.body.style.margin="0";const m=d.createElement("div");return m.style.height="100vh",d.body.appendChild(m),m}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),h=Mf(Bce,{onClose:()=>u.close()});h.mount(d),o=h,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return sn(()=>{c()}),Jo(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(C(),I("button",{class:"kap-fab",type:"button",title:t.value?"Focus KAP debug window":"Open KAP debug window",onClick:c}," KAP ",8,Fce))}}),Wce=bt(Hce,[["__scopeId","data-v-0a50ee88"]]);function $3(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 K1(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 Uce(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 ai(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:K1(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:$3(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 Vc(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 eC(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 x0(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:eC(e.source)};case"video":return{type:"video",source:eC(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 G1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(x0),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function jce(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 qce(e){return{content:e.content.map(jce),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 zce(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function N3(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 Vce(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Kce(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Vce),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function L3(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Kce),createdAt:e.created_at}}function Gce(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 Yce(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=Gce(o);return{answers:t,method:e.method,note:e.note}}function Y1(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 tC(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 ar(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 As(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Xce(e){if(!e||typeof e!="object")return null;const t=e,n=ar(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const o=t.budget,s=o&&typeof o=="object"?o:{};return{goalId:ar(t,"goalId")??ar(t,"goal_id")??"goal",objective:ar(t,"objective")??"",completionCriterion:ar(t,"completionCriterion")??ar(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:ar(t,"terminalReason")??ar(t,"terminal_reason"),budget:{tokenBudget:As(s,"tokenBudget")??As(s,"token_budget"),remainingTokens:As(s,"remainingTokens")??As(s,"remaining_tokens"),turnBudget:As(s,"turnBudget")??As(s,"turn_budget"),remainingTurns:As(s,"remainingTurns")??As(s,"remaining_turns"),wallClockBudgetMs:As(s,"wallClockBudgetMs")??As(s,"wall_clock_budget_ms"),remainingWallClockMs:As(s,"remainingWallClockMs")??As(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function Qce(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:ai(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:ai(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:Vc(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Vc(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:K1(t.payload.status),previousStatus:K1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:$3(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=Xce(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:G1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(x0),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:N3(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:L3(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:Y1(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:X1(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function Zce(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function nC(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 X1(e){const t={};for(const[n,o]of Object.entries(e.providers))t[n]={type:o.type,baseUrl:o.base_url,defaultModel:o.default_model,hasApiKey:o.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,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 Jce(e){return e.session_id}function eue(e){return e.seq}const tue="main",nue=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 gr(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 oue(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 oC(){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 as(e,t){const n=e[t];return typeof n=="string"?n:void 0}function il(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Ms(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function sue(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=as(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=as(t,"goalId")??as(t,"goal_id")??"goal",r=as(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:as(t,"completionCriterion")??as(t,"completion_criterion"),status:s,turnsUsed:il(t,"turnsUsed")??il(t,"turns_used")??0,tokensUsed:il(t,"tokensUsed")??il(t,"tokens_used")??0,wallClockMs:il(t,"wallClockMs")??il(t,"wall_clock_ms")??0,terminalReason:as(t,"terminalReason")??as(t,"terminal_reason"),budget:{tokenBudget:Ms(o,"tokenBudget")??Ms(o,"token_budget"),remainingTokens:Ms(o,"remainingTokens")??Ms(o,"remaining_tokens"),turnBudget:Ms(o,"turnBudget")??Ms(o,"turn_budget"),remainingTurns:Ms(o,"remainingTurns")??Ms(o,"remaining_turns"),wallClockBudgetMs:Ms(o,"wallClockBudgetMs")??Ms(o,"wall_clock_budget_ms"),remainingWallClockMs:Ms(o,"remainingWallClockMs")??Ms(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function xc(e,t,n,o){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function iue(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=as(t,"name")??as(t,"toolName")??"tool",o=Lf(rue(n)),s=lue(n,t.args??t.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const s=as(n,"text");if(s)return _g(s);const i=as(n,"message");if(i)return _g(i)}const o=as(t,"message");if(o)return _g(o)}return null}function rue(e){return e.replace(/_\d+$/,"")}const sC=2e3;function _g(e){return e.length>sC?`${e.slice(0,sC)}…`:e}function lue(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return s1(e,n)}function aue(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];const r=iue(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=xc(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 Bd(e){return{...e,content:e.content.map(t=>({...t}))}}function iC(e,t,n){const o={id:gr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function cue(e,t,n,o,s,i){const r={id:o,sessionId:t,role:"user",content:s,createdAt:i,promptId:n};return e.messages.push(r),r}function uue(e){return Array.isArray(e)?e.map(t=>x0(t)):[]}function rC(e,t,n,o){const s=e.messages.find(r=>r.id===t);if(!s)return-1;const i=s.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=o:i.thinking+=o,s.content.length-1):(s.content.push(n==="text"?{type:"text",text:o}:{type:"thinking",thinking:o}),s.content.length-1)}function due(e,t,n,o,s,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:o,input:s,outputLines:i})}function fue(e){const t=e.update,n=t&&typeof t=="object"?t:null,s=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:s}:null}function lC(e,t){e.messages.find(n=>n.id===t)}function hue(e,t,n,o,s,i){const r={id:gr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:o,isError:s}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function Cg(e,t){return e.messages.find(n=>n.id===t)}function aC(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 pue(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=oC(),e.set(u,d)),d}function o(u){e.set(u,oC())}function s(u){t.add(u)}function i(u,d){const h=n(u);h.currentPromptId=d}function r(u,d){o(u);const h=n(u),m=d.promptId??gr("pr_");h.currentPromptId=m,h.turnPromptId.set(d.turnId,m);const f=iC(h,u,m);d.thinkingText.length>0&&f.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&f.content.push({type:"text",text:d.assistantText});for(const g of d.runningTools){const _=typeof g.lastProgress?.text=="string"&&g.lastProgress.text.length>0?[g.lastProgress.text]:void 0;f.content.push({type:"toolUse",toolCallId:g.toolCallId,toolName:g.name,input:g.args??{},outputLines:_}),h.toolStartTimes.set(g.toolCallId,Date.now())}return h.currentAssistantMsgId=f.id,h.turnTextLen=d.assistantText.length,h.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:m},{type:"messageCreated",message:Bd(f)}]}function l(u,d,h,m){try{return c(u,d,h,m)}catch(f){return console.error("[agentProjector] Error projecting event:",u,f instanceof Error?f.message:f),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,h,m){const f=n(h),g=d,_=[],w=g?.agentId;if(typeof w=="string"&&w!==tue){const y=t.has(w);if(y&&(u==="thinking.delta"||u==="assistant.delta")){const b=g?.delta??"";return b?[{type:"agentDelta",sessionId:h,agentId:w,delta:{[u==="thinking.delta"?"thinking":"text"]:b}}]:[]}if(y&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:h,agentId:w,reason:g?.reason}];if(nue.has(u))return aue(f,h,w,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)&&_.push({type:"sessionMetaUpdated",sessionId:h,...v});break}case"prompt.submitted":{const y=g?.promptId,b=g?.userMessageId;if(!y||!b)break;const v=uue(g?.content);if(v.length===0)break;f.currentPromptId=y;const x=cue(f,h,y,b,v,typeof g?.createdAt=="string"?g.createdAt:new Date().toISOString());_.push({type:"messageCreated",message:Bd(x)});break}case"turn.started":{const y=g?.turnId,b=f.currentPromptId??gr("pr_");f.currentPromptId=b,y!==void 0&&f.turnPromptId.set(y,b),f.turnTextLen=0,f.turnThinkLen=0,_.push({type:"sessionStatusChanged",sessionId:h,status:"running",previousStatus:"idle",currentPromptId:b});break}case"turn.step.started":{const y=g?.turnId;let b=f.turnPromptId.get(y)??f.currentPromptId;b||(b=gr("pr_"),f.currentPromptId=b,y!==void 0&&f.turnPromptId.set(y,b));const v=iC(f,h,b);f.currentAssistantMsgId=v.id,_.push({type:"messageCreated",message:Bd(v)});break}case"thinking.delta":{const y=f.currentAssistantMsgId;if(!y)break;const b=g?.delta??"";if(!b)break;m?.offset===0&&f.turnThinkLen>0&&(f.turnThinkLen=0);const v=a(f.turnThinkLen,m?.offset);if(v==="skip")break;if(v==="gap"){_.push({type:"historyCompacted",sessionId:h,beforeSeq:0,reason:"delta_gap"});break}const x=rC(f,y,"thinking",b);if(x<0)break;f.turnThinkLen+=b.length,_.push({type:"assistantDelta",sessionId:h,messageId:y,contentIndex:x,delta:{thinking:b}});break}case"assistant.delta":{const y=f.currentAssistantMsgId;if(!y)break;const b=g?.delta??"";if(!b)break;m?.offset===0&&f.turnTextLen>0&&(f.turnTextLen=0);const v=a(f.turnTextLen,m?.offset);if(v==="skip")break;if(v==="gap"){_.push({type:"historyCompacted",sessionId:h,beforeSeq:0,reason:"delta_gap"});break}const x=rC(f,y,"text",b);if(x<0)break;f.turnTextLen+=b.length,_.push({type:"assistantDelta",sessionId:h,messageId:y,contentIndex:x,delta:{text:b}});break}case"tool.use":case"tool.call.started":{const y=f.currentAssistantMsgId,b=g?.turnId,v=f.turnPromptId.get(b)??f.currentPromptId;if(!y||!v)break;const x=g?.toolCallId,L=g?.name??g?.toolName??"",N=g?.args??g?.input??{};due(f,y,x,L,N);const k=Cg(f,y);k&&k.content.length-1,f.toolStartTimes.set(x,Date.now()),k&&_.push({type:"messageUpdated",sessionId:h,messageId:y,content:k.content.map(T=>({...T})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const y=g?.toolCallId,b=fue(g??{});y&&b&&_.push({type:"toolOutput",sessionId:h,toolCallId:y,outputChunk:b.outputChunk,stream:b.stream});break}case"tool.result":{const y=g?.turnId;let b=f.turnPromptId.get(y)??f.currentPromptId;b||(b=gr("pr_"),f.currentPromptId=b,y!==void 0&&f.turnPromptId.set(y,b));const v=g?.toolCallId,x=g?.output,L=g?.isError??!1;f.toolStartTimes.get(v)??Date.now(),f.toolStartTimes.delete(v);const N=hue(f,h,v,x,L,b);_.push({type:"messageCreated",message:Bd(N)}),f.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const y=f.currentAssistantMsgId,b=oue(g?.usage);if(f.totalInput+=b.input,f.totalOutput+=b.output,f.totalCacheRead+=b.cacheRead,f.totalCacheCreate+=b.cacheCreate,y){lC(f,y);const v=Cg(f,y);v&&_.push({type:"messageUpdated",sessionId:h,messageId:y,content:v.content.map(x=>({...x})),status:"completed"})}break}case"agent.status.updated":{g?.model&&(f.model=g.model),g?.contextTokens!==void 0&&(f.contextTokens=g.contextTokens),g?.maxContextTokens!==void 0&&(f.contextLimit=g.maxContextTokens),_.push({type:"sessionUsageUpdated",sessionId:h,usage:aC(f),model:f.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=f.currentAssistantMsgId,b=g?.reason??"completed",v=il(g??{},"durationMs");if(y){lC(f,y);const N=Cg(f,y);N&&_.push({type:"messageUpdated",sessionId:h,messageId:y,content:N.content.map(k=>({...k})),status:b==="failed"||b==="filtered"?"error":"completed",durationMs:v})}f.turnCount++;const x=aC(f);_.push({type:"sessionUsageUpdated",sessionId:h,usage:x});const L=b==="cancelled"||b==="failed"||b==="filtered"?"aborted":"idle";_.push({type:"sessionStatusChanged",sessionId:h,status:L,previousStatus:"running"}),f.currentAssistantMsgId=void 0,f.currentPromptId=void 0,f.turnTextLen=0,f.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{f.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const b={id:typeof g?.subagentId=="string"&&g.subagentId.length>0?g.subagentId:gr("task_"),sessionId:h,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};f.subagentMeta.set(b.id,b),_.push({type:"taskCreated",sessionId:h,task:b});break}case"subagent.started":{const y=xc(f,h,g?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});y&&_.push({type:"taskCreated",sessionId:h,task:y});break}case"subagent.suspended":{const y=xc(f,h,g?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof g?.reason=="string"?g.reason:void 0});y&&_.push({type:"taskCreated",sessionId:h,task:y});break}case"subagent.completed":{const y=typeof g?.resultSummary=="string"?g.resultSummary:void 0,b=xc(f,h,g?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:y});b&&_.push({type:"taskCreated",sessionId:h,task:b}),_.push({type:"taskCompleted",sessionId:h,taskId:g?.subagentId??"",status:"completed",outputPreview:y});break}case"subagent.failed":{const y=typeof g?.error=="string"?g.error:void 0,b=xc(f,h,g?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:y});b&&_.push({type:"taskCreated",sessionId:h,task:b}),_.push({type:"taskCompleted",sessionId:h,taskId:g?.subagentId??"",status:"failed",outputPreview:y});break}case"error":{_.push({type:"unknown",raw:{_agentError:!0,code:g?.code,message:g?.message}});break}case"warning":{_.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):gr("task_"),x=typeof y.description=="string"?y.description:typeof y.command=="string"?y.command:Sn.global.t("tasks.defaultDescription"),L=typeof y.command=="string"?y.command:void 0;_.push({type:"taskCreated",sessionId:h,task:{id:v,sessionId:h,kind:"bash",description:x,command:L,status:"running",createdAt:b??new Date().toISOString(),startedAt:b,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"background.task.terminated":{const y=g?.info??{},b=y.status==="failed"||typeof y.exitCode=="number"&&y.exitCode!==0;_.push({type:"taskCompleted",sessionId:h,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??{};_.push({type:"compactionCompleted",sessionId:h,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}),_.push({type:"historyCompacted",sessionId:h,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{_.push({type:"compactionStarted",sessionId:h,trigger:g?.trigger==="manual"?"manual":"auto",instruction:typeof g?.instruction=="string"?g.instruction:void 0});break}case"compaction.cancelled":{_.push({type:"compactionCancelled",sessionId:h});break}case"goal.updated":{const y=sue(g?.snapshot??null);_.push({type:"goalUpdated",sessionId:h,goal:y?.status==="complete"?null:y});break}}return _}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const mue=new Set(["server_hello","ack","ping","resync_required","error","pong"]),cC=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"]),gue=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"]),vue=new Set(["assistant.delta","thinking.delta"]);function yue(e,t){if(mue.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return vue.has(o)?kue(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?gue.has(o)?{route:"protocol"}:cC.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:cC.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function kue(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 Q1 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 Tc 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 Pa(e){return e instanceof Q1||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function P3(e){return e instanceof Tc||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const T0="kimi-web.server-credential",bue="token";let vu;const Z1=new Set;function wue(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(bue);if(!n)return;const o=new URL(window.location.href);return o.hash="",window.history.replaceState(window.history.state,"",`${o.pathname}${o.search}`),n}function _ue(){try{return globalThis.sessionStorage?.getItem(T0)??void 0}catch{return}}function Cue(){const e=wue();return e?(R3(e),!0):(vu=_ue(),vu!==void 0)}function O3(){return vu}function R3(e){vu=e;try{globalThis.sessionStorage?.setItem(T0,e)}catch{}}function Sue(){vu=void 0;try{globalThis.sessionStorage?.removeItem(T0)}catch{}}function xue(e){return Z1.add(e),()=>{Z1.delete(e)}}function Tue(){Sue();for(const e of Z1)try{e()}catch{}}const Ac=3e4,D3="0123456789ABCDEFGHJKMNPQRSTVWXYZ",uC=500,Aue=40101;function dC(){try{return AbortSignal.timeout(Ac)}catch{return}}function Mue(e,t){let n="",o=e;for(let s=0;s<t;s++)n=D3[o%32]+n,o=Math.floor(o/32);return n}function Eue(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=>D3[n%32]).join("")}function fC(){return`${Mue(Date.now(),10)}${Eue(16)}`}function Iue(e){try{const t=[];return e.forEach((n,o)=>{typeof n=="string"?t.push({field:o,value:n}):t.push({field:o,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function hC(e){try{const t=await e.text();return t?t.length>uC?`${t.slice(0,uC)}...`:t:void 0}catch{return}}class $ue{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async post(t,n,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postForm(t,n){const o=Nf(this.origin,t),s=fC(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();X2({method:"POST",path:t,url:o,requestId:s,body:Iue(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:dC()})}catch(u){throw Dd({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new Tc({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Ac})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw Dd({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new Tc({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Ac,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await hC(c)})}if(Q2({method:"POST",path:t,requestId:s,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new Q1({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,o,s,i=[]){let r=Nf(this.origin,n);if(s){const m=new URLSearchParams;for(const[g,_]of Object.entries(s))_!==void 0&&m.set(g,String(_));const f=m.toString();f&&(r=`${r}?${f}`)}const l=fC(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();X2({method:t,path:n,url:r,requestId:l,body:o});let u;try{u=await fetch(r,{method:t,headers:a,body:o!==void 0?JSON.stringify(o):void 0,signal:dC()})}catch(m){throw Dd({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:m}),new Tc({message:`Network error calling ${t} ${n}`,cause:m,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:Ac})}let d;const h=u.clone();try{d=await u.json()}catch(m){throw Dd({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:m}),new Tc({message:`Failed to parse JSON response from ${t} ${n}`,cause:m,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:Ac,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await hC(h)})}if(Q2({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 Q1({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details});return d.data}addClientHeaders(t){const n=O3();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===Aue)&&Tue()}}const Nue="kimi-code.bearer.";class Lue{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;Zl("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=O3(),n=t!==void 0?[`${Nue}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{Zl("open")},o.onmessage=s=>{try{const i=JSON.parse(String(s.data));Noe(i),this.handleFrame(i)}catch(i){Zl("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{Zl("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{Zl("close",s?{code:s.code,reason:s.reason,wasClean:s.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,Zl("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const o=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);o!==-1&&this.pendingSubscriptions.splice(o,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,o){const s=Fd(t,n),i=this.terminalAttachments.get(s),r=o??i?.lastSeq??0;this.terminalAttachments.set(s,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,o){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:o}})}terminalResize(t,n,o,s){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:o,rows:s}})}terminalDetach(t,n){this.terminalAttachments.delete(Fd(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(Fd(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}handleFrame(t){const n=t;switch(t.type){case"server_hello":this.onServerHello();break;case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,i=n.seq,r=Fd(o,s),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(o,s,a,i);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(o,s,r);break}default:{this.trackCursor(n);const o=n.type,s=yue(o,n.payload);if(s.route==="protocol"){this.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:s.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,o){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:o>0?o:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,o=t.seq;if(typeof n!="string"||typeof o!="number")return;const s=this.subscriptions.get(n);if(!s||o<=s.seq&&s.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:s.epoch;this.subscriptions.set(n,{seq:Math.max(o,s.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),$oe(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function Fd(e,t){return`${e}\0${t}`}function Sg(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 pC(e){return e==="auto_compact"||e==="manual_compact"}class Pue{http;config;constructor(t){this.config=t,this.http=new $ue(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?Uce(t.status):void 0,include_archive:t?.includeArchive,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(ai),hasMore:o.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const o=await this.http.post("/sessions",n);return ai(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return ai(n)}async updateSession(t,n){const o={};n.title!==void 0&&(o.title=n.title),n.cwd!==void 0&&(o.metadata={cwd:n.cwd});const s={};n.model!==void 0&&(s.model=n.model),n.permissionMode!==void 0&&(s.permission_mode=n.permissionMode),n.planMode!==void 0&&(s.plan_mode=n.planMode),n.swarmMode!==void 0&&(s.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(s.goal_objective=n.goalObjective),n.goalControl!==void 0&&(s.goal_control=n.goalControl),n.thinking!==void 0&&(s.thinking=n.thinking),Object.keys(s).length>0&&(o.agent_config=s);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return ai(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async listMessages(t,n){const o={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,o);return{items:s.items.map(G1),hasMore:s.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:ai(n.session),messages:n.messages.items.map(G1),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(o=>({toolCallId:o.tool_call_id,name:o.name,args:o.args,description:o.description,lastProgress:o.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(N3),pendingQuestions:n.pending_questions.map(L3)}}async submitPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,qce(n));return{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}async steerPrompts(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:o.steered,promptIds:o.prompt_ids}}async abortPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:o.aborted,atSeq:o.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,o);return ai(s)}async createChildSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,o);return ai(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(ai)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,zce(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,Yce(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const o={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,o)).items.map(Y1)}async getTask(t,n,o){const s={with_output:o?.withOutput,output_bytes:o?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,s);return Y1(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(Sg)}async createTerminal(t,n={}){const o={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},s=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,o);return Sg(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Sg(o)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async activateSkill(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,o!==void 0&&o.length>0?{args:o}:{});return{activated:s.activated,skillName:s.skill_name}}async listDirectory(t,n){const o={};n.path!==void 0&&(o.path=n.path),n.depth!==void 0&&(o.depth=n.depth),n.includeGitStatus!==void 0&&(o.include_git_status=n.includeGitStatus);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,o),i=s.children_by_path?Object.fromEntries(Object.entries(s.children_by_path).map(([r,l])=>[r,l.map(tC)])):void 0;return{items:s.items.map(tC),childrenByPath:i,truncated:s.truncated}}async readFile(t,n){const o={path:n.path};n.offset!==void 0&&(o.offset=n.offset),n.length!==void 0&&(o.length=n.length);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,o);return{path:s.path,content:s.content,encoding:s.encoding,size:s.size,truncated:s.truncated,etag:s.etag,mime:s.mime,languageId:s.language_id,lineCount:s.line_count,isBinary:s.is_binary}}async searchFiles(t,n){const o={query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,o);return{items:s.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const o={pattern:n.pattern};n.regex!==void 0&&(o.regex=n.regex),n.caseSensitive!==void 0&&(o.case_sensitive=n.caseSensitive);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,o);return{files:s.files,filesScanned:s.files_scanned,truncated:s.truncated,elapsedMs:s.elapsed_ms}}async getGitStatus(t,n){const o={};n!==void 0&&(o.paths=n);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,o);return{branch:s.branch,ahead:s.ahead,behind:s.behind,entries:s.entries,additions:s.additions,deletions:s.deletions,pullRequest:s.pullRequest??null}}async getFileDiff(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:o.path,diff:o.diff}}getFileDownloadUrl(t,n){const o=n.split("/").map(s=>encodeURIComponent(s)).join("/");return Nf(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${o}:download`)}async openFile(t,n){const o={path:n.path};return n.line!==void 0&&(o.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,o)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,o,s){const i={app_id:n,path:o};s!==void 0&&(i.line=s),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Vc)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const o=await this.http.post("/workspaces",n);return Vc(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const o=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Vc(o)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(o=>({name:o.name,path:o.path,isDir:o.is_dir,isGitRepo:o.is_git_repo,branch:o.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(Zce)}async listProviders(){return(await this.http.get("/providers")).items.map(nC)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const o=await this.http.post("/providers",n);return nC(o)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return xg(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return xg(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return xg(t)}async getConfig(){const t=await this.http.get("/config");return X1(t)}async setConfig(t){const n={},o={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=o[i];l!==void 0&&(n[l]=r)}const s=await this.http.post("/config",n);return X1(s)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const o=await this.http.postForm("/files",n);return{id:o.id,name:o.name,mediaType:o.media_type,size:o.size}}getFileUrl(t){return Nf(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=A5(this.config.serverHttpUrl,this.config.clientId),o=pue(),s=new Lue(n,this.config.clientId,{onWireEvent:i=>{const r=Jce(i),l=eue(i),a=Qce(i);a.type==="historyCompacted"&&!pC(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=o.project(r,c,a,{offset:u});for(const h of d)h.type==="historyCompacted"&&!pC(h.reason)&&t.onResync(a,l),t.onEvent(h,{sessionId:a,seq:l})},onResync:(i,r,l)=>{o.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return s.connect(),{subscribe(i,r){s.subscribe(i,r??{seq:0})},unsubscribe(i){s.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){o.reset(i);return}const l=o.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){o.bindNextPromptId(i,r)},abort(i,r){s.abort(i,r)},terminalAttach(i,r,l){s.terminalAttach(i,r,l)},terminalInput(i,r,l){s.terminalInput(i,r,l)},terminalResize(i,r,l,a){s.terminalResize(i,r,l,a)},terminalDetach(i,r){s.terminalDetach(i,r)},terminalClose(i,r){s.terminalClose(i,r)},markSideChannelAgent(i){o.markSideChannelAgent(i)},close(){s.close()}}}}function xg(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}let mC;function at(){return mC??=new Pue(_5()),mC}function Oue(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Rue(e,t){return e.find(n=>n.root===t.cwd)?.id??t.workspaceId??t.cwd}function Due(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,activeRoot:s,activeBranch:i,sessionsHasMoreByWorkspace:r}=e,l=new Set(o),a=new Map;for(const m of t)l.has(m.root)||a.has(m.root)||a.set(m.root,{...m});for(const m of n){const f=m.cwd;f&&(l.has(f)||a.has(f)||a.set(f,{id:m.workspaceId??f,root:f,name:Oue(f),isGitRepo:!1,sessionCount:0}))}const c=new Map;for(const m of n){const f=Rue(t,m);c.set(f,(c.get(f)??0)+1)}const u=[...new Set(t.filter(m=>!l.has(m.root)).map(m=>m.root))],d=[...a.keys()].filter(m=>!u.includes(m));d.sort((m,f)=>m.localeCompare(f));const h=[];for(const m of[...u,...d]){const f=a.get(m),g=c.get(f.id)??c.get(f.root)??0,_=r[f.id]===!1?g:Math.max(f.sessionCount,g);let w=f.branch;!w&&i&&s===f.root&&(w=i),h.push({...f,sessionCount:_,branch:w})}return h}function Bue(e){const t=new Map,n=new Set;function o(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&o(i)});return t.set(i,l),l}function s(i){if(t.has(i)){n.add(i);return}o(i)}return{run:o,request:s}}const Fue=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function Hue(e){return Fue.has(e.type)}function Wue(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function Uue(e,t,n=Wue){let o=[],s=null;const i=()=>{if(s=null,o.length===0)return;const l=o;o=[];for(const a of l)e(a)},r=(l=>{if(t(l)){o.push(l),s===null&&(s=n(i));return}i(),e(l)});return r.flush=i,r}const B3=["blue","mono"],F3=["light","dark","system"],H3=15,jue=12,que=20;function zue(){const e=bn(Ct.accent);return e&&B3.includes(e)?e:"blue"}function Vue(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Kue(){const e=bn(Ct.colorScheme);return e&&F3.includes(e)?e:"system"}function Gue(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(o=>{const i=(o.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";o.setAttribute("content",n??i)})}function Yue(){const e=bn(Ct.theme);return e==="terminal"||e==="modern"||e==="kimi"?e:"modern"}function Xue(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.theme=e)}function A0(e){return Number.isFinite(e)?Math.min(que,Math.max(jue,Math.round(e))):H3}function Que(){const e=bn(Ct.uiFontSize);return e===null?H3:A0(Number(e))}function Zue(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${A0(e)}px`)}const op=ne(Yue()),M0=ne(Kue()),E0=ne(zue()),I0=ne(Que());ze(op,Xue,{immediate:!0});ze(M0,Gue,{immediate:!0});ze(E0,Vue,{immediate:!0});ze(I0,Zue,{immediate:!0});function W3(e){e!=="terminal"&&e!=="modern"&&e!=="kimi"||(op.value=e,An(Ct.theme,e))}function Jue(){W3(op.value==="modern"?"terminal":"modern")}function ede(e){F3.includes(e)&&(M0.value=e,An(Ct.colorScheme,e))}function tde(e){B3.includes(e)&&(E0.value=e,An(Ct.accent,e))}function nde(e){const t=A0(e);I0.value=t,An(Ct.uiFontSize,String(t))}const ode=600,sde=250,sp=250,ide=1e3,rde=160,ah=ne(!1);let cl=[],hl=null,ch=-sp;function lde(){cl=[],ch=-sp,ah.value=!1,hl!==null&&(clearTimeout(hl),hl=null)}function ade(){ah.value=!0,hl!==null&&clearTimeout(hl),hl=setTimeout(()=>{hl=null,cl=[],ch=-sp,ah.value=!1},ide)}function cde(e){if(e<=0)return;const t=Date.now();cl.push({time:t,chars:e});const n=t-ode;if(cl=cl.filter(l=>l.time>=n),t-ch<sp)return;ch=t;const o=cl[0]?.time??t,s=Math.max(t-o,sde);cl.reduce((l,a)=>l+a.chars,0)/s*1e3>=rde&&ade()}function ude(){return{theme:op,colorScheme:M0,accent:E0,uiFontSize:I0,fastMoon:ah,setTheme:W3,toggleTheme:Jue,setColorScheme:ede,setAccent:tde,setUiFontSize:nde,resetFastMoon:lde,recordMoonDelta:cde}}function U3(e,t){const n=bn(e);return n===null?t:n==="1"}const $0=ne(U3(Ct.notifyOnComplete,!0)),N0=ne(U3(Ct.notifyOnQuestion,!1)),L0=ne(typeof Notification<"u"?Notification.permission:"denied");async function j3(e,t,n){if(!n){e.value=!1,An(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}L0.value=o,o==="granted"&&(e.value=!0,An(t,"1"))}function dde(e){return j3($0,Ct.notifyOnComplete,e)}function fde(e){return j3(N0,Ct.notifyOnQuestion,e)}function q3(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{L0.value=i,i==="granted"&&gC(t,n,o)});return}gC(t,n,o)}}function gC(e,t,n){if(e.isActiveAndVisible)return;const o=e.sessionTitle.trim()||"Kimi Code";try{const s=new Notification(o,{body:t,tag:n});s.onclick=()=>{try{window.focus()}catch{}e.onClick(),s.close()}}catch{}}function hde(e,t){q3($0.value,t,Sn.global.t("settings.notifyBody"),`kimi-complete-${e}`)}function pde(e,t){const n=t.questionPreview||Sn.global.t("settings.notifyQuestionBody");q3(N0.value,t,n,`kimi-question-${e}`)}function mde(){return{notifyOnComplete:$0,notifyOnQuestion:N0,notifyPermission:L0,setNotifyOnComplete:dde,setNotifyOnQuestion:fde,maybeNotifyCompletion:hde,maybeNotifyQuestion:pde}}function gde(){return bn(Ct.soundOnComplete)==="1"}const Lu=ne(gde());function vde(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let Tg=null;function z3(){const e=vde();if(!e)return null;if(Tg===null)try{Tg=new e}catch{return null}return Tg}function V3(){if(!Lu.value)return;const e=z3();e!==null&&e.state==="suspended"&&e.resume().then(()=>{mr("sound: audio context resumed",{state:e.state})},t=>{mr("sound: audio context resume rejected",{error:String(t)})})}let vC=!1;function yde(){if(vC||typeof window>"u")return;vC=!0;const e=()=>{V3()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}yde();function kde(e){Lu.value=e,An(Ct.soundOnComplete,e?"1":"0"),e&&V3()}function yC(e,t,n,o,s){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(s,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+o),i.start(l),i.stop(l+o+.02)}function K3(){const e=z3();if(e===null){mr("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){mr("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{mr("sound: context resumed for next time",{state:e.state})},t=>{mr("sound: resume rejected",{error:String(t)})});return}try{yC(e,880,0,.16,.18),yC(e,1320,.1,.22,.16),mr("sound: chime scheduled",{state:e.state})}catch(t){mr("sound: failed to play",{error:String(t)})}}function bde(){Lu.value&&K3()}function wde(){Lu.value&&K3()}function _de(){return{soundOnComplete:Lu,setSoundOnComplete:kde,maybePlayCompletionSound:bde,maybePlayQuestionSound:wde}}function kC(e,t){const n=new Set(e.map(s=>s.id)),o=t.filter(s=>s.kind==="subagent"&&!n.has(s.id));return o.length===0?e:[...e,...o]}const Cde=1e3,Sde=4096,bC=32*1024;function xde(e,t){let n=null,o;const s=new Set;async function i(h){try{const f=await at().listTasks(h);e.tasksBySession={...e.tasksBySession,[h]:kC(f,e.tasksBySession[h]??[])},await r(h,f)}catch{}}async function r(h,m){if(e.activeSessionId!==h)return;const f=m??e.tasksBySession[h]??[],g=at(),_=new Map;if(await Promise.all(f.map(async y=>{if((y.status==="completed"||y.status==="failed"||y.status==="cancelled")&&!s.has(y.id)&&!((y.outputLines?.length??0)>0))try{const v=await g.getTask(h,y.id,{withOutput:!0,outputBytes:bC});v.outputPreview!==void 0&&_.set(y.id,{preview:v.outputPreview,bytes:v.outputBytes})}catch{}finally{s.add(y.id)}})),_.size===0)return;const w=e.tasksBySession[h]??[];e.tasksBySession={...e.tasksBySession,[h]:w.map(y=>{const b=_.get(y.id);return b?{...y,outputPreview:b.preview,outputBytes:b.bytes}:y})}}async function l(h){if(e.activeSessionId!==h)return;const m=at();let f;try{f=await m.listTasks(h)}catch{return}const g=new Map;await Promise.all(f.map(async b=>{const v=b.status==="running",x=b.status==="completed"||b.status==="failed"||b.status==="cancelled";if(!(!v&&!x)&&!(x&&(s.has(b.id)||(b.outputLines?.length??0)>0)))try{const L=await m.getTask(h,b.id,{withOutput:!0,outputBytes:v?Sde:bC});L.outputPreview!==void 0&&g.set(b.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{x&&s.add(b.id)}}));const _=e.tasksBySession[h]??[],w=new Map(_.map(b=>[b.id,b])),y=f.map(b=>{const v=w.get(b.id),x=g.get(b.id);return{...b,outputLines:v?.outputLines,outputPreview:x?.preview??v?.outputPreview,outputBytes:x?.bytes??v?.outputBytes}});e.tasksBySession={...e.tasksBySession,[h]:kC(y,_)}}function a(h){n!==null&&o===h||(c(),o=h,l(h),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===h?l(h):c())},Cde))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=ne(0);let d=null;return ze(()=>t.value.some(h=>h.status==="running"),h=>{h&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!h&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),ze(()=>{const h=e.activeSessionId;if(!h)return{sid:void 0,hasRunning:!1};const m=e.tasksBySession[h]??[];return{sid:h,hasRunning:m.some(f=>f.status==="running")}},({sid:h,hasRunning:m},f,g)=>{let _;m&&h!==void 0?a(h):h!==void 0?_=setTimeout(()=>{(e.tasksBySession[h]??[]).some(y=>y.status==="running")||c()},1500):c(),g(()=>{_!==void 0&&clearTimeout(_)})},{deep:!0,immediate:!0}),{taskClock:F(()=>u.value),loadTasksForSession:i}}const G3=Ct.starredModels;function Tde(){try{const e=bn(G3);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Ade(e){try{An(G3,JSON.stringify(e))}catch{}}function Mde(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=ne([]),d=ne(Tde()),h=ne({}),m=ne([]),f=ne(null);function g(V){if(!(V==null||V.length===0))return u.value.find(U=>U.id===V||U.model===V)}function _(){const V=e.activeSessionId?e.sessions.find(U=>U.id===e.activeSessionId):void 0;return g(V?.model??f.value??e.defaultModel)}function w(V){const U=U2(_(),V);return e.thinking=U,l(U),U}async function y(V){try{const ee=await at().listSkills(V);h.value={...h.value,[V]:ee}}catch{}}async function b(){try{const V=at();u.value=await V.listModels(),w(e.thinking)}catch(V){n("loadModels",V)}}async function v(){try{const V=await at().refreshOAuthProviderModels();for(const U of V.failed)n("refreshOAuthProviderModels",new Error(U.reason),{message:U.provider})}catch{}}async function x(){try{const V=at();m.value=await V.listProviders()}catch(V){n("loadProviders",V)}}async function L(V){const U=e.activeSessionId,ee=U2(g(V),e.thinking),K=e.thinking;if(!U){f.value=V,w(ee);return}const G=e.sessions.find(X=>X.id===U)?.model;a(U,X=>({...X,model:V})),ee!==K&&(e.thinking=ee,l(ee));try{await at().updateSession(U,{model:V,thinking:ee!==K?ee:void 0})}catch(X){a(U,ke=>({...ke,model:G??ke.model})),ee!==K&&(e.thinking=K,l(K)),n("setModel",X,{sessionId:U});return}await o(U)}function N(V){const U=new Set(d.value);U.has(V)?U.delete(V):U.add(V),d.value=Array.from(U),Ade(d.value)}async function k(V,U){const ee=e.activeSessionId;if(!ee)return;const K=i.value==="idle"&&!r.has(ee),G=`msg_skill_opt_${Date.now().toString(36)}`;if(K){r.add(ee),e.sendingBySession={...e.sendingBySession,[ee]:!0};const X={id:G,sessionId:ee,role:"user",content:[{type:"text",text:`/${V}${U?` ${U}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:V,skillArgs:U}}};c(ee,ke=>[...ke,X])}try{await at().activateSkill(ee,V,U)}catch(X){K&&(r.delete(ee),e.sendingBySession={...e.sendingBySession,[ee]:!1},c(ee,ke=>ke.filter(le=>le.id!==G))),n("activateSkill",X,{sessionId:ee})}}async function T(V){try{await at().addProvider(V),await Promise.all([x(),b()])}catch(U){n("addProvider",U)}}async function E(V){try{await at().deleteProvider(V),await Promise.all([x(),b()])}catch(U){n("deleteProvider",U)}}async function O(V){try{const U=await at().refreshProvider(V);for(const ee of U.failed)n("refreshProvider",new Error(ee.reason),{message:ee.provider});await Promise.all([x(),b()])}catch(U){n("refreshProvider",U)}}async function A(){try{const V=await at().refreshAllProviders();for(const U of V.failed)n("refreshAllProviders",new Error(U.reason),{message:U.provider});await Promise.all([x(),b()])}catch(V){n("refreshAllProviders",V)}}async function $(){try{return await at().startOAuthLogin()}catch{return null}}async function R(){try{return await at().pollOAuthLogin()}catch{return null}}async function D(){try{await at().cancelOAuthLogin()}catch{}}function W(V){const U=w(V);s({thinking:U})}return{models:u,starredModelIds:d,providers:m,draftModel:f,skillsBySession:h,loadSkillsForSession:y,loadModels:b,refreshOAuthProviderModels:v,loadProviders:x,setModel:L,toggleStarModel:N,activateSkill:k,addProvider:T,deleteProvider:E,refreshProvider:O,refreshAllProviders:A,startOAuthLogin:$,pollOAuthLogin:R,cancelOAuthLogin:D,setThinking:W}}const Y3="kimiWeb.compaction",Ede=/^read[_-]?media(?:file)?$/i,Ide=/^agent$/i,$de=/^data:([^;]+);base64,(.*)$/s,Nde=/^<(image|video|audio)\s+path="([^"]+)">$/,Lde=/Mime type:\s*([^.\s]+)/i,Pde=/Size:\s*(\d+)\s*bytes/i,Ode=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Rde(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 Dde(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 Bde(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const s=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof s!="object"||s===null)return null;const i=s.url;return typeof i=="string"?{kind:n,url:i}:null}function Fde(e,t){if(!Ede.test(e))return;const n=Dde(t);if(n===null)return;let o,s,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const m=d.text,f=Nde.exec(m);f&&(s=f[1],o=f[2]);const g=Lde.exec(m);g?.[1]&&(i=g[1]);const _=Pde.exec(m);_?.[1]&&(r=Number(_[1]));const w=Ode.exec(m);w?.[1]&&w[2]&&(l=`${w[1]}x${w[2]}`);continue}const h=Bde(d);h&&(a=h)}if(a===null)return;const c=$de.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Rde(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function X3(e){if(e!=null){if(typeof e=="string")return e.split(`
|
|
266
|
-
`);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
|
|
267
|
-
`));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
|
|
268
|
-
`)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
|
|
269
|
-
`)):o.type==="image_url"||o.type==="image"?t.push("[image]"):typeof o.type=="string"?t.push(`[${o.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Hde(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 Wde(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 Ude(e,t,n,o){const s=Wde(t),i=n?n.isError?"failed":"completed":o?"working":"completed",r=n?X3(n.output):void 0;return{id:e,toolCallId:e,name:s.description&&s.description.length>0?s.description:"Sub Agent",subagentType:s.subagentType,prompt:s.prompt,phase:i,status:n?n.isError?"failed":"completed":o?"running":"completed",summary:r&&r.length>0?r.join(`
|
|
270
|
-
`):void 0}}function jde(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,o=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==o?n-o:e.createdAt.localeCompare(t.createdAt)}function qde(e,t){const n=e.split(`
|
|
271
|
-
`),o=t.split(`
|
|
272
|
-
`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function zde(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:qde(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command")return{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0};if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Vde(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function Kde(e){return e.metadata?.origin?.kind==="compaction_summary"}function Gde(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function Yde(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 Q3(e,t,n,o=!0,s=[],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 s){if(g.kind!=="subagent")continue;const _=[g.parentToolCallId,g.id].filter(w=>typeof w=="string"&&w.length>0);for(const w of _){const y=c.get(w)??[];y.push(g),c.set(w,y)}}for(const[g,_]of c.entries())c.set(g,_.toSorted(jde));const u=new Map;for(const g of e)for(const _ of g.content)_.type==="toolResult"&&u.set(_.toolCallId,{output:_.output,isError:!!_.isError});let d=null;function h(g=!1){if(!d)return;const _=d;if(d=null,!g||!o)for(let w=0;w<_.tools.length;w++){const y=_.tools[w];if(y.status!=="running")continue;const b={...y,status:"ok"};_.tools[w]=b;const v=_.blocks.find(x=>x.kind==="tool"&&x.tool.id===b.id);v&&v.kind==="tool"&&(v.tool=b)}r.push({id:_.id,role:"assistant",no:l++,text:_.textParts.join(`
|
|
273
|
-
`),thinking:_.thinkingParts.length>0?_.thinkingParts.join(`
|
|
274
|
-
`):void 0,tools:_.tools.length>0?_.tools:void 0,blocks:_.blocks.length>0?_.blocks:void 0,approval:_.approval,approvalId:_.approvalId,durationMs:_.durationMs})}function m(g,_){for(const w of _)if(w.type==="text"){if(w.text){g.textParts.push(w.text);const y=g.blocks.at(-1);y&&y.kind==="text"?y.text+=`
|
|
275
|
-
`+w.text:g.blocks.push({kind:"text",text:w.text})}}else if(w.type==="thinking"){if(w.thinking){g.thinkingParts.push(w.thinking);const y=g.blocks.at(-1);y&&y.kind==="thinking"?y.thinking+=`
|
|
276
|
-
`+w.thinking:g.blocks.push({kind:"thinking",thinking:w.thinking})}}else if(w.type==="toolUse"){const y=c.get(w.toolCallId);if(y&&y.length>0){if(y.filter(N=>N.swarmIndex!==void 0).length>1)continue;const L=y.map(Hde);L.length===1?g.blocks.push({kind:"agent",member:L[0]}):g.blocks.push({kind:"agentGroup",members:L});continue}if(Ide.test(w.toolName)){const x=Ude(w.toolCallId,w.input,u.get(w.toolCallId),o);g.blocks.push({kind:"agent",member:x});continue}const b=a.get(w.toolCallId),v={id:w.toolCallId,name:w.toolName,arg:typeof w.input=="string"?w.input:JSON.stringify(w.input),status:"running",output:w.outputLines,planPath:w.toolName==="ExitPlanMode"?i[w.toolCallId]?.path:void 0};g.tools.push(v),g.blocks.push({kind:"tool",tool:v}),b&&(g.approval=zde(b),g.approvalId=b.approvalId)}else if(w.type==="toolResult"){const y=g.tools.findIndex(b=>b.id===w.toolCallId);if(y!==-1){const b=g.tools[y],v={...b,status:w.isError?"error":"ok",output:X3(w.output),media:w.isError?void 0:Fde(b.name,w.output)};v.name==="ExitPlanMode"&&!v.planPath&&(v.planPath=Yde(v.output)),g.tools[y]=v;const x=g.blocks.find(L=>L.kind==="tool"&&L.tool.id===w.toolCallId);x&&x.kind==="tool"&&(x.tool=v)}}}function f(g){if(g.type==="image"||g.type==="video"){const _=g.type,w=g.source;if(w.kind==="url")return{url:w.url,kind:_};if(w.kind==="base64")return{url:`data:${w.mediaType};base64,${w.data}`,kind:_};if(w.kind==="file"&&n)return{url:n(w.fileId),kind:_}}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(Kde(g)){h();const v=g.metadata?.[Y3];r.push({id:g.id,role:"compaction",no:l,text:g.content.filter(x=>x.type==="text").map(x=>x.text).join(`
|
|
277
|
-
`),compaction:{trigger:v?.trigger,tokensBefore:v?.tokensBefore,tokensAfter:v?.tokensAfter}});continue}if(g.role==="user"){if(h(),!Vde(g))continue;const v=g.metadata?.origin,x=v?.kind==="skill_activation"&&v?.trigger==="user-slash",L=v?.kind==="plugin_command"&&v?.trigger==="user-slash",N=[],k=[];for(const T of g.content){T.type==="text"&&(x?N.push(v.skillArgs??""):L?N.push(v.commandArgs??""):N.push(T.text));const E=f(T);E&&k.push({url:E.url,kind:E.kind,alt:T.type==="file"?T.name:void 0})}r.push({id:g.id,role:"user",no:l++,text:N.join(`
|
|
278
|
-
`),images:k.length>0?k:void 0,skillActivation:x?{name:v.skillName,args:v.skillArgs}:void 0,pluginCommand:L?{pluginId:v.pluginId,commandName:v.commandName,args:v.commandArgs}:void 0,createdAt:g.createdAt});continue}if(g.role==="tool"){d&&m(d,g.content);continue}const _=g.promptId;Gde(d,_)?d!==null&&d.promptId===void 0&&_!==void 0&&(d.promptId=_):(h(),d={id:g.id,promptId:_,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),m(y,g.content))}return h(!0),r}function Xde(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i}=t,r=ne({}),l=F(()=>{const N=e.activeSessionId;if(!N)return null;const k=r.value[N];return k?{parentId:N,agentId:k.agentId}:null}),a=F(()=>l.value?.parentId??null),c=F(()=>l.value!==null),u=F(()=>{const N=l.value;return N?!!e.sideChatSendingByAgent[N.agentId]:!1}),d=F(()=>{const N=l.value;return N?e.sideChatSendingByAgent[N.agentId]?!0:(e.tasksBySession[N.parentId]??[]).some(k=>k.id===N.agentId&&k.status==="running"):!1}),h=F(()=>{const N=l.value;if(!N)return[];const k=e.sideChatMessagesByAgent[N.agentId]??[];return Q3(k,[],T=>at().getFileUrl(T),d.value,[])});function m(N,k){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[N]:k(e.sideChatMessagesByAgent[N]??[])}}function f(N,k){m(N,T=>[...T,k])}function g(N){m(N,k=>{const T=[...k].reverse().findIndex(O=>O.role==="user");if(T===-1)return k;const E=k.length-1-T;return k.filter((O,A)=>A!==E)})}function _(N,k){m(N,T=>{const E=[...T];for(let O=E.length-1;O>=0;O-=1){const A=E[O];if(A.role==="user")return E[O]={...A,promptId:A.promptId??k},E}return T})}function w(N,k,T){T&&m(N,E=>{const O=E.at(-1);if(O?.role==="assistant"){const A=O.content[0],$=A?.type==="text"?A.text:"";return[...E.slice(0,-1),{...O,content:[{type:"text",text:`${$}${T}`}]}]}return[...E,{id:o(),sessionId:k,role:"assistant",content:[{type:"text",text:T}],createdAt:new Date().toISOString()}]})}function y(N,k,T){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[N]:!1},!T)return;const O=(e.sideChatMessagesByAgent[N]??[]).at(-1);(O?.role==="assistant"&&O.content[0]?.type==="text"?O.content[0].text:"").trim().length>0||w(N,k,T)}async function b(N){const k=e.activeSessionId;if(k){if(!r.value[k]){let T;try{({agentId:T}=await at().startBtw(k))}catch(E){n("openSideChat",E,{sessionId:k});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[T]:e.sideChatMessagesByAgent[T]??[]},r.value={...r.value,[k]:{agentId:T}},s(),i()?.markSideChannelAgent(T)}N&&N.trim()&&await x(N.trim())}}function v(){const N=e.activeSessionId;if(!N)return;const{[N]:k,...T}=r.value;r.value=T}async function x(N){const k=l.value,T=N.trim();if(!k||!T)return;const E=k.parentId,O=k.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[O]:!0};const A={id:o(),sessionId:E,role:"user",content:[{type:"text",text:T}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};f(O,A);try{const $=await at().submitPrompt(E,{content:[{type:"text",text:T}],agentId:O});_(O,$.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[E]:[...e.sideChatUserMessageIdsBySession[E]??[],$.userMessageId]}}catch($){n("sendSideChatPrompt",$,{sessionId:E}),g(O),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[O]:!1}}}function L(N){if(!r.value[N])return;const{[N]:k,...T}=r.value;r.value=T}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:h,appendSideChatAssistantText:w,finishSideChatAgent:y,openSideChat:b,closeSideChat:v,sendSideChatPrompt:x,clearSideChatForSession:L}}function Qde(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 Zde(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
|
|
279
|
-
`)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&Qde(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),o=Number.parseInt(a[2],10)),s=!0,t.push({type:"hunk",text:i});continue}if(!s||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:o}),o+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:o}),n+=1,o+=1)}return t}const J1="/sessions/";function wC(e){const{pathname:t}=e;if(!t.startsWith(J1))return;const n=t.slice(J1.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function Jde(e){return e===void 0||e.length===0?"/":`${J1}${encodeURIComponent(e)}`}const efe=50,tfe=40402,nfe=40410;function ofe(e,t){const{taskPoller:n,sideChat:o,modelProvider:s,pushOperationFailure:i,activity:r,inFlightPromptSessions:l,sessionsKnownEmpty:a,setSessions:c,updateSession:u,upsertSessionFront:d,appendSession:h,forgetSession:m,setActiveSessionId:f,updateSessionMessages:g,nextOptimisticMsgId:_,getEventConn:w,syncSessionFromSnapshot:y,subscribeToSessionEvents:b,hasLoadedMessages:v,refreshSessionStatus:x,persistSessionProfile:L,mergedWorkspaces:N,workspacesView:k,status:T,workspaceIdForSession:E,savePermissionToStorage:O,savePlanModeToStorage:A,saveSwarmModeToStorage:$,saveGoalModeToStorage:R,saveUnread:D,saveActiveWorkspaceToStorage:W,saveHiddenWorkspacesToStorage:V,goalErrorMessage:U,resetFastMoon:ee,initialized:K,selectedDiffPath:G,fileDiffLines:X,fileDiffLoading:ke}=t;async function le(de){if(e.messagesLoadingMoreBySession[de])return;const Te=e.messagesBySession[de];if(!Te||Te.length===0)return;const Ee=Te[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[de]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[de]:!1};try{const Ae=await at().listMessages(de,{beforeId:Ee,pageSize:efe}),J=[...Ae.items].reverse();g(de,he=>[...J,...he]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[de]:Ae.hasMore}}catch(Ae){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[de]:!0},i("loadOlderMessages",Ae,{sessionId:de})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[de]:!1}}}function He(de){n.loadTasksForSession(de),Pe(de),x(de),Object.prototype.hasOwnProperty.call(s.skillsBySession.value,de)||s.loadSkillsForSession(de)}async function ue(de){const Te=e.activeSessionId;if(Te){G.value=de,X.value=[],ke.value=!0;try{const Ae=await at().getFileDiff(Te,de);if(G.value!==de)return;X.value=Zde(Ae.diff)}catch(Ee){G.value===de&&(X.value=[]),console.warn("[loadFileDiff] diff unavailable for",de,Ee)}finally{G.value===de&&(ke.value=!1)}}}function ve(){G.value=null,X.value=[],ke.value=!1}async function Pe(de){try{const Ee=await at().getGitStatus(de);e.gitStatusBySession={...e.gitStatusBySession,[de]:Ee}}catch{}}async function Re(){try{const Te=await at().getAuth();e.authReady=Te.ready,e.defaultModel=Te.defaultModel,e.managedProviderStatus=Te.managedProvider?.status??null}catch{}}async function Q(){try{const de=at();e.config=await de.getConfig()}catch{}}async function ce(de){try{const Ee=await at().setConfig(de);return e.config=Ee,e.defaultModel=Ee.defaultModel??null,!0}catch(Te){return i("setConfig",Te),!1}}const Ce=100,q=5,te=30;async function pe(){const de=at(),Te=[];let Ee;for(;;){const Ae=await de.listSessions({pageSize:Ce,beforeId:Ee,excludeEmpty:!0});if(Te.push(...Ae.items),!Ae.hasMore||Ae.items.length===0)break;Ee=Ae.items[Ae.items.length-1].id}return Te}async function oe(){const de=at(),Te=e.workspaces;if(Te.length===0){const yt=await pe().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsFullyLoaded=!0,yt}const Ee=await Promise.all(Te.map(yt=>de.listSessions({workspaceId:yt.id,pageSize:q,excludeEmpty:!0}).then(Lt=>({workspaceId:yt.id,page:Lt})).catch(()=>({workspaceId:yt.id,page:{items:[],hasMore:!1}})))),Ae=[],J={},he={};for(const{workspaceId:yt,page:Lt}of Ee)Ae.push(...Lt.items),J[yt]=Lt.hasMore,he[yt]=Lt.items.length>0?Lt.items[Lt.items.length-1].id:void 0;return e.sessionsHasMoreByWorkspace=J,e.sessionsCursorByWorkspace=he,e.sessionsFullyLoaded=!1,Ae.sort((yt,Lt)=>new Date(Lt.updatedAt).getTime()-new Date(yt.updatedAt).getTime()),Ae}async function fe(de){if(e.sessionsLoadingMoreByWorkspace[de]||e.sessionsHasMoreByWorkspace[de]===!1)return;const Te=e.sessionsCursorByWorkspace[de];if(Te!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[de]:!0};try{const Ee=await at().listSessions({workspaceId:de,pageSize:te,beforeId:Te,excludeEmpty:!0}),Ae=new Set(e.sessions.map(he=>he.id)),J=Ee.items.filter(he=>!Ae.has(he.id));J.length>0&&c([...e.sessions,...J]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[de]:Ee.items.length>0?Ee.items[Ee.items.length-1].id:Te},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[de]:Ee.hasMore}}catch(Ee){i("loadMoreSessions",Ee)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[de]:!1}}}}async function H(){if(e.sessionsFullyLoaded)return;const de=await pe().catch(()=>null);if(de===null)return;c(de),e.sessionsFullyLoaded=!0;const Te={};for(const Ee of e.workspaces)Te[Ee.id]=!1;e.sessionsHasMoreByWorkspace=Te}async function Y(){e.loading=!0;try{const de=at();await Promise.all([de.getHealth().catch(()=>null),de.getMeta().then(yt=>{e.serverVersion=yt.serverVersion,e.availableOpenInApps=yt.openInApps}).catch(()=>null),s.loadModels()]),await Re(),await Q(),await re();const Te=await oe();c(Te);const Ee=Te[0],Ae=e.activeWorkspaceId;!(Ae!==null&&N.value.some(yt=>yt.id===Ae))&&Ee&&xe(E(Ee)),Nt();const he=typeof window<"u"?wC(window.location):void 0;!e.activeSessionId&&he!==void 0&&(e.sessions.some(Lt=>Lt.id===he)||await Rt(he))&&await Ft(he,{urlMode:"replace"}),!e.activeSessionId&&Te.length>0&&await Ft(Te[0].id,{urlMode:"replace"})}catch(de){i("load",de)}finally{e.loading=!1,K.value=!0}}async function re(){try{const de=at(),[Te,Ee]=await Promise.all([de.listWorkspaces().catch(()=>[]),de.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=ge(Te),e.fsHome=Ee.home||null,e.recentRoots=Ee.recentRoots}catch{}}function ge(de){const Te=yd();return Object.keys(Te).length===0?de:de.map(Ee=>{const Ae=Te[Ee.root];return Ae!==void 0?{...Ee,name:Ae}:Ee})}function xe(de){e.activeWorkspaceId=de,W(de)}function Ne(de){xe(de);const Te=e.sessions.filter(Ee=>E(Ee)===de);if(Te.length>0){const Ee=Te[0];Ee&&Ee.id!==e.activeSessionId&&Ft(Ee.id)}else f(void 0),lt(void 0,"push")}function ie(de){const Te=yd()[de.root],Ee=Te!==void 0?{...de,name:Te}:de;e.hiddenWorkspaceRoots.includes(Ee.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(he=>he!==Ee.root),V(e.hiddenWorkspaceRoots));const Ae=e.workspaces.findIndex(he=>he.id===Ee.id||he.root===Ee.root);if(Ae===-1){e.workspaces=[Ee,...e.workspaces];return}const J=[...e.workspaces];J[Ae]=Ee,e.workspaces=J}function ae(de){if(de.type==="workspaceCreated"||de.type==="workspaceUpdated"){ie(de.workspace);return}const Te=e.workspaces.find(Ae=>Ae.id===de.workspaceId)?.root??de.root;if(Te&&!e.hiddenWorkspaceRoots.includes(Te)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Te],V(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Ae=>Ae.id!==de.workspaceId&&Ae.root!==Te),e.activeWorkspaceId===de.workspaceId||e.activeWorkspaceId===Te){const Ae=k.value[0]?.id??null;if(e.activeWorkspaceId=Ae,Ae)W(Ae);else try{ru(Ct.activeWorkspace)}catch{}f(void 0),e.sessionLoading=!1,ve(),lt(void 0,"replace")}}function we(){f(void 0),lt(void 0,"push")}function je(de){xe(de),we(),ve()}async function nt(de,Te,Ee){const Ae=N.value.find(J=>J.id===de);if(Ae)try{const J=at();let he,yt=Ae.root;try{const hn=await J.addWorkspace({root:Ae.root});he=hn.id,yt=hn.root,ie(hn)}catch{}const Lt=s.draftModel.value??void 0,to=await J.createSession({workspaceId:he,cwd:yt,model:Lt});s.draftModel.value=null;const Ws=Lt!==void 0&&(!to.model||to.model.length===0)?{...to,model:Lt}:to;d(Ws),xe(to.workspaceId??he??de),await Ft(to.id),await qn(to.id,Te,Ee)}catch(J){i("startSessionAndSendPrompt",J)}}async function ct(de){const Te=de.trim();if(!Te)return!1;const Ee=at();try{const Ae=await Ee.addWorkspace({root:Te});return ie(Ae),je(Ae.id),!0}catch{return!1}}async function _t(de){try{return await at().browseFs(de)}catch{return{path:"",parent:null,entries:[]}}}async function $t(){try{return await at().getFsHome()}catch{return{home:"",recentRoots:[]}}}function lt(de,Te){if(Te==="none"||typeof window>"u"||!window.history)return;const Ee=Jde(de);if(window.location.pathname!==Ee)try{Te==="push"?window.history.pushState(null,"",Ee):window.history.replaceState(null,"",Ee)}catch{}}async function Rt(de){try{const Te=await at().getSession(de);return e.sessions.some(Ee=>Ee.id===Te.id)||h(Te),!0}catch{return!1}}function fn(){const de=wC(window.location);if(de===void 0){f(void 0);return}if(de!==e.activeSessionId){if(e.sessions.some(Te=>Te.id===de)){Ft(de,{urlMode:"none"});return}(async()=>{if(await Rt(de)){await Ft(de,{urlMode:"none"});return}const Te=e.sessions[0];Te?await Ft(Te.id,{urlMode:"replace"}):(f(void 0),lt(void 0,"replace"))})()}}let Mn=!1;function Nt(){Mn||typeof window>"u"||(Mn=!0,window.addEventListener("popstate",fn))}async function Ft(de,Te){const Ee=v(de),Ae=!Ee&&a.has(de);a.delete(de);try{lt(de,Te?.urlMode??"push"),e.sessionLoading=!Ee&&!Ae,f(de),ee(),e.unreadBySession[de]&&(e.unreadBySession={...e.unreadBySession,[de]:!1},D({[de]:!1})),ve();const J=e.sessions.find(he=>he.id===de);if(J){const he=E(J);e.activeWorkspaceId!==he&&xe(he)}if(Ee)b(de);else if(await y(de)==="not-found")return;He(de)}catch(J){i("selectSession",J,{sessionId:de})}finally{e.activeSessionId===de&&(e.sessionLoading=!1)}}async function qn(de,Te,Ee){l.add(de),e.sendingBySession={...e.sendingBySession,[de]:!0};const Ae=_();try{const J=at(),he=[];Te&&he.push({type:"text",text:Te});for(const hn of Ee??[])hn.kind==="video"?he.push({type:"video",source:{kind:"file",fileId:hn.fileId}}):he.push({type:"image",source:{kind:"file",fileId:hn.fileId}});if(he.length===0)return l.delete(de),e.sendingBySession={...e.sendingBySession,[de]:!1},!1;const yt={id:Ae,sessionId:de,role:"user",content:he,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};g(de,hn=>[...hn,yt]);const Lt=e.sessions.find(hn=>hn.id===de),to=(Lt?.model&&Lt.model.length>0?Lt.model:e.defaultModel)??void 0;if(e.goalMode&&Te)try{await J.updateSession(de,{goalObjective:Te.trim()})}catch(hn){return i("createGoal",hn,{sessionId:de}),l.delete(de),e.sendingBySession={...e.sendingBySession,[de]:!1},g(de,Pt=>Pt.some(pn=>pn.id===Ae)?Pt.filter(pn=>pn.id!==Ae):Pt),!1}const Ws=await J.submitPrompt(de,{content:he,model:to,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});return e.goalMode&&(e.goalMode=!1,R(!1)),e.promptIdBySession={...e.promptIdBySession,[de]:Ws.promptId},g(de,hn=>{const Pt=hn.findIndex(vi=>vi.id===Ae);if(Pt===-1)return hn;const pn=[...hn];return pn[Pt]={...pn[Pt],promptId:pn[Pt].promptId??Ws.promptId},pn}),w()?.bindNextPromptId(de,Ws.promptId),!0}catch(J){return l.delete(de),e.sendingBySession={...e.sendingBySession,[de]:!1},g(de,he=>he.some(yt=>yt.id===Ae)?he.filter(yt=>yt.id!==Ae):he),i("sendPrompt",J,{sessionId:de}),!1}}async function Je(de,Te){const Ee=e.activeSessionId;if(Ee){if(r.value!=="idle"||l.has(Ee)){Ro(de,Te);return}await qn(Ee,de,Te)}}async function Qn(de,Te){const Ee=e.activeSessionId;if(!Ee)return;const Ae=e.queuedBySession[Ee]??[],J=[],he=[];for(const Pt of Ae){const pn=Pt.text.trim();pn&&J.push(pn),Pt.attachments?.length&&he.push(...Pt.attachments)}const yt=de.trim();if(yt&&J.push(yt),Te?.length&&he.push(...Te),J.length===0&&he.length===0)return;Ae.length>0&&(e.queuedBySession={...e.queuedBySession,[Ee]:[]});const Lt=J.join(`
|
|
280
|
-
|
|
281
|
-
`);if(r.value==="idle"&&!l.has(Ee)){await qn(Ee,Lt,he);return}const to=[];Lt&&to.push({type:"text",text:Lt});for(const Pt of he)Pt.kind==="video"?to.push({type:"video",source:{kind:"file",fileId:Pt.fileId}}):to.push({type:"image",source:{kind:"file",fileId:Pt.fileId}});const Ws=_(),hn={id:Ws,sessionId:Ee,role:"user",content:to,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};g(Ee,Pt=>[...Pt,hn]);try{const Pt=at(),pn=e.sessions.find(ws=>ws.id===Ee),vi=(pn?.model&&pn.model.length>0?pn.model:e.defaultModel)??void 0,Us=await Pt.submitPrompt(Ee,{content:to,model:vi,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});if(g(Ee,ws=>{const Ml=ws.findIndex(pp=>pp.id===Ws);if(Ml===-1)return ws;const El=[...ws];return El[Ml]={...El[Ml],promptId:El[Ml].promptId??Us.promptId},El}),Us.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Ee]:Us.promptId},w()?.bindNextPromptId(Ee,Us.promptId);return}try{await Pt.steerPrompts(Ee,[Us.promptId])}catch{}}catch(Pt){g(Ee,pn=>pn.filter(vi=>vi.id!==Ws)),i("steer",Pt,{sessionId:Ee})}}async function es(de,Te){try{const Ae=await at().uploadFile({file:de,name:Te});return{fileId:Ae.id,name:Ae.name,mediaType:Ae.mediaType}}catch(Ee){return i("uploadImage",Ee),null}}function Ro(de,Te){const Ee=e.activeSessionId;if(!Ee)return;const Ae=e.queuedBySession[Ee]??[];e.queuedBySession={...e.queuedBySession,[Ee]:[...Ae,{text:de,attachments:Te}]}}async function po(){const de=e.activeSessionId;if(!de)return;const Te=e.sessions.find(J=>J.id===de);let Ee=e.promptIdBySession[de];if(Ee===void 0){const J=Te?.currentPromptId;J?.startsWith("prompt_")&&(Ee=J)}const Ae=at();if(Ee!==void 0)try{if((await Ae.abortPrompt(de,Ee)).aborted)return;const he={...e.promptIdBySession};delete he[de],e.promptIdBySession=he}catch(J){if(Pa(J)&&J.code===tfe){const he={...e.promptIdBySession};delete he[de],e.promptIdBySession=he}else{i("abortCurrentPrompt",J,{sessionId:de});return}}try{await Ae.abortSession(de)}catch(J){i("abortCurrentPrompt",J,{sessionId:de})}}async function Pn(de,Te){const Ee=e.activeSessionId;if(Ee)try{const Ae=at(),J={decision:Te.decision,scope:Te.scope,feedback:Te.feedback,selectedLabel:Te.selectedLabel};await Ae.respondApproval(Ee,de,J);const he=e.approvalsBySession[Ee]??[];e.approvalsBySession={...e.approvalsBySession,[Ee]:he.filter(yt=>yt.approvalId!==de)}}catch(Ae){i("respondApproval",Ae,{sessionId:Ee})}}async function an(de,Te){const Ee=e.activeSessionId;if(Ee)try{await at().respondQuestion(Ee,de,Te);const J=e.questionsBySession[Ee]??[];e.questionsBySession={...e.questionsBySession,[Ee]:J.filter(he=>he.questionId!==de)}}catch(Ae){i("respondQuestion",Ae,{sessionId:Ee})}}async function wn(de){const Te=e.activeSessionId;if(Te)try{await at().dismissQuestion(Te,de);const Ae=e.questionsBySession[Te]??[];e.questionsBySession={...e.questionsBySession,[Te]:Ae.filter(J=>J.questionId!==de)}}catch(Ee){i("dismissQuestion",Ee,{sessionId:Te})}}async function On(de){const Te=e.activeSessionId;if(Te)try{await at().cancelTask(Te,de);const Ae=e.tasksBySession[Te]??[];e.tasksBySession={...e.tasksBySession,[Te]:Ae.map(J=>J.id===de?{...J,status:"cancelled"}:J)}}catch(Ee){i("cancelTask",Ee,{sessionId:Te})}}function zn(de){e.planMode=de,A(de),L({planMode:de})}function Zn(){zn(!e.planMode)}function Jn(de){e.swarmMode=de,$(de),L({swarmMode:de})}function Do(){const de=!e.swarmMode;de&&e.permission==="manual"&&!confirm("Enable swarm mode? The agent will run multiple sub agents in parallel.")||Jn(de)}function Bo(de){e.goalMode=de,R(de)}function At(){Bo(!e.goalMode)}async function Co(de){const Te=de.trim();if(!Te||e.permission==="manual"&&!confirm(`Start goal: "${Te}"? The agent will run autonomously toward this objective.`))return;const Ee=e.activeSessionId;if(Ee){try{await at().updateSession(Ee,{goalObjective:Te})}catch(Ae){i("createGoal",Ae,{sessionId:Ee,message:U(Ae)});return}await Je(Te)}}function cn(de){const Te=e.activeSessionId;Te&&Promise.resolve(at().updateSession(Te,{goalControl:de})).catch(Ee=>{i("controlGoal",Ee,{sessionId:Te,message:U(Ee)})})}function Fo(de){e.permission=de,O(de),L({permissionMode:de})}function So(de){const Te=[...e.warnings];Te.splice(de,1),e.warnings=Te}async function eo(de,Te){try{await at().updateSession(de,{title:Te}),u(de,Ae=>({...Ae,title:Te}))}catch(Ee){i("renameSession",Ee,{sessionId:de})}}async function Ye(de,Te){const Ee=e.workspaces.find(J=>J.id===de)?.root,Ae=()=>{e.workspaces=e.workspaces.map(J=>J.id===de?{...J,name:Te}:J)};try{if(await at().updateWorkspace(de,{name:Te}),Ee!==void 0){const J=yd();Ee in J&&(delete J[Ee],Mb(J))}Ae()}catch(J){if(Ee!==void 0&&Pa(J)&&J.code===nfe){Mb({...yd(),[Ee]:Te}),Ae();return}i("renameWorkspace",J)}}async function qe(de){const Te=e.workspaces.find(he=>he.id===de)?.root??N.value.find(he=>he.id===de)?.root??de,Ee=e.activeSessionId?e.sessions.find(he=>he.id===e.activeSessionId):void 0,Ae=e.activeWorkspaceId===de||e.activeWorkspaceId===Te,J=!!(Ee&&(Ee.cwd===Te||Ee.workspaceId===de||E(Ee)===de));Te&&!e.hiddenWorkspaceRoots.includes(Te)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Te],V(e.hiddenWorkspaceRoots));try{await at().deleteWorkspace(de)}catch{}if(e.workspaces=e.workspaces.filter(he=>he.id!==de&&he.root!==Te),Ae||J){const he=k.value[0]?.id??null;if(e.activeWorkspaceId=he,he)W(he);else try{ru(Ct.activeWorkspace)}catch{}}(Ae||J)&&(f(void 0),e.sessionLoading=!1,ve(),lt(void 0,"replace"))}async function tt(de){try{await at().archiveSession(de),m(de),o.clearSideChatForSession(de);const{[de]:Ee,...Ae}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Ae,e.activeSessionId===de){const J=e.sessions[0];J?await Ft(J.id,{urlMode:"replace"}):(f(void 0),lt(void 0,"replace"))}}catch(Te){i("archiveSession",Te,{sessionId:de})}}async function it(){try{await at().logout(),await Re(),await Y()}catch(de){i("logout",de)}}function Ie(de){const Te=e.activeSessionId;Te&&at().compactSession(Te,de).catch(Ee=>{i("compact",Ee,{sessionId:Te})})}async function be(de){const Te=de??e.activeSessionId;if(Te)try{const Ee=await at().forkSession(Te);d(Ee),await Ft(Ee.id)}catch(Ee){i("fork",Ee,{sessionId:Te})}}async function Fe(de=1){const Te=e.activeSessionId;if(!Te)return null;const Ee=(()=>{const Ae=e.messagesBySession[Te]??[];for(let J=Ae.length-1;J>=0;J--){const he=Ae[J];if(he.role==="user"&&!(he.metadata?.origin&&he.metadata.origin.kind!=="user"))return he.content.filter(yt=>yt.type==="text").map(yt=>yt.text).join(`
|
|
282
|
-
`)}return null})();try{return await at().undoSession(Te,de),await y(Te),Ee}catch(Ae){return i("undo",Ae,{sessionId:Te}),null}}function xt(de){const Te=e.activeSessionId;if(!Te)return;const Ee=e.queuedBySession[Te]??[];if(de<0||de>=Ee.length)return;const Ae=[...Ee];Ae.splice(de,1),e.queuedBySession={...e.queuedBySession,[Te]:Ae}}async function Tt(de){const Te=e.activeSessionId;if(!Te)return[];try{return(await at().listDirectory(Te,{path:de,includeGitStatus:!0})).items}catch{return[]}}async function mn(de){const Te=e.activeSessionId;if(!Te)return null;try{const Ae=await at().readFile(Te,{path:de});return{path:Ae.path,content:Ae.content,encoding:Ae.encoding,mime:Ae.mime,languageId:Ae.languageId,isBinary:Ae.isBinary,size:Ae.size,lineCount:Ae.lineCount}}catch{return null}}const gn=10485760;function bs(de){const Te=e.activeSessionId;return Te?at().getFileDownloadUrl(Te,de):null}async function ts(de,Te){const Ee=e.activeSessionId;if(!Ee)return!1;try{return await at().openFile(Ee,{path:de,line:Te}),!0}catch(Ae){return i("openFile",Ae,{sessionId:Ee}),!1}}async function Ki(de){const Te=e.activeSessionId;if(!Te)return;const Ee=T.value.cwd||".";try{await at().openInApp(Te,de,Ee)}catch(Ae){i("openInApp",Ae,{sessionId:Te})}}async function mi(de){const Te=e.activeSessionId;if(!Te)return!1;try{return await at().revealFile(Te,{path:de}),!0}catch(Ee){return i("revealFile",Ee,{sessionId:Te}),!1}}async function Vn(de){if(/^(https?:|data:|blob:)/i.test(de))return de;const Te=e.activeSessionId;if(!Te)return de;let Ee=de;if(Ee.startsWith("/")){const Ae=e.sessions.find(J=>J.id===Te)?.cwd;if(Ae&&(Ee===Ae||Ee.startsWith(Ae.endsWith("/")?Ae:`${Ae}/`))){if(Ee=Ee.slice(Ae.length).replace(/^\//,""),!Ee)return de}else return de}try{const J=await at().readFile(Te,{path:Ee,length:gn});return!J.isBinary||J.encoding!=="base64"||J.truncated?de:`data:${J.mime};base64,${J.content}`}catch{return de}}async function gi(de){const Te=e.activeSessionId;if(!Te)return[];try{return(await at().searchFiles(Te,{query:de,limit:20})).items.map(J=>({path:J.path,name:J.name}))}catch{return[]}}return{loadFileDiff:ue,clearFileDiff:ve,loadGitStatus:Pe,checkAuth:Re,loadConfig:Q,updateConfig:ce,listAllSessionsGlobal:pe,load:Y,loadWorkspaces:re,loadMoreSessions:fe,loadAllSessions:H,selectWorkspace:xe,openWorkspace:Ne,upsertWorkspacePreserveOrder:ie,applyWorkspaceEvent:ae,clearActiveSession:we,openWorkspaceDraft:je,startSessionAndSendPrompt:nt,addWorkspaceByPath:ct,browseFs:_t,getFsHome:$t,writeSessionUrl:lt,fetchSessionIntoList:Rt,onSessionRoutePopState:fn,bindSessionRoute:Nt,selectSession:Ft,submitPromptInternal:qn,sendPrompt:Je,steerPrompt:Qn,uploadImage:es,enqueue:Ro,unqueue:xt,abortCurrentPrompt:po,respondApproval:Pn,respondQuestion:an,dismissQuestion:wn,cancelTask:On,setPlanMode:zn,togglePlanMode:Zn,setSwarmMode:Jn,toggleSwarmMode:Do,setGoalMode:Bo,toggleGoalMode:At,createGoal:Co,controlGoal:cn,setPermission:Fo,dismissWarning:So,renameSession:eo,renameWorkspace:Ye,deleteWorkspace:qe,archiveSession:tt,logout:it,compact:Ie,forkSession:be,undo:Fe,listDir:Tt,readFileContent:mn,getFileDownloadUrl:bs,openWorkspaceFile:ts,openInApp:Ki,revealWorkspaceFile:mi,resolveImageUrl:Vn,searchFiles:gi,loadOlderMessages:le,refreshSessionSidecars:He}}const sfe="kimiWeb.optimisticUserMessage";function ife(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function rfe(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 lfe(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const o=e.lastSeqBySession[t]??0;n>o&&(e.lastSeqBySession[t]=n)}}function Ag(e){return e.role==="user"&&e.metadata?.[sfe]===!0}function afe(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function _C(e){let t="",n=0;for(const o of e.content)o.type==="text"?t+=o.text:(o.type==="image"||o.type==="file")&&(n+=1);return{text:t,media:n}}function cfe(e,t){const n=_C(e),o=_C(t);return n.text===o.text&&n.media===o.media}function ufe(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(Ag(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(Ag(s)&&afe(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(Ag(s)&&cfe(s,t))return o}return-1}function dfe(e,t,n){let o=!1;const s=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(o=!0,{...i,content:l}):i});return o?s:e}function ffe(e,t,n){const o=rfe(e);switch(lfe(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(i=>i.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?t.session:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(i=>i.id!==s),delete o.messagesBySession[s],delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionStatusChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const i=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,i=o.compactionBySession[s],{[s]:r,...l}=o.compactionBySession;if(o.compactionBySession=l,Object.prototype.hasOwnProperty.call(o.messagesBySession,s)){const a=o.messagesBySession[s]??[],c=`compaction_${s}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};o.messagesBySession[s]=[...a,{id:c,sessionId:s,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[Y3]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:s,...i}=o.compactionBySession;o.compactionBySession=i;break}case"messageCreated":{const s=t.message.sessionId,i=t.message.createdAt;o.sessions=o.sessions.map(a=>a.id===s&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=o.messagesBySession[s]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"){const a=ufe(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},o.messagesBySession[s]=c;break}}o.messagesBySession[s]=[...r,t.message]}break}case"messageUpdated":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=dfe(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const s=t.sessionId,i=o.approvalsBySession[s]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,i=t.approvalId,r=o.approvalsBySession[s]??[];o.approvalsBySession[s]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const s=t.sessionId,i=o.questionsBySession[s]??[];i.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,i=t.questionId,r=o.questionsBySession[s]??[];o.questionsBySession[s]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const s=t.sessionId,i=o.tasksBySession[s]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)o.tasksBySession[s]=[...i,t.task];else{const l=[...i];l[r]={...t.task,outputLines:i[r].outputLines},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId)return r;const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const s=t.sessionId;t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&(s._agentError||s._agentWarning)){const i=s._agentError?Sn.global.t("warnings.errorLabel"):Sn.global.t("warnings.noteLabel"),r=s.message??s.code??"agent error";o.warnings=[...o.warnings,`${i}: ${r}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function hfe(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function pfe(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type!=="toolUse"||xl(s.toolName)!=="todo")continue;let i=s.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:hfe(a.status)}]:[]})}}return[]}const mfe=["queued","working","suspended","completed","failed"];function gfe(e){return e.subagentPhase?e.subagentPhase:e.status==="completed"?"completed":e.status==="failed"?"failed":"working"}function vfe(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function yfe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const o=n.parentToolCallId??"swarm",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:gfe(n),summary:n.outputPreview,outputLines:n.outputLines,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=vfe();for(const r of s)i[r.phase]++;return{id:n,members:s,counts:i}}).filter(n=>n.members.length>1).toSorted((n,o)=>{const s=n.members.at(0)?.swarmIndex??0,i=o.members.at(0)?.swarmIndex??0;return s!==i?s-i:n.id.localeCompare(o.id)})}function kfe(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of mfe)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}const rs=ude(),ul=mde(),uh=_de(),Z3=Ct.permission,J3=Ct.activeWorkspace,eM=Ct.thinking,tM=Ct.planMode,nM=Ct.swarmMode,oM=Ct.goalMode,CC=40401,sM=Ct.onboarded,bfe=["off","low","medium","high","xhigh","max"];ru(Ct.codeFont);function wfe(){try{const e=bn(Z3);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function _fe(e){try{An(Z3,e)}catch{}}function Cfe(){try{const e=bn(eM);if(e&&bfe.includes(e))return e}catch{}return"high"}function Sfe(e){try{An(eM,e)}catch{}}function xfe(){try{return bn(tM)==="true"}catch{return!1}}function Tfe(e){try{An(tM,e?"true":"false")}catch{}}function Afe(){try{return bn(nM)==="true"}catch{return!1}}function Mfe(e){try{An(nM,e?"true":"false")}catch{}}function Efe(){try{return bn(oM)==="true"}catch{return!1}}function Ife(e){try{An(oM,e?"true":"false")}catch{}}function $fe(){try{return bn(J3)}catch{return null}}const iM=Ct.hiddenWorkspaces;function Nfe(){try{const e=bn(iM);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Lfe(e){try{An(iM,JSON.stringify(e))}catch{}}function Pfe(e){try{An(J3,e)}catch{}}function Ofe(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Se=ds({...ife(),connected:!1,serverVersion:"",workspaceName:"kimi-web",connection:"disconnected",permission:wfe(),thinking:Cfe(),planMode:xfe(),swarmMode:Afe(),goalMode:Efe(),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:$v(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:$fe(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Nfe(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsFullyLoaded:!1});function rM(e){Se.sessions=e}function ip(e,t){Se.sessions=Se.sessions.map(n=>n.id===e?t(n):n)}function Rfe(e){Se.sessions=[e,...Se.sessions.filter(t=>t.id!==e.id)]}function Dfe(e){Se.sessions=[...Se.sessions,e]}function Bfe(e){Se.sessions=Se.sessions.filter(t=>t.id!==e)}function lM(){const e=Se.activeSessionId;e&&Se.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Se.unreadBySession={...Se.unreadBySession,[e]:!1},Nv({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Ct.unread&&(Se.unreadBySession=$v(),lM())});typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&lM()});function P0(e){Se.activeSessionId=e}function Ffe(e){Se.messagesBySession=e}function Hfe(e,t){Se.messagesBySession={...Se.messagesBySession,[e]:t}}function aM(e,t){Se.messagesBySession={...Se.messagesBySession,[e]:t(Se.messagesBySession[e]??[])}}function Wfe(e){const{[e]:t,...n}=Se.messagesBySession;Se.messagesBySession=n}function cM(e){hi?.unsubscribe(e),yu.flush(),Bfe(e),Wfe(e),delete Se.approvalsBySession[e],delete Se.questionsBySession[e],delete Se.tasksBySession[e],delete Se.goalBySession[e],delete Se.gitStatusBySession[e],delete Se.lastSeqBySession[e],delete Se.compactionBySession[e],delete Se.messagesLoadingMoreBySession[e],delete Se.messagesHasMoreBySession[e],delete Se.messagesLoadMoreErrorBySession[e],delete ap[e],kM.delete(e),lp.delete(e),delete Se.queuedBySession[e],delete Se.promptIdBySession[e],delete Se.sendingBySession[e]}const uM=ne(null),dM=ne([]),fM=ne(!1),hM=ne(!1);async function rp(e){let t;try{t=await at().getSessionStatus(e)}catch{return}ip(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Se.swarmMode=t.swarmMode,Se.planMode=t.planMode}function pM(e){const t=Se.activeSessionId;t&&Promise.resolve(at().updateSession(t,e)).then(()=>rp(t)).catch(()=>{})}const mM=Ct.betaToc;function Ufe(){try{return bn(mM)==="true"}catch{return!1}}function jfe(e){try{An(mM,e?"true":"false")}catch{}}const gM=ne(Ufe());function qfe(e){gM.value=e,jfe(e)}function zfe(e){try{return bn(e)??""}catch{return""}}const vM=ne(zfe(sM)==="1");function Vfe(e){vM.value=e;try{An(sM,e?"1":"0")}catch{}}let hi=null,SC=0;function yM(){return SC+=1,`msg_opt_${Date.now().toString(36)}_${SC}`}const lp=new Set;function Kfe(e,t,n){const o={sessions:Se.sessions,activeSessionId:Se.activeSessionId,messagesBySession:Se.messagesBySession,approvalsBySession:Se.approvalsBySession,planReviewByToolCallId:Se.planReviewByToolCallId,questionsBySession:Se.questionsBySession,tasksBySession:Se.tasksBySession,goalBySession:Se.goalBySession,lastSeqBySession:Se.lastSeqBySession,compactionBySession:Se.compactionBySession,config:Se.config,warnings:Se.warnings},s=ffe(o,e,{sessionId:t,seq:n});rM(s.sessions),P0(s.activeSessionId),Ffe(s.messagesBySession),Se.approvalsBySession=s.approvalsBySession,Se.planReviewByToolCallId=s.planReviewByToolCallId,Se.questionsBySession=s.questionsBySession,Se.tasksBySession=s.tasksBySession,Se.goalBySession=s.goalBySession,Se.lastSeqBySession=s.lastSeqBySession,Se.compactionBySession=s.compactionBySession,Se.config=s.config??null,Se.warnings=s.warnings,e.type==="configChanged"&&(Se.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(_n.loadModels(),_n.loadProviders()),e.type==="sessionUsageUpdated"&&e.sessionId===Se.activeSessionId&&e.swarmMode!==void 0&&(Se.swarmMode=e.swarmMode),e.type==="sessionUsageUpdated"&&e.sessionId===Se.activeSessionId&&e.planMode!==void 0&&(Se.planMode=e.planMode)}function Gfe(e,t){Kfe(e,t.sessionId,t.seq);const n=vo.sideChatTargetBySession.value[t.sessionId];if(n){const{agentId:o}=n,s=t.sessionId;e.type==="agentDelta"&&e.agentId===o?e.delta.text&&vo.appendSideChatAssistantText(o,s,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===o?vo.finishSideChatAgent(o,s):e.type==="taskProgress"&&e.taskId===o?vo.appendSideChatAssistantText(o,s,e.outputChunk):e.type==="taskCompleted"&&e.taskId===o&&vo.finishSideChatAgent(o,s,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const o=e.message.sessionId;Se.promptIdBySession[o]!==e.message.promptId&&(Se.promptIdBySession={...Se.promptIdBySession,[o]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Se.activeSessionId&&rs.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&ipe(e.sessionId,e.status),e.type==="questionRequested"&&rpe(e.sessionId,e.question)}const yu=Uue(({appEvent:e,meta:t})=>Gfe(e,t),({appEvent:e})=>Hue(e));function O0(){if(hi!==null||typeof WebSocket>"u")return;Se.connection="connecting",hi=at().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ft.applyWorkspaceEvent(t);return}yu({appEvent:t,meta:n})},onResync(t,n,o){yu.flush(),o!==void 0&&(ap[t]=o),she.request(t)},onError(t,n,o){R0({severity:"error",title:Sn.global.t("warnings.wsTitle"),message:n,details:[oo("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){Se.connected=t,Se.connection=t?"connected":"disconnected"}})}const ap={},kM=new Set;function Yfe(e){return Pa(e)&&e.code===CC?!0:typeof e=="object"&&e!==null&&e.code===CC}function oo(e,t){if(!(t==null||t===""))return{label:Sn.global.t(`warnings.details.${e}`),value:bM(t)}}function bM(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 Xfe(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Qfe(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Zfe(e,t,n){const o=[oo("operation",e),oo("sessionId",n)];return P3(t)?o.push(oo("request",`${t.method} ${t.path}`),oo("endpoint",t.url),oo("requestId",t.requestId),oo("phase",t.phase),oo("timeout",`${t.timeoutMs}ms`),oo("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),oo("contentType",t.contentType),oo("responsePreview",t.bodyPreview),oo("cause",t.cause)):Pa(t)?o.push(oo("code",t.code),oo("requestId",t.requestId),oo("message",t.message),oo("details",t.details)):o.push(oo("errorName",Xfe(t)),oo("message",Qfe(t)??bM(t))),o.filter(s=>s!==void 0)}function Jfe(e,t,n={}){const o=P3(t),s=Pa(t),i=n.title??(o?Sn.global.t("warnings.daemonNetworkTitle"):s?Sn.global.t("warnings.daemonApiTitle"):Sn.global.t("warnings.operationFailedTitle")),r=n.message??(o?Sn.global.t("warnings.daemonNetworkMessage"):s?t.message:Sn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:Zfe(e,t,n.sessionId)}}function R0(e){Se.warnings=[...Se.warnings,e]}function cp(e,t,n){R0(Jfe(e,t,n))}const ehe={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function the(e){if(!Pa(e))return;const t=ehe[e.code];return t?Sn.global.t(t):void 0}async function nhe(e){if(cM(e),Se.activeSessionId!==e)return;const t=Se.sessions[0];t?await ft.selectSession(t.id,{urlMode:"replace"}):(P0(void 0),Se.sessionLoading=!1,ft.writeSessionUrl(void 0,"replace"))}const xC=new Set;async function ohe(e){if(!xC.has(e)){xC.add(e);try{const t=await at().getSessionWarnings(e),n=Sn.global.t("warnings.noteLabel");for(const o of t)R0(`${n}: ${o.message}`)}catch{}}}async function wM(e){try{const n=await at().getSessionSnapshot(e);yu.flush(),ip(e,o=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:o.model})),Hfe(e,n.messages),Se.messagesHasMoreBySession={...Se.messagesHasMoreBySession,[e]:n.hasMoreMessages},Se.approvalsBySession={...Se.approvalsBySession,[e]:n.pendingApprovals};for(const o of n.pendingApprovals){const s=o.display;s?.kind==="plan_review"&&typeof s.plan=="string"&&s.plan.length>0&&(Se.planReviewByToolCallId={...Se.planReviewByToolCallId,[o.toolCallId]:{plan:s.plan,path:typeof s.path=="string"?s.path:void 0}})}return Se.questionsBySession={...Se.questionsBySession,[e]:n.pendingQuestions},Se.lastSeqBySession={...Se.lastSeqBySession,[e]:n.asOfSeq},ap[e]=n.epoch,O0(),hi&&(hi.seedSnapshot(e,n),hi.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch})),ohe(e),"ok"}catch(t){return Yfe(t)?(await nhe(e),"not-found"):(cp("getSessionSnapshot",t,{title:Sn.global.t("warnings.sessionSnapshotTitle"),message:Sn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const she=Bue(wM);function ihe(e){return Object.prototype.hasOwnProperty.call(Se.messagesBySession,e)}function rhe(e){if(O0(),hi){yu.flush();const t=Se.lastSeqBySession[e]??0,n=ap[e];hi.subscribe(e,{seq:t,epoch:n})}}function up(e){const t=Se.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=vo.sideChatTargetBySession.value[e]?.agentId,s=(Se.tasksBySession[e]??[]).filter(i=>i.status==="running");return s.length===0?!(n&&Se.sideChatSendingByAgent[n]):s.some(i=>i.id!==n)}function D0(e,t){try{const n=new Date(e),s=Date.now()-n.getTime(),i=s/36e5;return s<6e4?Sn.global.t("sessions.justNow"):i<1?`${Math.round(s/6e4)}m`:i<24?`${Math.round(i)}h`:n.toLocaleDateString(Sn.global.locale.value,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}const lhe=3e4,ku=ne(0);let Mg=null;function ahe(){Mg===null&&(Mg=setInterval(()=>{ku.value=(ku.value+1)%Number.MAX_SAFE_INTEGER},lhe),Mg.unref?.())}function che(e,t){const n=e.split(`
|
|
283
|
-
`),o=t.split(`
|
|
284
|
-
`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function uhe(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:che(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:o,cwd:s,danger:i}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:i}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:i}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function dhe(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 fhe(e){const t=Se.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const i of s.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const i of s.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(o)){const l=n.get(i.toolCallId);if(l)return l}}}function hhe(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=Sn.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=Sn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??fhe(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o}}const phe=F(()=>{const e=Se.sessions.find(n=>n.id===Se.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Se.workspaceName,branch:t}}),mhe=F(()=>(ku.value,Se.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:D0(e.updatedAt,e.status),status:e.status,busy:up(e.id)})))),ghe=F(()=>Se.activeSessionId??""),vhe=F(()=>{const e=Se.activeSessionId;return e?_n.skillsBySession.value[e]??[]:[]}),yhe=F(()=>{const e=Se.activeSessionId;return e?Se.sendingBySession[e]??!1:!1}),vo=Xde(Se,{pushOperationFailure:cp,nextOptimisticMsgId:yM,connectEventsIfNeeded:O0,getEventConn:()=>hi}),dp=F(()=>{const e=Se.activeSessionId;if(!e)return[];const t=vo.sideChatTargetBySession.value[e]?.agentId;return(Se.tasksBySession[e]??[]).filter(n=>n.id!==t)}),_M=xde(Se,dp),khe=F(()=>{const e=Se.activeSessionId;if(!e)return[];const t=new Set(Se.sideChatUserMessageIdsBySession[e]??[]),n=(Se.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=Se.approvalsBySession[e]??[];return Q3(n,o,s=>at().getFileUrl(s),fp.value!=="idle",dp.value,Se.planReviewByToolCallId)}),bhe=F(()=>(_M.taskClock.value,dp.value.map(hhe))),CM=F(()=>yfe(dp.value)),oa=F(()=>{const e=Se.activeSessionId;return e?Se.goalBySession[e]??null:null}),whe=F(()=>{const e=Se.activeSessionId;return e?pfe(Se.messagesBySession[e]??[]):[]}),_he=F(()=>{const e=Se.activeSessionId;return e?Se.compactionBySession[e]??null:null}),Che=F(()=>Se.connection),She=F(()=>Se.loading),xhe=F(()=>Se.sessionLoading),The=F(()=>{const e=Se.activeSessionId;return e?Se.messagesLoadingMoreBySession[e]??!1:!1}),Ahe=F(()=>{const e=Se.activeSessionId;return e?Se.messagesHasMoreBySession[e]??!1:!1}),Mhe=F(()=>{const e=Se.activeSessionId;return e?Se.messagesLoadMoreErrorBySession[e]??!1:!1}),Ehe=F(()=>Se.serverVersion),Ihe=F(()=>Se.permission),$he=F(()=>Se.thinking),Nhe=F(()=>Se.planMode),Lhe=F(()=>Se.swarmMode),Phe=F(()=>Se.goalMode),Ohe=F(()=>{const e=kfe(CM.value);return{plan:Se.planMode,goal:oa.value&&oa.value.status!=="complete"?{status:oa.value.status,turnsUsed:oa.value.turnsUsed,elapsedMs:oa.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Rhe=F(()=>{const e=Se.activeSessionId;return e?(Se.queuedBySession[e]??[]).map(t=>({text:t.text,attachmentCount:t.attachments?.length??0})):[]}),Dhe=F(()=>Se.warnings),Bhe=F(()=>{const e=Se.activeSessionId;return e?(Se.questionsBySession[e]??[]).map(dhe):[]}),Fhe=F(()=>{const e=Se.activeSessionId;return e?(Se.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:uhe(t),agentName:t.agentName})):[]}),fp=F(()=>{const e=Se.activeSessionId;return e?(Se.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Se.questionsBySession[e]??[]).length>0?"awaiting-question":up(e)?"running":"idle":"idle"}),_n=Mde(Se,{pushOperationFailure:cp,refreshSessionStatus:rp,persistSessionProfile:pM,activity:fp,inFlightPromptSessions:lp,saveThinkingToStorage:Sfe,updateSession:ip,updateSessionMessages:aM}),dh=F(()=>{const e=Se.activeSessionId;if(!e)return null;const t=Se.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Hhe=F(()=>{const e=Se.activeSessionId;return e?Se.gitStatusBySession[e]?.pullRequest??null:null}),Whe=F(()=>{const e=Se.activeSessionId;if(!e)return[];const t=Se.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),Uhe=F(()=>{const e=Se.activeSessionId;if(!e)return null;const t=Se.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),SM=F(()=>{const e=Se.sessions.find(r=>r.id===Se.activeSessionId),t=dh.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?_n.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??Se.defaultModel)??"—",s=_n.models.value.find(r=>r.id===o||r.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Se.permission,branch:t,cwd:e?.cwd??"",isGitRepo:dh.value!==null}}),jhe=F(()=>dM.value),qhe=F(()=>Se.sessions.find(t=>t.id===Se.activeSessionId)?.usage.totalCostUsd??0),zhe=F(()=>Se.authReady),Vhe=F(()=>Se.defaultModel),Khe=F(()=>Se.managedProviderStatus),Ghe=F(()=>Se.config),Yhe=F(()=>{const e=Se.activeSessionId;if(!e)return{};const t=Se.gitStatusBySession[e];return t?{...t.entries}:{}});function hp(e){return Se.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const B0=F(()=>Due({workspaces:Se.workspaces,sessions:Se.sessions,hiddenWorkspaceRoots:Se.hiddenWorkspaceRoots,activeRoot:Se.sessions.find(e=>e.id===Se.activeSessionId)?.cwd,activeBranch:dh.value?.branch??null,sessionsHasMoreByWorkspace:Se.sessionsHasMoreByWorkspace})),fh=ne(k5());ze(()=>[B0.value.map(e=>e.id).join("\0"),Se.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=$5(n,fh.value);o!==null&&(fh.value=o,Px(o))});const Wa=F(()=>{const e=B0.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Ofe(t.root,Se.fsHome),branch:t.branch,sessionCount:t.sessionCount}));return N5(e,fh.value)}),xM=F(()=>{const e=Se.activeWorkspaceId,t=Wa.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),Xhe=F(()=>{const e=xM.value;return e?Wa.value.find(t=>t.id===e)??null:null}),Qhe=F(()=>{ku.value;const e=new Set(Wa.value.map(t=>t.id));return Se.sessions.filter(t=>!t.parentSessionId&&e.has(hp(t))).map(t=>({id:t.id,title:t.title,time:D0(t.updatedAt,t.status),status:t.status,busy:up(t.id),lastPrompt:t.lastPrompt}))}),Zhe=F(()=>{ku.value;const e=new Map;for(const t of Se.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=hp(t),o={id:t.id,title:t.title,time:D0(t.updatedAt,t.status),status:t.status,busy:up(t.id),updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return Wa.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Se.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Se.sessionsLoadingMoreByWorkspace[t.id]??!1}))});function Jhe(e){fh.value=e,Px(e)}const TM=F(()=>{const e={};for(const[t,n]of Object.entries(Se.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Se.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),epe=F(()=>{const e={};for(const[t,n]of Object.entries(Se.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Se.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),tpe=F(()=>{const e={};for(const[t,n]of Object.entries(Se.unreadBySession))n&&(e[t]=!0);return e}),npe=F(()=>{const e={},t=TM.value;for(const n of Se.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=hp(n);e[s]=(e[s]??0)+o}return e}),ope=F(()=>Se.recentRoots),spe=F(()=>Se.availableOpenInApps),ft=ofe(Se,{taskPoller:_M,sideChat:vo,modelProvider:_n,pushOperationFailure:cp,activity:fp,inFlightPromptSessions:lp,sessionsKnownEmpty:kM,setSessions:rM,updateSession:ip,upsertSessionFront:Rfe,appendSession:Dfe,forgetSession:cM,setActiveSessionId:P0,updateSessionMessages:aM,nextOptimisticMsgId:yM,getEventConn:()=>hi,syncSessionFromSnapshot:wM,subscribeToSessionEvents:rhe,hasLoadedMessages:ihe,refreshSessionStatus:rp,persistSessionProfile:pM,mergedWorkspaces:B0,workspacesView:Wa,status:SM,workspaceIdForSession:hp,savePermissionToStorage:_fe,savePlanModeToStorage:Tfe,saveSwarmModeToStorage:Mfe,saveGoalModeToStorage:Ife,saveUnread:Nv,saveActiveWorkspaceToStorage:Pfe,saveHiddenWorkspacesToStorage:Lfe,goalErrorMessage:the,resetFastMoon:rs.resetFastMoon,initialized:hM,selectedDiffPath:uM,fileDiffLines:dM,fileDiffLoading:fM});function ipe(e,t){if(lp.delete(e),Se.sendingBySession={...Se.sendingBySession,[e]:!1},Se.promptIdBySession[e]!==void 0){const i={...Se.promptIdBySession};delete i[e],Se.promptIdBySession=i}e===Se.activeSessionId?(rs.resetFastMoon(),ft.loadGitStatus(e),rp(e)):t==="idle"&&(Se.unreadBySession={...Se.unreadBySession,[e]:!0},Nv({[e]:!0})),ul.maybeNotifyCompletion(e,{isActiveAndVisible:e===Se.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:Se.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{ft.selectSession(e)}}),t==="idle"&&uh.maybePlayCompletionSound();const n=Se.queuedBySession[e]??[];if(n.length===0)return;const[o,...s]=n;Se.queuedBySession={...Se.queuedBySession,[e]:s},o!==void 0&&ft.submitPromptInternal(e,o.text,o.attachments).then(i=>{if(!i){const r=Se.queuedBySession[e]??[];Se.queuedBySession={...Se.queuedBySession,[e]:[o,...r]}}})}function rpe(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;ul.maybeNotifyQuestion(e,{isActiveAndVisible:e===Se.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:Se.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,onClick:()=>{ft.selectSession(e)}}),uh.maybePlayQuestionSound()}function lpe(){return ahe(),{workspace:phe,sessions:mhe,activeSessionId:ghe,workspacesView:Wa,visibleWorkspace:Xhe,activeWorkspaceId:xM,sessionsForView:Qhe,workspaceGroups:Zhe,attentionBySession:TM,pendingBySession:epe,attentionByWorkspace:npe,unreadBySession:tpe,recentRoots:ope,turns:khe,tasks:bhe,todos:whe,goal:oa,swarms:CM,activationBadges:Ohe,compaction:_he,status:SM,sessionCost:qhe,fileDiff:jhe,selectedDiffPath:uM,fileDiffLoading:fM,changes:Whe,gitInfo:dh,gitDiffStats:Uhe,activePullRequest:Hhe,changesByPath:Yhe,pendingApprovals:Fhe,availableOpenInApps:spe,connection:Che,loading:She,sessionLoading:xhe,loadingMoreMessages:The,hasMoreMessages:Ahe,loadMoreMessagesError:Mhe,serverVersion:Ehe,initialized:hM,permission:Ihe,thinking:$he,planMode:Nhe,swarmMode:Lhe,goalMode:Phe,queued:Rhe,warnings:Dhe,questions:Bhe,activity:fp,isSending:yhe,fastMoon:rs.fastMoon,models:_n.models,starredModelIds:_n.starredModelIds,providers:_n.providers,theme:rs.theme,setTheme:rs.setTheme,toggleTheme:rs.toggleTheme,uiFontSize:rs.uiFontSize,setUiFontSize:rs.setUiFontSize,betaToc:gM,setBetaToc:qfe,colorScheme:rs.colorScheme,setColorScheme:rs.setColorScheme,accent:rs.accent,setAccent:rs.setAccent,notifyOnComplete:ul.notifyOnComplete,notifyOnQuestion:ul.notifyOnQuestion,notifyPermission:ul.notifyPermission,setNotifyOnComplete:ul.setNotifyOnComplete,setNotifyOnQuestion:ul.setNotifyOnQuestion,soundOnComplete:uh.soundOnComplete,setSoundOnComplete:uh.setSoundOnComplete,onboarded:vM,setOnboarded:Vfe,load:ft.load,selectSession:ft.selectSession,clearActiveSession:ft.clearActiveSession,loadOlderMessages:ft.loadOlderMessages,loadWorkspaces:ft.loadWorkspaces,loadMoreSessions:ft.loadMoreSessions,loadAllSessions:ft.loadAllSessions,selectWorkspace:ft.selectWorkspace,openWorkspace:ft.openWorkspace,openWorkspaceDraft:ft.openWorkspaceDraft,startSessionAndSendPrompt:ft.startSessionAndSendPrompt,addWorkspaceByPath:ft.addWorkspaceByPath,browseFs:ft.browseFs,getFsHome:ft.getFsHome,sendPrompt:ft.sendPrompt,steerPrompt:ft.steerPrompt,sideChatVisible:vo.sideChatVisible,sideChatSessionId:vo.sideChatSessionId,sideChatTurns:vo.sideChatTurns,sideChatRunning:vo.sideChatRunning,sideChatSending:vo.sideChatSending,openSideChat:vo.openSideChat,closeSideChat:vo.closeSideChat,sendSideChatPrompt:vo.sendSideChatPrompt,uploadImage:ft.uploadImage,abortCurrentPrompt:ft.abortCurrentPrompt,respondApproval:ft.respondApproval,respondQuestion:ft.respondQuestion,dismissQuestion:ft.dismissQuestion,cancelTask:ft.cancelTask,setPermission:ft.setPermission,setThinking:_n.setThinking,setPlanMode:ft.setPlanMode,togglePlanMode:ft.togglePlanMode,setSwarmMode:ft.setSwarmMode,toggleSwarmMode:ft.toggleSwarmMode,setGoalMode:ft.setGoalMode,toggleGoalMode:ft.toggleGoalMode,createGoal:ft.createGoal,controlGoal:ft.controlGoal,enqueue:ft.enqueue,dismissWarning:ft.dismissWarning,renameSession:ft.renameSession,renameWorkspace:ft.renameWorkspace,deleteWorkspace:ft.deleteWorkspace,reorderWorkspaces:Jhe,archiveSession:ft.archiveSession,compact:ft.compact,forkSession:ft.forkSession,undo:ft.undo,unqueue:ft.unqueue,searchFiles:ft.searchFiles,loadGitStatus:ft.loadGitStatus,loadFileDiff:ft.loadFileDiff,clearFileDiff:ft.clearFileDiff,listDir:ft.listDir,readFileContent:ft.readFileContent,getFileDownloadUrl:ft.getFileDownloadUrl,openWorkspaceFile:ft.openWorkspaceFile,openInApp:ft.openInApp,revealWorkspaceFile:ft.revealWorkspaceFile,resolveImageUrl:ft.resolveImageUrl,refreshOAuthProviderModels:_n.refreshOAuthProviderModels,loadModels:_n.loadModels,loadProviders:_n.loadProviders,skills:vhe,activateSkill:_n.activateSkill,setModel:_n.setModel,toggleStarModel:_n.toggleStarModel,addProvider:_n.addProvider,deleteProvider:_n.deleteProvider,refreshProvider:_n.refreshProvider,refreshAllProviders:_n.refreshAllProviders,authReady:zhe,defaultModel:Vhe,managedProviderStatus:Khe,config:Ghe,updateConfig:ft.updateConfig,checkAuth:ft.checkAuth,startOAuthLogin:_n.startOAuthLogin,pollOAuthLogin:_n.pollOAuthLogin,cancelOAuthLogin:_n.cancelOAuthLogin,logout:ft.logout}}function ape({client:e,authLogoRef:t}){const n=F(()=>e.authReady.value),o=F(()=>e.initialized.value&&!n.value),s="/login",i=ne(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)}ze(o,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==s&&(i.value=l(),a(s));return}window.location.pathname===s&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return Yt(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function cpe({running:e,showAuthGate:t}){const{t:n}=St(),o=["◐","◓","◑","◒"],s=ne(0);let i=null;function r(){i===null&&(s.value=0,i=setInterval(()=>{s.value=(s.value+1)%o.length},250))}function l(){i!==null&&(clearInterval(i),i=null),s.value=0}ze(e,c=>{c?r():l()},{immediate:!0});const a=F(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});yI(()=>{typeof document<"u"&&(document.title=a.value)}),Yt(()=>{l()})}const AM=ne(typeof window>"u"?0:window.innerWidth);let Hd=0,hh=!1;function ev(){AM.value=window.innerWidth}function upe(){hh||typeof window>"u"||(window.addEventListener("resize",ev),hh=!0,ev())}function dpe(){!hh||typeof window>"u"||(window.removeEventListener("resize",ev),hh=!1)}function MM(e,t,n){return Math.max(t,e-n)}function tv(e,t,n){return Math.min(n,Math.max(t,e))}function EM(){return sn(()=>{Hd+=1,upe()}),Jo(()=>{Hd=Math.max(0,Hd-1),Hd===0&&dpe()}),{viewportWidth:AM}}const fpe="kimi-web.file-preview-width",sa=320;function hpe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=EM(),i=F(()=>Math.max(0,s.value-t.value)),r=F(()=>MM(i.value,sa,sa));function l(ce){return tv(Math.round(ce),sa,r.value)}function a(){return l(i.value/2)}const c=F(()=>a()),u=ne(c.value),d=F(()=>tv(u.value,sa,r.value)),h=ne(null),m=F(()=>{const ce=h.value;if(!ce)return null;const q=e.turns.value.find(te=>te.id===ce.turnId)?.blocks?.[ce.blockIndex];return q?.kind==="thinking"?q.thinking:null}),f=F(()=>m.value!==null);function g(ce){const Ce=h.value;if(Ce&&Ce.turnId===ce.turnId&&Ce.blockIndex===ce.blockIndex){h.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",h.value=ce}function _(){h.value=null,n.value==="thinking"&&(n.value=null)}const w=ne(null),y=F(()=>{const ce=w.value;if(!ce)return null;const Ce=e.turns.value.find(q=>q.id===ce.turnId);return Ce?.role==="compaction"&&Ce.text?Ce.text:null}),b=F(()=>y.value!==null);function v(ce){if(w.value?.turnId===ce.turnId){w.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",w.value=ce}function x(){w.value=null,n.value==="compaction"&&(n.value=null)}const L=ne(null),N=F(()=>{const ce=L.value;if(!ce)return null;const q=e.turns.value.find(te=>te.id===ce.turnId)?.blocks?.[ce.blockIndex];return q?q.kind==="agent"?q.member.id===ce.memberId?q.member:null:q.kind==="agentGroup"?q.members.find(te=>te.id===ce.memberId)??null:null:null}),k=F(()=>N.value!==null);function T(ce){const Ce=L.value;if(Ce&&Ce.turnId===ce.turnId&&Ce.memberId===ce.memberId){L.value=null,n.value==="agent"&&(n.value=null);return}n.value="agent",L.value=ce}function E(){L.value=null,n.value==="agent"&&(n.value=null)}const O=ne(null),A=F(()=>{const ce=O.value;if(!ce)return null;const Ce=cL(e.turns.value,ce);return Ce?{id:ce,title:Lf(Ce.name),path:aL(Ce.arg),lines:Ce.status==="error"?null:Wx(Ce),output:Ce.output}:null}),$=F(()=>A.value!==null);function R(ce){if(n.value==="toolDiff"&&O.value===ce){D();return}n.value="toolDiff",O.value=ce}function D(){O.value=null,n.value==="toolDiff"&&(n.value=null)}const W=ne("list"),V=ne(null);function U(){if(n.value==="diff"){ee();return}n.value="diff",W.value="list",V.value=null,e.loadGitStatus(e.activeSessionId.value)}function ee(){n.value==="diff"&&(n.value=null),W.value="list",V.value=null,e.clearFileDiff()}async function K(ce){W.value="detail",V.value=ce,await e.loadFileDiff(ce)}async function G(ce){await e.openSideChat(ce),n.value="btw"}function X(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function ke(){n.value==="btw"&&(n.value=null)}const le=F(()=>e.sideChatVisible.value),He=F(()=>n.value!==null&&(n.value!=="thinking"||f.value)&&(n.value!=="compaction"||b.value)&&(n.value!=="agent"||k.value)&&(n.value!=="toolDiff"||$.value)&&(n.value!=="btw"||le.value)),ue=ne(!1),ve=ne({});function Pe(){switch(n.value){case"thinking":return h.value?{kind:"thinking",...h.value}:null;case"compaction":return w.value?{kind:"compaction",...w.value}:null;case"agent":return L.value?{kind:"agent",...L.value}:null;case"toolDiff":return O.value?{kind:"toolDiff",toolId:O.value}:null;case"btw":return{kind:"btw"};default:return null}}function Re(ce){if(ce)switch(ce.kind){case"thinking":h.value={turnId:ce.turnId,blockIndex:ce.blockIndex},n.value="thinking";break;case"compaction":w.value={turnId:ce.turnId},n.value="compaction";break;case"agent":L.value={turnId:ce.turnId,blockIndex:ce.blockIndex,memberId:ce.memberId},n.value="agent";break;case"toolDiff":O.value=ce.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function Q(){return n.value==="thinking"&&f.value?(_(),!0):n.value==="compaction"&&b.value?(x(),!0):n.value==="agent"&&k.value?(E(),!0):n.value==="toolDiff"&&$.value?(D(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(ee(),!0):n.value==="btw"?(X(),!0):!1}return ze(e.activeSessionId,(ce,Ce)=>{if(Ce){const q=Pe();q?ve.value[Ce]=q:delete ve.value[Ce]}o(),_(),x(),E(),D(),ee(),ke(),ce&&Re(ve.value[ce])}),{PREVIEW_WIDTH_KEY:fpe,PREVIEW_MIN:sa,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:m,thinkingVisible:f,openThinkingPanel:g,closeThinkingPanel:_,compactionPanelText:y,compactionPanelVisible:b,openCompactionPanel:v,closeCompactionPanel:x,agentPanelMember:N,agentPanelVisible:k,openAgentPanel:T,closeAgentPanel:E,toolDiffTarget:A,toolDiffVisible:$,openToolDiff:R,closeToolDiff:D,detailDiffMode:W,detailDiffPath:V,openDiffDetail:U,closeDiffDetail:ee,selectDiffFile:K,btwVisible:le,openSideChatTab:G,closeSideChat:X,hideSideChatPanel:ke,sidePanelVisible:He,panelDragging:ue,closeOpenSidePanel:Q}}const ppe=Ct.sidebarWidth,TC=Ct.sidebarCollapsed,AC=270,Eg=170,mpe=36,gpe=320;function vpe(e={}){const{viewportWidth:t}=EM(),n=ne(AC),o=ne(!1),s=F(()=>{const c=gpe+(QC(e.previewOpen)?sa:0);return MM(t.value,Eg,c)}),i=F(()=>o.value?mpe:tv(n.value,Eg,s.value));function r(){try{o.value=bn(TC)==="true"}catch{o.value=!1}}function l(){try{An(TC,String(o.value))}catch{}}function a(){o.value=!o.value,l()}return{SIDEBAR_WIDTH_KEY:ppe,SIDEBAR_DEFAULT:AC,SIDEBAR_MIN:Eg,sidebarMax:s,sessionColWidth:n,sidebarCollapsed:o,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function ype({client:e,detailTarget:t}){const{t:n}=St(),o=ne(null),s=ne(null),i=ne(!1),r=ne(null),l=ne(null);let a=0;const c=F(()=>{const v=l.value;return v?e.getFileDownloadUrl(v):null}),u=F(()=>o.value!==null);function d(v){return v.length>1?v.replace(/\/+$/,""):v}function h(v){const x=[];for(const L of v.split(/[\\/]+/))if(!(!L||L===".")){if(L===".."){x.pop();continue}x.push(L)}return x.join("/")}function m(v){const x=v.trim();if(!x)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(x))return{error:n("filePreview.errors.unsupportedPath")};if(x.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const L=d(e.status.value.cwd);if(x.startsWith("/")){if(!L||x!==L&&!x.startsWith(`${L}/`))return{error:n("filePreview.errors.outsideWorkspace")};const k=x===L?"":x.slice(L.length+1);if(k.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const T=h(k);return T?{path:T}:{error:n("filePreview.errors.isDirectory")}}if(x.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const N=h(x);return N?{path:N}:{error:n("filePreview.errors.emptyPath")}}async function f(v){const x=o.value;if(t.value==="file"&&x&&x.path===v.path&&x.line===v.line){w();return}const L=++a;t.value="file",s.value=null,r.value=null,i.value=!0,o.value=v,l.value=null;const N=m(v.path);if("error"in N){i.value=!1,r.value=N.error;return}l.value=N.path;try{const k=await e.readFileContent(N.path);if(L!==a)return;k?s.value={...k,path:k.path||N.path}:s.value={path:N.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(k){if(L!==a)return;r.value=k instanceof Error?k.message:n("filePreview.errors.loadFailed")}finally{L===a&&(i.value=!1)}}function g(v){return/^data:([^;,]+)/i.exec(v)?.[1]}function _(v){v.kind==="image"&&(t.value="file",o.value=null,l.value=null,r.value=null,i.value=!1,s.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 w(){o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,t.value==="file"&&(t.value=null)}function y(){const v=s.value?.path??o.value?.path;v&&e.openWorkspaceFile(v,o.value?.line)}function b(){const v=s.value?.path??o.value?.path;v&&e.revealWorkspaceFile(v)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:c,previewExternalActions:u,openFilePreview:f,openMediaPreview:_,closeFilePreview:w,openPreviewInEditor:y,revealPreviewFile:b}}const kpe=640,bpe=`(max-width: ${kpe}px)`;function wpe(){const e=ne(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(bpe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),Yt(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),Yt(()=>t.removeListener(n))),e}const _pe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Cpe={class:"server-auth-card"},Spe=["disabled"],xpe=["disabled"],Tpe=Qe({__name:"ServerAuthDialog",setup(e){const t=ne(""),n=ne(null),o=ne(!1);sn(()=>{ht(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,R3(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(C(),I("div",_pe,[p("div",Cpe,[l[1]||(l[1]=p("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required",-1)),l[2]||(l[2]=p("p",{class:"server-auth-hint"},[ut(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),p("code",null,"KIMI_CODE_PASSWORD"),ut("). ")],-1)),qt(p("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:o.value,onKeydown:i},null,40,Spe),[[Wn,t.value]]),p("button",{type:"button",class:"server-auth-button",disabled:!t.value||o.value,onClick:s},P(o.value?"Connecting…":"Connect"),9,xpe)])]))}}),Ape=bt(Tpe,[["__scopeId","data-v-fb2ac094"]]),Mpe={class:"app-shell"},Epe={key:1,class:"auth-page"},Ipe={class:"auth-page-inner"},$pe={class:"auth-page-copy"},Npe={key:0,class:"sidebar-rail"},Lpe=["title","aria-label"],Ppe={key:3,class:"coming-soon"},Ope={class:"cs-text"},Rpe=["aria-label","aria-hidden"],Dpe=Qe({__name:"App",setup(e){const t=Cue(),n=ne(!t);let o=null;const s=lpe();yn("resolveImage",s.resolveImageUrl);const{t:i}=St(),r=Zs(),l=wpe(),a=ne(!1),c=ne(!1),u=F(()=>{const Ae=s.activeSessionId.value;return s.sessions.value.find(J=>J.id===Ae)?.title??""}),d=F(()=>s.visibleWorkspace.value?.sessionCount??0),h=F(()=>s.activity.value!=="idle"),m=ne(null),{showAuthGate:f,blinkAuthLogo:g}=ape({client:s,authLogoRef:m});cpe({running:h,showAuthGate:f});function _(Ae){return Ae==="off"?"high":"off"}const w=ne(!s.onboarded.value);function y(){s.setOnboarded(!0),w.value=!1}function b(){w.value=!0}sn(()=>{s.load(),ue(),document.addEventListener("keydown",v,!0),o=xue(()=>{n.value=!0})}),Yt(()=>{document.removeEventListener("keydown",v,!0),o!==null&&(o(),o=null)});function v(Ae){Ae.key==="Escape"&&(Do.value||qn()&&(Ae.stopPropagation(),Ae.preventDefault()))}const x=ne(null),L=ne(!1);ze(s.activeSessionId,()=>{L.value=!0,ht(()=>{L.value=!1})});const{previewTarget:N,previewFile:k,previewLoading:T,previewError:E,previewDownloadUrl:O,previewExternalActions:A,openFilePreview:$,openMediaPreview:R,closeFilePreview:D,openPreviewInEditor:W,revealPreviewFile:V}=ype({client:s,detailTarget:x}),U=F(()=>x.value!==null),{SIDEBAR_WIDTH_KEY:ee,SIDEBAR_DEFAULT:K,SIDEBAR_MIN:G,sidebarMax:X,sessionColWidth:ke,sidebarCollapsed:le,sideWidth:He,loadSidebarCollapsed:ue,toggleSidebarCollapse:ve}=vpe({previewOpen:U}),{PREVIEW_WIDTH_KEY:Pe,PREVIEW_MIN:Re,previewDefaultWidth:Q,previewMax:ce,previewWidth:Ce,previewPanelWidth:q,thinkingPanelText:te,thinkingVisible:pe,openThinkingPanel:oe,closeThinkingPanel:fe,compactionPanelText:H,compactionPanelVisible:Y,openCompactionPanel:re,closeCompactionPanel:ge,agentPanelMember:xe,openAgentPanel:Ne,closeAgentPanel:ie,toolDiffTarget:ae,openToolDiff:we,closeToolDiff:je,detailDiffMode:nt,detailDiffPath:ct,openDiffDetail:_t,closeDiffDetail:$t,selectDiffFile:lt,btwVisible:Rt,openSideChatTab:fn,closeSideChat:Mn,sidePanelVisible:Nt,panelDragging:Ft,closeOpenSidePanel:qn}=hpe({client:s,sideWidth:He,detailTarget:x,closeFilePreview:D}),Je=ne(null),Qn=ne([]),es=F(()=>Qn.value.length>1);function Ro(Ae){Qn.value=Ae}const po=ne(!1),Pn=ne(!1),an=ne(!1),wn=ne(!1),On=ne(!1),zn=ne(!1),Zn=ne(null),Jn=ne(null),Do=F(()=>po.value||Pn.value||an.value||wn.value||On.value||zn.value||w.value||a.value||c.value),Bo=ne(!1),At=ne(!1),Co=ne(!1),cn=ne(!1),Fo=ne(!1);async function So(){Bo.value=!0,At.value=!1,po.value=!0;try{await s.refreshOAuthProviderModels(),await s.loadModels()}catch{At.value=!0}finally{Bo.value=!1}}function eo(){an.value=!0}async function Ye(Ae){po.value=!1,await s.setModel(Ae)}async function qe(Ae){await s.addProvider(Ae)}async function tt(Ae){await s.deleteProvider(Ae)}async function it(Ae){await s.refreshProvider(Ae)}async function Ie(Ae){Fo.value=!0;try{await s.updateConfig(Ae)&&await s.checkAuth()}finally{Fo.value=!1}}async function be(){return s.startOAuthLogin()}async function Fe(){return s.pollOAuthLogin()}async function xt(){return s.cancelOAuthLogin()}async function Tt(){an.value=!1,await s.checkAuth(),await s.load()}async function mn(Ae){await s.undo(1),await ht(),Je.value?.loadComposerForEdit(Ae)}function gn(Ae){if(Ae==="/compact"||Ae.startsWith("/compact ")){s.compact(Ae.slice(8).trim()||void 0);return}if(Ae==="/swarm"||Ae.startsWith("/swarm ")){const J=Ae.slice(6).trim();J==="on"?s.setSwarmMode(!0):J==="off"?s.setSwarmMode(!1):J?(s.setSwarmMode(!0),s.sendPrompt(J)):s.toggleSwarmMode();return}if(Ae==="/goal"||Ae.startsWith("/goal ")){const J=Ae.slice(5).trim();J==="pause"||J==="resume"||J==="cancel"?s.controlGoal(J):J?s.createGoal(J):s.toggleGoalMode();return}if(Ae==="/btw"||Ae.startsWith("/btw ")){const J=Ae.slice(4).trim();!J&&s.sideChatVisible.value?Mn():fn(J||void 0);return}switch(Ae){case"/new":case"/clear":de();break;case"/fork":s.forkSession();break;case"/undo":s.undo();break;case"/permission":{const J=s.permission.value,he=J==="manual"?"auto":J==="auto"?"yolo":"manual";s.setPermission(he);break}case"/plan":s.togglePlanMode();break;case"/auto":s.setPermission("auto");break;case"/yolo":s.setPermission("yolo");break;case"/thinking":s.setThinking(_(s.thinking.value));break;case"/help":s.dismissWarning(-1);break;case"/status":On.value=!0;break;case"/model":So();break;case"/provider":break;case"/login":eo();break;default:{const J=Ae.indexOf(" "),he=(J===-1?Ae:Ae.slice(0,J)).slice(1),yt=J===-1?void 0:Ae.slice(J+1).trim()||void 0;he&&s.activateSkill(he,yt);break}}}function bs(Ae){s.unqueue(Ae)}function ts(Ae){s.unqueue(Ae)}async function Ki(Ae){const J=s.activeWorkspaceId.value;if(!s.activeSessionId.value&&J){await s.startSessionAndSendPrompt(J,Ae.text,Ae.attachments);return}if(!s.activeSessionId.value&&!J){Zn.value=Ae,wn.value=!0;return}s.sendPrompt(Ae.text,Ae.attachments)}async function mi(Ae){if(Jn.value=null,!await s.addWorkspaceByPath(Ae)){Jn.value=i("workspace.addFailed");return}wn.value=!1;const he=Zn.value;Zn.value=null;const yt=s.activeWorkspaceId.value;he&&yt&&await s.startSessionAndSendPrompt(yt,he.text,he.attachments)}function Vn(){Zn.value=null,Jn.value=null,wn.value=!1}function gi(){ht(()=>{Je.value?.focusComposer()})}function de(){const Ae=s.activeWorkspaceId.value;Ae?s.openWorkspaceDraft(Ae):s.clearActiveSession(),gi()}function Te(Ae){s.openWorkspaceDraft(Ae),gi()}function Ee(Ae){Ae&&window.open(Ae,"_blank","noopener")}return(Ae,J)=>(C(),I("div",Mpe,[n.value?(C(),Ve(Ape,{key:0})):se("",!0),S(f)?(C(),I("section",Epe,[p("div",Ipe,[(C(),I("svg",{ref_key:"authLogoRef",ref:m,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:J[0]||(J[0]=Ze(()=>{},["prevent"])),onClick:J[1]||(J[1]=(...he)=>S(g)&&S(g)(...he))},[...J[95]||(J[95]=[Ir('<defs data-v-1ebff03f><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-1ebff03f><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-1ebff03f></rect><g class="ch-eyes" fill="#000" data-v-1ebff03f><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-1ebff03f></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-1ebff03f></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-1ebff03f></rect>',2)])],544)),p("div",$pe,[p("h1",null,P(S(i)("app.authPageTitle")),1),p("p",null,P(S(i)("app.authPageMessage")),1)]),p("button",{type:"button",class:"auth-page-btn",onClick:eo},[J[96]||(J[96]=p("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"},[p("path",{d:"M6 3h5a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6"}),p("path",{d:"M9 8H2"}),p("path",{d:"M5 5l3 3-3 3"})],-1)),p("span",null,P(S(i)("app.authPageLogin")),1)])])])):(C(),I("div",{key:2,class:Le(["app",{mobile:S(l),"sidebar-collapsed":S(le)&&!S(l)}]),style:Wt({"--side-w":S(He)+"px","--preview-w":S(q)+"px"})},[S(l)?(C(),Ve(rle,{key:1,workspace:S(s).visibleWorkspace.value,"session-title":u.value,running:h.value,branch:S(s).status.value.branch,"session-count":d.value,onOpenSwitcher:J[17]||(J[17]=he=>a.value=!0),onOpenSettings:J[18]||(J[18]=he=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(C(),I(Oe,{key:0},[qt(vt(IN,{"col-width":S(He),"active-workspace":S(s).visibleWorkspace.value,"active-workspace-id":S(s).activeWorkspaceId.value,sessions:S(s).sessionsForView.value,groups:S(s).workspaceGroups.value,"active-id":S(s).activeSessionId.value,"attention-by-session":S(s).attentionBySession.value,"pending-by-session":S(s).pendingBySession.value,"unread-by-session":S(s).unreadBySession.value,onSelect:J[2]||(J[2]=he=>S(s).selectSession(he)),onCreate:de,onCreateInWorkspace:J[3]||(J[3]=he=>Te(he)),onSelectWorkspace:J[4]||(J[4]=he=>S(s).openWorkspace(he)),onAddWorkspace:J[5]||(J[5]=he=>wn.value=!0),onRename:J[6]||(J[6]=(he,yt)=>S(s).renameSession(he,yt)),onArchive:J[7]||(J[7]=he=>S(s).archiveSession(he)),onFork:J[8]||(J[8]=he=>S(s).forkSession(he)),onRenameWorkspace:J[9]||(J[9]=(he,yt)=>S(s).renameWorkspace(he,yt)),onDeleteWorkspace:J[10]||(J[10]=he=>S(s).deleteWorkspace(he)),onReorderWorkspaces:J[11]||(J[11]=he=>S(s).reorderWorkspaces(he)),onLoadMoreSessions:J[12]||(J[12]=he=>void S(s).loadMoreSessions(he)),onLoadAllSessions:J[13]||(J[13]=he=>void S(s).loadAllSessions()),onSelectWorkspaces:Ro,onOpenSettings:J[14]||(J[14]=he=>zn.value=!0),onCollapse:S(ve)},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","onCollapse"]),[[Ks,!S(le)]]),qt(vt(Nb,{"storage-key":S(ee),"default-width":S(K),min:S(G),max:S(X),"onUpdate:width":J[15]||(J[15]=he=>ke.value=he)},null,8,["storage-key","default-width","min","max"]),[[Ks,!S(le)]]),S(le)?(C(),I("div",Npe,[p("button",{type:"button",class:"sidebar-expand-btn",title:S(i)("sidebar.expandSidebar"),"aria-label":S(i)("sidebar.expandSidebar"),onClick:J[16]||(J[16]=(...he)=>S(ve)&&S(ve)(...he))},[...J[97]||(J[97]=[Ir('<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-1ebff03f><path d="M4 6h9" data-v-1ebff03f></path><path d="M4 12h9" data-v-1ebff03f></path><path d="M4 18h9" data-v-1ebff03f></path><path d="M17 9l3 3-3 3" data-v-1ebff03f></path></svg>',1)])],8,Lpe)])):se("",!0)],64)),es.value?(C(),I("div",Ppe,[J[98]||(J[98]=p("span",{class:"cs-icon"},"🚧",-1)),p("span",Ope,P(S(i)("app.comingSoon")),1)])):(C(),Ve(EZ,{key:2,ref_key:"conversationPaneRef",ref:Je,mobile:S(l),modern:S(s).theme.value==="modern"||S(s).theme.value==="kimi",turns:S(s).turns.value,"session-id":S(s).activeSessionId.value,approvals:S(s).pendingApprovals.value,changes:S(s).changes.value,"git-info":S(s).gitInfo.value,tasks:S(s).tasks.value,todos:S(s).todos.value,goal:S(s).goal.value,swarms:S(s).swarms.value,"activation-badges":S(s).activationBadges.value,status:S(s).status.value,thinking:S(s).thinking.value,"plan-mode":S(s).planMode.value,"swarm-mode":S(s).swarmMode.value,"goal-mode":S(s).goalMode.value,models:S(s).models.value,"starred-ids":S(s).starredModelIds.value,skills:S(s).skills.value,questions:S(s).questions.value,running:h.value,queued:S(s).queued.value,"search-files":S(s).searchFiles,"upload-image":S(s).uploadImage,sending:S(s).isSending.value,"fast-moon":S(s).fastMoon.value,"file-reload-key":S(s).activeSessionId.value,"session-loading":S(s).sessionLoading.value,compaction:S(s).compaction.value,"has-more-messages":S(s).hasMoreMessages.value,"loading-more":S(s).loadingMoreMessages.value,"loading-more-error":S(s).loadMoreMessagesError.value,"load-older-messages":S(s).loadOlderMessages,"workspace-name":S(s).visibleWorkspace.value?.name,"workspace-root":S(s).visibleWorkspace.value?.root??S(s).status.value.cwd,"git-diff-stats":S(s).gitDiffStats.value,workspaces:S(s).workspacesView.value,"active-workspace-id":S(s).activeWorkspaceId.value,"session-title":u.value,pr:S(s).activePullRequest.value,"beta-toc":S(s).betaToc.value,onOpenChanges:J[19]||(J[19]=he=>S(_t)()),onSelectWorkspace:J[20]||(J[20]=he=>Te(he)),onAddWorkspace:J[21]||(J[21]=he=>wn.value=!0),onOpenPr:Ee,onSubmit:J[22]||(J[22]=he=>Ki(he)),onSteer:J[23]||(J[23]=he=>S(s).steerPrompt(he.text,he.attachments)),onApproval:J[24]||(J[24]=(he,yt)=>S(s).respondApproval(he,yt)),onCancelTask:J[25]||(J[25]=he=>S(s).cancelTask(he)),onAnswer:J[26]||(J[26]=(he,yt)=>S(s).respondQuestion(he,yt)),onDismiss:J[27]||(J[27]=he=>S(s).dismissQuestion(he)),onCommand:gn,onInterrupt:J[28]||(J[28]=he=>S(s).abortCurrentPrompt()),onUnqueue:bs,onEditQueued:ts,onSetPermission:J[29]||(J[29]=he=>S(s).setPermission(he)),onSetThinking:J[30]||(J[30]=he=>S(s).setThinking(he)),onTogglePlan:J[31]||(J[31]=he=>S(s).togglePlanMode()),onToggleSwarm:J[32]||(J[32]=he=>S(s).toggleSwarmMode()),onToggleGoal:J[33]||(J[33]=he=>S(s).toggleGoalMode()),onCreateGoal:J[34]||(J[34]=he=>S(s).createGoal(he)),onControlGoal:J[35]||(J[35]=he=>S(s).controlGoal(he)),onRefreshGitStatus:J[36]||(J[36]=he=>S(s).activeSessionId.value&&S(s).loadGitStatus(S(s).activeSessionId.value)),onRenameSession:J[37]||(J[37]=(he,yt)=>S(s).renameSession(he,yt)),onForkSession:J[38]||(J[38]=he=>S(s).forkSession(he)),onArchiveSession:J[39]||(J[39]=he=>S(s).archiveSession(he)),onCompact:J[40]||(J[40]=he=>S(s).compact()),onPickModel:J[41]||(J[41]=he=>So()),onSelectModel:J[42]||(J[42]=he=>S(s).setModel(he)),onOpenFile:J[43]||(J[43]=he=>S($)(he)),onOpenMedia:J[44]||(J[44]=he=>S(R)(he)),onOpenThinking:J[45]||(J[45]=he=>S(oe)(he)),onOpenCompaction:J[46]||(J[46]=he=>S(re)(he)),onOpenAgent:J[47]||(J[47]=he=>S(Ne)(he)),onOpenToolDiff:J[48]||(J[48]=he=>S(we)(he)),onEditMessage:mn},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"])),S(Nt)&&!S(l)?(C(),Ve(Nb,{key:4,"storage-key":S(Pe),"default-width":S(Q),min:S(Re),max:S(ce),reverse:"","aria-label":S(i)("layout.resizePreviewAria"),"onUpdate:width":J[49]||(J[49]=he=>Ce.value=he),"onUpdate:dragging":J[50]||(J[50]=he=>Ft.value=he)},null,8,["storage-key","default-width","min","max","aria-label"])):se("",!0),!S(l)||S(Nt)?(C(),I("aside",{key:5,class:Le(["global-preview",{open:S(Nt),mobile:S(l),"no-anim":S(Ft)||L.value}]),role:"complementary","aria-label":S(i)("layout.detailPanelAria"),"aria-hidden":!S(Nt)},[x.value==="thinking"&&S(pe)?(C(),Ve(V2,{key:0,text:S(te)??"",onClose:S(fe)},null,8,["text","onClose"])):x.value==="compaction"&&S(Y)?(C(),Ve(V2,{key:1,text:S(H)??"",subtitle:S(i)("conversation.summaryTitle"),onClose:S(ge)},null,8,["text","subtitle","onClose"])):x.value==="agent"&&S(xe)?(C(),Ve(dee,{key:2,member:S(xe),onClose:S(ie)},null,8,["member","onClose"])):x.value==="btw"&&S(Rt)?(C(),Ve(Hee,{key:3,turns:S(s).sideChatTurns.value,running:S(s).sideChatRunning.value,sending:S(s).sideChatSending.value,onSend:J[51]||(J[51]=he=>S(s).sendSideChatPrompt(he)),onClose:S(Mn)},null,8,["turns","running","sending","onClose"])):x.value==="diff"?(C(),Ve(Tte,{key:4,mode:S(nt),changes:S(s).changes.value,"git-info":S(s).gitInfo.value,"file-diff":S(s).fileDiff.value,"selected-diff-path":S(s).selectedDiffPath.value,"file-diff-loading":S(s).fileDiffLoading.value,closable:"",onOpen:S(lt),onBack:J[52]||(J[52]=he=>{nt.value="list",ct.value=null,S(s).clearFileDiff()}),onClose:S($t)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):x.value==="toolDiff"&&S(ae)?(C(),Ve(Mee,{key:5,target:S(ae),onClose:S(je)},null,8,["target","onClose"])):x.value==="file"?(C(),Ve(HJ,{key:6,file:S(k),loading:S(T),error:S(E),line:S(N)?.line,"download-url":S(O),closable:"","external-actions":S(A),"open-file":S($),onClose:S(D),onOpenExternal:S(W),onReveal:S(V)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):se("",!0)],10,Rpe)):se("",!0),po.value?(C(),Ve(Jte,{key:6,models:S(s).models.value,current:S(s).status.value.modelId,"starred-ids":S(s).starredModelIds.value,loading:Bo.value,unavailable:At.value,onSelect:J[53]||(J[53]=he=>Ye(he)),onToggleStar:J[54]||(J[54]=he=>S(s).toggleStarModel(he)),onClose:J[55]||(J[55]=he=>po.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):se("",!0),zn.value?(C(),Ve(Hie,{key:7,theme:S(s).theme.value,"color-scheme":S(s).colorScheme.value,"ui-font-size":S(s).uiFontSize.value,"auth-ready":S(s).authReady.value,"account-model":S(s).defaultModel.value,notify:S(s).notifyOnComplete.value,"notify-question":S(s).notifyOnQuestion.value,"notify-permission":S(s).notifyPermission.value,sound:S(s).soundOnComplete.value,"beta-toc":S(s).betaToc.value,config:S(s).config.value,models:S(s).models.value,"config-saving":Fo.value,"server-version":S(s).serverVersion.value,onSetTheme:J[56]||(J[56]=he=>S(s).setTheme(he)),onSetColorScheme:J[57]||(J[57]=he=>S(s).setColorScheme(he)),onSetUiFontSize:J[58]||(J[58]=he=>S(s).setUiFontSize(he)),onSetNotify:J[59]||(J[59]=he=>S(s).setNotifyOnComplete(he)),onSetNotifyQuestion:J[60]||(J[60]=he=>S(s).setNotifyOnQuestion(he)),onSetSound:J[61]||(J[61]=he=>S(s).setSoundOnComplete(he)),onSetBetaToc:J[62]||(J[62]=he=>S(s).setBetaToc(he)),onUpdateConfig:J[63]||(J[63]=he=>Ie(he)),onLogin:J[64]||(J[64]=()=>{zn.value=!1,eo()}),onLogout:S(s).logout,onOpenOnboarding:J[65]||(J[65]=()=>{zn.value=!1,b()}),onClose:J[66]||(J[66]=he=>zn.value=!1)},null,8,["theme","color-scheme","ui-font-size","auth-ready","account-model","notify","notify-question","notify-permission","sound","beta-toc","config","models","config-saving","server-version","onLogout"])):se("",!0),Pn.value?(C(),Ve(Une,{key:8,providers:S(s).providers.value,loading:Co.value,unavailable:cn.value,onAdd:J[67]||(J[67]=he=>qe(he)),onRefresh:J[68]||(J[68]=he=>it(he)),onDelete:J[69]||(J[69]=he=>tt(he)),onOpenLogin:J[70]||(J[70]=()=>{Pn.value=!1,eo()}),onClose:J[71]||(J[71]=he=>Pn.value=!1)},null,8,["providers","loading","unavailable"])):se("",!0),On.value?(C(),Ve(Bre,{key:9,status:S(s).status.value,thinking:S(s).thinking.value,"plan-mode":S(s).planMode.value,"swarm-mode":S(s).swarmMode.value,"cost-usd":S(s).sessionCost.value,onClose:J[72]||(J[72]=he=>On.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):se("",!0),wn.value?(C(),Ve(_re,{key:10,"browse-fs":S(s).browseFs,"get-fs-home":S(s).getFsHome,"default-path":S(s).visibleWorkspace.value?.root??S(s).status.value.cwd,error:Jn.value,onAdd:J[73]||(J[73]=he=>mi(he)),onClose:Vn},null,8,["browse-fs","get-fs-home","default-path","error"])):se("",!0),vt(qi,{name:"gload-fade"},{default:$n(()=>[S(s).initialized.value?se("",!0):(C(),Ve(uce,{key:0}))]),_:1}),w.value&&!S(f)?(C(),Ve(ice,{key:11,theme:S(s).theme.value,onSetTheme:J[74]||(J[74]=he=>S(s).setTheme(he)),onComplete:y,onSkip:y},null,8,["theme"])):se("",!0),vt(Xre,{warnings:S(s).warnings.value,onDismiss:S(s).dismissWarning},null,8,["warnings","onDismiss"]),S(r)?(C(),Ve(Wce,{key:12})):se("",!0),S(l)?(C(),Ve(Rle,{key:13,modelValue:a.value,"onUpdate:modelValue":J[75]||(J[75]=he=>a.value=he),groups:S(s).workspaceGroups.value,"active-workspace-id":S(s).activeWorkspaceId.value,"active-id":S(s).activeSessionId.value,"attention-by-session":S(s).attentionBySession.value,"attention-by-workspace":S(s).attentionByWorkspace.value,onSelect:J[76]||(J[76]=he=>S(s).selectSession(he)),onCreate:de,onCreateInWorkspace:J[77]||(J[77]=he=>Te(he)),onAddWorkspace:J[78]||(J[78]=he=>wn.value=!0),onRename:J[79]||(J[79]=(he,yt)=>S(s).renameSession(he,yt)),onArchive:J[80]||(J[80]=he=>S(s).archiveSession(he)),onDeleteWorkspace:J[81]||(J[81]=he=>S(s).deleteWorkspace(he)),onLoadMore:J[82]||(J[82]=he=>void S(s).loadMoreSessions(he))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):se("",!0),S(l)?(C(),Ve(Bae,{key:14,modelValue:c.value,"onUpdate:modelValue":J[83]||(J[83]=he=>c.value=he),status:S(s).status.value,thinking:S(s).thinking.value,"plan-mode":S(s).planMode.value,"swarm-mode":S(s).swarmMode.value,theme:S(s).theme.value,"color-scheme":S(s).colorScheme.value,"ui-font-size":S(s).uiFontSize.value,"auth-ready":S(s).authReady.value,"beta-toc":S(s).betaToc.value,"server-version":S(s).serverVersion.value,onPickModel:J[84]||(J[84]=he=>So()),onSetThinking:J[85]||(J[85]=he=>S(s).setThinking(he)),onTogglePlan:J[86]||(J[86]=he=>S(s).togglePlanMode()),onToggleSwarm:J[87]||(J[87]=he=>S(s).toggleSwarmMode()),onSetPermission:J[88]||(J[88]=he=>S(s).setPermission(he)),onSetTheme:J[89]||(J[89]=he=>S(s).setTheme(he)),onSetColorScheme:J[90]||(J[90]=he=>S(s).setColorScheme(he)),onSetUiFontSize:J[91]||(J[91]=he=>S(s).setUiFontSize(he)),onSetBetaToc:J[92]||(J[92]=he=>S(s).setBetaToc(he)),onLogin:J[93]||(J[93]=()=>{c.value=!1,eo()}),onLogout:S(s).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","theme","color-scheme","ui-font-size","auth-ready","beta-toc","server-version","onLogout"])):se("",!0)],6)),an.value?(C(),Ve(woe,{key:3,"on-start-o-auth-login":be,"on-poll-o-auth-login":Fe,"on-cancel-o-auth-login":xt,onSuccess:Tt,onClose:J[94]||(J[94]=he=>an.value=!1)})):se("",!0)]))}}),Bpe=bt(Dpe,[["__scopeId","data-v-1ebff03f"]]);Poe();Mf(Bpe).use(Sn).mount("#app");export{OE as $,dme as A,xI as B,Bn as C,Fme as D,PC as E,Oe as F,Ir as G,ut as H,vt as I,sI as J,cme as K,di as L,Qe as M,Q$ as N,pme as O,mme as P,yme as Q,cf as R,ya as S,nme as T,gme as U,wv as V,hme as W,Wme as X,vme as Y,Pme as Z,Hpe as _,cS as a,ko as a$,ho as a0,sv as a1,Gpe as a2,uv as a3,w$ as a4,Zt as a5,Ra as a6,eme as a7,zme as a8,ime as a9,pS as aA,RI as aB,UI as aC,sn as aD,WI as aE,HI as aF,iv as aG,FI as aH,Yt as aI,fv as aJ,cI as aK,C as aL,G$ as aM,Zpe as aN,yn as aO,ZC as aP,Qpe as aQ,pf as aR,ds as aS,df as aT,ne as aU,Mme as aV,f4 as aW,Xe as aX,ga as aY,qI as aZ,ume as a_,ame as aa,lme as ab,rme as ac,Ime as ad,Vme as ae,Bt as af,A$ as ag,Ah as ah,Cr as ai,Ui as aj,Ln as ak,Eme as al,fs as am,Er as an,kr as ao,wme as ap,_me as aq,en as ar,ht as as,N$ as at,Le as au,Fpe as av,Wt as aw,OI as ax,BI as ay,Jo as az,Xpe as b,wU as b$,Dme as b0,Qc as b1,bf as b2,Ome as b3,Mr as b4,eI as b5,Upe as b6,Sl as b7,gI as b8,Rme as b9,Wn as bA,Ks as bB,M$ as bC,Nme as bD,ze as bE,yI as bF,tme as bG,kI as bH,Sme as bI,$n as bJ,kme as bK,qt as bL,Os as bM,$me as bN,Ze as bO,Jpe as bP,Jt as bQ,Vo as bR,tge as bS,uj as bT,XA as bU,oge as bV,FW as bW,f0 as bX,nge as bY,w1 as bZ,cge as b_,Wpe as ba,P as bb,Wd as bc,fme as bd,Ht as be,zpe as bf,qpe as bg,QC as bh,Ame as bi,jpe as bj,S as bk,Su as bl,jme as bm,Hme as bn,J$ as bo,ome as bp,xme as bq,vI as br,Ume as bs,bme as bt,sme as bu,aS as bv,Tf as bw,l4 as bx,ex as by,Af as bz,Lme as c,bU as c0,c0 as c1,kU as c2,Zme as c3,NW as c4,Qme as c5,eh as c6,Gme as c7,yU as c8,qA as c9,age as ca,Yme as cb,dge as cc,A1 as cd,ua as ce,x1 as cf,fge as cg,uge as ch,ege as ci,ls as cj,Xme as ck,Jme as cl,WW as cm,lge as cn,T1 as co,S1 as cp,rge as cq,Kme as cr,ige as cs,sge as ct,Tme as d,Sr as e,Vpe as f,qi as g,qme as h,Kpe as i,Ype as j,Fs as k,wu as l,Xn as m,kh as n,ji as o,Bme as p,F as q,Mf as r,Ve as s,se as t,I as u,p as v,f$ as w,Cme as x,d$ as y,h4 as z};
|