@moonshot-ai/kimi-code 0.20.3 → 0.21.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 +88644 -84533
- package/dist-web/assets/{CodeBlockNode-QzsUDFhj.js → CodeBlockNode-j7RGe-Ru.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-COQWnG7I.js → CodeBlockShell.vue_vue_type_style_index_0_lang-D274ciOI.js} +1 -1
- package/dist-web/assets/{Tooltip-DjdYJu5x.js → Tooltip-DtxNXMAM.js} +1 -1
- package/dist-web/assets/arc-DQs9uADf.js +1 -0
- package/dist-web/assets/arc-Doj0wRZ0.js +1 -0
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-D0xfzSKA.js → architectureDiagram-3BPJPVTR-BlG2tTPz.js} +1 -1
- package/dist-web/assets/architectureDiagram-3BPJPVTR-CQ09RrbH.js +36 -0
- package/dist-web/assets/blockDiagram-GPEHLZMM-CAtDjkJt.js +132 -0
- package/dist-web/assets/{blockDiagram-GPEHLZMM-jtPOGuGl.js → blockDiagram-GPEHLZMM-nkQI5ZZa.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-BPIjsoUA.js → c4Diagram-AAUBKEIU-DZN5-qYv.js} +1 -1
- package/dist-web/assets/c4Diagram-AAUBKEIU-DtzacMnD.js +10 -0
- package/dist-web/assets/channel-DNkUo9e6.js +1 -0
- package/dist-web/assets/channel-EUwKK__D.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-ChbTHkcK.js → chunk-2J33WTMH-ByD5PYWi.js} +1 -1
- package/dist-web/assets/chunk-2J33WTMH-w4sdiKFO.js +1 -0
- package/dist-web/assets/{chunk-4BX2VUAB-br1aQrtt.js → chunk-4BX2VUAB-DPyg-S27.js} +1 -1
- package/dist-web/assets/chunk-4BX2VUAB-WqrE2gaw.js +1 -0
- package/dist-web/assets/chunk-55IACEB6-B5dE1-Um.js +1 -0
- package/dist-web/assets/{chunk-55IACEB6-CoLSy_-M.js → chunk-55IACEB6-CH4yuhZ8.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-Ch73eH6y.js → chunk-727SXJPM-DGgZVtcA.js} +2 -2
- package/dist-web/assets/chunk-727SXJPM-Dn5wkDO_.js +206 -0
- package/dist-web/assets/chunk-AQP2D5EJ-FS8-f8lF.js +231 -0
- package/dist-web/assets/{chunk-AQP2D5EJ-7Y0GIirZ.js → chunk-AQP2D5EJ-hJPUZ-_O.js} +1 -1
- package/dist-web/assets/chunk-FMBD7UC4-B2zs_Y-d.js +15 -0
- package/dist-web/assets/{chunk-FMBD7UC4-D7IRCdHF.js → chunk-FMBD7UC4-Barfn9Db.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-WfKpgeWa.js → chunk-ND2GUHAM-ByZWAnct.js} +1 -1
- package/dist-web/assets/chunk-ND2GUHAM-C4-rwdcv.js +1 -0
- package/dist-web/assets/chunk-QZHKN3VN-_Rz9_NuS.js +1 -0
- package/dist-web/assets/{chunk-QZHKN3VN-BgQBqGri.js → chunk-QZHKN3VN-i-qEmEeB.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js +1 -0
- package/dist-web/assets/classDiagram-4FO5ZUOK-DugUof1s.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DugUof1s.js +1 -0
- package/dist-web/assets/cose-bilkent-S5V4N54A-Bi19n8m-.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-Du7Q4b9R.js → cose-bilkent-S5V4N54A-Cb-FqQcD.js} +1 -1
- package/dist-web/assets/dagre-BM42HDAG-DLMfLCoV.js +4 -0
- package/dist-web/assets/{dagre-BM42HDAG-BBLoya79.js → dagre-BM42HDAG-vKebiMPC.js} +1 -1
- package/dist-web/assets/defaultLocale-CCNgq9ws.js +1 -0
- package/dist-web/assets/diagram-2AECGRRQ-DQTst0OH.js +43 -0
- package/dist-web/assets/{diagram-2AECGRRQ-kByHrOvZ.js → diagram-2AECGRRQ-DkhIWqYP.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-Dnkgbduh.js → diagram-5GNKFQAL-DN4cTkR0.js} +1 -1
- package/dist-web/assets/diagram-5GNKFQAL-DoE6q7H1.js +10 -0
- package/dist-web/assets/diagram-KO2AKTUF-CFQs13i5.js +3 -0
- package/dist-web/assets/{diagram-KO2AKTUF-CKfrJMO5.js → diagram-KO2AKTUF-DI-TheQb.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-D3GoTx0o.js → diagram-LMA3HP47-D39qCe0X.js} +1 -1
- package/dist-web/assets/diagram-LMA3HP47-He5zlyMt.js +24 -0
- package/dist-web/assets/{diagram-OG6HWLK6-B057HNTB.js → diagram-OG6HWLK6-ChLxsS1Q.js} +1 -1
- package/dist-web/assets/diagram-OG6HWLK6-DRyxjFMa.js +24 -0
- package/dist-web/assets/{erDiagram-TEJ5UH35-CMFH1-0F.js → erDiagram-TEJ5UH35-qvX9VJtw.js} +1 -1
- package/dist-web/assets/erDiagram-TEJ5UH35-yd6SOv_7.js +85 -0
- package/dist-web/assets/{flowDiagram-I6XJVG4X-Ue7D_If3.js → flowDiagram-I6XJVG4X-DYLFBHuf.js} +1 -1
- package/dist-web/assets/flowDiagram-I6XJVG4X-DkYNQv0R.js +162 -0
- package/dist-web/assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js +292 -0
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-C3vvEQsr.js → ganttDiagram-6RSMTGT7-tnxpnL8N.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-D-L62M3k.js → gitGraphDiagram-PVQCEYII-D8AoA9Eo.js} +1 -1
- package/dist-web/assets/gitGraphDiagram-PVQCEYII-DMbTATyw.js +106 -0
- package/dist-web/assets/graph-BwjfAU3j.js +1 -0
- package/dist-web/assets/{index-YYCI79IV.js → index-16wIPHON.js} +2 -2
- package/dist-web/assets/{index-DRCzCVsJ.js → index-CfoTgIKh.js} +1 -1
- package/dist-web/assets/index-DFqBlS-2.css +1 -0
- package/dist-web/assets/index-DTBMRzx_.js +284 -0
- package/dist-web/assets/{index10-C0e1uOHF.js → index10-ChP4b_K8.js} +1 -1
- package/dist-web/assets/index11-D6-PIcGb.js +8 -0
- package/dist-web/assets/{index5-BD3g_HrT.js → index5-C_gkYwVK.js} +1 -1
- package/dist-web/assets/{index6-BsyLzjzN.js → index6-fL_9Ohtp.js} +1 -1
- package/dist-web/assets/{index7-BU9c3C-0.js → index7-DX_J7I3Z.js} +1 -1
- package/dist-web/assets/{index8-DC4X3Xlc.js → index8-D_LvlNqi.js} +2 -2
- package/dist-web/assets/infoDiagram-5YYISTIA-2JF3XEdD.js +2 -0
- package/dist-web/assets/{infoDiagram-5YYISTIA-DuKrZwyg.js → infoDiagram-5YYISTIA-REaaEnj0.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-DvYYK586.js → ishikawaDiagram-YF4QCWOH-BiPRDWgG.js} +1 -1
- package/dist-web/assets/ishikawaDiagram-YF4QCWOH-C5OstRVV.js +70 -0
- package/dist-web/assets/{journeyDiagram-JHISSGLW-CijMU22u.js → journeyDiagram-JHISSGLW-DrZSDIQL.js} +1 -1
- package/dist-web/assets/journeyDiagram-JHISSGLW-yctdo4bX.js +139 -0
- package/dist-web/assets/{kanban-definition-UN3LZRKU-BmaUhICc.js → kanban-definition-UN3LZRKU-BQZXHq9-.js} +1 -1
- package/dist-web/assets/kanban-definition-UN3LZRKU-CxBCv27E.js +89 -0
- package/dist-web/assets/katexRenderer.worker-CO_gEm4q.js +257 -0
- package/dist-web/assets/layout-C1ojF0zw.js +1 -0
- package/dist-web/assets/linear-3mB6q2-g.js +1 -0
- package/dist-web/assets/{linear-C5DmXyYK.js → linear-DqGsUakD.js} +1 -1
- package/dist-web/assets/{mermaid.core-CxStNiKR.js → mermaid.core-DYzdrsrJ.js} +5 -5
- package/dist-web/assets/mermaidParser.worker-Dx4jPi9z.js +313 -0
- package/dist-web/assets/mindmap-definition-RKZ34NQL-BmJZpjh6.js +96 -0
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-CH1ykt4a.js → mindmap-definition-RKZ34NQL-D69QyDIc.js} +1 -1
- package/dist-web/assets/pieDiagram-4H26LBE5-BkwDAvbt.js +30 -0
- package/dist-web/assets/{pieDiagram-4H26LBE5-D812Mhsu.js → pieDiagram-4H26LBE5-CQwY5Xfh.js} +2 -2
- package/dist-web/assets/quadrantDiagram-W4KKPZXB-BmT_qM09.js +7 -0
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-WyDSXdZ7.js → quadrantDiagram-W4KKPZXB-CLVmtX4l.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-CzaQOU4P.js → requirementDiagram-4Y6WPE33-8ptI5UBX.js} +1 -1
- package/dist-web/assets/requirementDiagram-4Y6WPE33-CZrxH1Y2.js +84 -0
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-D2mgS_7C.js → sankeyDiagram-5OEKKPKP-CZjapjER.js} +1 -1
- package/dist-web/assets/sankeyDiagram-5OEKKPKP-De_o7hDr.js +40 -0
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-CuoLev25.js → sequenceDiagram-3UESZ5HK-CWHjmftc.js} +1 -1
- package/dist-web/assets/sequenceDiagram-3UESZ5HK-VAxffBe7.js +162 -0
- package/dist-web/assets/stateDiagram-AJRCARHV-D2xCeXSD.js +1 -0
- package/dist-web/assets/stateDiagram-AJRCARHV-nDExQydZ.js +1 -0
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BzwD_BIl.js +1 -0
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Dn6bAjEF.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-DkLWuglL.js → timeline-definition-PNZ67QCA-CRlejYtd.js} +1 -1
- package/dist-web/assets/timeline-definition-PNZ67QCA-DsVZdrZa.js +120 -0
- package/dist-web/assets/vennDiagram-CIIHVFJN-BBHQmCFf.js +34 -0
- package/dist-web/assets/{vennDiagram-CIIHVFJN-DYjvU6dg.js → vennDiagram-CIIHVFJN-CTv_68HS.js} +1 -1
- package/dist-web/assets/{vue.runtime.esm-bundler-C_eIrEdV.js → vue.runtime.esm-bundler-CQbR9uOv.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-DSIStv05.js → wardley-L42UT6IY-0vHHFPAt.js} +1 -1
- package/dist-web/assets/wardley-L42UT6IY-BJFn8eDD.js +173 -0
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-DSPJWT6D.js → wardleyDiagram-YWT4CUSO-CpO8VbUu.js} +1 -1
- package/dist-web/assets/wardleyDiagram-YWT4CUSO-DCiyDQNB.js +78 -0
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-C0OPS_b1.js → xychartDiagram-2RQKCTM6-ClTcdHp2.js} +1 -1
- package/dist-web/assets/xychartDiagram-2RQKCTM6-Db_VoDBV.js +7 -0
- package/dist-web/index.html +2 -2
- package/package.json +6 -6
- package/dist-web/assets/arc-BgPs0rMd.js +0 -1
- package/dist-web/assets/channel-DnBCccMg.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DezksBKS.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DezksBKS.js +0 -1
- package/dist-web/assets/index-BOozFshs.js +0 -284
- package/dist-web/assets/index-gP3qbaq1.css +0 -1
- package/dist-web/assets/index11-qzoItZ5X.js +0 -9
- package/dist-web/assets/stateDiagram-AJRCARHV-BoTsuaL9.js +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-8LYkXLp8.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-QzsUDFhj.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-COQWnG7I.js","assets/index8-DC4X3Xlc.js","assets/index11-qzoItZ5X.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 ih(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ot={},sa=[],Ps=()=>{},rC=()=>!1,du=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),rh=e=>e.startsWith("onUpdate:"),tn=Object.assign,z1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ZM=Object.prototype.hasOwnProperty,Kt=(e,t)=>ZM.call(e,t),ut=Array.isArray,ia=e=>Aa(e)==="[object Map]",ml=e=>Aa(e)==="[object Set]",Gy=e=>Aa(e)==="[object Date]",JM=e=>Aa(e)==="[object RegExp]",wt=e=>typeof e=="function",sn=e=>typeof e=="string",gs=e=>typeof e=="symbol",Gt=e=>e!==null&&typeof e=="object",V1=e=>(Gt(e)||wt(e))&&wt(e.then)&&wt(e.catch),lC=Object.prototype.toString,Aa=e=>lC.call(e),eE=e=>Aa(e).slice(8,-1),lh=e=>Aa(e)==="[object Object]",ah=e=>sn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,rl=ih(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ch=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},tE=/-\w/g,Xn=ch(e=>e.replace(tE,t=>t.slice(1).toUpperCase())),nE=/\B([A-Z])/g,Uo=ch(e=>e.replace(nE,"-$1").toLowerCase()),uh=ch(e=>e.charAt(0).toUpperCase()+e.slice(1)),Nd=ch(e=>e?`on${uh(e)}`:""),ao=(e,t)=>!Object.is(e,t),ra=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},aC=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},dh=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Zd=e=>{const t=sn(e)?Number(e):NaN;return isNaN(t)?e:t};let Yy;const fh=()=>Yy||(Yy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),oE="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",sE=ih(oE);function Wt(e){if(ut(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=sn(o)?aE(o):Wt(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(sn(e)||Gt(e))return e}const iE=/;(?![^(]*\))/g,rE=/:([^]+)/,lE=/\/\*[^]*?\*\//g;function aE(e){const t={};return e.replace(lE,"").split(iE).forEach(n=>{if(n){const o=n.split(rE);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Pe(e){let t="";if(sn(e))t=e;else if(ut(e))for(let n=0;n<e.length;n++){const o=Pe(e[n]);o&&(t+=o+" ")}else if(Gt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Bhe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!sn(t)&&(e.class=Pe(t)),n&&(e.style=Wt(n)),e}const cE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",uE=ih(cE);function cC(e){return!!e||e===""}function dE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Pi(e[o],t[o]);return n}function Pi(e,t){if(e===t)return!0;let n=Gy(e),o=Gy(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=gs(e),o=gs(t),n||o)return e===t;if(n=ut(e),o=ut(t),n||o)return n&&o?dE(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||!Pi(e[r],t[r]))return!1}}return String(e)===String(t)}function hh(e,t){return e.findIndex(n=>Pi(n,t))}const uC=e=>!!(e&&e.__v_isRef===!0),P=e=>sn(e)?e:e==null?"":ut(e)||Gt(e)&&(e.toString===lC||!wt(e.toString))?uC(e)?P(e.value):JSON.stringify(e,dC,2):String(e),dC=(e,t)=>uC(t)?dC(e,t.value):ia(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[nm(o,i)+" =>"]=s,n),{})}:ml(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>nm(n))}:gs(t)?nm(t):Gt(t)&&!ut(t)&&!lh(t)?String(t):t,nm=(e,t="")=>{var n;return gs(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function fE(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 fC{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&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 hE(e){return new fC(e)}function K1(){return Yn}function G1(e,t=!1){Yn&&Yn.cleanups.push(e)}let dn;const om=new WeakSet;class Jd{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Yn&&(Yn.active?Yn.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,om.has(this)&&(om.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||pC(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Xy(this),mC(this);const t=dn,n=Vs;dn=this,Vs=!0;try{return this.fn()}finally{gC(this),dn=t,Vs=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Q1(t);this.deps=this.depsTail=void 0,Xy(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?om.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){bg(this)&&this.run()}get dirty(){return bg(this)}}let hC=0,wc,_c;function pC(e,t=!1){if(e.flags|=8,t){e.next=_c,_c=e;return}e.next=wc,wc=e}function Y1(){hC++}function X1(){if(--hC>0)return;if(_c){let t=_c;for(_c=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;wc;){let t=wc;for(wc=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function mC(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function gC(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),Q1(o),pE(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function bg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(vC(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function vC(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Fc)||(e.globalVersion=Fc,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!bg(e))))return;e.flags|=2;const t=e.dep,n=dn,o=Vs;dn=e,Vs=!0;try{mC(e);const s=e.fn(e._value);(t.version===0||ao(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{dn=n,Vs=o,gC(e),e.flags&=-3}}function Q1(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)Q1(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function pE(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Fhe(e,t){e.effect instanceof Jd&&(e=e.effect.fn);const n=new Jd(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 Hhe(e){e.effect.stop()}let Vs=!0;const yC=[];function Oi(){yC.push(Vs),Vs=!1}function Ri(){const e=yC.pop();Vs=e===void 0?!0:e}function Xy(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=dn;dn=void 0;try{t()}finally{dn=n}}}let Fc=0;class mE{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ph{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||!Vs||dn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==dn)n=this.activeLink=new mE(dn,this),dn.deps?(n.prevDep=dn.depsTail,dn.depsTail.nextDep=n,dn.depsTail=n):dn.deps=dn.depsTail=n,kC(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=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++,Fc++,this.notify(t)}notify(t){Y1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{X1()}}}function kC(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)kC(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ef=new WeakMap,ll=Symbol(""),wg=Symbol(""),Hc=Symbol("");function yo(e,t,n){if(Vs&&dn){let o=ef.get(e);o||ef.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new ph),s.map=o,s.key=n),s.track()}}function Ai(e,t,n,o,s,i){const r=ef.get(e);if(!r){Fc++;return}const l=a=>{a&&a.trigger()};if(Y1(),t==="clear")r.forEach(l);else{const a=ut(e),c=a&&ah(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===Hc||!gs(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Hc)),t){case"add":a?c&&l(r.get("length")):(l(r.get(ll)),ia(e)&&l(r.get(wg)));break;case"delete":a||(l(r.get(ll)),ia(e)&&l(r.get(wg)));break;case"set":ia(e)&&l(r.get(ll));break}}X1()}function gE(e,t){const n=ef.get(e);return n&&n.get(t)}function Bl(e){const t=Ht(e);return t===e?t:(yo(t,"iterate",Hc),us(e)?t:t.map(Ks))}function mh(e){return yo(e=Ht(e),"iterate",Hc),e}function li(e,t){return Di(e)?ba(mr(e)?Ks(t):t):Ks(t)}const vE={__proto__:null,[Symbol.iterator](){return sm(this,Symbol.iterator,e=>li(this,e))},concat(...e){return Bl(this).concat(...e.map(t=>ut(t)?Bl(t):t))},entries(){return sm(this,"entries",e=>(e[1]=li(this,e[1]),e))},every(e,t){return _i(this,"every",e,t,void 0,arguments)},filter(e,t){return _i(this,"filter",e,t,n=>n.map(o=>li(this,o)),arguments)},find(e,t){return _i(this,"find",e,t,n=>li(this,n),arguments)},findIndex(e,t){return _i(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return _i(this,"findLast",e,t,n=>li(this,n),arguments)},findLastIndex(e,t){return _i(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return _i(this,"forEach",e,t,void 0,arguments)},includes(...e){return im(this,"includes",e)},indexOf(...e){return im(this,"indexOf",e)},join(e){return Bl(this).join(e)},lastIndexOf(...e){return im(this,"lastIndexOf",e)},map(e,t){return _i(this,"map",e,t,void 0,arguments)},pop(){return tc(this,"pop")},push(...e){return tc(this,"push",e)},reduce(e,...t){return Qy(this,"reduce",e,t)},reduceRight(e,...t){return Qy(this,"reduceRight",e,t)},shift(){return tc(this,"shift")},some(e,t){return _i(this,"some",e,t,void 0,arguments)},splice(...e){return tc(this,"splice",e)},toReversed(){return Bl(this).toReversed()},toSorted(e){return Bl(this).toSorted(e)},toSpliced(...e){return Bl(this).toSpliced(...e)},unshift(...e){return tc(this,"unshift",e)},values(){return sm(this,"values",e=>li(this,e))}};function sm(e,t,n){const o=mh(e),s=o[t]();return o!==e&&!us(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const yE=Array.prototype;function _i(e,t,n,o,s,i){const r=mh(e),l=r!==e&&!us(e),a=r[t];if(a!==yE[t]){const d=a.apply(e,i);return l?Ks(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,li(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,o);return l&&s?s(u):u}function Qy(e,t,n,o){const s=mh(e),i=s!==e&&!us(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=li(e,c)),n.call(this,c,li(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?li(e,a):a}function im(e,t,n){const o=Ht(e);yo(o,"iterate",Hc);const s=o[t](...n);return(s===-1||s===!1)&&yh(n[0])?(n[0]=Ht(n[0]),o[t](...n)):s}function tc(e,t,n=[]){Oi(),Y1();const o=Ht(e)[t].apply(e,n);return X1(),Ri(),o}const kE=ih("__proto__,__v_isRef,__isVue"),bC=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(gs));function bE(e){gs(e)||(e=String(e));const t=Ht(this);return yo(t,"has",e),t.hasOwnProperty(e)}class wC{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?AC:TC:i?xC:SC).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=ut(t);if(!s){let a;if(r&&(a=vE[n]))return a;if(n==="hasOwnProperty")return bE}const l=Reflect.get(t,n,Pn(t)?t:o);if((gs(n)?bC.has(n):kE(n))||(s||yo(t,"get",n),i))return l;if(Pn(l)){const a=r&&ah(n)?l:l.value;return s&&Gt(a)?tf(a):a}return Gt(l)?s?tf(l):as(l):l}}class _C extends wC{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=ut(t)&&ah(n);if(!this._isShallow){const c=Di(i);if(!us(o)&&!Di(o)&&(i=Ht(i),o=Ht(o)),!r&&Pn(i)&&!Pn(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:Kt(t,n),a=Reflect.set(t,n,o,Pn(t)?t:s);return t===Ht(s)&&(l?ao(o,i)&&Ai(t,"set",n,o):Ai(t,"add",n,o)),a}deleteProperty(t,n){const o=Kt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&Ai(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!gs(n)||!bC.has(n))&&yo(t,"has",n),o}ownKeys(t){return yo(t,"iterate",ut(t)?"length":ll),Reflect.ownKeys(t)}}class CC extends wC{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const wE=new _C,_E=new CC,CE=new _C(!0),SE=new CC(!0),_g=e=>e,Qu=e=>Reflect.getPrototypeOf(e);function xE(e,t,n){return function(...o){const s=this.__v_raw,i=Ht(s),r=ia(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?_g:t?ba:Ks;return!t&&yo(i,"iterate",a?wg:ll),tn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Zu(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function TE(e,t){const n={get(s){const i=this.__v_raw,r=Ht(i),l=Ht(s);e||(ao(s,l)&&yo(r,"get",s),yo(r,"get",l));const{has:a}=Qu(r),c=t?_g:e?ba:Ks;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",ll),s.size},has(s){const i=this.__v_raw,r=Ht(i),l=Ht(s);return e||(ao(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?_g:e?ba:Ks;return!e&&yo(a,"iterate",ll),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return tn(n,e?{add:Zu("add"),set:Zu("set"),delete:Zu("delete"),clear:Zu("clear")}:{add(s){const i=Ht(this),r=Qu(i),l=Ht(s),a=!t&&!us(s)&&!Di(s)?l:s;return r.has.call(i,a)||ao(s,a)&&r.has.call(i,s)||ao(l,a)&&r.has.call(i,l)||(i.add(a),Ai(i,"add",a,a)),this},set(s,i){!t&&!us(i)&&!Di(i)&&(i=Ht(i));const r=Ht(this),{has:l,get:a}=Qu(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?ao(i,u)&&Ai(r,"set",s,i):Ai(r,"add",s,i),this},delete(s){const i=Ht(this),{has:r,get:l}=Qu(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&&Ai(i,"delete",s,void 0),c},clear(){const s=Ht(this),i=s.size!==0,r=s.clear();return i&&Ai(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=xE(s,e,t)}),n}function gh(e,t){const n=TE(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 AE={get:gh(!1,!1)},ME={get:gh(!1,!0)},EE={get:gh(!0,!1)},IE={get:gh(!0,!0)},SC=new WeakMap,xC=new WeakMap,TC=new WeakMap,AC=new WeakMap;function $E(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function as(e){return Di(e)?e:vh(e,!1,wE,AE,SC)}function NE(e){return vh(e,!1,CE,ME,xC)}function tf(e){return vh(e,!0,_E,EE,TC)}function Whe(e){return vh(e,!0,SE,IE,AC)}function vh(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=$E(eE(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function mr(e){return Di(e)?mr(e.__v_raw):!!(e&&e.__v_isReactive)}function Di(e){return!!(e&&e.__v_isReadonly)}function us(e){return!!(e&&e.__v_isShallow)}function yh(e){return e?!!e.__v_raw:!1}function Ht(e){const t=e&&e.__v_raw;return t?Ht(t):e}function fr(e){return!Kt(e,"__v_skip")&&Object.isExtensible(e)&&aC(e,"__v_skip",!0),e}const Ks=e=>Gt(e)?as(e):e,ba=e=>Gt(e)?tf(e):e;function Pn(e){return e?e.__v_isRef===!0:!1}function ne(e){return MC(e,!1)}function gl(e){return MC(e,!0)}function MC(e,t){return Pn(e)?e:new LE(e,t)}class LE{constructor(t,n){this.dep=new ph,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ht(t),this._value=n?t:Ks(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||us(t)||Di(t);t=o?t:Ht(t),ao(t,n)&&(this._rawValue=t,this._value=o?t:Ks(t),this.dep.trigger())}}function Uhe(e){e.dep&&e.dep.trigger()}function x(e){return Pn(e)?e.value:e}function EC(e){return wt(e)?e():x(e)}const PE={get:(e,t,n)=>t==="__v_raw"?e:x(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return Pn(s)&&!Pn(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function IC(e){return mr(e)?e:new Proxy(e,PE)}class OE{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ph,{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 RE(e){return new OE(e)}function qhe(e){const t=ut(e)?new Array(e.length):{};for(const n in e)t[n]=$C(e,n);return t}class DE{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=gs(n)?n:String(n),this._raw=Ht(t);let s=!0,i=t;if(!ut(t)||gs(this._key)||!ah(this._key))do s=!yh(i)||us(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=x(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Pn(this._raw[this._key])){const n=this._object[this._key];if(Pn(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return gE(this._raw,this._key)}}class BE{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 jhe(e,t,n){return Pn(e)?e:wt(e)?new BE(e):Gt(e)&&arguments.length>1?$C(e,t,n):ne(e)}function $C(e,t,n){return new DE(e,t,n)}class FE{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ph(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Fc-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 pC(this,!0),!0}get value(){const t=this.dep.track();return vC(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function HE(e,t,n=!1){let o,s;return wt(e)?o=e:(o=e.get,s=e.set),new FE(o,s,n)}const zhe={GET:"get",HAS:"has",ITERATE:"iterate"},Vhe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Ju={},nf=new WeakMap;let rr;function Khe(){return rr}function WE(e,t=!1,n=rr){if(n){let o=nf.get(n);o||nf.set(n,o=[]),o.push(e)}}function UE(e,t,n=Ot){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>s?y:us(y)||s===!1||s===0?Mi(y,1):Mi(y);let u,d,f,g,h=!1,m=!1;if(Pn(e)?(d=()=>e.value,h=us(e)):mr(e)?(d=()=>c(e),h=!0):ut(e)?(m=!0,h=e.some(y=>mr(y)||us(y)),d=()=>e.map(y=>{if(Pn(y))return y.value;if(mr(y))return c(y);if(wt(y))return a?a(y,2):y()})):wt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Oi();try{f()}finally{Ri()}}const y=rr;rr=u;try{return a?a(e,3,[g]):e(g)}finally{rr=y}}:d=Ps,t&&s){const y=d,S=s===!0?1/0:s;d=()=>Mi(y(),S)}const _=K1(),w=()=>{u.stop(),_&&_.active&&z1(_.effects,u)};if(i&&t){const y=t;t=(...S)=>{y(...S),w()}}let k=m?new Array(e.length).fill(Ju):Ju;const b=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const S=u.run();if(s||h||(m?S.some((L,N)=>ao(L,k[N])):ao(S,k))){f&&f();const L=rr;rr=u;try{const N=[S,k===Ju?void 0:m&&k[0]===Ju?[]:k,g];k=S,a?a(t,3,N):t(...N)}finally{rr=L}}}else u.run()};return l&&l(b),u=new Jd(d),u.scheduler=r?()=>r(b,!1):b,g=y=>WE(y,!1,u),f=u.onStop=()=>{const y=nf.get(u);if(y){if(a)a(y,4);else for(const S of y)S();nf.delete(u)}},t?o?b(!0):k=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 Mi(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--,Pn(e))Mi(e.value,t,n);else if(ut(e))for(let o=0;o<e.length;o++)Mi(e[o],t,n);else if(ml(e)||ia(e))e.forEach(o=>{Mi(o,t,n)});else if(lh(e)){for(const o in e)Mi(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Mi(e[o],t,n)}return e}/**
|
|
11
|
-
* @vue/runtime-core v3.5.35
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/const NC=[];function qE(e){NC.push(e)}function jE(){NC.pop()}function Ghe(e,t){}const Yhe={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"},zE={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 fu(e,t,n,o){try{return o?e(...o):e()}catch(s){Ma(s,t,n)}}function Rs(e,t,n,o){if(wt(e)){const s=fu(e,t,n,o);return s&&V1(s)&&s.catch(i=>{Ma(i,t,n)}),s}if(ut(e)){const s=[];for(let i=0;i<e.length;i++)s.push(Rs(e[i],t,n,o));return s}}function Ma(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){Oi(),fu(i,null,10,[e,a,c]),Ri();return}}VE(e,n,s,o,r)}function VE(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const Ao=[];let si=-1;const la=[];let lr=null,Kl=0;const LC=Promise.resolve();let of=null;function ht(e){const t=of||LC;return e?t.then(this?e.bind(this):e):t}function KE(e){let t=si+1,n=Ao.length;for(;t<n;){const o=t+n>>>1,s=Ao[o],i=Wc(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function Z1(e){if(!(e.flags&1)){const t=Wc(e),n=Ao[Ao.length-1];!n||!(e.flags&2)&&t>=Wc(n)?Ao.push(e):Ao.splice(KE(t),0,e),e.flags|=1,PC()}}function PC(){of||(of=LC.then(OC))}function sf(e){ut(e)?la.push(...e):lr&&e.id===-1?lr.splice(Kl+1,0,e):e.flags&1||(la.push(e),e.flags|=1),PC()}function Zy(e,t,n=si+1){for(;n<Ao.length;n++){const o=Ao[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;Ao.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function rf(e){if(la.length){const t=[...new Set(la)].sort((n,o)=>Wc(n)-Wc(o));if(la.length=0,lr){lr.push(...t);return}for(lr=t,Kl=0;Kl<lr.length;Kl++){const n=lr[Kl];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}lr=null,Kl=0}}const Wc=e=>e.id==null?e.flags&2?-1:1/0:e.id;function OC(e){try{for(si=0;si<Ao.length;si++){const t=Ao[si];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),fu(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;si<Ao.length;si++){const t=Ao[si];t&&(t.flags&=-2)}si=-1,Ao.length=0,rf(),of=null,(Ao.length||la.length)&&OC()}}let Gl,ed=[];function RC(e,t){var n,o;Gl=e,Gl?(Gl.enabled=!0,ed.forEach(({event:s,args:i})=>Gl.emit(s,...i)),ed=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{RC(i,t)}),setTimeout(()=>{Gl||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ed=[])},3e3)):ed=[]}let uo=null,kh=null;function Uc(e){const t=uo;return uo=e,kh=e&&e.type.__scopeId||null,t}function Xhe(e){kh=e}function Qhe(){kh=null}const Zhe=e=>$n;function $n(e,t=uo,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&df(-1);const i=Uc(t);let r;try{r=e(...s)}finally{Uc(i),o._d&&df(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function jt(e,t){if(uo===null)return e;const n=gu(uo),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&&Mi(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function ri(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&&(Oi(),Rs(a,n,8,[e.el,l,e,t]),Ri())}}function yn(e,t){if(co){let n=co.provides;const o=co.parent&&co.parent.provides;o===n&&(n=co.provides=Object.create(o)),n[e]=t}}function Bt(e,t,n=!1){const o=fo();if(o||al){let s=al?al._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 Jhe(){return!!(fo()||al)}const GE=Symbol.for("v-scx"),YE=()=>Bt(GE);function XE(e,t){return hu(e,null,t)}function epe(e,t){return hu(e,null,{flush:"post"})}function QE(e,t){return hu(e,null,{flush:"sync"})}function ze(e,t,n){return hu(e,t,n)}function hu(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(hl){if(i==="sync"){const g=YE();c=g.__watcherHandles||(g.__watcherHandles=[])}else if(!a){const g=()=>{};return g.stop=Ps,g.resume=Ps,g.pause=Ps,g}}const u=co;l.call=(g,h,m)=>Rs(g,u,h,m);let d=!1;i==="post"?l.scheduler=g=>{Rn(g,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(g,h)=>{h?g():Z1(g)}),l.augmentJob=g=>{t&&(g.flags|=4),d&&(g.flags|=2,u&&(g.id=u.uid,g.i=u))};const f=UE(e,t,l);return hl&&(c?c.push(f):a&&f()),f}function ZE(e,t,n){const o=this.proxy,s=sn(e)?e.includes(".")?DC(o,e):()=>o[e]:e.bind(o,o);let i;wt(t)?i=t:(i=t.handler,n=t);const r=Ea(this),l=hu(s,i.bind(o),n);return r(),l}function DC(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}const sr=new WeakMap,BC=Symbol("_vte"),FC=e=>e.__isTeleport,Zr=e=>e&&(e.disabled||e.disabled===""),JE=e=>e&&(e.defer||e.defer===""),Jy=e=>typeof SVGElement<"u"&&e instanceof SVGElement,ek=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Cg=(e,t)=>{const n=e&&e.to;return sn(n)?t?t(n):null:n},e4={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:g,querySelector:h,createText:m,createComment:_,parentNode:w}}=c,k=Zr(t.props);let{dynamicChildren:b}=t;const y=(N,v,M)=>{N.shapeFlag&16&&u(N.children,v,M,s,i,r,l,a)},S=(N=t)=>{const v=Zr(N.props),M=N.target=Cg(N.props,h),$=Sg(M,N,m,g);M&&(r!=="svg"&&Jy(M)?r="svg":r!=="mathml"&&ek(M)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(M),v||(y(N,M,$),uc(N,!1)))},L=N=>{const v=()=>{if(sr.get(N)===v){if(sr.delete(N),Zr(N.props)){const M=w(N.el)||n;y(N,M,N.anchor),uc(N,!0)}S(N)}};sr.set(N,v),Rn(v,i)};if(e==null){const N=t.el=m(""),v=t.anchor=m("");if(g(N,n,o),g(v,n,o),JE(t.props)||i&&i.pendingBranch){L(t);return}k&&(y(t,n,v),uc(t,!0)),S()}else{t.el=e.el;const N=t.anchor=e.anchor,v=sr.get(e);if(v){v.flags|=8,sr.delete(e),L(t);return}t.targetStart=e.targetStart;const M=t.target=e.target,$=t.targetAnchor=e.targetAnchor,O=Zr(e.props),T=O?n:M,I=O?N:$;if(r==="svg"||Jy(M)?r="svg":(r==="mathml"||ek(M))&&(r="mathml"),b?(f(e.dynamicChildren,b,T,s,i,r,l),av(e,t,!0)):a||d(e,t,T,I,s,i,r,l,!1),k)O?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):td(t,n,N,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=Cg(t.props,h);R&&td(t,R,null,c,0)}else O&&td(t,M,$,c,1);uc(t,k)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,g=i||!Zr(f),h=sr.get(e);if(h&&(h.flags|=8,sr.delete(e)),d&&(s(c),s(u)),i&&s(a),!h&&r&16)for(let m=0;m<l.length;m++){const _=l[m];o(_,t,n,g,!!_.dynamicChildren)}},move:td,hydrate:t4};function td(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),!sr.has(e)&&(!d||Zr(u))&&a&16)for(let f=0;f<c.length;f++)s(c[f],t,n,2);d&&o(l,t,n)}function t4(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(_,w){let k=w;for(;k;){if(k&&k.nodeType===8){if(k.data==="teleport start anchor")t.targetStart=k;else if(k.data==="teleport anchor"){t.targetAnchor=k,_._lpa=t.targetAnchor&&r(t.targetAnchor);break}}k=r(k)}}function g(_,w){w.anchor=d(r(_),w,l(_),n,o,s,i)}const h=t.target=Cg(t.props,a),m=Zr(t.props);if(h){const _=h._lpa||h.firstChild;t.shapeFlag&16&&(m?(g(e,t),f(h,_),t.targetAnchor||Sg(h,t,u,c,l(e)===h?e:null)):(t.anchor=r(e),f(h,_),t.targetAnchor||Sg(h,t,u,c),d(_&&r(_),t,h,n,o,s,i))),uc(t,m)}else m&&t.shapeFlag&16&&(g(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const tpe=e4;function uc(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 Sg(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[BC]=r,e&&(o(i,e,s),o(r,e,s)),r}const Es=Symbol("_leaveCb"),nc=Symbol("_enterCb");function HC(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return rn(()=>{e.isMounted=!0}),Yo(()=>{e.isUnmounting=!0}),e}const Ss=[Function,Array],WC={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ss,onEnter:Ss,onAfterEnter:Ss,onEnterCancelled:Ss,onBeforeLeave:Ss,onLeave:Ss,onAfterLeave:Ss,onLeaveCancelled:Ss,onBeforeAppear:Ss,onAppear:Ss,onAfterAppear:Ss,onAppearCancelled:Ss},UC=e=>{const t=e.subTree;return t.component?UC(t.component):t},n4={name:"BaseTransition",props:WC,setup(e,{slots:t}){const n=fo(),o=HC();return()=>{const s=t.default&&J1(t.default(),!0),i=s&&s.length?qC(s):n.subTree?ie():void 0;if(!i)return;const r=Ht(e),{mode:l}=r;if(o.isLeaving)return rm(i);const a=tk(i);if(!a)return rm(i);let c=qc(a,r,o,n,d=>c=d);a.type!==Bn&&br(a,c);let u=n.subTree&&tk(n.subTree);if(u&&u.type!==Bn&&!qs(u,a)&&UC(n).type!==Bn){let d=qc(u,r,o,n);if(br(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},rm(i);l==="in-out"&&a.type!==Bn?d.delayLeave=(f,g,h)=>{const m=jC(o,u);m[String(u.key)]=u,f[Es]=()=>{g(),f[Es]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{h(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function qC(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Bn){t=n;break}}return t}const o4=n4;function jC(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:f,onLeave:g,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:_,onAppear:w,onAfterAppear:k,onAppearCancelled:b}=t,y=String(e.key),S=jC(n,e),L=(M,$)=>{M&&Rs(M,o,9,$)},N=(M,$)=>{const O=$[1];L(M,$),ut(M)?M.every(T=>T.length<=1)&&O():M.length<=1&&O()},v={mode:r,persisted:l,beforeEnter(M){let $=a;if(!n.isMounted)if(i)$=_||a;else return;M[Es]&&M[Es](!0);const O=S[y];O&&qs(e,O)&&O.el[Es]&&O.el[Es](),L($,[M])},enter(M){if(S[y]===e)return;let $=c,O=u,T=d;if(!n.isMounted)if(i)$=w||c,O=k||u,T=b||d;else return;let I=!1;M[nc]=D=>{I||(I=!0,D?L(T,[M]):L(O,[M]),v.delayedLeave&&v.delayedLeave(),M[nc]=void 0)};const R=M[nc].bind(null,!1);$?N($,[M,R]):R()},leave(M,$){const O=String(e.key);if(M[nc]&&M[nc](!0),n.isUnmounting)return $();L(f,[M]);let T=!1;M[Es]=R=>{T||(T=!0,$(),R?L(m,[M]):L(h,[M]),M[Es]=void 0,S[O]===e&&delete S[O])};const I=M[Es].bind(null,!1);S[O]=e,g?N(g,[M,I]):I()},clone(M){const $=qc(M,t,n,o,s);return s&&s($),$}};return v}function rm(e){if(pu(e))return e=Bi(e),e.children=null,e}function tk(e){if(!pu(e))return FC(e.type)&&e.children?qC(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 br(e,t){e.shapeFlag&6&&e.component?(e.transition=t,br(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 J1(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(J1(r.children,t,l))):(t||r.type!==Bn)&&o.push(l!=null?Bi(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 npe(){const e=fo();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function ev(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ope(e){const t=fo(),n=gl(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 nk(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const lf=new WeakMap;function aa(e,t,n,o,s=!1){if(ut(e)){e.forEach((m,_)=>aa(m,t&&(ut(t)?t[_]:t),n,o,s));return}if(Ni(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&aa(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?gu(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,f=Ht(d),g=d===Ot?rC:m=>nk(u,m)?!1:Kt(f,m),h=(m,_)=>!(_&&nk(u,_));if(c!=null&&c!==a){if(ok(t),sn(c))u[c]=null,g(c)&&(d[c]=null);else if(Pn(c)){const m=t;h(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(wt(a))fu(a,l,12,[r,u]);else{const m=sn(a),_=Pn(a);if(m||_){const w=()=>{if(e.f){const k=m?g(a)?d[a]:u[a]:h()||!e.k?a.value:u[e.k];if(s)ut(k)&&z1(k,i);else if(ut(k))k.includes(i)||k.push(i);else if(m)u[a]=[i],g(a)&&(d[a]=u[a]);else{const b=[i];h(a,e.k)&&(a.value=b),e.k&&(u[e.k]=b)}}else m?(u[a]=r,g(a)&&(d[a]=r)):_&&(h(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const k=()=>{w(),lf.delete(e)};k.id=-1,lf.set(e,k),Rn(k,n)}else ok(e),w()}}}function ok(e){const t=lf.get(e);t&&(t.flags|=8,lf.delete(e))}let sk=!1;const Fl=()=>{sk||(console.error("Hydration completed but contains mismatches."),sk=!0)},s4=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",i4=e=>e.namespaceURI.includes("MathML"),nd=e=>{if(e.nodeType===1){if(s4(e))return"svg";if(i4(e))return"mathml"}},Zl=e=>e.nodeType===8;function r4(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(b,y)=>{if(!y.hasChildNodes()){n(null,b,y),rf(),y._vnode=b;return}d(y.firstChild,b,null,null,null),rf(),y._vnode=b},d=(b,y,S,L,N,v=!1)=>{v=v||!!y.dynamicChildren;const M=Zl(b)&&b.data==="[",$=()=>m(b,y,S,L,N,M),{type:O,ref:T,shapeFlag:I,patchFlag:R}=y;let D=b.nodeType;y.el=b,R===-2&&(v=!1,y.dynamicChildren=null);let W=null;switch(O){case gr:D!==3?y.children===""?(a(y.el=s(""),r(b),b),W=b):W=$():(b.data!==y.children&&(Fl(),b.data=y.children),W=i(b));break;case Bn:k(b)?(W=i(b),w(y.el=b.content.firstChild,b,S)):D!==8||M?W=$():W=i(b);break;case da:if(M&&(b=i(b),D=b.nodeType),D===1||D===3){W=b;const V=!y.children.length;for(let U=0;U<y.staticCount;U++)V&&(y.children+=W.nodeType===1?W.outerHTML:W.data),U===y.staticCount-1&&(y.anchor=W),W=i(W);return M?i(W):W}else $();break;case Oe:M?W=h(b,y,S,L,N,v):W=$();break;default:if(I&1)(D!==1||y.type.toLowerCase()!==b.tagName.toLowerCase())&&!k(b)?W=$():W=f(b,y,S,L,N,v);else if(I&6){y.slotScopeIds=N;const V=r(b);if(M?W=_(b):Zl(b)&&b.data==="teleport start"?W=_(b,b.data,"teleport end"):W=i(b),t(y,V,null,S,L,nd(V),v),Ni(y)&&!y.type.__asyncResolved){let U;M?(U=vt(Oe),U.anchor=W?W.previousSibling:V.lastChild):U=b.nodeType===3?ft(""):vt("div"),U.el=b,y.component.subTree=U}}else I&64?D!==8?W=$():W=y.type.hydrate(b,y,S,L,N,v,e,g):I&128&&(W=y.type.hydrate(b,y,S,L,nd(r(b)),N,v,e,d))}return T!=null&&aa(T,null,L,y),W},f=(b,y,S,L,N,v)=>{v=v||!!y.dynamicChildren;const{type:M,props:$,patchFlag:O,shapeFlag:T,dirs:I,transition:R}=y,D=M==="input"||M==="option";if(D||O!==-1){I&&ri(y,null,S,"created");let W=!1;if(k(b)){W=cS(null,R)&&S&&S.vnode.props&&S.vnode.props.appear;const U=b.content.firstChild;if(W){const J=U.getAttribute("class");J&&(U.$cls=J),R.beforeEnter(U)}w(U,b,S),y.el=b=U}if(T&16&&!($&&($.innerHTML||$.textContent))){let U=g(b.firstChild,y,b,S,L,N,v);for(U&&!od(b,1)&&Fl();U;){const J=U;U=U.nextSibling,l(J)}}else if(T&8){let U=y.children;U[0]===`
|
|
15
|
-
`&&(b.tagName==="PRE"||b.tagName==="TEXTAREA")&&(U=U.slice(1));const{textContent:J}=b;J!==U&&J!==U.replace(/\r\n|\r/g,`
|
|
16
|
-
`)&&(od(b,0)||Fl(),b.textContent=y.children)}if($){if(D||!v||O&48){const U=b.tagName.includes("-");for(const J in $)(D&&(J.endsWith("value")||J==="indeterminate")||du(J)&&!rl(J)||J[0]==="."||U&&!rl(J))&&o(b,J,null,$[J],void 0,S)}else if($.onClick)o(b,"onClick",null,$.onClick,void 0,S);else if(O&4&&mr($.style))for(const U in $.style)$.style[U]}let V;(V=$&&$.onVnodeBeforeMount)&&Fo(V,S,y),I&&ri(y,null,S,"beforeMount"),((V=$&&$.onVnodeMounted)||I||W)&&hS(()=>{V&&Fo(V,S,y),W&&R.enter(b),I&&ri(y,null,S,"mounted")},L)}return b.nextSibling},g=(b,y,S,L,N,v,M)=>{M=M||!!y.dynamicChildren;const $=y.children,O=$.length;let T=!1;for(let I=0;I<O;I++){const R=M?$[I]:$[I]=Wo($[I]),D=R.type===gr;b?(D&&!M&&I+1<O&&Wo($[I+1]).type===gr&&(a(s(b.data.slice(R.children.length)),S,i(b)),b.data=R.children),b=d(b,R,L,N,v,M)):D&&!R.children?a(R.el=s(""),S):(T||(T=!0,od(S,1)||Fl()),n(null,R,S,null,L,N,nd(S),v))}return b},h=(b,y,S,L,N,v)=>{const{slotScopeIds:M}=y;M&&(N=N?N.concat(M):M);const $=r(b),O=g(i(b),y,$,S,L,N,v);return O&&Zl(O)&&O.data==="]"?i(y.anchor=O):(Fl(),a(y.anchor=c("]"),$,O),O)},m=(b,y,S,L,N,v)=>{if(od(b.parentElement,1)||Fl(),y.el=null,v){const O=_(b);for(;;){const T=i(b);if(T&&T!==O)l(T);else break}}const M=i(b),$=r(b);return l(b),n(null,y,$,M,S,L,nd($),N),S&&(S.vnode.el=y.el,_h(S,y.el)),M},_=(b,y="[",S="]")=>{let L=0;for(;b;)if(b=i(b),b&&Zl(b)&&(b.data===y&&L++,b.data===S)){if(L===0)return i(b);L--}return b},w=(b,y,S)=>{const L=y.parentNode;L&&L.replaceChild(b,y);let N=S;for(;N;)N.vnode.el===y&&(N.vnode.el=N.subTree.el=b),N=N.parent},k=b=>b.nodeType===1&&b.tagName==="TEMPLATE";return[u,d]}const ik="data-allow-mismatch",l4={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function od(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(ik);)e=e.parentElement;const n=e&&e.getAttribute(ik);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(l4[t])}}const a4=fh().requestIdleCallback||(e=>setTimeout(e,1)),c4=fh().cancelIdleCallback||(e=>clearTimeout(e)),spe=(e=1e4)=>t=>{const n=a4(t,{timeout:e});return()=>c4(n)};function u4(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 ipe=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(u4(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},rpe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},lpe=(e=[])=>(t,n)=>{sn(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 d4(e,t){if(Zl(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(Zl(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const Ni=e=>!!e.type.__asyncLoader;function ai(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 f=()=>(d++,c=null,g()),g=()=>{let h;return c||(h=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((_,w)=>{a(m,()=>_(f()),()=>w(m),d+1)});throw m}).then(m=>h!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return Qe({name:"AsyncComponentWrapper",__asyncLoader:g,__asyncHydrate(h,m,_){let w=!1;(m.bu||(m.bu=[])).push(()=>w=!0);const k=()=>{w||_()},b=i?()=>{const y=i(k,S=>d4(h,S));y&&(m.bum||(m.bum=[])).push(y)}:k;u?b():g().then(()=>!m.isUnmounted&&b())},get __asyncResolved(){return u},setup(){const h=co;if(ev(h),u)return()=>sd(u,h);const m=b=>{c=null,Ma(b,h,13,!o)};if(l&&h.suspense||hl)return g().then(b=>()=>sd(b,h)).catch(b=>(m(b),()=>o?vt(o,{error:b}):null));const _=ne(!1),w=ne(),k=ne(!!s);return s&&setTimeout(()=>{k.value=!1},s),r!=null&&setTimeout(()=>{if(!_.value&&!w.value){const b=new Error(`Async component timed out after ${r}ms.`);m(b),w.value=b}},r),g().then(()=>{_.value=!0,h.parent&&pu(h.parent.vnode)&&h.parent.update()}).catch(b=>{m(b),w.value=b}),()=>{if(_.value&&u)return sd(u,h);if(w.value&&o)return vt(o,{error:w.value});if(n&&!k.value)return sd(n,h)}}})}function sd(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 pu=e=>e.type.__isKeepAlive,f4={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=fo(),o=n.ctx;if(!o.renderer)return()=>{const k=t.default&&t.default();return k&&k.length===1?k[0]:k};const s=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,f=d("div");o.activate=(k,b,y,S,L)=>{const N=k.component;c(k,b,y,0,l),a(N.vnode,k,b,y,N,l,S,k.slotScopeIds,L),Rn(()=>{N.isDeactivated=!1,N.a&&ra(N.a);const v=k.props&&k.props.onVnodeMounted;v&&Fo(v,N.parent,k)},l)},o.deactivate=k=>{const b=k.component;cf(b.m),cf(b.a),c(k,f,null,1,l),Rn(()=>{b.da&&ra(b.da);const y=k.props&&k.props.onVnodeUnmounted;y&&Fo(y,b.parent,k),b.isDeactivated=!0},l)};function g(k){lm(k),u(k,n,l,!0)}function h(k){s.forEach((b,y)=>{const S=Lg(Ni(b)?b.type.__asyncResolved||{}:b.type);S&&!k(S)&&m(y)})}function m(k){const b=s.get(k);b&&(!r||!qs(b,r))?g(b):r&&lm(r),s.delete(k),i.delete(k)}ze(()=>[e.include,e.exclude],([k,b])=>{k&&h(y=>dc(k,y)),b&&h(y=>!dc(b,y))},{flush:"post",deep:!0});let _=null;const w=()=>{_!=null&&(uf(n.subTree.type)?Rn(()=>{s.set(_,id(n.subTree))},n.subTree.suspense):s.set(_,id(n.subTree)))};return rn(w),tv(w),Yo(()=>{s.forEach(k=>{const{subTree:b,suspense:y}=n,S=id(b);if(k.type===S.type&&k.key===S.key){lm(S);const L=S.component.da;L&&Rn(L,y);return}g(k)})}),()=>{if(_=null,!t.default)return r=null;const k=t.default(),b=k[0];if(k.length>1)return r=null,k;if(!wr(b)||!(b.shapeFlag&4)&&!(b.shapeFlag&128))return r=null,b;let y=id(b);if(y.type===Bn)return r=null,y;const S=y.type,L=Lg(Ni(y)?y.type.__asyncResolved||{}:S),{include:N,exclude:v,max:M}=e;if(N&&(!L||!dc(N,L))||v&&L&&dc(v,L))return y.shapeFlag&=-257,r=y,b;const $=y.key==null?S:y.key,O=s.get($);return y.el&&(y=Bi(y),b.shapeFlag&128&&(b.ssContent=y)),_=$,O?(y.el=O.el,y.component=O.component,y.transition&&br(y,y.transition),y.shapeFlag|=512,i.delete($),i.add($)):(i.add($),M&&i.size>parseInt(M,10)&&m(i.values().next().value)),y.shapeFlag|=256,r=y,uf(b.type)?b:y}}},ape=f4;function dc(e,t){return ut(e)?e.some(n=>dc(n,t)):sn(e)?e.split(",").includes(t):JM(e)?(e.lastIndex=0,e.test(t)):!1}function h4(e,t){zC(e,"a",t)}function p4(e,t){zC(e,"da",t)}function zC(e,t,n=co){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(bh(t,o,n),n){let s=n.parent;for(;s&&s.parent;)pu(s.parent.vnode)&&m4(o,t,n,s),s=s.parent}}function m4(e,t,n,o){const s=bh(t,e,o,!0);Yt(()=>{z1(o[t],s)},n)}function lm(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function id(e){return e.shapeFlag&128?e.ssContent:e}function bh(e,t,n=co,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Oi();const l=Ea(n),a=Rs(t,n,e,r);return l(),Ri(),a});return o?s.unshift(i):s.push(i),i}}const Wi=e=>(t,n=co)=>{(!hl||e==="sp")&&bh(e,(...o)=>t(...o),n)},g4=Wi("bm"),rn=Wi("m"),VC=Wi("bu"),tv=Wi("u"),Yo=Wi("bum"),Yt=Wi("um"),v4=Wi("sp"),y4=Wi("rtg"),k4=Wi("rtc");function b4(e,t=co){bh("ec",e,t)}const nv="components",w4="directives";function _4(e,t){return ov(nv,e,!0,t)||e}const KC=Symbol.for("v-ndc");function ko(e){return sn(e)?ov(nv,e,!1)||e:e||KC}function cpe(e){return ov(w4,e)}function ov(e,t,n=!0,o=!1){const s=uo||co;if(s){const i=s.type;if(e===nv){const l=Lg(i,!1);if(l&&(l===t||l===Xn(t)||l===uh(Xn(t))))return i}const r=rk(s[e]||i[e],t)||rk(s.appContext[e],t);return!r&&o?i:r}}function rk(e,t){return e&&(e[t]||e[Xn(t)]||e[uh(Xn(t))])}function Xe(e,t,n,o){let s;const i=n&&n[o],r=ut(e);if(r||sn(e)){const l=r&&mr(e);let a=!1,c=!1;l&&(a=!us(e),c=Di(e),e=mh(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?ba(Ks(e[u])):Ks(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 upe(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(ut(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 ca(e,t,n={},o,s){if(uo.ce||uo.parent&&Ni(uo.parent)&&uo.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&&sv(i(n)),l=n.key||r&&r.key,a=Ve(Oe,{key:(l&&!gs(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 sv(e){return e.some(t=>wr(t)?!(t.type===Bn||t.type===Oe&&!sv(t.children)):!0)?e:null}function dpe(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:Nd(o)]=e[o];return n}const xg=e=>e?yS(e)?gu(e):xg(e.parent):null,Cc=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=>xg(e.parent),$root:e=>xg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>iv(e),$forceUpdate:e=>e.f||(e.f=()=>{Z1(e.update)}),$nextTick:e=>e.n||(e.n=ht.bind(e.proxy)),$watch:e=>ZE.bind(e)}),am=(e,t)=>e!==Ot&&!e.__isScriptSetup&&Kt(e,t),Tg={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(am(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];Ag&&(r[t]=0)}}const c=Cc[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 am(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)||am(t,l)||Kt(i,l)||Kt(o,l)||Kt(Cc,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)}},C4=tn({},Tg,{get(e,t){if(t!==Symbol.unscopables)return Tg.get(e,t,e)},has(e,t){return t[0]!=="_"&&!sE(t)}});function fpe(){return null}function hpe(){return null}function ppe(e){}function mpe(e){}function gpe(){return null}function vpe(){}function ype(e,t){return null}function kpe(){return GC().slots}function mu(){return GC().attrs}function GC(e){const t=fo();return t.setupContext||(t.setupContext=wS(t))}function jc(e){return ut(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function bpe(e,t){const n=jc(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?ut(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 wpe(e,t){return!e||!t?e||t:ut(e)&&ut(t)?e.concat(t):tn({},jc(e),jc(t))}function _pe(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function Cpe(e){const t=fo(),n=hl;let o=e();Vc(),n&&fa(!1);const s=()=>{Ea(t),n&&fa(!0)},i=()=>{fo()!==t&&t.scope.off(),Vc(),n&&fa(!1)};return V1(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Ag=!0;function S4(e){const t=iv(e),n=e.proxy,o=e.ctx;Ag=!1,t.beforeCreate&&lk(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:g,updated:h,activated:m,deactivated:_,beforeDestroy:w,beforeUnmount:k,destroyed:b,unmounted:y,render:S,renderTracked:L,renderTriggered:N,errorCaptured:v,serverPrefetch:M,expose:$,inheritAttrs:O,components:T,directives:I,filters:R}=t;if(c&&x4(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=as(V))}if(Ag=!0,i)for(const V in i){const U=i[V],J=wt(U)?U.bind(n,n):wt(U.get)?U.get.bind(n,n):Ps,K=!wt(U)&&wt(U.set)?U.set.bind(n):Ps,G=F({get:J,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)YC(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&&lk(u,e,"c");function W(V,U){ut(U)?U.forEach(J=>V(J.bind(n))):U&&V(U.bind(n))}if(W(g4,d),W(rn,f),W(VC,g),W(tv,h),W(h4,m),W(p4,_),W(b4,v),W(k4,L),W(y4,N),W(Yo,k),W(Yt,y),W(v4,M),ut($))if($.length){const V=e.exposed||(e.exposed={});$.forEach(U=>{Object.defineProperty(V,U,{get:()=>n[U],set:J=>n[U]=J,enumerable:!0})})}else e.exposed||(e.exposed={});S&&e.render===Ps&&(e.render=S),O!=null&&(e.inheritAttrs=O),T&&(e.components=T),I&&(e.directives=I),M&&ev(e)}function x4(e,t,n=Ps){ut(e)&&(e=Mg(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),Pn(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function lk(e,t,n){Rs(ut(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function YC(e,t,n,o){let s=o.includes(".")?DC(n,o):()=>n[o];if(sn(e)){const i=t[e];wt(i)&&ze(s,i)}else if(wt(e))ze(s,e.bind(n));else if(Gt(e))if(ut(e))e.forEach(i=>YC(i,t,n,o));else{const i=wt(e.handler)?e.handler.bind(n):t[e.handler];wt(i)&&ze(s,i,e)}}function iv(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=>af(a,c,r,!0)),af(a,t,r)),Gt(t)&&i.set(t,a),a}function af(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&af(e,i,n,!0),s&&s.forEach(r=>af(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=T4[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const T4={data:ak,props:ck,emits:ck,methods:fc,computed:fc,beforeCreate:xo,created:xo,beforeMount:xo,mounted:xo,beforeUpdate:xo,updated:xo,beforeDestroy:xo,beforeUnmount:xo,destroyed:xo,unmounted:xo,activated:xo,deactivated:xo,errorCaptured:xo,serverPrefetch:xo,components:fc,directives:fc,watch:M4,provide:ak,inject:A4};function ak(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 A4(e,t){return fc(Mg(e),Mg(t))}function Mg(e){if(ut(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function xo(e,t){return e?[...new Set([].concat(e,t))]:t}function fc(e,t){return e?tn(Object.create(null),e,t):t}function ck(e,t){return e?ut(e)&&ut(t)?[...new Set([...e,...t])]:tn(Object.create(null),jc(e),jc(t??{})):t}function M4(e,t){if(!e)return t;if(!t)return e;const n=tn(Object.create(null),e);for(const o in t)n[o]=xo(e[o],t[o]);return n}function XC(){return{app:null,config:{isNativeTag:rC,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let E4=0;function I4(e,t){return function(o,s=null){wt(o)||(o=tn({},o)),s!=null&&!Gt(s)&&(s=null);const i=XC(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:E4++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:rI,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,f){if(!a){const g=c._ceVNode||vt(o,s);return g.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(g,u):e(g,u,f),a=!0,c._container=u,u.__vue_app__=c,gu(g.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Rs(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=al;al=c;try{return u()}finally{al=d}}};return c}}let al=null;function Spe(e,t,n=Ot){const o=fo(),s=Xn(t),i=Uo(t),r=QC(e,s),l=RE((a,c)=>{let u,d=Ot,f;return QE(()=>{const g=e[s];ao(u,g)&&(u=g,c())}),{get(){return a(),n.get?n.get(u):u},set(g){const h=n.set?n.set(g):g;if(!ao(h,u)&&!(d!==Ot&&ao(g,d)))return;const m=o.vnode.props;m&&(t in m||s in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${s}`in m||`onUpdate:${i}`in m)||(u=g,c()),o.emit(`update:${t}`,h),ao(g,h)&&ao(g,d)&&!ao(h,f)&&c(),d=g,f=h}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Ot:l,done:!1}:{done:!0}}}},l}const QC=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Xn(t)}Modifiers`]||e[`${Uo(t)}Modifiers`];function $4(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Ot;let s=n;const i=t.startsWith("update:"),r=i&&QC(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>sn(u)?u.trim():u)),r.number&&(s=n.map(dh)));let l,a=o[l=Nd(t)]||o[l=Nd(Xn(t))];!a&&i&&(a=o[l=Nd(Uo(t))]),a&&Rs(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,Rs(c,e,6,s)}}const N4=new WeakMap;function ZC(e,t,n=!1){const o=n?N4: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=ZC(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):(ut(i)?i.forEach(a=>r[a]=null):tn(r,i),Gt(e)&&o.set(e,r),r)}function wh(e,t){return!e||!du(t)?!1:(t=t.slice(2).replace(/Once$/,""),Kt(e,t[0].toLowerCase()+t.slice(1))||Kt(e,Uo(t))||Kt(e,t))}function Ld(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:g,ctx:h,inheritAttrs:m}=e,_=Uc(e);let w,k;try{if(n.shapeFlag&4){const y=s||o,S=y;w=Wo(c.call(S,y,u,d,g,f,h)),k=l}else{const y=t;w=Wo(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),k=t.props?l:P4(l)}}catch(y){Sc.length=0,Ma(y,e,1),w=vt(Bn)}let b=w;if(k&&m!==!1){const y=Object.keys(k),{shapeFlag:S}=b;y.length&&S&7&&(i&&y.some(rh)&&(k=O4(k,i)),b=Bi(b,k,!1,!0))}return n.dirs&&(b=Bi(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&br(b,n.transition),w=b,Uc(_),w}function L4(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(wr(s)){if(s.type!==Bn||s.children==="v-if"){if(n)return;n=s}}else return}return n}const P4=e=>{let t;for(const n in e)(n==="class"||n==="style"||du(n))&&((t||(t={}))[n]=e[n]);return t},O4=(e,t)=>{const n={};for(const o in e)(!rh(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function R4(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?uk(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(JC(r,o,f)&&!wh(c,f))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?uk(o,r,c):!0:!!r;return!1}function uk(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){const i=o[s];if(JC(t,e,i)&&!wh(n,i))return!0}return!1}function JC(e,t,n){const o=e[n],s=t[n];return n==="style"&&Gt(o)&&Gt(s)?!Pi(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 eS={},tS=()=>Object.create(eS),nS=e=>Object.getPrototypeOf(e)===eS;function D4(e,t,n,o=!1){const s={},i=tS();e.propsDefaults=Object.create(null),oS(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:NE(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function B4(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 f=u[d];if(wh(e.emitsOptions,f))continue;const g=t[f];if(a)if(Kt(i,f))g!==i[f]&&(i[f]=g,c=!0);else{const h=Xn(f);s[h]=Eg(a,l,h,g,e,!1)}else g!==i[f]&&(i[f]=g,c=!0)}}}else{oS(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!Kt(t,d)&&((u=Uo(d))===d||!Kt(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=Eg(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&&Ai(e.attrs,"set","")}function oS(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(rl(a))continue;const c=t[a];let u;s&&Kt(s,u=Xn(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:wh(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]=Eg(s,a,d,c[d],e,!Kt(c,d))}}return r}function Eg(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=Ea(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===Uo(n))&&(o=!0))}return o}const F4=new WeakMap;function sS(e,t,n=!1){const o=n?F4: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[f,g]=sS(d,t,!0);tn(r,f),g&&l.push(...g)};!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,sa),sa;if(ut(i))for(let u=0;u<i.length;u++){const d=Xn(i[u]);dk(d)&&(r[d]=Ot)}else if(i)for(const u in i){const d=Xn(u);if(dk(d)){const f=i[u],g=r[d]=ut(f)||wt(f)?{type:f}:tn({},f),h=g.type;let m=!1,_=!0;if(ut(h))for(let w=0;w<h.length;++w){const k=h[w],b=wt(k)&&k.name;if(b==="Boolean"){m=!0;break}else b==="String"&&(_=!1)}else m=wt(h)&&h.name==="Boolean";g[0]=m,g[1]=_,(m||Kt(g,"default"))&&l.push(d)}}const c=[r,l];return Gt(e)&&o.set(e,c),c}function dk(e){return e[0]!=="$"&&!rl(e)}const rv=e=>e==="_"||e==="_ctx"||e==="$stable",lv=e=>ut(e)?e.map(Wo):[Wo(e)],H4=(e,t,n)=>{if(t._n)return t;const o=$n((...s)=>lv(t(...s)),n);return o._c=!1,o},iS=(e,t,n)=>{const o=e._ctx;for(const s in e){if(rv(s))continue;const i=e[s];if(wt(i))t[s]=H4(s,i,o);else if(i!=null){const r=lv(i);t[s]=()=>r}}},rS=(e,t)=>{const n=lv(t);e.slots.default=()=>n},lS=(e,t,n)=>{for(const o in t)(n||!rv(o))&&(e[o]=t[o])},W4=(e,t,n)=>{const o=e.slots=tS();if(e.vnode.shapeFlag&32){const s=t._;s?(lS(o,t,n),n&&aC(o,"_",s,!0)):iS(t,o)}else t&&rS(e,t)},U4=(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:lS(s,t,n):(i=!t.$stable,iS(t,s)),r=t}else t&&(rS(e,t),r={default:1});if(i)for(const l in s)!rv(l)&&r[l]==null&&delete s[l]},Rn=hS;function q4(e){return aS(e)}function j4(e){return aS(e,r4)}function aS(e,t){const n=fh();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:g=Ps,insertStaticContent:h}=e,m=(j,te,he,oe=null,fe=null,H=null,Y=void 0,re=null,ge=!!te.dynamicChildren)=>{if(j===te)return;j&&!qs(j,te)&&(oe=ve(j),X(j,fe,H,!0),j=null),te.patchFlag===-2&&(ge=!1,te.dynamicChildren=null);const{type:xe,ref:$e,shapeFlag:se}=te;switch(xe){case gr:_(j,te,he,oe);break;case Bn:w(j,te,he,oe);break;case da:j==null&&k(te,he,oe,Y);break;case Oe:T(j,te,he,oe,fe,H,Y,re,ge);break;default:se&1?S(j,te,he,oe,fe,H,Y,re,ge):se&6?I(j,te,he,oe,fe,H,Y,re,ge):(se&64||se&128)&&xe.process(j,te,he,oe,fe,H,Y,re,ge,Q)}$e!=null&&fe?aa($e,j&&j.ref,H,te||j,!te):$e==null&&j&&j.ref!=null&&aa(j.ref,null,H,j,!0)},_=(j,te,he,oe)=>{if(j==null)o(te.el=l(te.children),he,oe);else{const fe=te.el=j.el;te.children!==j.children&&c(fe,te.children)}},w=(j,te,he,oe)=>{j==null?o(te.el=a(te.children||""),he,oe):te.el=j.el},k=(j,te,he,oe)=>{[j.el,j.anchor]=h(j.children,te,he,oe,j.el,j.anchor)},b=({el:j,anchor:te},he,oe)=>{let fe;for(;j&&j!==te;)fe=f(j),o(j,he,oe),j=fe;o(te,he,oe)},y=({el:j,anchor:te})=>{let he;for(;j&&j!==te;)he=f(j),s(j),j=he;s(te)},S=(j,te,he,oe,fe,H,Y,re,ge)=>{if(te.type==="svg"?Y="svg":te.type==="math"&&(Y="mathml"),j==null)L(te,he,oe,fe,H,Y,re,ge);else{const xe=j.el&&j.el._isVueCE?j.el:null;try{xe&&xe._beginPatch(),M(j,te,fe,H,Y,re,ge)}finally{xe&&xe._endPatch()}}},L=(j,te,he,oe,fe,H,Y,re)=>{let ge,xe;const{props:$e,shapeFlag:se,transition:ae,dirs:we}=j;if(ge=j.el=r(j.type,H,$e&&$e.is,$e),se&8?u(ge,j.children):se&16&&v(j.children,ge,null,oe,fe,cm(j,H),Y,re),we&&ri(j,null,oe,"created"),N(ge,j,j.scopeId,Y,oe),$e){for(const nt in $e)nt!=="value"&&!rl(nt)&&i(ge,nt,null,$e[nt],H,oe);"value"in $e&&i(ge,"value",null,$e.value,H),(xe=$e.onVnodeBeforeMount)&&Fo(xe,oe,j)}we&&ri(j,null,oe,"beforeMount");const qe=cS(fe,ae);qe&&ae.beforeEnter(ge),o(ge,te,he),((xe=$e&&$e.onVnodeMounted)||qe||we)&&Rn(()=>{try{xe&&Fo(xe,oe,j),qe&&ae.enter(ge),we&&ri(j,null,oe,"mounted")}finally{}},fe)},N=(j,te,he,oe,fe)=>{if(he&&g(j,he),oe)for(let H=0;H<oe.length;H++)g(j,oe[H]);if(fe){let H=fe.subTree;if(te===H||uf(H.type)&&(H.ssContent===te||H.ssFallback===te)){const Y=fe.vnode;N(j,Y,Y.scopeId,Y.slotScopeIds,fe.parent)}}},v=(j,te,he,oe,fe,H,Y,re,ge=0)=>{for(let xe=ge;xe<j.length;xe++){const $e=j[xe]=re?Ti(j[xe]):Wo(j[xe]);m(null,$e,te,he,oe,fe,H,Y,re)}},M=(j,te,he,oe,fe,H,Y)=>{const re=te.el=j.el;let{patchFlag:ge,dynamicChildren:xe,dirs:$e}=te;ge|=j.patchFlag&16;const se=j.props||Ot,ae=te.props||Ot;let we;if(he&&jr(he,!1),(we=ae.onVnodeBeforeUpdate)&&Fo(we,he,te,j),$e&&ri(te,j,he,"beforeUpdate"),he&&jr(he,!0),(se.innerHTML&&ae.innerHTML==null||se.textContent&&ae.textContent==null)&&u(re,""),xe?$(j.dynamicChildren,xe,re,he,oe,cm(te,fe),H):Y||U(j,te,re,null,he,oe,cm(te,fe),H,!1),ge>0){if(ge&16)O(re,se,ae,he,fe);else if(ge&2&&se.class!==ae.class&&i(re,"class",null,ae.class,fe),ge&4&&i(re,"style",se.style,ae.style,fe),ge&8){const qe=te.dynamicProps;for(let nt=0;nt<qe.length;nt++){const ct=qe[nt],_t=se[ct],$t=ae[ct];($t!==_t||ct==="value")&&i(re,ct,_t,$t,fe,he)}}ge&1&&j.children!==te.children&&u(re,te.children)}else!Y&&xe==null&&O(re,se,ae,he,fe);((we=ae.onVnodeUpdated)||$e)&&Rn(()=>{we&&Fo(we,he,te,j),$e&&ri(te,j,he,"updated")},oe)},$=(j,te,he,oe,fe,H,Y)=>{for(let re=0;re<te.length;re++){const ge=j[re],xe=te[re],$e=ge.el&&(ge.type===Oe||!qs(ge,xe)||ge.shapeFlag&198)?d(ge.el):he;m(ge,xe,$e,null,oe,fe,H,Y,!0)}},O=(j,te,he,oe,fe)=>{if(te!==he){if(te!==Ot)for(const H in te)!rl(H)&&!(H in he)&&i(j,H,te[H],null,fe,oe);for(const H in he){if(rl(H))continue;const Y=he[H],re=te[H];Y!==re&&H!=="value"&&i(j,H,re,Y,fe,oe)}"value"in he&&i(j,"value",te.value,he.value,fe)}},T=(j,te,he,oe,fe,H,Y,re,ge)=>{const xe=te.el=j?j.el:l(""),$e=te.anchor=j?j.anchor:l("");let{patchFlag:se,dynamicChildren:ae,slotScopeIds:we}=te;we&&(re=re?re.concat(we):we),j==null?(o(xe,he,oe),o($e,he,oe),v(te.children||[],he,$e,fe,H,Y,re,ge)):se>0&&se&64&&ae&&j.dynamicChildren&&j.dynamicChildren.length===ae.length?($(j.dynamicChildren,ae,he,fe,H,Y,re),(te.key!=null||fe&&te===fe.subTree)&&av(j,te,!0)):U(j,te,he,$e,fe,H,Y,re,ge)},I=(j,te,he,oe,fe,H,Y,re,ge)=>{te.slotScopeIds=re,j==null?te.shapeFlag&512?fe.ctx.activate(te,he,oe,Y,ge):R(te,he,oe,fe,H,Y,ge):D(j,te,ge)},R=(j,te,he,oe,fe,H,Y)=>{const re=j.component=vS(j,oe,fe);if(pu(j)&&(re.ctx.renderer=Q),kS(re,!1,Y),re.asyncDep){if(fe&&fe.registerDep(re,W,Y),!j.el){const ge=re.subTree=vt(Bn);w(null,ge,te,he),j.placeholder=ge.el}}else W(re,j,te,he,fe,H,Y)},D=(j,te,he)=>{const oe=te.component=j.component;if(R4(j,te,he))if(oe.asyncDep&&!oe.asyncResolved){V(oe,te,he);return}else oe.next=te,oe.update();else te.el=j.el,oe.vnode=te},W=(j,te,he,oe,fe,H,Y)=>{const re=()=>{if(j.isMounted){let{next:se,bu:ae,u:we,parent:qe,vnode:nt}=j;{const Rt=uS(j);if(Rt){se&&(se.el=nt.el,V(j,se,Y)),Rt.asyncDep.then(()=>{Rn(()=>{j.isUnmounted||xe()},fe)});return}}let ct=se,_t;jr(j,!1),se?(se.el=nt.el,V(j,se,Y)):se=nt,ae&&ra(ae),(_t=se.props&&se.props.onVnodeBeforeUpdate)&&Fo(_t,qe,se,nt),jr(j,!0);const $t=Ld(j),lt=j.subTree;j.subTree=$t,m(lt,$t,d(lt.el),ve(lt),j,fe,H),se.el=$t.el,ct===null&&_h(j,$t.el),we&&Rn(we,fe),(_t=se.props&&se.props.onVnodeUpdated)&&Rn(()=>Fo(_t,qe,se,nt),fe)}else{let se;const{el:ae,props:we}=te,{bm:qe,m:nt,parent:ct,root:_t,type:$t}=j,lt=Ni(te);if(jr(j,!1),qe&&ra(qe),!lt&&(se=we&&we.onVnodeBeforeMount)&&Fo(se,ct,te),jr(j,!0),ae&&Se){const Rt=()=>{j.subTree=Ld(j),Se(ae,j.subTree,j,fe,null)};lt&&$t.__asyncHydrate?$t.__asyncHydrate(ae,j,Rt):Rt()}else{_t.ce&&_t.ce._hasShadowRoot()&&_t.ce._injectChildStyle($t,j.parent?j.parent.type:void 0);const Rt=j.subTree=Ld(j);m(null,Rt,he,oe,j,fe,H),te.el=Rt.el}if(nt&&Rn(nt,fe),!lt&&(se=we&&we.onVnodeMounted)){const Rt=te;Rn(()=>Fo(se,ct,Rt),fe)}(te.shapeFlag&256||ct&&Ni(ct.vnode)&&ct.vnode.shapeFlag&256)&&j.a&&Rn(j.a,fe),j.isMounted=!0,te=he=oe=null}};j.scope.on();const ge=j.effect=new Jd(re);j.scope.off();const xe=j.update=ge.run.bind(ge),$e=j.job=ge.runIfDirty.bind(ge);$e.i=j,$e.id=j.uid,ge.scheduler=()=>Z1($e),jr(j,!0),xe()},V=(j,te,he)=>{te.component=j;const oe=j.vnode.props;j.vnode=te,j.next=null,B4(j,te.props,oe,he),U4(j,te.children,he),Oi(),Zy(j),Ri()},U=(j,te,he,oe,fe,H,Y,re,ge=!1)=>{const xe=j&&j.children,$e=j?j.shapeFlag:0,se=te.children,{patchFlag:ae,shapeFlag:we}=te;if(ae>0){if(ae&128){K(xe,se,he,oe,fe,H,Y,re,ge);return}else if(ae&256){J(xe,se,he,oe,fe,H,Y,re,ge);return}}we&8?($e&16&&ue(xe,fe,H),se!==xe&&u(he,se)):$e&16?we&16?K(xe,se,he,oe,fe,H,Y,re,ge):ue(xe,fe,H,!0):($e&8&&u(he,""),we&16&&v(se,he,oe,fe,H,Y,re,ge))},J=(j,te,he,oe,fe,H,Y,re,ge)=>{j=j||sa,te=te||sa;const xe=j.length,$e=te.length,se=Math.min(xe,$e);let ae;for(ae=0;ae<se;ae++){const we=te[ae]=ge?Ti(te[ae]):Wo(te[ae]);m(j[ae],we,he,null,fe,H,Y,re,ge)}xe>$e?ue(j,fe,H,!0,!1,se):v(te,he,oe,fe,H,Y,re,ge,se)},K=(j,te,he,oe,fe,H,Y,re,ge)=>{let xe=0;const $e=te.length;let se=j.length-1,ae=$e-1;for(;xe<=se&&xe<=ae;){const we=j[xe],qe=te[xe]=ge?Ti(te[xe]):Wo(te[xe]);if(qs(we,qe))m(we,qe,he,null,fe,H,Y,re,ge);else break;xe++}for(;xe<=se&&xe<=ae;){const we=j[se],qe=te[ae]=ge?Ti(te[ae]):Wo(te[ae]);if(qs(we,qe))m(we,qe,he,null,fe,H,Y,re,ge);else break;se--,ae--}if(xe>se){if(xe<=ae){const we=ae+1,qe=we<$e?te[we].el:oe;for(;xe<=ae;)m(null,te[xe]=ge?Ti(te[xe]):Wo(te[xe]),he,qe,fe,H,Y,re,ge),xe++}}else if(xe>ae)for(;xe<=se;)X(j[xe],fe,H,!0),xe++;else{const we=xe,qe=xe,nt=new Map;for(xe=qe;xe<=ae;xe++){const Nt=te[xe]=ge?Ti(te[xe]):Wo(te[xe]);Nt.key!=null&&nt.set(Nt.key,xe)}let ct,_t=0;const $t=ae-qe+1;let lt=!1,Rt=0;const fn=new Array($t);for(xe=0;xe<$t;xe++)fn[xe]=0;for(xe=we;xe<=se;xe++){const Nt=j[xe];if(_t>=$t){X(Nt,fe,H,!0);continue}let Ft;if(Nt.key!=null)Ft=nt.get(Nt.key);else for(ct=qe;ct<=ae;ct++)if(fn[ct-qe]===0&&qs(Nt,te[ct])){Ft=ct;break}Ft===void 0?X(Nt,fe,H,!0):(fn[Ft-qe]=xe+1,Ft>=Rt?Rt=Ft:lt=!0,m(Nt,te[Ft],he,null,fe,H,Y,re,ge),_t++)}const Mn=lt?z4(fn):sa;for(ct=Mn.length-1,xe=$t-1;xe>=0;xe--){const Nt=qe+xe,Ft=te[Nt],jn=te[Nt+1],Je=Nt+1<$e?jn.el||dS(jn):oe;fn[xe]===0?m(null,Ft,he,Je,fe,H,Y,re,ge):lt&&(ct<0||xe!==Mn[ct]?G(Ft,he,Je,2):ct--)}}},G=(j,te,he,oe,fe=null)=>{const{el:H,type:Y,transition:re,children:ge,shapeFlag:xe}=j;if(xe&6){G(j.component.subTree,te,he,oe);return}if(xe&128){j.suspense.move(te,he,oe);return}if(xe&64){Y.move(j,te,he,Q);return}if(Y===Oe){o(H,te,he);for(let se=0;se<ge.length;se++)G(ge[se],te,he,oe);o(j.anchor,te,he);return}if(Y===da){b(j,te,he);return}if(oe!==2&&xe&1&&re)if(oe===0)re.persisted&&!H[Es]?o(H,te,he):(re.beforeEnter(H),o(H,te,he),Rn(()=>re.enter(H),fe));else{const{leave:se,delayLeave:ae,afterLeave:we}=re,qe=()=>{j.ctx.isUnmounted?s(H):o(H,te,he)},nt=()=>{const ct=H._isLeaving||!!H[Es];H._isLeaving&&H[Es](!0),re.persisted&&!ct?qe():se(H,()=>{qe(),we&&we()})};ae?ae(H,qe,nt):nt()}else o(H,te,he)},X=(j,te,he,oe=!1,fe=!1)=>{const{type:H,props:Y,ref:re,children:ge,dynamicChildren:xe,shapeFlag:$e,patchFlag:se,dirs:ae,cacheIndex:we,memo:qe}=j;if(se===-2&&(fe=!1),re!=null&&(Oi(),aa(re,null,he,j,!0),Ri()),we!=null&&(te.renderCache[we]=void 0),$e&256){te.ctx.deactivate(j);return}const nt=$e&1&&ae,ct=!Ni(j);let _t;if(ct&&(_t=Y&&Y.onVnodeBeforeUnmount)&&Fo(_t,te,j),$e&6)We(j.component,he,oe);else{if($e&128){j.suspense.unmount(he,oe);return}nt&&ri(j,null,te,"beforeUnmount"),$e&64?j.type.remove(j,te,he,Q,oe):xe&&!xe.hasOnce&&(H!==Oe||se>0&&se&64)?ue(xe,te,he,!1,!0):(H===Oe&&se&384||!fe&&$e&16)&&ue(ge,te,he),oe&&ke(j)}const $t=qe!=null&&we==null;(ct&&(_t=Y&&Y.onVnodeUnmounted)||nt||$t)&&Rn(()=>{_t&&Fo(_t,te,j),nt&&ri(j,null,te,"unmounted"),$t&&(j.el=null)},he)},ke=j=>{const{type:te,el:he,anchor:oe,transition:fe}=j;if(te===Oe){le(he,oe);return}if(te===da){y(j);return}const H=()=>{s(he),fe&&!fe.persisted&&fe.afterLeave&&fe.afterLeave()};if(j.shapeFlag&1&&fe&&!fe.persisted){const{leave:Y,delayLeave:re}=fe,ge=()=>Y(he,H);re?re(j.el,H,ge):ge()}else H()},le=(j,te)=>{let he;for(;j!==te;)he=f(j),s(j),j=he;s(te)},We=(j,te,he)=>{const{bum:oe,scope:fe,job:H,subTree:Y,um:re,m:ge,a:xe}=j;cf(ge),cf(xe),oe&&ra(oe),fe.stop(),H&&(H.flags|=8,X(Y,j,te,he)),re&&Rn(re,te),Rn(()=>{j.isUnmounted=!0},te)},ue=(j,te,he,oe=!1,fe=!1,H=0)=>{for(let Y=H;Y<j.length;Y++)X(j[Y],te,he,oe,fe)},ve=j=>{if(j.shapeFlag&6)return ve(j.component.subTree);if(j.shapeFlag&128)return j.suspense.next();const te=f(j.anchor||j.el),he=te&&te[BC];return he?f(he):te};let Ne=!1;const Re=(j,te,he)=>{let oe;j==null?te._vnode&&(X(te._vnode,null,null,!0),oe=te._vnode.component):m(te._vnode||null,j,te,null,null,null,he),te._vnode=j,Ne||(Ne=!0,Zy(oe),rf(),Ne=!1)},Q={p:m,um:X,m:G,r:ke,mt:R,mc:v,pc:U,pbc:$,n:ve,o:e};let ce,Se;return t&&([ce,Se]=t(Q)),{render:Re,hydrate:ce,createApp:I4(Re,ce)}}function cm({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 jr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function cS(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function av(e,t,n=!1){const o=e.children,s=t.children;if(ut(o)&&ut(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]=Ti(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&av(r,l)),l.type===gr&&(l.patchFlag===-1&&(l=s[i]=Ti(l)),l.el=r.el),l.type===Bn&&!l.el&&(l.el=r.el)}}function z4(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 uS(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:uS(t)}function cf(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function dS(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?dS(t.subTree):null}const uf=e=>e.__isSuspense;let Ig=0;const V4={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)K4(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}G4(e,t,n,o,s,r,l,a,c)}},hydrate:Y4,normalize:X4},xpe=V4;function zc(e,t){const n=e.props&&e.props[t];wt(n)&&n()}function K4(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=fS(e,s,o,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,o,f,i,r),f.deps>0?(zc(e,"onPending"),zc(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),ua(f,e.ssFallback)):f.resolve(!1,!0)}function G4(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,g=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:_,isHydrating:w}=d;if(m)d.pendingBranch=f,qs(m,f)?(a(m,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():_&&(w||(a(h,g,n,o,s,null,i,r,l),ua(d,g)))):(d.pendingId=Ig++,w?(d.isHydrating=!1,d.activeBranch=m):c(m,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),_?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(h,g,n,o,s,null,i,r,l),ua(d,g))):h&&qs(h,f)?(a(h,f,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(h&&qs(h,f))a(h,f,n,o,s,d,i,r,l),ua(d,f);else if(zc(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Ig++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:k,pendingId:b}=d;k>0?setTimeout(()=>{d.pendingId===b&&d.fallback(g)},k):k===0&&d.fallback(g)}}function fS(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:g,n:h,o:{parentNode:m,remove:_}}=c;let w;const k=Q4(e);k&&t&&t.pendingBranch&&(w=t.pendingId,t.deps++);const b=e.props?Zd(e.props.timeout):void 0,y=i,S={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:Ig++,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:v,activeBranch:M,pendingBranch:$,pendingId:O,effects:T,parentComponent:I,container:R,isInFallback:D}=S;let W=!1;if(S.isHydrating)S.isHydrating=!1;else if(!L){W=M&&$.transition&&$.transition.mode==="out-in";let J=!1;W&&(M.transition.afterLeave=()=>{O===S.pendingId&&(f($,R,i===y&&!J?h(M):i,0),sf(T),D&&v.ssFallback&&(v.ssFallback.el=null))}),M&&!S.isFallbackMountPending&&(m(M.el)===R&&(i=h(M),J=!0),g(M,I,S,!0),!W&&D&&v.ssFallback&&Rn(()=>v.ssFallback.el=null,S)),W||f($,R,i,0)}S.isFallbackMountPending=!1,ua(S,$),S.pendingBranch=null,S.isInFallback=!1;let V=S.parent,U=!1;for(;V;){if(V.pendingBranch){V.effects.push(...T),U=!0;break}V=V.parent}!U&&!W&&sf(T),S.effects=[],k&&t&&t.pendingBranch&&w===t.pendingId&&(t.deps--,t.deps===0&&!N&&t.resolve()),zc(v,"onResolve")},fallback(L){if(!S.pendingBranch)return;const{vnode:N,activeBranch:v,parentComponent:M,container:$,namespace:O}=S;zc(N,"onFallback");const T=h(v),I=()=>{S.isFallbackMountPending=!1,S.isInFallback&&(d(null,L,$,T,M,null,O,l,a),ua(S,L))},R=L.transition&&L.transition.mode==="out-in";R&&(S.isFallbackMountPending=!0,v.transition.afterLeave=I),S.isInFallback=!0,g(v,M,null,!0),R||I()},move(L,N,v){S.activeBranch&&f(S.activeBranch,L,N,v),S.container=L},next(){return S.activeBranch&&h(S.activeBranch)},registerDep(L,N,v){const M=!!S.pendingBranch;M&&S.deps++;const $=L.vnode.el;L.asyncDep.catch(O=>{Ma(O,L,0)}).then(O=>{if(L.isUnmounted||S.isUnmounted||S.pendingId!==L.suspenseId)return;Vc(),L.asyncResolved=!0;const{vnode:T}=L;$g(L,O,!1),$&&(T.el=$);const I=!$&&L.subTree.el;N(L,T,m($||L.subTree.el),$?null:h(L.subTree),S,r,v),I&&(T.placeholder=null,_(I)),_h(L,T.el),M&&--S.deps===0&&S.resolve()})},unmount(L,N){S.isUnmounted=!0,S.activeBranch&&g(S.activeBranch,n,L,N),S.pendingBranch&&g(S.pendingBranch,n,L,N)}};return S}function Y4(e,t,n,o,s,i,r,l,a){const c=t.suspense=fS(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 X4(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=fk(o?n.default:n),e.ssFallback=o?fk(n.fallback):vt(Bn)}function fk(e){let t;if(wt(e)){const n=fl&&e._c;n&&(e._d=!1,C()),e=e(),n&&(e._d=!0,t=bo,pS())}return ut(e)&&(e=L4(e)),e=Wo(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function hS(e,t){t&&t.pendingBranch?ut(e)?t.effects.push(...e):t.effects.push(e):sf(e)}function ua(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 Q4(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Oe=Symbol.for("v-fgt"),gr=Symbol.for("v-txt"),Bn=Symbol.for("v-cmt"),da=Symbol.for("v-stc"),Sc=[];let bo=null;function C(e=!1){Sc.push(bo=e?null:[])}function pS(){Sc.pop(),bo=Sc[Sc.length-1]||null}let fl=1;function df(e,t=!1){fl+=e,e<0&&bo&&t&&(bo.hasOnce=!0)}function mS(e){return e.dynamicChildren=fl>0?bo||sa:null,pS(),fl>0&&bo&&bo.push(e),e}function E(e,t,n,o,s,i){return mS(p(e,t,n,o,s,i,!0))}function Ve(e,t,n,o,s){return mS(vt(e,t,n,o,s,!0))}function wr(e){return e?e.__v_isVNode===!0:!1}function qs(e,t){return e.type===t.type&&e.key===t.key}function Tpe(e){}const gS=({key:e})=>e??null,Pd=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?sn(e)||Pn(e)||wt(e)?{i:uo,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&&gS(t),ref:t&&Pd(t),scopeId:kh,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:uo};return l?(cv(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=sn(n)?8:16),fl>0&&!r&&bo&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&bo.push(a),a}const vt=Z4;function Z4(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===KC)&&(e=Bn),wr(e)){const l=Bi(e,t,!0);return n&&cv(l,n),fl>0&&!i&&bo&&(l.shapeFlag&6?bo[bo.indexOf(e)]=l:bo.push(l)),l.patchFlag=-2,l}if(sI(e)&&(e=e.__vccOpts),t){t=J4(t);let{class:l,style:a}=t;l&&!sn(l)&&(t.class=Pe(l)),Gt(a)&&(yh(a)&&!ut(a)&&(a=tn({},a)),t.style=Wt(a))}const r=sn(e)?1:uf(e)?128:FC(e)?64:Gt(e)?4:wt(e)?2:0;return p(e,t,n,o,s,r,i,!0)}function J4(e){return e?yh(e)||nS(e)?tn({},e):e:null}function Bi(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&&gS(c),ref:t&&t.ref?n&&i?ut(i)?i.concat(Pd(t)):[i,Pd(t)]:Pd(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&&Bi(e.ssContent),ssFallback:e.ssFallback&&Bi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&br(u,a.clone(u)),u}function ft(e=" ",t=0){return vt(gr,null,e,t)}function _r(e,t){const n=vt(da,null,e);return n.staticCount=t,n}function ie(e="",t=!1){return t?(C(),Ve(Bn,null,e)):vt(Bn,null,e)}function Wo(e){return e==null||typeof e=="boolean"?vt(Bn):ut(e)?vt(Oe,null,e.slice()):wr(e)?Ti(e):vt(gr,null,String(e))}function Ti(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Bi(e)}function cv(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(ut(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),cv(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!nS(t)?t._ctx=uo:s===3&&uo&&(uo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else wt(t)?(t={default:t,_ctx:uo},n=32):(t=String(t),o&64?(n=16,t=[ft(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=Pe([t.class,o.class]));else if(s==="style")t.style=Wt([t.style,o.style]);else if(du(s)){const i=t[s],r=o[s];r&&i!==r&&!(ut(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!rh(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function Fo(e,t,n,o=null){Rs(e,t,7,[n,o])}const eI=XC();let tI=0;function vS(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||eI,i={uid:tI++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new fC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:sS(o,s),emitsOptions:ZC(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=$4.bind(null,i),e.ce&&e.ce(i),i}let co=null;const fo=()=>co||uo;let ff,fa;{const e=fh(),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)}};ff=t("__VUE_INSTANCE_SETTERS__",n=>co=n),fa=t("__VUE_SSR_SETTERS__",n=>hl=n)}const Ea=e=>{const t=co;return ff(e),e.scope.on(),()=>{e.scope.off(),ff(t)}},Vc=()=>{co&&co.scope.off(),ff(null)};function yS(e){return e.vnode.shapeFlag&4}let hl=!1;function kS(e,t=!1,n=!1){t&&fa(t);const{props:o,children:s}=e.vnode,i=yS(e);D4(e,o,i,t),W4(e,s,n||t);const r=i?nI(e,t):void 0;return t&&fa(!1),r}function nI(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Tg);const{setup:o}=n;if(o){Oi();const s=e.setupContext=o.length>1?wS(e):null,i=Ea(e),r=fu(o,e,0,[e.props,s]),l=V1(r);if(Ri(),i(),(l||e.sp)&&!Ni(e)&&ev(e),l){if(r.then(Vc,Vc),t)return r.then(a=>{$g(e,a,t)}).catch(a=>{Ma(a,e,0)});e.asyncDep=r}else $g(e,r,t)}else bS(e,t)}function $g(e,t,n){wt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Gt(t)&&(e.setupState=IC(t)),bS(e,n)}let hf,Ng;function Ape(e){hf=e,Ng=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,C4))}}const Mpe=()=>!hf;function bS(e,t,n){const o=e.type;if(!e.render){if(!t&&hf&&!o.render){const s=o.template||iv(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=hf(s,c)}}e.render=o.render||Ps,Ng&&Ng(e)}{const s=Ea(e);Oi();try{S4(e)}finally{Ri(),s()}}}const oI={get(e,t){return yo(e,"get",""),e[t]}};function wS(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,oI),slots:e.slots,emit:e.emit,expose:t}}function gu(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(IC(fr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Cc)return Cc[n](e)},has(t,n){return n in t||n in Cc}})):e.proxy}function Lg(e,t=!0){return wt(e)?e.displayName||e.name:e.name||t&&e.__name}function sI(e){return wt(e)&&"__vccOpts"in e}const F=(e,t)=>HE(e,t,hl);function Zt(e,t,n){try{df(-1);const o=arguments.length;return o===2?Gt(t)&&!ut(t)?wr(t)?vt(e,null,[t]):vt(e,t):vt(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&wr(n)&&(n=[n]),vt(e,t,n))}finally{df(1)}}function Epe(){}function Ipe(e,t,n,o){const s=n[o];if(s&&iI(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function iI(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(ao(n[o],t[o]))return!1;return fl>0&&bo&&bo.push(e),!0}const rI="3.5.35",$pe=Ps,Npe=zE,Lpe=Gl,Ppe=RC,lI={createComponentInstance:vS,setupComponent:kS,renderComponentRoot:Ld,setCurrentRenderingInstance:Uc,isVNode:wr,normalizeVNode:Wo,getComponentPublicInstance:gu,ensureValidVNode:sv,pushWarningContext:qE,popWarningContext:jE},Ope=lI,Rpe=null,Dpe=null,Bpe=null;/**
|
|
17
|
-
* @vue/runtime-dom v3.5.35
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/let Pg;const hk=typeof window<"u"&&window.trustedTypes;if(hk)try{Pg=hk.createPolicy("vue",{createHTML:e=>e})}catch{}const _S=Pg?e=>Pg.createHTML(e):e=>e,aI="http://www.w3.org/2000/svg",cI="http://www.w3.org/1998/Math/MathML",Si=typeof document<"u"?document:null,pk=Si&&Si.createElement("template"),uI={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"?Si.createElementNS(aI,e):t==="mathml"?Si.createElementNS(cI,e):n?Si.createElement(e,{is:n}):Si.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>Si.createTextNode(e),createComment:e=>Si.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Si.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{pk.innerHTML=_S(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=pk.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]}},Zi="transition",oc="animation",wa=Symbol("_vtc"),CS={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},SS=tn({},WC,CS),dI=e=>(e.displayName="Transition",e.props=SS,e),Fi=dI((e,{slots:t})=>Zt(o4,xS(e),t)),zr=(e,t=[])=>{ut(e)?e.forEach(n=>n(...t)):e&&e(...t)},mk=e=>e?ut(e)?e.some(t=>t.length>1):e.length>1:!1;function xS(e){const t={};for(const T in e)T in CS||(t[T]=e[T]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:g=`${n}-leave-to`}=e,h=fI(s),m=h&&h[0],_=h&&h[1],{onBeforeEnter:w,onEnter:k,onEnterCancelled:b,onLeave:y,onLeaveCancelled:S,onBeforeAppear:L=w,onAppear:N=k,onAppearCancelled:v=b}=t,M=(T,I,R,D)=>{T._enterCancelled=D,ir(T,I?u:l),ir(T,I?c:r),R&&R()},$=(T,I)=>{T._isLeaving=!1,ir(T,d),ir(T,g),ir(T,f),I&&I()},O=T=>(I,R)=>{const D=T?N:k,W=()=>M(I,T,R);zr(D,[I,W]),gk(()=>{ir(I,T?a:i),oi(I,T?u:l),mk(D)||vk(I,o,m,W)})};return tn(t,{onBeforeEnter(T){zr(w,[T]),oi(T,i),oi(T,r)},onBeforeAppear(T){zr(L,[T]),oi(T,a),oi(T,c)},onEnter:O(!1),onAppear:O(!0),onLeave(T,I){T._isLeaving=!0;const R=()=>$(T,I);oi(T,d),T._enterCancelled?(oi(T,f),Og(T)):(Og(T),oi(T,f)),gk(()=>{T._isLeaving&&(ir(T,d),oi(T,g),mk(y)||vk(T,o,_,R))}),zr(y,[T,R])},onEnterCancelled(T){M(T,!1,void 0,!0),zr(b,[T])},onAppearCancelled(T){M(T,!0,void 0,!0),zr(v,[T])},onLeaveCancelled(T){$(T),zr(S,[T])}})}function fI(e){if(e==null)return null;if(Gt(e))return[um(e.enter),um(e.leave)];{const t=um(e);return[t,t]}}function um(e){return Zd(e)}function oi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[wa]||(e[wa]=new Set)).add(t)}function ir(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[wa];n&&(n.delete(t),n.size||(e[wa]=void 0))}function gk(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let hI=0;function vk(e,t,n,o){const s=e._endId=++hI,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=TS(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=g=>{g.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function TS(e,t){const n=window.getComputedStyle(e),o=h=>(n[h]||"").split(", "),s=o(`${Zi}Delay`),i=o(`${Zi}Duration`),r=yk(s,i),l=o(`${oc}Delay`),a=o(`${oc}Duration`),c=yk(l,a);let u=null,d=0,f=0;t===Zi?r>0&&(u=Zi,d=r,f=i.length):t===oc?c>0&&(u=oc,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?Zi:oc:null,f=u?u===Zi?i.length:a.length:0);const g=u===Zi&&/\b(?:transform|all)(?:,|$)/.test(o(`${Zi}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:g}}function yk(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>kk(n)+kk(e[o])))}function kk(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Og(e){return(e?e.ownerDocument:document).body.offsetHeight}function pI(e,t,n){const o=e[wa];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const pf=Symbol("_vod"),AS=Symbol("_vsh"),js={name:"show",beforeMount(e,{value:t},{transition:n}){e[pf]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):sc(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),sc(e,!0),o.enter(e)):o.leave(e,()=>{sc(e,!1)}):sc(e,t))},beforeUnmount(e,{value:t}){sc(e,t)}};function sc(e,t){e.style.display=t?e[pf]:"none",e[AS]=!t}function mI(){js.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const MS=Symbol("");function Fpe(e){const t=fo();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>mf(i,s))},o=()=>{const s=e(t.proxy);t.ce?mf(t.ce,s):Rg(t.subTree,s),n(s)};VC(()=>{sf(o)}),rn(()=>{ze(o,Ps,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),Yt(()=>s.disconnect())})}function Rg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Rg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)mf(e.el,t);else if(e.type===Oe)e.children.forEach(n=>Rg(n,t));else if(e.type===da){let{el:n,anchor:o}=e;for(;n&&(mf(n,t),n!==o);)n=n.nextSibling}}function mf(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=fE(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[MS]=o}}const gI=/(?:^|;)\s*display\s*:/;function vI(e,t,n){const o=e.style,s=sn(n);let i=!1;if(n&&!s){if(t)if(sn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&hc(o,l,"")}else for(const r in t)n[r]==null&&hc(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?kI(e,r,!sn(t)&&t?t[r]:void 0,l)||hc(o,r,l):hc(o,r,"")}}else if(s){if(t!==n){const r=o[MS];r&&(n+=";"+r),o.cssText=n,i=gI.test(n)}}else t&&e.removeAttribute("style");pf in e&&(e[pf]=i?o.display:"",e[AS]&&(o.display="none"))}const bk=/\s*!important$/;function hc(e,t,n){if(ut(n))n.forEach(o=>hc(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=yI(e,t);bk.test(n)?e.setProperty(Uo(o),n.replace(bk,""),"important"):e[o]=n}}const wk=["Webkit","Moz","ms"],dm={};function yI(e,t){const n=dm[t];if(n)return n;let o=Xn(t);if(o!=="filter"&&o in e)return dm[t]=o;o=uh(o);for(let s=0;s<wk.length;s++){const i=wk[s]+o;if(i in e)return dm[t]=i}return t}function kI(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&sn(o)&&n===o}const _k="http://www.w3.org/1999/xlink";function Ck(e,t,n,o,s,i=uE(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(_k,t.slice(6,t.length)):e.setAttributeNS(_k,t,n):n==null||i&&!cC(n)?e.removeAttribute(t):e.setAttribute(t,i?"":gs(n)?String(n):n)}function Sk(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?_S(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let r=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=cC(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(s||t)}function Ei(e,t,n,o){e.addEventListener(t,n,o)}function bI(e,t,n,o){e.removeEventListener(t,n,o)}const xk=Symbol("_vei");function wI(e,t,n,o,s=null){const i=e[xk]||(e[xk]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=_I(t);if(o){const c=i[t]=xI(o,s);Ei(e,l,c,a)}else r&&(bI(e,l,r,a),i[t]=void 0)}}const Tk=/(?:Once|Passive|Capture)$/;function _I(e){let t;if(Tk.test(e)){t={};let o;for(;o=e.match(Tk);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Uo(e.slice(2)),t]}let fm=0;const CI=Promise.resolve(),SI=()=>fm||(CI.then(()=>fm=0),fm=Date.now());function xI(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(ut(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&&Rs(c,t,5,l)}}else Rs(s,t,5,[o])};return n.value=e,n.attached=SI(),n}const Ak=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,TI=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?pI(e,o,r):t==="style"?vI(e,n,o):du(t)?rh(t)||wI(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):AI(e,t,o,r))?(Sk(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ck(e,t,o,r,i,t!=="value")):e._isVueCE&&(MI(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!sn(o)))?Sk(e,Xn(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Ck(e,t,o,r))};function AI(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ak(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 Ak(t)&&sn(n)?!1:t in e}function MI(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 Mk={};function EI(e,t,n){let o=Qe(e,t);lh(o)&&(o=tn({},o,t));class s extends uv{constructor(r){super(o,r,n)}}return s.def=o,s}const Hpe=((e,t)=>EI(e,t,zI)),II=typeof HTMLElement<"u"?HTMLElement:class{};class uv extends II{constructor(t,n={},o=kf){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!==kf?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 uv){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&&!ut(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Zd(this._props[a])),(l||(l=Object.create(null)))[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:()=>x(n[o])})}_resolveProps(t){const{props:n}=t,o=ut(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):Mk;const s=Xn(t);n&&this._numberProps&&this._numberProps[s]&&(o=Zd(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===Mk?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(Uo(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Uo(t),n+""):n||this.removeAttribute(Uo(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),jI(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,lh(r[0])?tn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),Uo(i)!==i&&s(Uo(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 $I(e){const t=fo(),n=t&&t.ce;return n||null}function Wpe(){const e=$I();return e&&e.shadowRoot}function Upe(e="$style"){{const t=fo();if(!t)return Ot;const n=t.type.__cssModules;if(!n)return Ot;const o=n[e];return o||Ot}}const ES=new WeakMap,IS=new WeakMap,gf=Symbol("_moveCb"),Ek=Symbol("_enterCb"),NI=e=>(delete e.props.mode,e),LI=NI({name:"TransitionGroup",props:tn({},SS,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=fo(),o=HC();let s,i;return tv(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!DI(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(PI),s.forEach(OI);const l=s.filter(RI);Og(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;oi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[gf]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[gf]=null,ir(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=Ht(e),l=xS(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),br(u,qc(u,l,o,n)),ES.set(u,$S(u.el)))}i=t.default?J1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&br(u,qc(u,l,o,n))}return vt(a,null,i)}}}),qpe=LI;function PI(e){const t=e.el;t[gf]&&t[gf](),t[Ek]&&t[Ek]()}function OI(e){IS.set(e,$S(e.el))}function RI(e){const t=ES.get(e),n=IS.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 $S(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function DI(e,t,n){const o=e.cloneNode(),s=e[wa];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}=TS(o);return i.removeChild(o),r}const Cr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ut(t)?n=>ra(t,n):t};function BI(e){e.target.composing=!0}function Ik(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Os=Symbol("_assign");function $k(e,t,n){return t&&(e=e.trim()),n&&(e=dh(e)),e}const Wn={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[Os]=Cr(s);const i=o||s.props&&s.props.type==="number";Ei(e,t?"change":"input",r=>{r.target.composing||e[Os]($k(e.value,n,i))}),(n||i)&&Ei(e,"change",()=>{e.value=$k(e.value,n,i)}),t||(Ei(e,"compositionstart",BI),Ei(e,"compositionend",Ik),Ei(e,"change",Ik))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[Os]=Cr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?dh(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)}},vf={deep:!0,created(e,t,n){e[Os]=Cr(n),Ei(e,"change",()=>{const o=e._modelValue,s=_a(e),i=e.checked,r=e[Os];if(ut(o)){const l=hh(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(ml(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(LS(e,i))})},mounted:Nk,beforeUpdate(e,t,n){e[Os]=Cr(n),Nk(e,t,n)}};function Nk(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(ut(t))s=hh(t,o.props.value)>-1;else if(ml(t))s=t.has(o.props.value);else{if(t===n)return;s=Pi(t,LS(e,!0))}e.checked!==s&&(e.checked=s)}const NS={created(e,{value:t},n){e.checked=Pi(t,n.props.value),e[Os]=Cr(n),Ei(e,"change",()=>{e[Os](_a(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[Os]=Cr(o),t!==n&&(e.checked=Pi(t,o.props.value))}},yf={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=ml(t);Ei(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?dh(_a(r)):_a(r));e[Os](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,ht(()=>{e._assigning=!1})}),e[Os]=Cr(o)},mounted(e,{value:t}){Lk(e,t)},beforeUpdate(e,t,n){e[Os]=Cr(n)},updated(e,{value:t}){e._assigning||Lk(e,t)}};function Lk(e,t){const n=e.multiple,o=ut(t);if(!(n&&!o&&!ml(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=_a(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=hh(t,l)>-1}else r.selected=t.has(l);else if(Pi(_a(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function _a(e){return"_value"in e?e._value:e.value}function LS(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const FI={created(e,t,n){rd(e,t,n,null,"created")},mounted(e,t,n){rd(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){rd(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){rd(e,t,n,o,"updated")}};function PS(e,t){switch(e){case"SELECT":return yf;case"TEXTAREA":return Wn;default:switch(t){case"checkbox":return vf;case"radio":return NS;default:return Wn}}}function rd(e,t,n,o,s){const r=PS(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function HI(){Wn.getSSRProps=({value:e})=>({value:e}),NS.getSSRProps=({value:e},t)=>{if(t.props&&Pi(t.props.value,e))return{checked:!0}},vf.getSSRProps=({value:e},t)=>{if(ut(e)){if(t.props&&hh(e,t.props.value)>-1)return{checked:!0}}else if(ml(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},FI.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=PS(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const WI=["ctrl","shift","alt","meta"],UI={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)=>WI.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=UI[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},qI={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ns=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=Uo(s.key);if(t.some(r=>r===i||qI[r]===i))return e(s)}))},OS=tn({patchProp:TI},uI);let xc,Pk=!1;function RS(){return xc||(xc=q4(OS))}function DS(){return xc=Pk?xc:j4(OS),Pk=!0,xc}const jI=((...e)=>{RS().render(...e)}),jpe=((...e)=>{DS().hydrate(...e)}),kf=((...e)=>{const t=RS().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=FS(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,BS(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),zI=((...e)=>{const t=DS().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=FS(o);if(s)return n(s,!0,BS(s))},t});function BS(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function FS(e){return sn(e)?document.querySelector(e):e}let Ok=!1;const zpe=()=>{Ok||(Ok=!0,HI(),mI())};/*!
|
|
21
|
-
* shared v11.4.5
|
|
22
|
-
* (c) 2026 kazuya kawaguchi
|
|
23
|
-
* Released under the MIT License.
|
|
24
|
-
*/function VI(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const bf=typeof window<"u",Mr=(e,t=!1)=>t?Symbol.for(e):Symbol(e),KI=(e,t,n)=>GI({l:e,k:t,s:n}),GI=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Hn=e=>typeof e=="number"&&isFinite(e),HS=e=>fv(e)==="[object Date]",Ca=e=>fv(e)==="[object RegExp]",Ch=e=>Dt(e)&&Object.keys(e).length===0,Un=Object.assign,YI=Object.create,on=(e=null)=>YI(e);let Rk;const ol=()=>Rk||(Rk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:on());function Dk(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function XI(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const QI=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,ZI=/^(?:href|src|action|formaction)$/i;function dv(e){return QI.test(e)}function JI(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const i=s.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const f=e[l];if(c){f===c&&(c=null);continue}if(f==='"'||f==="'")c=f;else if(f==="(")a++;else if(f===")"&&(a--,a===0))break}if(a!==0)break;const u=e.slice(r+1,l).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=e.slice(o,i),n+=dv(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function Bk(e,t){if(ZI.test(e)&&dv(t))return"about:blank";const n=e.toLowerCase()==="style"?JI(t):t;return XI(n)}function e$(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${Bk(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${Bk(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)=>dv(s)?`${o}about:blank`:n),e}const t$=Object.prototype.hasOwnProperty;function Ls(e,t){return t$.call(e,t)}const In=Array.isArray,kn=e=>typeof e=="function",rt=e=>typeof e=="string",qt=e=>typeof e=="boolean",zt=e=>e!==null&&typeof e=="object",n$=e=>zt(e)&&kn(e.then)&&kn(e.catch),WS=Object.prototype.toString,fv=e=>WS.call(e),Dt=e=>fv(e)==="[object Object]",o$=e=>e==null?"":In(e)||Dt(e)&&e.toString===WS?JSON.stringify(e,null,2):String(e);function hv(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const ld=e=>!zt(e)||In(e);function Od(e,t){if(ld(e)||ld(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])?[]:on()),ld(s[i])||ld(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 s$(e,t,n){return{line:e,column:t,offset:n}}function Dg(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},i$=17;function Sh(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 r$(e){throw e}const ti=" ",l$="\r",go=`
|
|
29
|
-
`,a$="\u2028",c$="\u2029";function u$(e){const t=e;let n=0,o=1,s=1,i=0;const r=N=>t[N]===l$&&t[N+1]===go,l=N=>t[N]===go,a=N=>t[N]===c$,c=N=>t[N]===a$,u=N=>r(N)||l(N)||a(N)||c(N),d=()=>n,f=()=>o,g=()=>s,h=()=>i,m=N=>r(N)||a(N)||c(N)?go:t[N],_=()=>m(n),w=()=>m(n+i);function k(){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 y(){n=0,o=1,s=1,i=0}function S(N=0){i=N}function L(){const N=n+i;for(;N!==n;)k();i=0}return{index:d,line:f,column:g,peekOffset:h,charAt:m,currentChar:_,currentPeek:w,next:k,peek:b,reset:y,resetPeek:S,skipToPeek:L}}const Ci=void 0,d$=".",Fk="'",f$="tokenizer";function h$(e,t={}){const n=t.location!==!1,o=u$(e),s=()=>o.index(),i=()=>s$(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 $e=n?Dg(xe.startLoc,Y):null,se=Sh(H,$e,{domain:f$,args:ge});u(se)}}function f(H,Y,re){H.endLoc=i(),H.currentType=Y;const ge={type:Y};return n&&(ge.loc=Dg(H.startLoc,H.endLoc)),re!=null&&(ge.value=re),ge}const g=H=>f(H,13);function h(H,Y){return H.currentChar()===Y?(H.next(),Y):(d(Qt.EXPECTED_TOKEN,i(),0,Y),"")}function m(H){let Y="";for(;H.currentPeek()===ti||H.currentPeek()===go;)Y+=H.currentPeek(),H.peek();return Y}function _(H){const Y=m(H);return H.skipToPeek(),Y}function w(H){if(H===Ci)return!1;const Y=H.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y===95}function k(H){if(H===Ci)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;m(H);const ge=w(H.currentPeek());return H.resetPeek(),ge}function y(H,Y){const{currentType:re}=Y;if(re!==2)return!1;m(H);const ge=H.currentPeek()==="-"?H.peek():H.currentPeek(),xe=k(ge);return H.resetPeek(),xe}function S(H,Y){const{currentType:re}=Y;if(re!==2)return!1;m(H);const ge=H.currentPeek()===Fk;return H.resetPeek(),ge}function L(H,Y){const{currentType:re}=Y;if(re!==7)return!1;m(H);const ge=H.currentPeek()===".";return H.resetPeek(),ge}function N(H,Y){const{currentType:re}=Y;if(re!==8)return!1;m(H);const ge=w(H.currentPeek());return H.resetPeek(),ge}function v(H,Y){const{currentType:re}=Y;if(!(re===7||re===11))return!1;m(H);const ge=H.currentPeek()===":";return H.resetPeek(),ge}function M(H,Y){const{currentType:re}=Y;if(re!==9)return!1;const ge=()=>{const $e=H.currentPeek();return $e==="{"?w(H.peek()):$e==="@"||$e==="|"||$e===":"||$e==="."||$e===ti||!$e?!1:$e===go?(H.peek(),ge()):O(H,!1)},xe=ge();return H.resetPeek(),xe}function $(H){m(H);const Y=H.currentPeek()==="|";return H.resetPeek(),Y}function O(H,Y=!0){const re=(xe=!1,$e="")=>{const se=H.currentPeek();return se==="{"||se==="@"||!se?xe:se==="|"?!($e===ti||$e===go):se===ti?(H.peek(),re(!0,ti)):se===go?(H.peek(),re(!0,go)):!0},ge=re();return Y&&H.resetPeek(),ge}function T(H,Y){const re=H.currentChar();return re===Ci?Ci:Y(re)?(H.next(),re):null}function I(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 T(H,I)}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 T(H,D)}function V(H){const Y=H.charCodeAt(0);return Y>=48&&Y<=57}function U(H){return T(H,V)}function J(H){const Y=H.charCodeAt(0);return Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102}function K(H){return T(H,J)}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===ti||re===go)if(O(H))Y+=re,H.next();else{if($(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!==Ci&&ge!==ti&&ge!==go&&ge!==" "){const xe=Q(H);return d(Qt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re+xe),re+xe}return H.currentChar()===Ci&&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()===Ci&&d(Qt.UNTERMINATED_CLOSING_BRACE,i(),0),Y}function We(H){return H!==Fk&&H!==go}function ue(H){_(H),h(H,"'");let Y="",re="";for(;Y=T(H,We);)Y==="\\"?re+=ve(H):re+=Y;const ge=H.currentChar();return ge===go||ge===Ci?(d(Qt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ge===go&&(H.next(),h(H,"'")),re):(h(H,"'"),re)}function ve(H){const Y=H.currentChar();switch(Y){case"\\":case"'":return H.next(),`\\${Y}`;case"u":return Ne(H,Y,4);case"U":return Ne(H,Y,6);default:return d(Qt.UNKNOWN_ESCAPE_SEQUENCE,i(),0,Y),""}}function Ne(H,Y,re){h(H,Y);let ge="";for(let xe=0;xe<re;xe++){const $e=K(H);if(!$e){d(Qt.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${Y}${ge}${H.currentChar()}`);break}ge+=$e}return`\\${Y}${ge}`}function Re(H){return H!=="{"&&H!=="}"&&H!==ti&&H!==go}function Q(H){_(H);let Y="",re="";for(;Y=T(H,Re);)re+=Y;return re}function ce(H){let Y="",re="";for(;Y=R(H);)re+=Y;return re}function Se(H){const Y=re=>{const ge=H.currentChar();return ge==="{"||ge==="@"||ge==="|"||ge==="("||ge===")"||!ge||ge===ti?re:(re+=ge,H.next(),Y(re))};return Y("")}function j(H){_(H);const Y=h(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=f(Y,2,"{"),_(H),Y.braceNest++,re;case"}":return Y.braceNest>0&&Y.currentType===2&&d(Qt.EMPTY_PLACEHOLDER,i(),0),H.next(),re=f(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=he(H,Y)||g(Y),Y.braceNest=0,re;default:{let xe=!0,$e=!0,se=!0;if($(H))return Y.braceNest>0&&d(Qt.UNTERMINATED_CLOSING_BRACE,i(),0),re=f(Y,1,j(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=f(Y,4,ke(H)),_(H),re;if($e=y(H,Y))return re=f(Y,5,le(H)),_(H),re;if(se=S(H,Y))return re=f(Y,6,ue(H)),_(H),re;if(!xe&&!$e&&!se)return re=f(Y,12,Q(H)),d(Qt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,re.value),_(H),re;break}}return re}function he(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===ti)&&d(Qt.INVALID_LINKED_FORMAT,i(),0),xe){case"@":return H.next(),ge=f(Y,7,"@"),Y.inLinked=!0,ge;case".":return _(H),H.next(),f(Y,8,".");case":":return _(H),H.next(),f(Y,9,":");default:return $(H)?(ge=f(Y,1,j(H)),Y.braceNest=0,Y.inLinked=!1,ge):L(H,Y)||v(H,Y)?(_(H),he(H,Y)):N(H,Y)?(_(H),f(Y,11,ce(H))):M(H,Y)?(_(H),xe==="{"?te(H,Y)||ge:f(Y,10,Se(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)||g(Y);if(Y.inLinked)return he(H,Y)||g(Y);switch(H.currentChar()){case"{":return te(H,Y)||g(Y);case"}":return d(Qt.UNBALANCED_CLOSING_BRACE,i(),0),H.next(),f(Y,3,"}");case"@":return he(H,Y)||g(Y);default:{if($(H))return re=f(Y,1,j(H)),Y.braceNest=0,Y.inLinked=!1,re;if(O(H))return f(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()===Ci?f(a,13):oe(o,a)}return{nextToken:fe,currentOffset:s,currentPosition:i,context:c}}const p$="parser",m$=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,g$=/\\([\\@{}|])/g;function v$(e,t){return t}function y$(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 k$(e={}){const t=e.location!==!1,{onError:n}=e;function o(w,k,b,y,...S){const L=w.currentPosition();if(L.offset+=y,L.column+=y,n){const N=t?Dg(b,L):null,v=Sh(k,N,{domain:p$,args:S});n(v)}}function s(w,k,b){const y={type:w};return t&&(y.start=k,y.end=k,y.loc={start:b,end:b}),y}function i(w,k,b,y){t&&(w.end=k,w.loc&&(w.loc.end=b))}function r(w,k){const b=w.context(),y=s(3,b.offset,b.startLoc);return y.value=k.replace(g$,v$),i(y,w.currentOffset(),w.currentPosition()),y}function l(w,k){const b=w.context(),{lastOffset:y,lastStartLoc:S}=b,L=s(5,y,S);return L.index=parseInt(k,10),w.nextToken(),i(L,w.currentOffset(),w.currentPosition()),L}function a(w,k){const b=w.context(),{lastOffset:y,lastStartLoc:S}=b,L=s(4,y,S);return L.key=k,w.nextToken(),i(L,w.currentOffset(),w.currentPosition()),L}function c(w,k){const b=w.context(),{lastOffset:y,lastStartLoc:S}=b,L=s(9,y,S);return L.value=k.replace(m$,y$),w.nextToken(),i(L,w.currentOffset(),w.currentPosition()),L}function u(w){const k=w.nextToken(),b=w.context(),{lastOffset:y,lastStartLoc:S}=b,L=s(8,y,S);return k.type!==11?(o(w,Qt.UNEXPECTED_EMPTY_LINKED_MODIFIER,b.lastStartLoc,0),L.value="",i(L,y,S),{nextConsumeToken:k,node:L}):(k.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,ni(k)),L.value=k.value||"",i(L,w.currentOffset(),w.currentPosition()),{node:L})}function d(w,k){const b=w.context(),y=s(7,b.offset,b.startLoc);return y.value=k,i(y,w.currentOffset(),w.currentPosition()),y}function f(w){const k=w.context(),b=s(6,k.offset,k.startLoc);let y=w.nextToken();if(y.type===8){const S=u(w);b.modifier=S.node,y=S.nextConsumeToken||w.nextToken()}switch(y.type!==9&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(y)),y=w.nextToken(),y.type===2&&(y=w.nextToken()),y.type){case 10:y.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(y)),b.key=d(w,y.value||"");break;case 4:y.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(y)),b.key=a(w,y.value||"");break;case 5:y.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(y)),b.key=l(w,y.value||"");break;case 6:y.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(y)),b.key=c(w,y.value||"");break;default:{o(w,Qt.UNEXPECTED_EMPTY_LINKED_KEY,k.lastStartLoc,0);const S=w.context(),L=s(7,S.offset,S.startLoc);return L.value="",i(L,S.offset,S.startLoc),b.key=L,i(b,S.offset,S.startLoc),{nextConsumeToken:y,node:b}}}return i(b,w.currentOffset(),w.currentPosition()),{node:b}}function g(w){const k=w.context(),b=k.currentType===1?w.currentOffset():k.offset,y=k.currentType===1?k.endLoc:k.startLoc,S=s(2,b,y);S.items=[];let L=null;do{const M=L||w.nextToken();switch(L=null,M.type){case 0:M.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(M)),S.items.push(r(w,M.value||""));break;case 5:M.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(M)),S.items.push(l(w,M.value||""));break;case 4:M.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(M)),S.items.push(a(w,M.value||""));break;case 6:M.value==null&&o(w,Qt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,ni(M)),S.items.push(c(w,M.value||""));break;case 7:{const $=f(w);S.items.push($.node),L=$.nextConsumeToken||null;break}}}while(k.currentType!==13&&k.currentType!==1);const N=k.currentType===1?k.lastOffset:w.currentOffset(),v=k.currentType===1?k.lastEndLoc:w.currentPosition();return i(S,N,v),S}function h(w,k,b,y){const S=w.context();let L=y.items.length===0;const N=s(1,k,b);N.cases=[],N.cases.push(y);do{const v=g(w);L||(L=v.items.length===0),N.cases.push(v)}while(S.currentType!==13);return L&&o(w,Qt.MUST_HAVE_MESSAGES_IN_PLURAL,b,0),i(N,w.currentOffset(),w.currentPosition()),N}function m(w){const k=w.context(),{offset:b,startLoc:y}=k,S=g(w);return k.currentType===13?S:h(w,b,y,S)}function _(w){const k=h$(w,Un({},e)),b=k.context(),y=s(0,b.offset,b.startLoc);return t&&y.loc&&(y.loc.source=w),y.body=m(k),e.onCacheKey&&(y.cacheKey=e.onCacheKey(w)),b.currentType!==13&&o(k,Qt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,w[b.offset]||""),i(y,k.currentOffset(),k.currentPosition()),y}return{parse:_}}function ni(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function b$(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Hk(e,t){for(let n=0;n<e.length;n++)pv(e[n],t)}function pv(e,t){switch(e.type){case 1:Hk(e.cases,t),t.helper("plural");break;case 2:Hk(e.items,t);break;case 6:{pv(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 w$(e,t={}){const n=b$(e);n.helper("normalize"),e.body&&pv(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function _$(e){const t=e.body;return t.type===2?Wk(t):t.cases.forEach(n=>Wk(n)),e}function Wk(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=hv(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 Yl(e){switch(e.t=e.type,e.type){case 0:{const t=e;Yl(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++)Yl(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++)Yl(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;Yl(t.key),t.k=t.key,delete t.key,t.modifier&&(Yl(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 C$(e,t){const{filename:n,breakLineCode:o,needIndent:s}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(m,_){r.code+=m}function c(m,_=!0){const w=_?o:"";a(s?w+" ".repeat(m):w)}function u(m=!0){const _=++r.indentLevel;m&&c(_)}function d(m=!0){const _=--r.indentLevel;m&&c(_)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function S$(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Sa(e,t.key),t.modifier?(e.push(", "),Sa(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function x$(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&&(Sa(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function T$(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&&(Sa(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function A$(e,t){t.body?Sa(e,t.body):e.push("null")}function Sa(e,t){const{helper:n}=e;switch(t.type){case 0:A$(e,t);break;case 1:T$(e,t);break;case 2:x$(e,t);break;case 6:S$(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 M$=(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=C$(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${hv(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Sa(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 E$(e,t={}){const n=Un({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=k$(n).parse(e);return o?(i&&_$(l),s&&Yl(l),{ast:l,code:""}):(w$(l,n),M$(l,n))}/*!
|
|
31
|
-
* core-base v11.4.5
|
|
32
|
-
* (c) 2026 kazuya kawaguchi
|
|
33
|
-
* Released under the MIT License.
|
|
34
|
-
*/function I$(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ol().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ol().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function ci(e){return zt(e)&&mv(e)===0&&(Ls(e,"b")||Ls(e,"body"))}const US=["b","body"];function $$(e){return Er(e,US)}const qS=["c","cases"];function N$(e){return Er(e,qS,[])}const jS=["s","static"];function L$(e){return Er(e,jS)}const zS=["i","items"];function P$(e){return Er(e,zS,[])}const VS=["t","type"];function mv(e){return Er(e,VS)}const KS=["v","value"];function ad(e,t){const n=Er(e,KS);if(n!=null)return n;throw Kc(t)}const GS=["m","modifier"];function O$(e){return Er(e,GS)}const YS=["k","key"];function R$(e){const t=Er(e,YS);if(t)return t;throw Kc(6)}function Er(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(Ls(e,s)&&e[s]!=null)return e[s]}return n}const XS=[...US,...qS,...jS,...zS,...YS,...GS,...KS,...VS];function Kc(e){return new Error(`unhandled node type: ${e}`)}function hm(e){return n=>D$(n,e)}function D$(e,t){const n=$$(t);if(n==null)throw Kc(0);if(mv(n)===1){const i=N$(n);return e.plural(i.reduce((r,l)=>[...r,Uk(e,l)],[]))}else return Uk(e,n)}function Uk(e,t){const n=L$(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=P$(t).reduce((s,i)=>[...s,Bg(e,i)],[]);return e.normalize(o)}}function Bg(e,t){const n=mv(t);switch(n){case 3:return ad(t,n);case 9:return ad(t,n);case 4:{const o=t;if(Ls(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(Ls(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw Kc(n)}case 5:{const o=t;if(Ls(o,"i")&&Hn(o.i))return e.interpolate(e.list(o.i));if(Ls(o,"index")&&Hn(o.index))return e.interpolate(e.list(o.index));throw Kc(n)}case 6:{const o=t,s=O$(o),i=R$(o);return e.linked(Bg(e,i),s?Bg(e,s):void 0,e.type)}case 7:return ad(t,n);case 8:return ad(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const B$=e=>e;let cd=on();function F$(e,t={}){let n=!1;const o=t.onError||r$;return t.onError=s=>{n=!0,o(s)},{...E$(e,t),detectError:n}}function H$(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&rt(e)){qt(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||B$)(e),s=cd[o];if(s)return s;const{ast:i,detectError:r}=F$(e,{...t,location:!1,jit:!0}),l=hm(i);return r?l:cd[o]=l}else{const n=e.cacheKey;if(n){const o=cd[n];return o||(cd[n]=hm(e))}else return hm(e)}}let Gc=null;function W$(e){Gc=e}function U$(e,t,n){Gc&&Gc.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const q$=j$("function:translate");function j$(e){return t=>Gc&&Gc.emit(e,t)}const Ii={INVALID_ARGUMENT:i$,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},z$=24;function $i(e){return Sh(e,null,void 0)}function gv(e,t){return t.locale!=null?qk(t.locale):qk(e.locale)}let pm;function qk(e){if(rt(e))return e;if(kn(e)){if(e.resolvedOnce&&pm!=null)return pm;if(e.constructor.name==="Function"){const t=e();if(n$(t))throw $i(Ii.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return pm=t}else throw $i(Ii.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw $i(Ii.NOT_SUPPORT_LOCALE_TYPE)}function V$(e,t,n){return[...new Set([n,...In(t)?t:zt(t)?Object.keys(t):rt(t)?[t]:[n]])]}function Fg(e,t,n){const o=rt(n)?n:Yc,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;In(r);)r=jk(i,r,t);const l=In(t)||!Dt(t)?t:t.default?t.default:null;r=rt(l)?[l]:l,In(r)&&jk(i,r,!1),s.__localeChainCache.set(o,i)}return i}function jk(e,t,n){let o=!0;for(let s=0;s<t.length&&qt(o);s++){const i=t[s];rt(i)&&(o=K$(e,t[s],n))}return o}function K$(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=G$(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function G$(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 Ir=[];Ir[0]={w:[0],i:[3,0],"[":[4],o:[7]};Ir[1]={w:[1],".":[2],"[":[4],o:[7]};Ir[2]={w:[2],i:[3,0],0:[3,0]};Ir[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Ir[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Ir[5]={"'":[4,0],o:8,l:[5,0]};Ir[6]={'"':[4,0],o:8,l:[6,0]};const Y$=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function X$(e){return Y$.test(e)}function Q$(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 Z$(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 J$(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:X$(t)?Q$(t):"*"+t}function e6(e){const t=[];let n=-1,o=0,s=0,i,r,l,a,c,u,d;const f=[];f[0]=()=>{r===void 0?r=l:r+=l},f[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),s++},f[3]=()=>{if(s>0)s--,o=4,f[0]();else{if(s=0,r===void 0||(r=J$(r),r===!1))return!1;f[1]()}};function g(){const h=e[n+1];if(o===5&&h==="'"||o===6&&h==='"')return n++,l="\\"+h,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&g())){if(a=Z$(i),d=Ir[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(o===7)return t}}const zk=new Map;function t6(e,t){return zt(e)?e[t]:null}function n6(e,t){if(!zt(e))return null;let n=zk.get(t);if(n||(n=e6(t),n&&zk.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(XS.includes(r)&&ci(s)||!zt(s)||!Ls(s,r))return null;const l=s[r];if(l===void 0||kn(s))return null;s=l,i++}return s}const o6="11.4.5",xh=-1,Yc="en-US",wf="",Vk=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function s6(){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)?Vk(e):t==="vnode"&&zt(e)&&"__v_isVNode"in e?Vk(e.children):e}}let QS;function i6(e){QS=e}let ZS;function r6(e){ZS=e}let JS;function l6(e){JS=e}let ex=null;const a6=e=>{ex=e},c6=()=>ex;let tx=null;const Kk=e=>{tx=e},u6=()=>tx;let Gk=0;function d6(e={}){const t=kn(e.onWarn)?e.onWarn:VI,n=rt(e.version)?e.version:o6,o=rt(e.locale)||kn(e.locale)?e.locale:Yc,s=kn(o)?Yc:o,i=In(e.fallbackLocale)||Dt(e.fallbackLocale)||rt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=Dt(e.messages)?e.messages:mm(s),l=Dt(e.datetimeFormats)?e.datetimeFormats:mm(s),a=Dt(e.numberFormats)?e.numberFormats:mm(s),c=Un(on(),e.modifiers,s6()),u=e.pluralRules||on(),d=kn(e.missing)?e.missing:null,f=qt(e.missingWarn)||Ca(e.missingWarn)?e.missingWarn:!0,g=qt(e.fallbackWarn)||Ca(e.fallbackWarn)?e.fallbackWarn:!0,h=!!e.fallbackFormat,m=!!e.unresolving,_=kn(e.postTranslation)?e.postTranslation:null,w=Dt(e.processor)?e.processor:null,k=qt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter,y=kn(e.messageCompiler)?e.messageCompiler:QS,S=kn(e.messageResolver)?e.messageResolver:ZS||t6,L=kn(e.localeFallbacker)?e.localeFallbacker:JS||V$,N=zt(e.fallbackContext)?e.fallbackContext:void 0,v=e,M=zt(v.__datetimeFormatters)?v.__datetimeFormatters:new Map,$=zt(v.__numberFormatters)?v.__numberFormatters:new Map,O=zt(v.__meta)?v.__meta:{};Gk++;const T={version:n,cid:Gk,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:g,fallbackFormat:h,unresolving:m,postTranslation:_,processor:w,warnHtmlMessage:k,escapeParameter:b,messageCompiler:y,messageResolver:S,localeFallbacker:L,fallbackContext:N,onWarn:t,__meta:O};return T.datetimeFormats=l,T.numberFormats=a,T.__datetimeFormatters=M,T.__numberFormatters=$,__INTLIFY_PROD_DEVTOOLS__&&U$(T,n,O),T}const mm=e=>({[e]:on()});function vv(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 ic(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function f6(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function h6(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(f6(e,t[o]))return!0;return!1}function Yk(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!rt(t[0])&&!HS(t[0])&&!Hn(t[0]))return wf;const[a,c,u,d]=Hg(...t),f=qt(u.missingWarn)?u.missingWarn:e.missingWarn;qt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const g=!!u.part,h=gv(e,u),m=r(e,s,h);if(!rt(a)||a===""){const L=new Intl.DateTimeFormat(h.replace(/!/g,""),d);return g?L.formatToParts(c):L.format(c)}let _={},w,k=null;const b="datetime format";for(let L=0;L<m.length&&(w=m[L],_=n[w]||{},k=_[a],!Dt(k));L++)vv(e,a,w,f,b);if(!Dt(k)||!rt(w))return o?xh:a;let y=`${w}__${a}`;Ch(d)||(y=`${y}__${JSON.stringify(d)}`);let S=l.get(y);return S||(S=new Intl.DateTimeFormat(w,Un({},k,d)),l.set(y,S)),g?S.formatToParts(c):S.format(c)}const nx=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Hg(...e){const[t,n,o,s]=e,i=on();let r=on(),l;if(rt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw $i(Ii.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 $i(Ii.INVALID_ISO_DATE_ARGUMENT)}}else if(HS(t)){if(isNaN(t.getTime()))throw $i(Ii.INVALID_DATE_ARGUMENT);l=t}else if(Hn(t))l=t;else throw $i(Ii.INVALID_ARGUMENT);return rt(n)?i.key=n:Dt(n)&&Object.keys(n).forEach(a=>{nx.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 Xk(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function Qk(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!Hn(t[0]))return wf;const[a,c,u,d]=Wg(...t),f=qt(u.missingWarn)?u.missingWarn:e.missingWarn;qt(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const g=!!u.part,h=gv(e,u),m=r(e,s,h);if(!rt(a)||a===""){const L=new Intl.NumberFormat(h.replace(/!/g,""),d);return g?L.formatToParts(c):L.format(c)}let _={},w,k=null;const b="number format";for(let L=0;L<m.length&&(w=m[L],_=n[w]||{},k=_[a],!Dt(k));L++)vv(e,a,w,f,b);if(!Dt(k)||!rt(w))return o?xh:a;let y=`${w}__${a}`;Ch(d)||(y=`${y}__${JSON.stringify(d)}`);let S=l.get(y);return S||(S=new Intl.NumberFormat(w,Un({},k,d)),l.set(y,S)),g?S.formatToParts(c):S.format(c)}const ox=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Wg(...e){const[t,n,o,s]=e,i=on();let r=on();if(!Hn(t))throw $i(Ii.INVALID_ARGUMENT);const l=t;return rt(n)?i.key=n:Dt(n)&&Object.keys(n).forEach(a=>{ox.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 Zk(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const p6=e=>e,m6=e=>"",g6="text",v6=e=>e.length===0?"":hv(e),y6=o$;function gm(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function k6(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 b6(e={}){const t=e.locale,n=k6(e),o=rt(t)&&kn(e.pluralRules?.[t])?e.pluralRules[t]:gm,s=o===gm?void 0:gm,i=w=>w[o(n,w.length,s)],r=e.list||[],l=w=>r[w],a=e.named||on();Hn(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=w=>a[w];function u(w,k){const b=kn(e.messages)?e.messages(w,!!k):zt(e.messages)?e.messages[w]:!1;return b||(e.parent?e.parent.message(w):m6)}const d=w=>e.modifiers?e.modifiers[w]:p6,f=kn(e.processor?.normalize)?e.processor.normalize:v6,g=kn(e.processor?.interpolate)?e.processor.interpolate:y6,h=rt(e.processor?.type)?e.processor.type:g6,_={list:l,named:c,plural:i,linked:(w,...k)=>{const[b,y]=k;let S="text",L="";k.length===1?zt(b)?(L=b.modifier||L,S=b.type||S):rt(b)&&(L=b||L):k.length===2&&(rt(b)&&(L=b||L),rt(y)&&(S=y||S));const N=u(w,!0)(_),v=N===""||N===void 0?w:N,M=S==="vnode"&&In(v)&&L?v[0]:v;return L?d(L)(M,S):M},message:u,type:h,interpolate:g,normalize:f,values:Un(on(),r,a)};return _}const Jk=()=>"",Is=e=>kn(e);function eb(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Ug(...t),u=qt(c.missingWarn)?c.missingWarn:e.missingWarn,d=qt(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=qt(c.escapeParameter)?c.escapeParameter:e.escapeParameter,g=!!c.resolvedMessage,h=rt(c.default)||qt(c.default)?qt(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||h!=null&&(rt(h)||kn(h)),_=gv(e,c);f&&w6(c);let[w,k,b]=g?[a,_,l[_]||on()]:sx(e,a,_,r,d,u),y=w,S=a;if(!g&&!(rt(y)||ci(y)||Is(y))&&m&&(y=h,S=y),!g&&(!(rt(y)||ci(y)||Is(y))||!rt(k)))return s?xh:a;let L=!1;const N=()=>{L=!0},v=Is(y)?y:ix(e,a,k,y,S,N);if(L)return y;const M=S6(e,k,b,c),$=b6(M),O=_6(e,v,$);let T=o?o(O,a):O;if(f&&rt(T)&&(T=e$(T)),__INTLIFY_PROD_DEVTOOLS__){const I={timestamp:Date.now(),key:rt(a)?a:Is(y)?y.key:"",locale:k||(Is(y)?y.locale:""),format:rt(y)?y:Is(y)?y.source:"",message:T};I.meta=Un({},e.__meta,c6()||{}),q$(I)}return T}function w6(e){In(e.list)?e.list=e.list.map(t=>rt(t)?Dk(t):t):zt(e.named)&&Object.keys(e.named).forEach(t=>{rt(e.named[t])&&(e.named[t]=Dk(e.named[t]))})}function sx(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=on(),f,g=null;const h="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||on(),(g=a(d,t))===null&&(g=d[t]),!(rt(g)||ci(g)||Is(g)));m++)if(!h6(f,u)){const _=vv(e,t,f,i,h);_!==t&&(g=_)}return[g,f,d]}function ix(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(Is(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,C6(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function _6(e,t,n){return t(n)}function Ug(...e){const[t,n,o]=e,s=on();if(!rt(t)&&!Hn(t)&&!Is(t)&&!ci(t))throw $i(Ii.INVALID_ARGUMENT);const i=Hn(t)?String(t):(Is(t),t);return Hn(n)?s.plural=n:rt(n)?s.default=n:Dt(n)&&!Ch(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 C6(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>KI(t,n,r)}}function S6(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:s,pluralRules:i,messages:(g,h)=>{let m=r(n,g);if(m==null&&(u||h)){const[_,,w]=sx(u||e,g,t,l,a,c);m=_??r(w,g)}if(rt(m)||ci(m)){let _=!1;const k=ix(e,g,t,m,g,()=>{_=!0});return _?Jk:k}else return Is(m)?m:Jk}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),Hn(o.plural)&&(f.pluralIndex=o.plural),f}I$();/*!
|
|
35
|
-
* vue-i18n v11.4.5
|
|
36
|
-
* (c) 2026 kazuya kawaguchi
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/const x6="11.4.5";function T6(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ol().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ol().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ol().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ol().__INTLIFY_PROD_DEVTOOLS__=!1)}const Mo={UNEXPECTED_RETURN_TYPE:z$,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 qo(e,...t){return Sh(e,null,void 0)}const qg=Mr("__translateVNode"),jg=Mr("__datetimeParts"),zg=Mr("__numberParts"),rx=Mr("__setPluralRules"),lx=Mr("__injectWithOption"),Jl=Mr("__dispose");function Xc(e){if(!zt(e)||ci(e))return e;for(const t in e)if(Ls(e,t))if(!t.includes("."))zt(e[t])&&Xc(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]]=on()),!zt(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(ci(s)?XS.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!ci(s)){const r=s[n[o]];zt(r)&&Xc(r)}}return e}function yv(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=Dt(n)?n:In(o)?on():{[e]:on()};if(In(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||on(),Od(c,r[a])):Od(c,r)}else rt(l)&&Od(JSON.parse(l),r)}),s==null&&i)for(const l in r)Ls(r,l)&&Xc(r[l]);return r}function ax(e){return e.type}function cx(e,t,n){let o=zt(t.messages)?t.messages:on();"__i18nGlobal"in n&&(o=yv(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 tb(e){return vt(gr,null,e,0)}function Qc(){return fo()}const nb="__INTLIFY_META__",ob=()=>[],A6=()=>!1;let sb=0;function ib(e){return((t,n,o,s)=>e(n,o,Qc()||void 0,s))}const M6=()=>{const e=Qc();let t=null;return e&&(t=ax(e)[nb])?{[nb]:t}:null};function _f(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=bf?ne:gl;let r=qt(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:rt(e.locale)?e.locale:Yc),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(yv(l.value,e)),u=i(Dt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Dt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:qt(e.missingWarn)||Ca(e.missingWarn)?e.missingWarn:!0,g=t?t.fallbackWarn:qt(e.fallbackWarn)||Ca(e.fallbackWarn)?e.fallbackWarn:!0,h=t?t.fallbackRoot:qt(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,_=kn(e.missing)?e.missing:null,w=kn(e.missing)?ib(e.missing):null,k=kn(e.postTranslation)?e.postTranslation:null,b=t?t.warnHtmlMessage:qt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const S=t?t.modifiers:Dt(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,N;N=(()=>{o&&Kk(null);const se={version:x6,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:S,pluralRules:L,missing:w===null?void 0:w,missingWarn:f,fallbackWarn:g,fallbackFormat:m,unresolving:!0,postTranslation:k===null?void 0:k,warnHtmlMessage:b,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};se.datetimeFormats=u.value,se.numberFormats=d.value,se.__datetimeFormatters=Dt(N)?N.__datetimeFormatters:void 0,se.__numberFormatters=Dt(N)?N.__numberFormatters:void 0;const ae=d6(se);return o&&Kk(ae),ae})(),ic(N,l.value,a.value);function M(){return[l.value,a.value,c.value,u.value,d.value]}const $=F({get:()=>l.value,set:se=>{N.locale=se,l.value=se}}),O=F({get:()=>a.value,set:se=>{N.fallbackLocale=se,a.value=se,ic(N,l.value,se)}}),T=F(()=>c.value),I=F(()=>u.value),R=F(()=>d.value);function D(){return kn(k)?k:null}function W(se){k=se,N.postTranslation=se}function V(){return _}function U(se){se!==null&&(w=ib(se)),_=se,N.missing=w}const J=(se,ae,we,qe,nt,ct)=>{M();let _t;try{__INTLIFY_PROD_DEVTOOLS__,o||(N.fallbackContext=t?u6():void 0),_t=se(N)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(N.fallbackContext=void 0)}if(we!=="translate exists"&&Hn(_t)&&_t===xh||we==="translate exists"&&!_t){const[$t,lt]=ae();return t&&h?qe(t):nt($t)}else{if(ct(_t))return _t;throw qo(Mo.UNEXPECTED_RETURN_TYPE)}};function K(...se){return J(ae=>Reflect.apply(eb,null,[ae,...se]),()=>Ug(...se),"translate",ae=>Reflect.apply(ae.t,ae,[...se]),ae=>ae,ae=>rt(ae))}function G(...se){const[ae,we,qe]=se;if(qe&&!zt(qe))throw qo(Mo.INVALID_ARGUMENT);return K(ae,we,Un({resolvedMessage:!0},qe||{}))}function X(...se){return J(ae=>Reflect.apply(Yk,null,[ae,...se]),()=>Hg(...se),"datetime format",ae=>Reflect.apply(ae.d,ae,[...se]),()=>wf,ae=>rt(ae)||In(ae))}function ke(...se){return J(ae=>Reflect.apply(Qk,null,[ae,...se]),()=>Wg(...se),"number format",ae=>Reflect.apply(ae.n,ae,[...se]),()=>wf,ae=>rt(ae)||In(ae))}function le(se){return se.map(ae=>rt(ae)||Hn(ae)||qt(ae)?tb(String(ae)):ae)}const ue={normalize:le,interpolate:se=>se,type:"vnode"};function ve(...se){return J(ae=>{let we;const qe=ae;try{qe.processor=ue,we=Reflect.apply(eb,null,[qe,...se])}finally{qe.processor=null}return we},()=>Ug(...se),"translate",ae=>ae[qg](...se),ae=>[tb(ae)],ae=>In(ae))}function Ne(...se){return J(ae=>Reflect.apply(Qk,null,[ae,...se]),()=>Wg(...se),"number format",ae=>ae[zg](...se),ob,ae=>rt(ae)||In(ae))}function Re(...se){return J(ae=>Reflect.apply(Yk,null,[ae,...se]),()=>Hg(...se),"datetime format",ae=>ae[jg](...se),ob,ae=>rt(ae)||In(ae))}function Q(se){L=se,N.pluralRules=L}function ce(se,ae){return J(()=>{if(!se)return!1;const we=rt(ae)?ae:l.value,qe=rt(ae)?[we]:Fg(N,a.value,we);for(let nt=0;nt<qe.length;nt++){const ct=te(qe[nt]);let _t=N.messageResolver(ct,se);if(_t===null&&(_t=ct[se]),ci(_t)||Is(_t)||rt(_t))return!0}return!1},()=>[se],"translate exists",we=>Reflect.apply(we.te,we,[se,ae]),A6,we=>qt(we))}function Se(se){let ae=null;const we=Fg(N,a.value,l.value);for(let qe=0;qe<we.length;qe++){const nt=c.value[we[qe]]||{},ct=N.messageResolver(nt,se);if(ct!=null){ae=ct;break}}return ae}function j(se){const ae=Se(se);return ae??(t?t.tm(se)||{}:{})}function te(se){return c.value[se]||{}}function he(se,ae){if(s){const we={[se]:ae};for(const qe in we)Ls(we,qe)&&Xc(we[qe]);ae=we[se]}c.value[se]=ae,N.messages=c.value}function oe(se,ae){c.value[se]=c.value[se]||{};const we={[se]:ae};if(s)for(const qe in we)Ls(we,qe)&&Xc(we[qe]);ae=we[se],Od(ae,c.value[se]),N.messages=c.value}function fe(se){return u.value[se]||{}}function H(se,ae){u.value[se]=ae,N.datetimeFormats=u.value,Xk(N,se,ae)}function Y(se,ae){u.value[se]=Un(u.value[se]||{},ae),N.datetimeFormats=u.value,Xk(N,se,ae)}function re(se){return d.value[se]||{}}function ge(se,ae){d.value[se]=ae,N.numberFormats=d.value,Zk(N,se,ae)}function xe(se,ae){d.value[se]=Un(d.value[se]||{},ae),N.numberFormats=d.value,Zk(N,se,ae)}sb++,t&&bf&&(ze(t.locale,se=>{r&&(l.value=se,N.locale=se,ic(N,l.value,a.value))}),ze(t.fallbackLocale,se=>{r&&(a.value=se,N.fallbackLocale=se,ic(N,l.value,a.value))}));const $e={id:sb,locale:$,fallbackLocale:O,get inheritLocale(){return r},set inheritLocale(se){r=se,se&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,ic(N,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:T,get modifiers(){return S},get pluralRules(){return L||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(se){f=se,N.missingWarn=f},get fallbackWarn(){return g},set fallbackWarn(se){g=se,N.fallbackWarn=g},get fallbackRoot(){return h},set fallbackRoot(se){h=se},get fallbackFormat(){return m},set fallbackFormat(se){m=se,N.fallbackFormat=m},get warnHtmlMessage(){return b},set warnHtmlMessage(se){b=se,N.warnHtmlMessage=se},get escapeParameter(){return y},set escapeParameter(se){y=se,N.escapeParameter=se},t:K,getLocaleMessage:te,setLocaleMessage:he,mergeLocaleMessage:oe,getPostTranslationHandler:D,setPostTranslationHandler:W,getMissingHandler:V,setMissingHandler:U,[rx]:Q};return $e.datetimeFormats=I,$e.numberFormats=R,$e.rt=G,$e.te=ce,$e.tm=j,$e.d=X,$e.n=ke,$e.getDateTimeFormat=fe,$e.setDateTimeFormat=H,$e.mergeDateTimeFormat=Y,$e.getNumberFormat=re,$e.setNumberFormat=ge,$e.mergeNumberFormat=xe,$e[lx]=n,$e[qg]=ve,$e[jg]=Re,$e[zg]=Ne,$e}function E6(e){const t=rt(e.locale)?e.locale:Yc,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=qt(e.silentTranslationWarn)||Ca(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=qt(e.silentFallbackWarn)||Ca(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=qt(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,f=!!e.escapeParameterHtml,g=qt(e.sync)?e.sync:!0;let h=e.messages;if(Dt(e.sharedMessages)){const S=e.sharedMessages;h=Object.keys(S).reduce((N,v)=>{const M=N[v]||(N[v]={});return Un(M,S[v]),N},h||{})}const{__i18n:m,__root:_,__injectWithOption:w}=e,k=e.datetimeFormats,b=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:h,flatJson:y,datetimeFormats:k,numberFormats:b,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:g,__i18n:m,__root:_,__injectWithOption:w}}function Vg(e={}){const t=_f(E6(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 qt(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=qt(s)?!s:s},get silentFallbackWarn(){return qt(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=qt(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 I6(e,t,n){return{beforeCreate(){const o=Qc();if(!o)throw qo(Mo.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=rb(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Vg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=rb(e,s);else{this.$i18n=Vg({__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&&cx(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=Qc();if(!o)throw qo(Mo.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 rb(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[rx](t.pluralizationRules||e.pluralizationRules);const n=yv(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 kv={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function $6({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},on())}function ux(){return Oe}const N6=Qe({name:"i18n-t",props:Un({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Hn(e)||!isNaN(e)}},kv),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||xt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=on();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=rt(e.plural)?+e.plural:e.plural);const u=$6(t,a);return s[qg](e.keypath,u,c)},r=Un(on(),o),l=rt(e.tag)||zt(e.tag)?e.tag:ux();return zt(l)?Zt(l,r,{default:i}):Zt(l,r,i())}}}),lb=N6;function L6(e){return In(e)&&!rt(e[0])}function dx(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=on();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((g,h)=>n.includes(h)?Un(on(),g,{[h]:e.format[h]}):g,on()));const d=o(e.value,c,u);let f=[c.key];return In(d)?f=d.map((g,h)=>{const m=s[g.type],_=m?m({[g.type]:g.value,index:h,parts:d}):[g.value];return L6(_)&&(_[0].key=`${g.type}-${h}`),_}):rt(d)&&(f=[d]),f},l=Un(on(),i),a=rt(e.tag)||zt(e.tag)?e.tag:ux();return zt(a)?Zt(a,l,{default:r}):Zt(a,l,r())}}const P6=Qe({name:"i18n-n",props:Un({value:{type:Number,required:!0},format:{type:[String,Object]}},kv),setup(e,t){const n=e.i18n||xt({useScope:e.scope,__useComponent:!0});return dx(e,t,ox,(...o)=>n[zg](...o))}}),ab=P6;function O6(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 R6(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw qo(Mo.UNEXPECTED_ERROR);const c=O6(e,l.$),u=cb(a);return[Reflect.apply(c.t,c,[...ub(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);bf&&(r.__i18nWatcher=ze(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{bf&&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=cb(l);r.textContent=Reflect.apply(a.t,a,[...ub(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function cb(e){if(rt(e))return{path:e};if(Dt(e)){if(!("path"in e))throw qo(Mo.REQUIRED_VALUE,"path");return e}else throw qo(Mo.INVALID_VALUE)}function ub(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 D6(e,t,...n){const o=Dt(n[0])?n[0]:{};(qt(o.globalInstall)?o.globalInstall:!0)&&([lb.name,"I18nT"].forEach(i=>e.component(i,lb)),[ab.name,"I18nN"].forEach(i=>e.component(i,ab)),[hb.name,"I18nD"].forEach(i=>e.component(i,hb))),e.directive("t",R6(t))}const B6=Mr("global-vue-i18n");function F6(e={}){const t=__VUE_I18N_LEGACY_API__&&qt(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=qt(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=H6(e,t),r=Mr("");function l(d){return o.get(d)||null}function a(d,f){o.set(d,f)}function c(d){o.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),Dt(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let g=null;!t&&n&&(g=K6(d,u.global)),__VUE_I18N_FULL_INSTALL__&&D6(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(I6(i,i.__composer,u));const h=d.unmount;d.unmount=()=>{g&&g(),u.dispose(),h()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function xt(e={}){const t=Qc();if(t==null)throw qo(Mo.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw qo(Mo.NOT_INSTALLED);const n=W6(t),o=q6(n),s=ax(t),i=U6(e,s);if(i==="global")return cx(o,e,s),o;if(i==="parent"){let a=db(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw qo(Mo.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=Un({},e),u=db(n,t);c.__root=u||o;const d=_f(c);return a.__composerExtend&&(d[Jl]=a.__composerExtend(d)),K1()&&G1(()=>{const g=d[Jl];g&&(g(),delete d[Jl])}),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[Jl]=r.__composerExtend(l)),z6(r,t,l),r.__setInstance(t,l)}return l}function H6(e,t){const n=hE(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Vg(e)):n.run(()=>_f(e));if(o==null)throw qo(Mo.UNEXPECTED_ERROR);return[n,o]}function W6(e){const t=Bt(e.isCE?B6:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw qo(e.isCE?Mo.NOT_INSTALLED_WITH_PROVIDE:Mo.UNEXPECTED_ERROR);return t}function U6(e,t){return Ch(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function q6(e){return e.mode==="composition"?e.global:e.global.__composer}function db(e,t,n=!1){let o=null;const s=t.root;let i=j6(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[lx]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function j6(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function z6(e,t,n){rn(()=>{},t),Yt(()=>{const o=n;e.__deleteInstance(t);const s=o[Jl];s&&(s(),delete o[Jl])},t)}const V6=["locale","fallbackLocale","availableLocales"],fb=["t","rt","d","n","tm","te"];function K6(e,t){const n=Object.create(null);return V6.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw qo(Mo.UNEXPECTED_ERROR);const r=Pn(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,fb.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw qo(Mo.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,fb.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const G6=Qe({name:"i18n-d",props:Un({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},kv),setup(e,t){const n=e.i18n||xt({useScope:e.scope,__useComponent:!0});return dx(e,t,nx,(...o)=>n[jg](...o))}}),hb=G6;T6();i6(H$);r6(n6);l6(Fg);if(__INTLIFY_PROD_DEVTOOLS__){const e=ol();e.__INTLIFY__=!0,W$(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Mt={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",thinking:"kimi-web.thinking",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",theme:"kimi-web.theme",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",betaToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",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 pb(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 Zc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function bv(e){const t=bn(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Th(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function wv(){const e=bn(Mt.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 _v(e){const n={...wv()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];An(Mt.unread,JSON.stringify(n))}function Y6(){const e=bv(Mt.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function X6(e){Th(Mt.collapsedWorkspaces,Array.from(e))}function Q6(){const e=bv(Mt.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function fx(e){Th(Mt.workspaceOrder,Array.from(e))}const mb=Mt.clientId,Z6="kimi-code-web",J6="web";function e5(){return{serverHttpUrl:n5(),clientId:r5(),clientName:Z6,clientVersion:l5(),clientUiMode:J6}}function t5(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function n5(e){const t=t5(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function o5(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function s5(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return o5(e)}function Cf(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function i5(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 r5(){const e=bn(mb);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return An(mb,t),t}function l5(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function wo(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return a5(e)}function a5(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}function c5(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 u5(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 d5(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 f5={class:"row"},h5={class:"lead","aria-hidden":"true"},p5={key:0,class:"run-ico",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none"},m5={key:1,class:"unread-dot"},g5={class:"archive-label"},v5={class:"left"},y5=["onKeydown"],k5={class:"ts"},b5=["title"],w5={class:"tag-text"},_5=["title"],C5={class:"tag-text"},S5=["title"],x5={class:"tag-text"},T5=["title"],A5=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}=xt(),s=e,i=n,r=ne(!1),l=ne(null),a=ne(null);function c($){const O=$.target;a.value?.contains(O)||l.value?.contains(O)||d()}function u($){$.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 f=ne(!1),g=ne(""),h=ne(null);async function m(){d(),f.value=!0,g.value=s.session.title,await ht();try{h.value?.focus(),h.value?.select()}catch{}}function _(){const $=g.value.trim();$&&i("rename",s.session.id,$),f.value=!1}function w(){f.value=!1}const k=ne(!1),b=ne(!1);async function y(){const $=await wo(s.session.id);k.value=$,b.value=!$,setTimeout(()=>{k.value=!1,b.value=!1,d()},1500)}function S(){d(),i("fork",s.session.id)}const L=ne(!1);function N(){d(),L.value=!0}function v(){i("archive",s.session.id),L.value=!1}function M(){L.value=!1}return t({closeMenu:d,cancelArchive:M}),($,O)=>(C(),E("div",{class:Pe(["se",{on:e.active}]),onClick:O[5]||(O[5]=T=>i("select",e.session.id))},[p("div",f5,[p("span",h5,[e.session.busy?(C(),E("svg",p5,[...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(),E("span",m5)):ie("",!0)]),L.value?(C(),E("div",{key:0,class:"archive-confirm",onClick:O[0]||(O[0]=Ze(()=>{},["stop"]))},[p("span",g5,P(x(o)("sidebar.archiveConfirm")),1),p("button",{class:"btn-confirm",onClick:Ze(v,["stop"])},P(x(o)("sidebar.confirm")),1),p("button",{class:"btn-cancel",onClick:Ze(M,["stop"])},P(x(o)("sidebar.cancel")),1)])):(C(),E(Oe,{key:1},[p("div",v5,[f.value?jt((C(),E("input",{key:0,ref_key:"renameInputRef",ref:h,"onUpdate:modelValue":O[1]||(O[1]=T=>g.value=T),class:"rename-input",onClick:O[2]||(O[2]=Ze(()=>{},["stop"])),onKeydown:[Ns(Ze(_,["stop"]),["enter"]),Ns(Ze(w,["stop"]),["esc"])],onBlur:_},null,40,y5)),[[Wn,g.value]]):(C(),E("span",{key:1,class:"t",onDblclick:Ze(m,["stop"])},P(e.session.title),33))]),p("span",k5,P(e.session.time),1),!f.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(C(),E("span",{key:0,class:"tag tag-ask",title:x(o)("workspace.awaitingAnswerTitle")},[p("span",w5,P(x(o)("workspace.awaitingAnswer")),1)],8,b5)):ie("",!0),!f.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(C(),E("span",{key:1,class:"tag tag-approve",title:x(o)("workspace.awaitingPermissionTitle")},[p("span",C5,P(x(o)("workspace.awaitingPermission")),1)],8,_5)):ie("",!0),!f.value&&e.session.status==="aborted"?(C(),E("span",{key:2,class:"tag tag-aborted",title:x(o)("workspace.abortedTitle")},[p("span",x5,P(x(o)("workspace.aborted")),1)],8,S5)):ie("",!0),f.value?ie("",!0):(C(),E("button",{key:3,ref_key:"kebabRef",ref:l,class:Pe(["kebab",{open:r.value}]),title:x(o)("sidebar.options"),onClick:O[3]||(O[3]=Ze(T=>u(T),["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,T5))],64))]),r.value?(C(),E("div",{key:0,ref_key:"menuRef",ref:a,class:"menu",onClick:O[4]||(O[4]=Ze(()=>{},["stop"]))},[p("button",{class:Pe(["menu-item copy-id",{failed:b.value}]),onClick:Ze(y,["stop"])},P(b.value?x(o)("sidebar.copyFailed"):k.value?x(o)("sidebar.copied"):x(o)("sidebar.copySessionId")),3),O[8]||(O[8]=p("div",{class:"menu-divider"},null,-1)),p("button",{class:"menu-item",onClick:Ze(m,["stop"])},P(x(o)("sidebar.rename")),1),p("button",{class:"menu-item",onClick:Ze(S,["stop"])},P(x(o)("sidebar.fork")),1),p("button",{class:"menu-item archive",onClick:Ze(N,["stop"])},P(x(o)("sidebar.archive")),1)],512)):ie("",!0)],2))}}),bt=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},hx=bt(A5,[["__scopeId","data-v-8222aa18"]]),M5={class:"gh-top"},E5={class:"gh-folder",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},I5={key:0,class:"gh-name"},$5=["title","aria-label","aria-expanded"],N5=["title","aria-label"],L5=["title"],P5={class:"group-sessions"},O5=["disabled"],R5={key:1,class:"group-empty"},D5=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}=xt(),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(),E("div",{class:Pe(["group",{dragging:e.dragging}])},[p("div",{class:Pe(["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",M5,[(C(),E("svg",E5,[e.isCollapsed(e.group.workspace.id)?(C(),E(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(),E(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(),E("span",I5,P(e.group.workspace.name),1)):jt((C(),E("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]=Ns(u=>s("confirmRename"),["enter"])),c[2]||(c[2]=Ns(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:Pe(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),title:x(n)("sidebar.options"),"aria-label":x(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,$5),p("button",{type:"button",class:"gh-add",title:x(n)("workspace.newInGroup"),"aria-label":x(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,N5)]),p("div",{class:"gh-path",title:e.group.workspace.root},P(e.group.workspace.shortPath||e.group.workspace.root),9,L5)],34),jt(p("div",P5,[(C(!0),E(Oe,null,Xe(e.group.sessions,u=>(C(),Ve(hx,{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,f)=>s("renameSession",d,f)),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(),E("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?x(n)("sidebar.loadingMore"):x(n)("sidebar.showMore",{count:Math.max(0,e.group.workspace.sessionCount-e.group.sessions.length)})),9,O5)):ie("",!0),e.group.sessions.length===0?(C(),E("div",R5,P(x(n)("sidebar.noSessions")),1)):ie("",!0)],512),[[js,!e.isCollapsed(e.group.workspace.id)]])],2))}}),B5=bt(D5,[["__scopeId","data-v-4c114e7c"]]),F5={class:"side"},H5={class:"ch"},W5={class:"ch-brand"},U5={class:"ch-name"},q5={key:0,class:"ch-endpoint"},j5=["title","aria-label"],z5=["title","aria-label"],V5={class:"search"},K5=["placeholder","aria-label","onKeydown"],G5=["title","aria-label"],Y5={class:"btn-wrap"},X5={key:0,class:"sessions"},Q5={key:1,class:"empty"},Z5={key:1,class:"sessions"},J5={key:0,class:"empty"},eN=["onDragover","onDrop"],tN=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}=xt(),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 qe=(we.title??"").toLowerCase(),nt=(we.lastPrompt??"").toLowerCase();return qe.includes(ae)||nt.includes(ae)}):[]});function d(){l.value=""}function f(ae){d(),M(ae)}ze(c,ae=>{ae&&r("loadAllSessions")});const g=ne(new Set(Y6()));function h(ae){return g.value.has(ae)}function m(ae){const we=new Set(g.value);we.has(ae)?we.delete(ae):we.add(ae),g.value=we,X6(we)}const _=ne(null),w=ne(null);function k(ae){_.value=ae}function b(){_.value=null,w.value=null}function y(ae){const we=ae.currentTarget.getBoundingClientRect();return ae.clientY<we.top+we.height/2?"before":"after"}function S(ae,we){_.value===null||_.value===we||(ae.preventDefault(),ae.dataTransfer&&(ae.dataTransfer.dropEffect="move"),w.value={id:we,position:y(ae)})}function L(ae){const we=_.value,qe=w.value?.id===ae?w.value.position:"before";if(w.value=null,_.value=null,!we||we===ae)return;const nt=d5(i.groups.map(ct=>ct.workspace.id),we,ae,qe);r("reorderWorkspaces",nt)}const N=ne(new Set);function v(ae,we){if(we.shiftKey){we.stopPropagation();const qe=new Set(N.value);qe.has(ae)?qe.delete(ae):qe.add(ae),N.value=qe,r("selectWorkspaces",Array.from(qe));return}N.value=new Set,r("selectWorkspaces",[]),m(ae)}function M(ae){N.value=new Set,r("selectWorkspaces",[]),r("select",ae)}const $=ne(null),O=ne(""),T=ne(null);function I(){return T}function R(ae,we){$.value=ae,O.value=we,ht().then(()=>T.value?.focus())}function D(){const ae=$.value,we=O.value.trim();ae&&we&&r("renameWorkspace",ae,we),$.value=null}function W(){$.value=null}function V(ae){O.value=ae}const U=ne(!1),J=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 qe=new Set(N.value);qe.has(ae.id)?qe.delete(ae.id):qe.add(ae.id),N.value=qe,r("selectWorkspaces",Array.from(qe));return}we.preventDefault(),we.stopPropagation(),J.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),J.value=null,Q()}function We(){J.value&&wo(J.value.root),le()}function ue(){J.value&&R(J.value.id,J.value.name),le()}function ve(){const ae=J.value;ae&&ce(ae.id)&&(r("deleteWorkspace",ae.id),le())}const Ne=ne(null);let Re;function Q(){clearTimeout(Re),Ne.value=null}function ce(ae){return Ne.value===ae?(Q(),!0):(clearTimeout(Re),Ne.value=ae,Re=setTimeout(()=>{Ne.value=null},2500),!1)}const Se=ne(null),j=ne(null),te=ne({}),he=ne(null);function oe(ae){const we=ae.target;we.closest(".gh-more")||we.closest(".ws-menu")||H()}async function fe(ae,we){if(Se.value===ae.id){H();return}const qe=we.currentTarget;j.value=ae,Se.value=ae.id,document.addEventListener("mousedown",oe),document.addEventListener("scroll",H,!0),window.addEventListener("resize",H),await ht();const nt=he.value,ct=qe.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(){Se.value=null,j.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())}Yo(()=>{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 $e;function se(){const ae=xe.value;ae&&(ae.classList.remove("blink-now"),ae.getBoundingClientRect(),ae.classList.add("blink-now"),clearTimeout($e),$e=setTimeout(()=>ae.classList.remove("blink-now"),300))}return(ae,we)=>(C(),E("aside",F5,[p("div",{class:"col",style:Wt({width:e.colWidth+"px"})},[p("div",H5,[p("div",W5,[(C(),E("svg",{ref_key:"logoRef",ref:xe,class:Pe(["ch-logo",{"is-dev":x(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:se},[...we[19]||(we[19]=[_r('<defs data-v-bdcf1ef0><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-bdcf1ef0><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-bdcf1ef0></rect><g class="ch-eyes" fill="#000" data-v-bdcf1ef0><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-bdcf1ef0></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-bdcf1ef0></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-bdcf1ef0></rect>',2)])],2)),p("span",U5,[we[20]||(we[20]=ft("Kimi Code",-1)),x(o)?(C(),E("span",q5," · "+P(x(s)),1)):ie("",!0)])]),p("button",{type:"button",class:"collapse-btn",title:x(n)("sidebar.collapseSidebar"),"aria-label":x(n)("sidebar.collapseSidebar"),onClick:we[0]||(we[0]=Ze(qe=>r("collapse"),["stop"]))},[...we[21]||(we[21]=[_r('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-bdcf1ef0><path d="M11 6h9" data-v-bdcf1ef0></path><path d="M11 12h9" data-v-bdcf1ef0></path><path d="M11 18h9" data-v-bdcf1ef0></path><path d="M7 9l-3 3 3 3" data-v-bdcf1ef0></path></svg>',1)])],8,j5),p("button",{type:"button",class:"settings-btn",title:x(n)("settings.title"),"aria-label":x(n)("settings.title"),onClick:we[1]||(we[1]=Ze(qe=>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,z5)]),p("div",V5,[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)),jt(p("input",{"onUpdate:modelValue":we[2]||(we[2]=qe=>l.value=qe),class:"search-input",type:"text",placeholder:x(n)("sidebar.searchPlaceholder"),"aria-label":x(n)("sidebar.searchPlaceholder"),onKeydown:Ns(Ze(d,["stop"]),["esc"])},null,40,K5),[[Wn,l.value]]),c.value?(C(),E("button",{key:0,type:"button",class:"search-clear",title:x(n)("sidebar.searchClear"),"aria-label":x(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,G5)):ie("",!0)]),p("div",Y5,[p("button",{class:"btn-new-chat",onClick:we[3]||(we[3]=Ze(qe=>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(x(n)("sidebar.newChat")),1)]),ie("",!0)]),c.value?(C(),E("div",X5,[u.value.length>0?(C(!0),E(Oe,{key:0},Xe(u.value,qe=>(C(),Ve(hx,{key:qe.id,session:qe,active:qe.id===e.activeId,"approval-count":e.pendingBySession[qe.id]?.approvals??0,"question-count":e.pendingBySession[qe.id]?.questions??0,unread:e.unreadBySession[qe.id]??!1,onSelect:we[5]||(we[5]=nt=>f(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(),E("div",Q5,P(x(n)("sidebar.searchNoResults")),1))])):(C(),E("div",Z5,[e.groups.length===0?(C(),E("div",J5,P(x(n)("workspace.noWorkspace")),1)):(C(!0),E(Oe,{key:1},Xe(e.groups,qe=>(C(),E("div",{key:qe.workspace.id,class:Pe(["ws-drop-target",{"drop-before":w.value?.id===qe.workspace.id&&w.value.position==="before","drop-after":w.value?.id===qe.workspace.id&&w.value.position==="after"}]),onDragover:nt=>S(nt,qe.workspace.id),onDrop:nt=>L(qe.workspace.id)},[vt(B5,{group:qe,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"selected-ids":N.value,"renaming-id":$.value,"rename-value":O.value,"rename-input-ref":I(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":Se.value,dragging:_.value===qe.workspace.id,"is-collapsed":h,onGroupClick:v,onGroupContextmenu:ke,onToggleWsMenu:fe,onCreateInWorkspace:we[9]||(we[9]=nt=>r("createInWorkspace",nt)),onSelectSession:M,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:k,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,eN))),128))]))],4),U.value?(C(),E("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:We},P(x(n)("sidebar.copyPath")),1),p("button",{type:"button",class:"ghm-item",onClick:ue},P(x(n)("sidebar.rename")),1),p("button",{type:"button",class:"ghm-item del",onClick:ve},P(J.value&&Ne.value===J.value.id?x(n)("sidebar.confirm"):x(n)("sidebar.removeWorkspace")),1)],4)):ie("",!0),Se.value!==null&&j.value?(C(),E("div",{key:1,ref_key:"wsMenuRef",ref:he,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(qe=>Y(j.value),["stop"]))},P(x(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(qe=>re(j.value),["stop"]))},P(x(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(qe=>ge(j.value),["stop"]))},P(Ne.value===j.value.id?x(n)("sidebar.confirm"):x(n)("sidebar.removeWorkspace")),1)],4)):ie("",!0)]))}}),nN=bt(tN,[["__scopeId","data-v-bdcf1ef0"]]);function oN(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 sN(e,t){try{An(e,String(t))}catch{}}function iN(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(w){return Number.isFinite(w)?Math.min(EC(s),Math.max(o,Math.round(w))):n}const l=ne(r(oN(t)??n)),a=ne(!1);function c(w){const k=r(w);l.value=k,sN(t,k)}let u=0,d=0,f=null,g=-1;function h(w){if(!a.value)return;const k=w.clientX-u;c(d+(i?-k:k))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(g)}catch{}f.removeEventListener("pointermove",h),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,g=-1}}function _(w){w.preventDefault(),a.value=!0,u=w.clientX,d=r(l.value),f=w.currentTarget,g=w.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(g)}catch{}f.addEventListener("pointermove",h),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return Yo(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:_}}const rN=["aria-label"],lN=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}=xt(),{width:i,dragging:r,onPointerDown:l}=iN({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(),E("div",{class:Pe(["rh",{dragging:x(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??x(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>x(l)&&x(l)(...u))},[...c[1]||(c[1]=[p("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,rN))}}),gb=bt(lN,[["__scopeId","data-v-0d454900"]]),aN={preview:"Preview"},cN={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…"},uN={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"},dN={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},fN={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…"},hN={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"},pN={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"},mN={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"},gN={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"},vN={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"},yN={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"},bN={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},wN={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"},_N={panelTitle:"Thinking",close:"Close"},CN={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"},SN={},xN={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"}},TN={searching:"Searching…",noMatch:"No matches"},AN={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."}},MN={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"}},EN={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"}},IN={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},$N={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"},NN={label:"Theme",modern:"Explore",kimi:"Native",colorSchemeLabel:"Appearance",light:"Light",dark:"Dark",system:"System"},LN={preview:"预览"},PN={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",comingSoon:"敬请期待"},ON={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:"没有匹配的会话"},RN={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},DN={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:"正在加载更早的消息…"},BN={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:"进行中"},FN={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"},HN={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 后重试"},WN={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 关闭"},UN={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},qN={justNow:"刚刚"},jN={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:"拒绝并退出"},zN={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},VN={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:"展开"},KN={panelTitle:"思考过程",close:"关闭"},GN={title:"改动",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},YN={},XN={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:"无法读取这个文件"}},QN={searching:"搜索中…",noMatch:"无匹配"},ZN={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:"目标描述太长了,请精简后重试。"}},JN={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:"撤销上一条消息"}},e8={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"计划",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"}},t8={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},n8={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},o8={label:"主题",modern:"探索",kimi:"原生",colorSchemeLabel:"外观",light:"浅色",dark:"深色",system:"跟随系统"},s8={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"},i8={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",themeLabel:"主题",modernDesc:"气泡、对话感、更柔和。",kimiDesc:"原生风格:安静、扁平。",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},r8={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:"Telemetry",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",beta:"Experimental",betaToc:"Proportional conversation outline",betaTocHint:" Larger bubbles, viewport indicator, and hover tooltip"},l8={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:"遥测",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",beta:"实验性",betaToc:"对话目录增强",betaTocHint:"更大的气泡、视口指示器和悬停提示"},a8={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?"},c8={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"detached",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",confirmArchive:"确认归档?"},u8={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"},d8={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},f8={en:{common:aN,app:cN,sidebar:uN,workspace:dN,conversation:fN,status:hN,composer:pN,login:mN,providers:gN,model:vN,sessions:yN,approval:kN,question:bN,tasks:wN,thinking:_N,diff:CN,fileTree:SN,filePreview:xN,mention:TN,warnings:AN,commands:MN,tools:EN,layout:IN,mobile:$N,theme:NN,onboarding:s8,settings:r8,header:a8,sideChat:u8},zh:{common:LN,app:PN,sidebar:ON,workspace:RN,conversation:DN,status:BN,composer:FN,login:HN,providers:WN,model:UN,sessions:qN,approval:jN,question:zN,tasks:VN,thinking:KN,diff:GN,fileTree:YN,filePreview:XN,mention:QN,warnings:ZN,commands:JN,tools:e8,layout:t8,mobile:n8,theme:o8,onboarding:i8,settings:l8,header:c8,sideChat:d8}},px=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function h8(){const e=bn(Mt.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Sn=F6({legacy:!1,locale:h8(),fallbackLocale:"en",messages:f8});function mx(e){Sn.global.locale.value=e,An(Mt.locale,e)}const ha=Sn.global.t,p8={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"},m8={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 vl(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return m8[t]??t}function Sf(e){const t=p8[vl(e)];return t?ha(t):e}const 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"><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>',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"><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>',vb='<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>',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"><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>',yb='<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>',b8='<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>',w8='<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>',kb='<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>',_8='<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>',C8="";function S8(e){switch(vl(e)){case"read":return g8;case"bash":return v8;case"edit":return vb;case"multi_edit":return vb;case"write":return y8;case"grep":return yb;case"search":return yb;case"glob":return k8;case"ls":return b8;case"web_fetch":return w8;case"todo":return kb;case"task":return kb;default:return(e??"").trim().toLowerCase().includes("skill")?_8:C8}}const gx=80;function x8(e,t=gx){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function T8(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function A8(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Vt(e){return typeof e=="string"&&e.length>0?e:void 0}function Vr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function M8(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 vm(e){return Vt(e.path)??Vt(e.file_path)??Vt(e.filePath)??Vt(e.filename)}const E8=64;function Kg(e,t,n=!1){const o=(s,i=gx)=>n?s.trim():x8(s,i);try{const s=A8(t);if(!n&&T8(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(vl(e)){case"read":{const r=vm(s);if(!r)return i();const l=Vr(s.offset)??Vr(s.line_start)??Vr(s.start_line),a=Vr(s.limit)??Vr(s.length),c=Vr(s.line_end)??Vr(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=vm(s);return r?o(`${r} ${ha("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=vm(s);return r?o(r):i()}case"bash":{const r=Vt(s.command)??Vt(s.cmd)??Vt(s.script);return r?o(r,E8):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(M8(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(ha("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function I8(e){try{switch(vl(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return ha("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 ha("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?ha("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const $8=1e6,bb=5e3;function wb(e){if(e==="")return[];const t=e.split(`
|
|
39
|
-
`);return t.at(-1)===""&&t.pop(),t}function N8(e,t){const n=wb(e),o=wb(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>bb||i>bb||(s+1)*(i+1)>$8)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let g=1;g<=s;g++)for(let h=1;h<=i;h++)r[g][h]=n[g-1]===o[h-1]?r[g-1][h-1]+1:Math.max(r[g-1][h],r[g][h-1]);const l=[];let a=s,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===o[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:o[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const g of l)g.type==="context"?(u.push({type:"context",text:g.text,oldNo:d,newNo:f}),d++,f++):g.type==="add"?(u.push({type:"add",text:g.text,newNo:f}),f++):(u.push({type:"del",text:g.text,oldNo:d}),d++);return u}function L8(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 vx(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 yx(e){const t=vl(e.name);if(t!=="edit"&&t!=="write")return null;const n=vx(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:N8(o,s)}return null}function P8(e){const t=vx(e);return t&&typeof t.path=="string"?t.path:void 0}function O8(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const R8=["title"],D8=["title"],B8=["src","alt"],F8=["src"],H8=["src"],W8={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"},U8=["points"],q8=["innerHTML"],j8={class:"a"},z8=["title"],V8={class:"rt"},K8=["title"],G8={key:1,class:"chip"},Y8={key:2,class:"spin",role:"status","aria-label":"running"},X8={key:4,class:"tm"},Q8={key:0,class:"bb"},Z8={key:0,class:"bb-summary"},J8={key:1,class:"bb-empty"},eL=!1,tL=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 T=vl(n.tool.name);return T==="edit"||T==="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=()=>Sf(n.tool.name),f=()=>S8(n.tool.name),g=()=>Kg(n.tool.name,n.tool.arg),h=()=>Kg(n.tool.name,n.tool.arg,!0),m=()=>{const T=k.value;if(T&&n.tool.status!=="error"){const{added:I,removed:R}=L8(T);if(I||R)return`+${I} −${R}`}return I8({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),k=F(()=>yx(n.tool)),b=F(()=>n.tool.name==="ExitPlanMode"),y=F(()=>b.value?n.tool.planPath:void 0),S=F(()=>{const T=y.value;return T?T.split(/[\\/]+/).pop()||T:""});function L(){y.value&&o("openFile",{path:y.value})}const N=F(()=>eL);function v(T){return T.split(/[\\/]+/).pop()||T}function M(T){return T<1024?`${T} B`:T<1024*1024?`${(T/1024).toFixed(1)} KB`:`${(T/1024/1024).toFixed(1)} MB`}const $=F(()=>{const T=w.value;if(!T)return"";const I=[T.path?v(T.path):Sf(n.tool.name)];return T.mimeType&&I.push(T.mimeType),T.bytes!==void 0&&I.push(M(T.bytes)),T.dimensions&&I.push(T.dimensions),I.join(" · ")});function O(){const T=w.value;T?.kind==="image"&&o("openMedia",T)}return(T,I)=>w.value?(C(),E("div",{key:0,class:Pe(["media-tool",{mob:e.mobile}])},[p("div",{class:"media-title",title:w.value.path||$.value},P($.value),9,R8),w.value.kind==="image"?(C(),E("button",{key:0,type:"button",class:"media-image-button",title:w.value.path||$.value,onClick:O},[p("img",{class:"media-image",src:w.value.url,alt:w.value.path?v(w.value.path):$.value,loading:"lazy"},null,8,B8)],8,D8)):w.value.kind==="video"?(C(),E("video",{key:1,class:"media-video",src:w.value.url,controls:"",preload:"metadata"},null,8,F8)):(C(),E("audio",{key:2,class:"media-audio",src:w.value.url,controls:""},null,8,H8))],2)):(C(),E("div",{key:1,class:Pe(["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(),E("svg",W8,[p("polyline",{points:l.value?"4,6 8,10 12,6":"6,4 10,8 6,12"},null,8,U8)])),f()?(C(),E("span",{key:0,class:"gl",innerHTML:f(),"aria-hidden":"true"},null,8,q8)):ie("",!0),p("span",j8,P(d()),1),l.value?ie("",!0):(C(),E("span",{key:1,class:"p",title:g()},P(g()),9,z8)),p("span",V8,[N.value?(C(),E("button",{key:0,class:"plan-link",type:"button",title:y.value,onClick:Ze(L,["stop"])},"📄 "+P(S.value),9,K8)):ie("",!0),m()?(C(),E("span",G8,P(m()),1)):ie("",!0),e.tool.status==="running"?(C(),E("span",Y8)):(C(),E("span",{key:3,class:Pe(e.tool.status==="ok"?"ok":"er")},P(u()),3)),e.tool.timing&&e.tool.name!=="bash"?(C(),E("span",X8,P(e.tool.timing),1)):ie("",!0)])]),l.value?(C(),E("div",Q8,[h()?(C(),E("div",Z8,P(h()),1)):ie("",!0),i.value?ie("",!0):(C(),E("div",J8,"Waiting for output…")),(C(!0),E(Oe,null,Xe(e.tool.output??[],(R,D)=>(C(),E("div",{key:D},P(R),1))),128))])):ie("",!0)],2))}}),ud=bt(tL,[["__scopeId","data-v-4b9fd75b"]]);var nL=Object.create,Cv=Object.defineProperty,oL=Object.getOwnPropertyDescriptor,kx=Object.getOwnPropertyNames,sL=Object.getPrototypeOf,iL=Object.prototype.hasOwnProperty,bx=(e,t)=>function(){return t||(0,e[kx(e)[0]])((t={exports:{}}).exports,t),t.exports},wx=e=>{let t={};for(var n in e)Cv(t,n,{get:e[n],enumerable:!0});return t},rL=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=kx(t),i=0,r=s.length,l;i<r;i++)l=s[i],!iL.call(e,l)&&l!==n&&Cv(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=oL(t,l))||o.enumerable});return e},_x=(e,t,n)=>(n=e!=null?nL(sL(e)):{},rL(Cv(n,"default",{value:e,enumerable:!0}),e));function lL(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 aL(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function cL(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 uL(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 dL(){return`</ol>
|
|
44
|
-
</section>
|
|
45
|
-
`}function fL(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 hL(){return`</li>
|
|
46
|
-
`}function pL(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 mL(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=cL,e.renderer.rules.footnote_block_open=uL,e.renderer.rules.footnote_block_close=dL,e.renderer.rules.footnote_open=fL,e.renderer.rules.footnote_close=hL,e.renderer.rules.footnote_anchor=pL,e.renderer.rules.footnote_caption=aL,e.renderer.rules.footnote_anchor_name=lL;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let g;for(g=d+2;g<f;g++){if(l.src.charCodeAt(g)===32)return!1;if(l.src.charCodeAt(g)===93)break}if(g===d+2||g+1>=f||l.src.charCodeAt(++g)!==58)return!1;if(u)return!0;g++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const h=l.src.slice(d+2,g-2);l.env.footnotes.refs[`:${h}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:h},m.level=l.level++,l.tokens.push(m);const _=l.bMarks[a],w=l.tShift[a],k=l.sCount[a],b=l.parentType,y=g,S=l.sCount[a]+g-(l.bMarks[a]+l.tShift[a]);let L=S;for(;g<f;){const v=l.src.charCodeAt(g);if(n(v))v===9?L+=4-L%4:L++;else break;g++}l.tShift[a]=g-y,l.sCount[a]=L-S,l.bMarks[a]=y,l.blkIndent+=4,l.parentType="footnote",l.sCount[a]<l.blkIndent&&(l.sCount[a]+=l.blkIndent),l.md.block.tokenize(l,a,c,!0),l.parentType=b,l.blkIndent-=4,l.tShift[a]=w,l.sCount[a]=k,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,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const g=l.env.footnotes.list.length,h=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,h);const m=l.push("footnote_ref","",0);m.meta={id:g},l.env.footnotes.list[g]={content:l.src.slice(d,f),tokens:h}}return l.pos=f+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let g;l.env.footnotes.refs[`:${f}`]<0?(g=l.env.footnotes.list.length,l.env.footnotes.list[g]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=g):g=l.env.footnotes.refs[`:${f}`];const h=l.env.footnotes.list[g].count;l.env.footnotes.list[g].count++;const m=l.push("footnote_ref","",0);m.meta={id:g,subId:h,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(h){return h.type==="footnote_reference_open"?(d=!0,c=[],u=h.meta.label,!1):h.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(h),!d)}),!l.env.footnotes.list))return;const g=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let h=0,m=g.length;h<m;h++){const _=new l.Token("footnote_open","",1);if(_.meta={id:h,label:g[h].label},l.tokens.push(_),g[h].tokens){a=[];const b=new l.Token("paragraph_open","p",1);b.block=!0,a.push(b);const y=new l.Token("inline","",0);y.children=g[h].tokens,y.content=g[h].content,a.push(y);const S=new l.Token("paragraph_close","p",-1);S.block=!0,a.push(S)}else g[h].label&&(a=f[`:${g[h].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 k=g[h].count>0?g[h].count:1;for(let b=0;b<k;b++){const y=new l.Token("footnote_anchor","",0);y.meta={id:h,subId:b,label:g[h].label},l.tokens.push(y)}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 gL(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 vL(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 yL=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/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(yL,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function bL(e){e.inline.ruler.after("emphasis","sub",kL)}const wL=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function _L(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(wL,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function CL(e){e.inline.ruler.after("emphasis","sup",_L)}var SL=bx({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,_){_=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},_),m.core.ruler.after("inline","github-task-lists",function(w){for(var k=w.tokens,b=0,y=2;y<k.length;y++)s(k,y)&&(i(k[y],b,_,w.Token),b+=1,n(k[y-2],"class",_.liClass),n(k[o(k,y-2)],"class",_.ulClass))})};function n(m,_,w){var k=m.attrIndex(_),b=[_,w];k<0?m.attrPush(b):m.attrs[k]=b}function o(m,_){for(var w=m[_].level-1,k=_-1;k>=0;k--)if(m[k].level===w)return k;return-1}function s(m,_){return d(m[_])&&f(m[_-1])&&g(m[_-2])&&h(m[_])}function i(m,_,w,k){var b=w.idPrefix+_;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(b,k)),m.children.push(a(k)),m.children.unshift(r(m,b,w,k)),w.divWrap&&(m.children.unshift(c(w,k)),m.children.push(u(k)))}function r(m,_,w,k){var b=new k("checkbox_input","input",0);return b.attrs=[["type","checkbox"],["id",_]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&b.attrs.push(["checked","true"]),w.disabled===!0&&b.attrs.push(["disabled","true"]),b}function l(m,_){var w=new _("label_open","label",1);return w.attrs=[["for",m]],w}function a(m){return new m("label_close","label",-1)}function c(m,_){var w=new _("checkbox_open","div",0);return w.attrs=[["class",m.divClass]],w}function u(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function f(m){return m.type==="paragraph_open"}function g(m){return m.type==="list_item_open"}function h(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),xL=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))),TL=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),ym;const AL=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]]),ML=(ym=String.fromCodePoint)!==null&&ym!==void 0?ym: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 EL(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=AL.get(e))!==null&&t!==void 0?t:e}var so;(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"})(so||(so={}));const IL=32;var hr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(hr||(hr={}));function Gg(e){return e>=so.ZERO&&e<=so.NINE}function $L(e){return e>=so.UPPER_A&&e<=so.UPPER_F||e>=so.LOWER_A&&e<=so.LOWER_F}function NL(e){return e>=so.UPPER_A&&e<=so.UPPER_Z||e>=so.LOWER_A&&e<=so.LOWER_Z||Gg(e)}function LL(e){return e===so.EQUALS||NL(e)}var oo;(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"})(oo||(oo={}));var ur;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ur||(ur={}));var PL=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=oo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ur.Strict}startEntity(e){this.decodeMode=e,this.state=oo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case oo.EntityStart:return e.charCodeAt(t)===so.NUM?(this.state=oo.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=oo.NamedEntity,this.stateNamedEntity(e,t));case oo.NumericStart:return this.stateNumericStart(e,t);case oo.NumericDecimal:return this.stateNumericDecimal(e,t);case oo.NumericHex:return this.stateNumericHex(e,t);case oo.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|IL)===so.LOWER_X?(this.state=oo.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=oo.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(Gg(o)||$L(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(Gg(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===so.SEMI)this.consumed+=1;else if(this.decodeMode===ur.Strict)return 0;return this.emitCodePoint(EL(this.result),this.consumed),this.errors&&(e!==so.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&hr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=OL(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===ur.Attribute&&(s===0||LL(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&hr.VALUE_LENGTH)>>14,s!==0){if(i===so.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==ur.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]&hr.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]&~hr.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case oo.NamedEntity:return this.result!==0&&(this.decodeMode!==ur.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case oo.NumericDecimal:return this.emitNumericEntity(0,2);case oo.NumericHex:return this.emitNumericEntity(0,3);case oo.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case oo.EntityStart:return 0}}};function Cx(e){let t="";const n=new PL(e,o=>t+=ML(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 OL(e,t,n,o){const s=(t&hr.BRANCH_LENGTH)>>7,i=t&hr.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 RL=Cx(xL);Cx(TL);function Sv(e,t=ur.Legacy){return RL(e,t)}var DL=_x(SL());const _b={};function BL(e){let t=_b[e];if(t)return t;t=_b[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 Ah(e,t){typeof t!="string"&&(t=Ah.defaultChars);const n=BL(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})}Ah.defaultChars=";/?:@&=+$,#";Ah.componentChars="";var Yg=Ah;const Cb={};function FL(e){let t=Cb[e];if(t)return t;t=Cb[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 Mh(e,t,n){typeof t!="string"&&(n=t,t=Mh.defaultChars),typeof n>"u"&&(n=!0);const o=FL(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}Mh.defaultChars=";/?:@&=+$,-_.!~*'()#";Mh.componentChars="-_.!~*'()";var Sx=Mh;function xv(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 xf(){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 HL=/^([a-z0-9.+-]+:)/i,WL=/:[0-9]*$/,UL=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,qL=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
47
|
-
`," "]),jL=["'"].concat(qL),Sb=["%","/","?",";","#"].concat(jL),xb=["/","?","#"],zL=255,Tb=/^[+a-z0-9A-Z_-]{0,63}$/,VL=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ab={javascript:!0,"javascript:":!0},Mb={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function KL(e,t){if(e&&e instanceof xf)return e;const n=new xf;return n.parse(e,t),n}xf.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=UL.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=HL.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&&Ab[r])&&(i=i.substr(2),this.slashes=!0)),!Ab[r]&&(s||r&&!Mb[r])){let c=-1;for(let h=0;h<xb.length;h++)o=i.indexOf(xb[h]),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 h=0;h<Sb.length;h++)o=i.indexOf(Sb[h]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const f=i.slice(0,c);i=i.slice(c),this.parseHost(f),this.hostname=this.hostname||"";const g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g){const h=this.hostname.split(/\./);for(let m=0,_=h.length;m<_;m++){const w=h[m];if(w&&!w.match(Tb)){let k="";for(let b=0,y=w.length;b<y;b++)w.charCodeAt(b)>127?k+="x":k+=w[b];if(!k.match(Tb)){const b=h.slice(0,m),y=h.slice(m+1),S=w.match(VL);S&&(b.push(S[1]),y.unshift(S[2])),y.length&&(i=y.join(".")+i),this.hostname=b.join(".");break}}}}this.hostname.length>zL&&(this.hostname=""),g&&(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),Mb[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};xf.prototype.parseHost=function(e){let t=WL.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 Tv=KL,xx=wx({decode:()=>Yg,encode:()=>Sx,format:()=>xv,parse:()=>Tv}),Tx=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ax=/[\0-\x1F\x7F-\x9F]/,GL=/[\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]/,Mx=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,YL=/[\$\+<->\^`\|~\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]/,Ex=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,XL=wx({Any:()=>Tx,Cc:()=>Ax,Cf:()=>GL,P:()=>Mx,S:()=>YL,Z:()=>Ex}),QL=Object.defineProperty,Ix=e=>{let t={};for(var n in e)QL(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}`}},ZL=Ix({arrayReplaceAt:()=>iP,assign:()=>oP,countLines:()=>En,escapeHtml:()=>pP,escapeRE:()=>gP,fromCodePoint:()=>eu,has:()=>nP,isMdAsciiPunct:()=>Mf,isPunctChar:()=>Af,isPunctCode:()=>Xg,isSpace:()=>sP,isString:()=>eP,isValidEntityCode:()=>Ih,isWhiteSpace:()=>Jc,lib:()=>vP,mdurl:()=>xx,normalizeReference:()=>Eh,ucmicro:()=>Tf,unescapeAll:()=>tu,unescapeMd:()=>cP});const Tf=XL;function JL(e){return Object.prototype.toString.call(e)}function eP(e){return JL(e)==="[object String]"}const tP=Object.prototype.hasOwnProperty;function nP(e,t){return tP.call(e,t)}function oP(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 sP(e){return e===9||e===32}function Jc(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 Af(e){return Tf.P.test(e)||Tf.S.test(e)}const Eb=new Map;function Xg(e){if(Mf(e))return!0;const t=Eb.get(e);if(t!==void 0)return t;const n=Af(String.fromCharCode(e));return Eb.set(e,n),n}function Mf(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 Eh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function iP(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Ih(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 eu(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 $x=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,rP=new RegExp(`${$x.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),lP=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function aP(e,t){if(t.charCodeAt(0)===35&&lP.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Ih(o)?eu(o):e}const n=Sv(e);return n!==e?n:e}function cP(e){return e.includes("\\")?e.replace($x,"$1"):e}function tu(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(rP,(t,n,o)=>n||aP(t,o))}const uP=/[&<>"]/,dP=/[&<>"]/g,fP={"&":"&","<":"<",">":">",'"':"""};function hP(e){return fP[e]}function pP(e){return uP.test(e)?e.replace(dP,hP):e}const mP=/[.?*+^$[\]\\(){}|-]/g;function gP(e){return e.replace(mP,"\\$&")}const vP={mdurl:xx,ucmicro:Tf};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 yP=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,kP=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,bP=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,Av=["references","footnotes","abbreviations","abbr","abbrs"],Mv=Symbol.for("markdown-it-ts.global-state"),Ev=Object.prototype.hasOwnProperty;function Ib(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function zs(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function vr(e){if(Array.isArray(e))return e.map(t=>vr(t));if(zs(e)){const t={};for(const n of Object.keys(e))t[n]=vr(e[n]);return t}return e}function Ef(e){return Array.isArray(e)?e.map((t,n)=>String(n)):zs(e)?Object.keys(e):[]}function Qg(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(!Qg(e[n],t[n]))return!1;return!0}if(zs(e)||zs(t)){if(!zs(e)||!zs(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(!Ev.call(t,s)||!Qg(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function Nx(e,t){if(Array.isArray(e))return e[Number(t)];if(zs(e))return e[t]}function wP(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=vr(t[n]);return e}if(zs(e)&&zs(t)){for(const n of Object.keys(e))Ev.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=vr(t[n]);return e}return vr(t)}function _P(e,t,n){const o=n.ownedKeys??[],s=e[t];if(zs(s)||Array.isArray(s)){const i=new Set(Ef(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=vr(Nx(n.value,r)):delete s[r];!n.existed&&Ef(s).length===0&&delete e[t];return}n.existed?e[t]=vr(n.value):delete e[t]}function Iv(e){const t=e[Mv];return Ib(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Ib(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function CP(e,t){Object.defineProperty(e,Mv,{value:t,enumerable:!1,configurable:!0,writable:!0})}function Ho(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:yP.test(e)?"footnote-definition":kP.test(e)?"abbreviation-definition":bP.test(e)?"reference-definition":null}function vu(e){return Iv(e)?.reason??null}function pa(e,t,n){if(vu(e)&&Hi(e),!t)return n();$v(e,t);try{const o=n();return Nv(e),o}catch(o){throw Hi(e),o}}function $v(e,t){try{Hi(e);const n={};for(const o of Av)n[o]=Ev.call(e,o)?{existed:!0,value:vr(e[o])}:{existed:!1};CP(e,{reason:t,snapshot:n})}catch{}}function Nv(e){const t=Iv(e);if(t)for(const n of Av){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!zs(s)&&!Array.isArray(s))continue;const i=new Set(Ef(o.existed?o.value:void 0));o.ownedKeys=Ef(s).filter(r=>i.has(r)?!Qg(s[r],Nx(o.value,r)):!0)}}function Hi(e){const t=Iv(e);if(t){for(const n of Av){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){_P(e,n,o);continue}o.existed?e[n]=wP(e[n],o.value):delete e[n]}delete e[Mv]}}const Zg=Symbol.for("markdown-it-ts.diagnostics");function $h(e,t){if(e)try{const n=e[Zg];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[Zg]=o,o}catch{return}}function xi(e){return $h(e,!1)}function SP(e){if(e)try{const t=e[Zg];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function To(e){SP(e)}function Dn(e,t){const n=$h(e,!0);n&&(n.strategy=t)}function km(e,t){const n=$h(e,!0);n&&(n.chunk=t)}function Lx(e,t){const n=$h(e,!0);n&&(n.unbounded=t)}function xP(e){const t={};e=e||{},t.src_Any=Tx.source,t.src_Cc=Ax.source,t.src_Z=Ex.source,t.src_P=Mx.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 Jg(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Nh(e){return Object.prototype.toString.call(e)}function TP(e){return Nh(e)==="[object String]"}function AP(e){return Nh(e)==="[object Object]"}function MP(e){return Nh(e)==="[object RegExp]"}function $b(e){return Nh(e)==="[object Function]"}function EP(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Px={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function IP(e){return Object.keys(e||{}).reduce(function(t,n){return t||Px.hasOwnProperty(n)},!1)}const $P={"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}}},NP="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]",LP="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function PP(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function Nb(){return function(e,t){t.normalize(e)}}function If(e){const t=e.re=xP(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(NP),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,AP(a)){MP(a.validate)?c.validate=PP(a.validate):$b(a.validate)?c.validate=a.validate:i(l,a),$b(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Nb();return}if(TP(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:Nb()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(EP).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 Ox(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 vs(e,t){if(!(this instanceof vs))return new vs(e,t);t||IP(e)&&(t=e,e={}),this.__opts__=Jg({},Px,t),this.__schemas__=Jg({},$P,e),this.__compiled__={},this.__tlds__=LP,this.__tlds_replaced__=!1,this.re={},If(this)}vs.prototype.add=function(t,n){return this.__schemas__[t]=n,If(this),this};vs.prototype.set=function(t){return this.__opts__=Jg(this.__opts__,t),this};vs.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)};vs.prototype.pretest=function(t){return this.re.pretest.test(t)};vs.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};vs.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(f,g){return f?g?f.index!==g.index?f.index<g.index?f:g:f.lastIndex>=g.lastIndex?f:g:f:g}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const f=[o[u[0]],i[u[1]],s[u[2]]],g=c(c(f[0],f[1]),f[2]);if(!g)break;if(g===f[0]?u[0]++:g===f[1]?u[1]++:u[2]++,g.index<d)continue;const h=new Ox(t,g.schema,g.index,g.lastIndex);this.__compiled__[h.schema].normalize(h,this),n.push(h),d=g.lastIndex}return n.length?n:null};vs.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 Ox(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};vs.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(),If(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,If(this),this)};vs.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};vs.prototype.onCompile=function(){};var Rx=vs,OP=bx({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,_=Math.floor,w=String.fromCharCode;function k(D){throw new RangeError(h[D])}function b(D,W){const V=[];let U=D.length;for(;U--;)V[U]=W(D[U]);return V}function y(D,W){const V=D.split("@");let U="";V.length>1&&(U=V[0]+"@",D=V[1]),D=D.replace(g,".");const J=b(D.split("."),W).join(".");return U+J}function S(D){const W=[];let V=0;const U=D.length;for(;V<U;){const J=D.charCodeAt(V++);if(J>=55296&&J<=56319&&V<U){const K=D.charCodeAt(V++);(K&64512)==56320?W.push(((J&1023)<<10)+(K&1023)+65536):(W.push(J),V--)}else W.push(J)}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},v=function(D,W){return D+22+75*(D<26)-((W!=0)<<5)},M=function(D,W,V){let U=0;for(D=V?_(D/700):D>>1,D+=_(D/W);D>m*26>>1;U+=36)D=_(D/m);return _(U+(m+1)*D/(D+38))},$=function(D){const W=[],V=D.length;let U=0,J=128,K=72,G=D.lastIndexOf("-");G<0&&(G=0);for(let X=0;X<G;++X)D.charCodeAt(X)>=128&&k("not-basic"),W.push(D.charCodeAt(X));for(let X=G>0?G+1:0;X<V;){const ke=U;for(let We=1,ue=36;;ue+=36){X>=V&&k("invalid-input");const ve=N(D.charCodeAt(X++));ve>=36&&k("invalid-input"),ve>_((2147483647-U)/We)&&k("overflow"),U+=ve*We;const Ne=ue<=K?1:ue>=K+26?26:ue-K;if(ve<Ne)break;const Re=36-Ne;We>_(2147483647/Re)&&k("overflow"),We*=Re}const le=W.length+1;K=M(U-ke,le,ke==0),_(U/le)>2147483647-J&&k("overflow"),J+=_(U/le),U%=le,W.splice(U++,0,J)}return String.fromCodePoint(...W)},O=function(D){const W=[];D=S(D);const V=D.length;let U=128,J=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 We of D)We>=U&&We<ke&&(ke=We);const le=X+1;ke-U>_((2147483647-J)/le)&&k("overflow"),J+=(ke-U)*le,U=ke;for(const We of D)if(We<U&&++J>2147483647&&k("overflow"),We===U){let ue=J;for(let ve=36;;ve+=36){const Ne=ve<=K?1:ve>=K+26?26:ve-K;if(ue<Ne)break;const Re=ue-Ne,Q=36-Ne;W.push(w(v(Ne+Re%Q,0))),ue=_(Re/Q)}W.push(w(v(ue,0))),K=M(J,le,X===G),J=0,++X}++J,++U}return W.join("")},R={version:"2.3.1",ucs2:{decode:S,encode:L},decode:$,encode:O,toASCII:function(D){return y(D,function(W){return f.test(W)?"xn--"+O(W):W})},toUnicode:function(D){return y(D,function(W){return d.test(W)?$(W.slice(4).toLowerCase()):W})}};t.exports=R})}),Dx=_x(OP());function Lv(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=tu(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=tu(e.slice(t,s)),i.pos=s,i.ok=!0),i}var Bx=Lv;const Rd=-2;function RP(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 Rd}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return Rd;if(r===91){s++,i++;continue}i++}return-1}function Pv(e,t,n){let o=1,s=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=RP(l,t,a,n);if(f!==Rd)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=c,-1}}let g=-1;return s&&(g=e.pos),e.pos=c,g}var $f=Pv;function Ov(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+=tu(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+=tu(e.slice(t,i)),r}var Fx=Ov;function Lh(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 Rv(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function DP(e,t,n){const o=Lh(e,t),s=[t,n];o<0?Rv(e,s):e.attrs[o]=s}function BP(e,t){const n=Lh(e,t);return n>=0?e.attrs[n][1]:null}function FP(e,t,n){const o=Lh(e,t);o<0?Rv(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var HP=Ix({attrGet:()=>BP,attrIndex:()=>Lh,attrJoin:()=>FP,attrPush:()=>Rv,attrSet:()=>DP,parseLinkDestination:()=>Lv,parseLinkLabel:()=>Pv,parseLinkTitle:()=>Ov});function WP(e){return e.includes("\r")||e.includes("\0")}function Hx(e){return typeof e=="string"?e:e.toString()}function UP(e){if(e.inlineMode){const t=new Fn("inline","",0);t.content=Hx(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 qP=/^([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])?)*)$/,jP=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function zP(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(jP.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(qP.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 VP=zP;function KP(e,t){const n=e.src;let o=e.pos;if(n.charCodeAt(o)!==96)return!1;const s=o;o++;const i=e.posMax;for(;o<i&&n.charCodeAt(o)===96;)o++;const r=n.slice(s,o),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=s)return t||(e.pending+=r),e.pos+=l,!0;let a=o,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let f=n.slice(o,c);f.includes(`
|
|
49
|
-
`)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var GP=KP;function Lb(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[o].marker!==l.marker||s!==l.token-1)&&(o=r),s=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=o-i[o]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const g=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+g,i[c]=g,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 YP(e){const t=e.tokens_meta,n=e.tokens_meta.length;Lb(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Lb(t[o].delimiters)}var XP=YP;function QP(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 Pb(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 ZP(e){const t=e.tokens_meta,n=e.tokens_meta.length;Pb(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Pb(e,t[o].delimiters)}const Ob={tokenize:QP,postProcess:ZP};function Wx(e){return Sv(e)}function Dv(e){return e>=48&&e<=57}function JP(e){const t=e|32;return Dv(e)||t>=97&&t<=102}function Ux(e){const t=e|32;return t>=97&&t<=122}function eO(e){return Ux(e)||Dv(e)}function tO(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?JP(l):Dv(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function nO(e,t,n){let o=t+1;if(o>=n||!Ux(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&eO(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 Wx(s)!==s?s:null}function oO(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=tO(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=Ih(i)?eu(i):eu(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=nO(e.src,n,o);if(s){const i=Wx(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 sO=oO;const qx=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),e1=new Array(128),jx=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);e1[e]=`\\${t}`,jx[e]=qx[e]?t:e1[e]}function Rb(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 iO(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):(Rb(e,jx[i],e1[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 Rb(e,i<256&&qx[i]?r:l,l),e.pos=n+1,!0}var rO=iO;function lO(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 aO=lO;const zx=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Vx="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",cO=new RegExp(`^(?:${zx}|${Vx}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),uO=new RegExp(`^(?:${zx}|${Vx})`);function Kx(e){return e===32||e===9||e===10||e===12||e===13}function dO(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||Kx(t)}function fO(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t<e.length;t++){const n=e.charCodeAt(t);if(n===62)return!0;if(!Kx(n))return!1}return!1}function hO(e){const t=e|32;return t>=97&&t<=122}function pO(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&&!hO(i))return!1;const r=s.slice(o).match(cO);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,dO(l)&&e.linkLevel++,fO(l)&&e.linkLevel--}return e.pos+=l.length,!0}var mO=pO;function gO(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const g=e.pos+2,h=$f(e,e.pos+1,!1);if(h<0)return!1;if(i=h+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=Bx(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=Fx(e.src,i,e.posMax),i<f&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<f&&e.src.charCodeAt(i)===91?(c=i+1,i=$f(e,i),i>=0?s=e.src.slice(c,i++):i=h+1):i=h+1,s||(s=e.src.slice(g,h)),r=e.env.references[Eh(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(g,h);const m=[];e.md.inline.parse(o,e.md,e.env,m);const _=e.push("image","img",0);_.attrs=[["src",u],["alt",""]],_.children=m,_.content=o,a&&_.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var vO=gO;function yO(e,t){let n,o,s,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,g=$f(e,e.pos,!0);if(g<0)return!1;let h=g+1;if(h<d&&e.src.charCodeAt(h)===40){for(c=!1,h++;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);if(h>=d)return!1;if(s=Bx(e.src,h,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?h=s.pos:r="",a=h;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);if(s=Fx(e.src,h,e.posMax),h<d&&a!==h&&s.ok)for(l=s.str,h=s.pos;h<d&&(n=e.src.charCodeAt(h),!(n!==32&&n!==10));h++);}(h>=d||e.src.charCodeAt(h)!==41)&&(c=!0),h++}if(c){if(typeof e.env.references>"u")return!1;if(h<d&&e.src.charCodeAt(h)===91?(a=h+1,h=$f(e,h),h>=0?o=e.src.slice(a,h++):h=g+1):h=g+1,o||(o=e.src.slice(f,g)),i=e.env.references[Eh(o)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=g;const m=e.push("link_open","a",1),_=[["href",r]];m.attrs=_,l&&_.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=h,e.posMax=d,!0}var kO=yO;function Gx(e){const t=e|32;return t>=97&&t<=122}function bO(e){return e>=48&&e<=57}function wO(e){return Gx(e)||bO(e)||e===43||e===45||e===46}function _O(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&wO(e.charCodeAt(t));)t--;return t++,t>=e.length||!Gx(e.charCodeAt(t))?null:e.slice(t)}function CO(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 SO(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=_O(e.pending);if(!s)return!1;const i=CO(e.src,n-s.length,o),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=s.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-s.length,!0}function xO(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 TO=xO;function AO(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 Db(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 MO(e){const t=e.delimiters;Db(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&Db(e,n[o].delimiters)}const Bb={tokenize:AO,postProcess:MO};function Fb(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 EO(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||Fb(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!Fb(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var IO=EO;function Bv(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function $O(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 NO(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 Yx(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:Bv(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function ma(e,t,n,o,s,i){const r=Yx(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=NO(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=Bv()}function LO(e){const t=Yx(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=$O(s.samples)}return t.completedAt=Bv(),t}var Hb=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}},Xx=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=Jc(l),u=Jc(a),d=Xg(l),f=Xg(a),g=!u&&(!f||c||d),h=!c&&(!d||u||f);return{can_open:g&&(t||!h||d),can_close:h&&(t||!g||f),length:r}}};Xx.prototype.Token=Fn;const PO=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function Qx(e){return!PO.test(e)}var OO=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new Hb,this.ruler2=new Hb,this.ruler.push("text",IO),this.ruler.push("linkify",SO),this.ruler.push("newline",TO),this.ruler.push("escape",rO),this.ruler.push("backticks",GP),this.ruler.push("strikethrough",Bb.tokenize),this.ruler.push("emphasis",Ob.tokenize),this.ruler.push("link",kO),this.ruler.push("image",vO),this.ruler.push("autolink",VP),this.ruler.push("html_inline",mO),this.ruler.push("entity",sO),this.ruler2.push("balance_pairs",XP),this.ruler2.push("strikethrough",Bb.postProcess),this.ruler2.push("emphasis",Ob.postProcess),this.ruler2.push("fragments_join",aO),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(ma(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(ma(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()&&Qx(e)){const a=new Fn("text","",0);a.content=e,o.push(a);return}const s=new Xx(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();ma(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 RO(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&&Qx(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 DO=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,BO=/[0-9a-z]/i;function FO(e){return/^<a[>\s]/i.test(e)}function HO(e){return/^<\/a\s*>/i.test(e)}function WO(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(!DO.test(o)||!BO.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 UO(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"&&(FO(l.content)&&i>0&&i--,HO(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(g=>WO(e.md.linkify,g));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let g=0;g<c.length;g++){const h=c[g],m=e.md.normalizeLink(h.url);if(!e.md.validateLink(m))continue;let _=h.text;h.schema?h.schema==="mailto:"&&!/^mailto:/i.test(_)?_=e.md.normalizeLinkText(`mailto:${_}`).replace(/^mailto:/,""):_=e.md.normalizeLinkText(_):_=e.md.normalizeLinkText(`http://${_}`).replace(/^http:\/\//,"");const w=h.index;if(w>f){const S=new Fn("text","",0);S.content=a.slice(f,w),S.level=d,u.push(S)}const k=new Fn("link_open","a",1);k.attrs=[["href",m]],k.level=d++,k.markup="linkify",k.info="auto",u.push(k);const b=new Fn("text","",0);b.content=_,b.level=d,u.push(b);const y=new Fn("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),f=h.lastIndex}if(f!==0){if(f<a.length){const g=new Fn("text","",0);g.content=a.slice(f),g.level=d,u.push(g)}s.splice(r,1,...u)}}}}const qO=/\r\n?|\n/g,jO=/\0/g;function zO(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(qO,`
|
|
50
|
-
`)),o&&(s=s.replace(jO,"�")),e.src=s}const Zx=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,VO=/\((?:c|tm|r)\)/i,KO=/\((c|tm|r)\)/gi,GO={c:"©",r:"®",tm:"™"};function YO(e,t){return GO[t.toLowerCase()]}function XO(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(KO,YO)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function QO(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&Zx.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 ZO(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(""):"");VO.test(o)&&XO(n.children||[]),Zx.test(o)&&QO(n.children||[])}}var JO=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 eR=/['"]/,Wb=/['"]/g,Ub="’";function dd(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function tR(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;){Wb.lastIndex=c;const d=Wb.exec(a);if(!d)break;let f=!0,g=!0;c=d.index+1;const h=d[0]==="'";let m=32;if(d.index-1>=0)m=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let _=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=Mf(m)||Af(String.fromCharCode(m)),k=Mf(_)||Af(String.fromCharCode(_)),b=Jc(m),y=Jc(_);if(y?f=!1:k&&(b||w||(f=!1)),b?g=!1:w&&(y||k||(g=!1)),_===34&&d[0]==='"'&&m>=48&&m<=57&&(g=f=!1),f&&g&&(f=w,g=k),!f&&!g){h&&(r.content=dd(r.content,d.index,Ub));continue}if(g)for(n=o.length-1;n>=0;n--){let S=o[n];if(o[n].level<l)break;if(S.single===h&&o[n].level===l){S=o[n];let L,N;h?(L=s[2]||"‘",N=s[3]||"’"):(L=s[0]||"“",N=s[1]||"”"),r.content=dd(r.content,d.index,N),e[S.token].content=dd(e[S.token].content,S.pos,L),c+=N.length-1,S.token===i&&(c+=L.length-1),a=r.content,u=a.length,o.length=n;continue e}}f?o.push({token:i,pos:d.index,single:h,level:l}):g&&h&&(r.content=dd(r.content,d.index,Ub))}}}function nR(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("");!eR.test(o)||!n.children||tR(n.children,e)}}function oR(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 sR=/^(?:vbscript|javascript|file|data):/,iR=/^data:image\/(?:gif|png|jpeg|webp);/,Jx=["http:","https:","mailto:"];function eT(e){const t=e.trim().toLowerCase();return sR.test(t)?iR.test(t):!0}function tT(e){const t=Tv(e,!0);if(t.hostname&&(!t.protocol||Jx.includes(t.protocol)))try{t.hostname=Dx.default.toASCII(t.hostname)}catch{}return Sx(xv(t))}function nT(e){const t=Tv(e,!0);if(t.hostname&&(!t.protocol||Jx.includes(t.protocol)))try{t.hostname=Dx.default.toUnicode(t.hostname)}catch{}return Yg(xv(t),`${Yg.defaultChars}%`)}function rR(e){switch(e){case 9:case 32:return!0}return!1}function lR(e,t,n,o){const s=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const f=e.lineMax;if(a[t]-e.blkIndent>=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const g=[],h=[],m=[],_=[],w=e.md.block.ruler.getRulesForState(e,"blockquote"),k=e.parentType;e.parentType="blockquote";let b=!1,y;for(y=t;y<n;y++){const M=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(s.charCodeAt(u++)===62&&!M){let O=a[y]+1,T,I;s.charCodeAt(u)===32?(u++,O++,I=!1,T=!0):s.charCodeAt(u)===9?(T=!0,(c[y]+O)%4===3?(u++,O++,I=!1):I=!0):T=!1;let R=O;for(g.push(i[y]),i[y]=u;u<d;){const D=s.charCodeAt(u);if(rR(D))D===9?R+=4-(R+c[y]+(I?1:0))%4:R++;else break;u++}b=u>=d,h.push(c[y]),c[y]=a[y]+1+(T?1:0),m.push(a[y]),a[y]=R-O,_.push(l[y]),l[y]=u-i[y];continue}if(b)break;let $=!1;for(let O=0,T=w.length;O<T;O++)if(w[O](e,y,n,!0)){$=!0;break}if($){e.lineMax=y,e.blkIndent!==0&&(g.push(i[y]),h.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]-=e.blkIndent);break}g.push(i[y]),h.push(c[y]),_.push(l[y]),m.push(a[y]),a[y]=-1}const S=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,y);const v=e.push("blockquote_close","blockquote",-1);v.markup=">",e.lineMax=f,e.parentType=k,N[1]=e.line;for(let M=0;M<_.length;M++)i[M+t]=g[M],l[M+t]=_[M],a[M+t]=m[M],c[M+t]=h[M];return e.blkIndent=S,!0}function aR(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 cR(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,f=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-l<a)&&(s=e.skipSpaces(s),!(s<i)))){f=!0;break}a=e.sCount[t],e.line=d+(f?1:0);const g=e.push("fence","code",0);return g.info=u,g.content=e.getLines(t+1,d,a,!0),g.markup=c,g.map=[t,e.line],!0}const qb=["","h1","h2","h3","h4","h5","h6"],jb=["","#","##","###","####","#####","######"];function zb(e){switch(e){case 9:case 32:return!0}return!1}function uR(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&&!zb(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&zb(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const g=e.push("heading_open",qb[d],1);g.markup=jb[d],g.map=[t,e.line];const h=e.push("inline","",0);h.content=s.slice(a,c).trim(),h.map=[t,e.line],h.children=[];const m=e.push("heading_close",qb[d],-1);return m.markup=jb[d],!0}function dR(e){switch(e){case 9:case 32:return!0}return!1}function fR(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&&!dR(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 Hl=[[/^<(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(`${uO.source}\\s*$`),/^$/,!1]];function hR(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<Hl.length&&!Hl[l][0].test(r);l++);if(l===Hl.length)return!1;if(o)return Hl[l][2];let a=t+1;if(!Hl[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),Hl[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 Vb(e){switch(e){case 9:case 32:return!0}return!1}const Tc={Pipe:1,ParagraphTerminator:2};function pR(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 oT=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=s.length;u<d;u++){const f=s.charCodeAt(u);if(f===124&&(c|=Tc.Pipe|Tc.ParagraphTerminator),!a)if(Vb(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,pR(f)&&(c|=Tc.ParagraphTerminator);(f===10||u===d-1)&&(f!==10&&u++,this.bMarks.push(l),this.eMarks.push(u),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),this.lineFlags.push(c),a=!1,i=0,r=0,c=0,l=u+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineFlags.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const s=new 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 f=d;const g=o?this.eMarks[u]+1:this.eMarks[u];let h=0;const m=this.src,_=this.bsCount,w=this.tShift;for(;f<g&&h<n;){const k=m.charCodeAt(f);if(k===9||k===32)k===9?h+=4-(h+_[u])%4:h++;else if(f-d<w[u])h++;else break;f++}return h>n?new Array(h-n+1).join(" ")+m.slice(f,g):m.slice(f,g)}const s=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let f=0;const g=r[d];let h=g,m;for(d+1<t||o?m=l[d]+1:m=l[d];h<m&&f<n;){const _=i.charCodeAt(h);if(Vb(_))_===9?f+=4-(f+a[d])%4:f++;else if(h-g<c[d])f++;else break;h++}f>n?s[u]=new Array(f-n+1).join(" ")+i.slice(h,m):s[u]=i.slice(h,m)}return s.join("")}};oT.prototype.Token=Fn;function mR(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function sT(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function iT(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&Tc.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:mR(n,o,s)}const Kb=["","h1","h2"];function gR(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=sT(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,g,h=t+1;for(;h<n;h++){const y=i[h]+r[h],S=l[h];if(y>=S)break;if(a[h]-c>3)continue;if(a[h]>=c&&(g=s.charCodeAt(y),g===45||g===61)){let N=y+1,v=N;for(;N<S&&s.charCodeAt(N)===g;)N++;for(v=N;N<S;){const M=s.charCodeAt(N);if(M!==9&&M!==32)break;N++}if(N>=S){f=g===61?1:2;break}if(v-y>1)continue}if(a[h]<0||u&&!iT(e,h,s,y,S))continue;let L=!1;for(let N=0,v=o.length;N<v;N++)if(o[N](e,h,n,!0)){L=!0;break}if(L)break}if(!f)return!1;let m;if(h===t+1){const y=i[t]+r[t];let S=l[t];for(;S>y;){const L=s.charCodeAt(S-1);if(L!==9&&L!==32)break;S--}m=s.slice(y,S)}else m=e.getLines(t,h,c,!1).trim();e.line=h+1;const _=g===61?"=":"-",w=e.push("heading_open",Kb[f],1);w.markup=_,w.map=[t,e.line];const k=e.push("inline","",0);k.content=m,k.map=[t,e.line-1],k.children=[];const b=e.push("heading_close",Kb[f],-1);return b.markup=_,e.parentType=d,!0}function rT(e){switch(e){case 9:case 32:return!0}return!1}function Gb(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&&!rT(i.charCodeAt(l))?-1:l}function Yb(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),!rT(c))?-1:a}function vR(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 yR=["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 bR(e,t,n,o){let s,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const g=e.src,h=e.bMarks,m=e.tShift,_=e.eMarks,w=e.sCount,k=e.bsCount,b=h[l]+m[l];if(b>=_[l])return!1;const y=g.charCodeAt(b);if(y>=48&&y<=57){if(f=Yb(e,l),f<0||(u=!0,r=b,d=vR(e,l,f),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(f=Gb(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=_[l])return!1;if(o)return!0;const S=g.charCodeAt(f-1),L=String.fromCharCode(S);if(u){const T=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(T.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 v=!1;const M=e.tokens.length-1,$=e.md.block.ruler.getRulesForState(e,"list"),O=e.parentType;for(e.parentType="list";l<n;){i=f,s=_[l];const T=w[l]+f-(h[l]+m[l]);let I=T;for(;i<s;){const le=g.charCodeAt(i);if(le===9)I+=4-(I+k[l])%4;else if(le===32)I++;else break;i++}const R=i;let D;R>=s?D=1:D=I-T,D>4&&(D=1);const W=T+D,V=e.push("list_item_open","li",1);V.markup=L;const U=[l,0];V.map=U,u&&(V.info=f-r-1===1?yR[g.charCodeAt(r)-48]:g.slice(r,f-1));const J=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-h[l],e.sCount[l]=I,R>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||v)&&(a=!1),v=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=J,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,We=$.length;le<We;le++)if($[le](e,l,n,!0)){ke=!0;break}if(ke)break;if(u){if(f=Yb(e,l),f<0)break;r=h[l]+m[l]}else if(f=Gb(e,l),f<0)break;if(S!==g.charCodeAt(f-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,M),!0}function Xb(e){return e===9||e===32}function wR(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=sT(e);let f=t+1;for(e.parentType="paragraph";f<n&&!e.isEmpty(f);f++){if(c[f]-u>3||c[f]<0)continue;if(s==="list"&&c[f]>=u){const b=r[f]+l[f],y=a[f];if(b<y){const S=i.charCodeAt(b);if(S===42||S===45||S===43){if(b+1>=y||Xb(i.charCodeAt(b+1)))break}else if(S>=48&&S<=57&&b+1<y){let L=b+1;for(;;){if(L>=y){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>=y||Xb(i.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const _=r[f]+l[f],w=a[f];if(d&&!iT(e,f,i,_,w))continue;let k=!1;for(let b=0,y=o.length;b<y;b++)if(o[b](e,f,n,!0)){k=!0;break}if(k)break}const g=e.getLines(t,f,u,!1).trim();e.line=f;const h=e.push("paragraph_open","p",1);h.map=[t,e.line];const m=e.push("inline","",0);return m.content=g,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function fd(e){switch(e){case 9:case 32:return!0}return!1}function _R(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 y=e.lineMax;if(b>=y||e.isEmpty(b))return null;let S=!1;if(e.sCount[b]-e.blkIndent>3&&(S=!0),e.sCount[b]<0&&(S=!0),!S){const v=e.parentType;e.parentType="reference";let M=!1;for(let $=0,O=l.length;$<O;$++)if(l[$](e,b,y,!0)){M=!0;break}if(e.parentType=v,M)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 y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(b===92&&(s++,s<i&&c.charCodeAt(s)===10)){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const b=c.charCodeAt(s);if(b===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!fd(b))break}const d=e.md.helpers.parseLinkDestination(c,s,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;s=d.pos;const g=s,h=r,m=s;for(;s<i;s++){const b=c.charCodeAt(s);if(b===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!fd(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&&m!==s&&_.ok?(w=_.str,s=_.pos):(w="",s=g,r=h);s<i&&fd(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&w)for(w="",s=g,r=h;s<i&&fd(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const k=Eh(c.slice(1,u));return k?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[k]>"u"&&(e.env.references[k]={title:w,href:f}),e.line=r),!0):!1}function bm(e){switch(e){case 9:case 32:return!0}return!1}const CR=65536;function wm(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function SR(e,t){if(e.lineFlags)return(e.lineFlags[t]&Tc.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 Qb(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 xR(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&&!bm(l)||r===45&&bm(l)||!SR(e,t))return!1;for(;i<e.eMarks[s];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!bm(y))return!1;i++}let a=wm(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const S=c[y].trim();if(!S){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(S))return!1;S.charCodeAt(S.length-1)===58?u.push(S.charCodeAt(0)===58?"center":"right"):S.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=wm(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=Qb(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(o)return!0;const f=e.parentType;e.parentType="table";const g=e.md.block.ruler.getRulesForState(e,"blockquote"),h=e.push("table_open","table",1),m=[t,0];h.map=m;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 y=0;y<c.length;y++){const S=e.push("th_open","th",1);u[y]&&(S.attrs=[["style",`text-align:${u[y]}`]]);const L=e.push("inline","",0);L.content=c[y].trim(),L.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let k,b=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let y=!1;for(let L=0,N=g.length;L<N;L++)if(g[L](e,s,n,!0)){y=!0;break}if(y||(a=wm(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=Qb(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),b+=d-c.length,b>CR))break;if(s===t+2){const L=e.push("tbody_open","tbody",1);L.map=k=[t+2,0]}const S=e.push("tr_open","tr",1);S.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 v=e.push("inline","",0);v.content=c[L]?c[L].trim():"",v.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return k&&(e.push("tbody_close","tbody",-1),k[1]=s),e.push("table_close","table",-1),m[1]=s,e.parentType=f,e.line=s,!0}var TR=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 ma(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 hd=[["table",xR,["paragraph","reference"]],["code",aR],["fence",cR,["paragraph","reference","blockquote","list"]],["blockquote",lR,["paragraph","reference","blockquote","list"]],["hr",fR,["paragraph","reference","blockquote","list"]],["list",bR,["paragraph","reference","blockquote"]],["reference",_R],["html_block",hR,["paragraph","reference","blockquote"]],["heading",uR,["paragraph","reference","blockquote"]],["lheading",gR],["paragraph",wR]];var AR=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new TR;for(let e=0;e<hd.length;e++)this.ruler.push(hd[e][0],hd[e][1],{alt:(hd[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 g=e.line;let h=!1;for(let m=0;m<s;m++)if(h=o[m](e,u,n,!1),h){if(g>=e.line)throw new Error("block rule didn't increment state.line");break}if(!h)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const f=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const g=e.line;let h=!1;for(let m=0;m<s;m++){const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();h=f[m].fn(e,u,n,!1);const w=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ma(e.env,"block",f[m].name,w-_,h,!1),h){if(g>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!h)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 oT(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}},lT=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}};lT.prototype.Token=Fn;const Zb=[["normalize",zO],["block",UP],["inline",RO],["linkify",UO],["replacements",ZO],["smartquotes",nR],["text_join",oR]],MR={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},ER={parseLinkLabel:Pv,parseLinkDestination:Lv,parseLinkTitle:Ov};function IR(){return{...MR}}function $R(){return{...ER}}var NR=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new AR,this.inline=new OO,this.ruler=new JO;for(let e=0;e<Zb.length;e++){const[t,n]=Zb[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:IR(),helpers:$R(),normalizeLink:tT,normalizeLinkText:nT,validateLink:eT,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new Rx),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 lT(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();ma(e.env,"core",t[n].name,s-o,!0,!1)}LO(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&WP(e))return this.parse(Hx(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 LR=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function Nf(e){return!LR.test(e)}function pc(e,t){const n=e.indexOf(`
|
|
52
|
-
`,t);return n===-1?e.length:n}function Dd(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 Jb(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function _m(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function PR(e){if(e.length>3)return Nf(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 OR=["","h1","h2","h3","h4","h5","h6"],RR=["","#","##","###","####","#####","######"],ew=0,Cm=1,Sm=2;function ls(e,t,n,o){const s=new Fn(e,t,n);return s.level=o,s.block=!0,s}function aT(e,t,n){const o=ls("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 DR(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(!Nf(u))return!1;const d=OR[i],f=RR[i],g=ls("heading_open",d,1,0);g.map=[s,s+1],g.markup=f,e.push(g),e.push(aT(u,s,1));const h=ls("heading_close",d,-1,0);return h.markup=f,e.push(h),!0}function BR(e,t,n){const o=ls("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(aT(t,n,1)),e.push(ls("paragraph_close","p",-1,0))}function FR(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function xm(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function HR(e,t){const n=ls("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function WR(e,t,n){const o=ls("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=ls("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=ls("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=ls("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=ls("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function UR(e){const t=ls("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function qR(e,t,n,o){if(!Jb(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=pc(e,l);if(Jb(e,l,c)&&Dd(e,l+3,c)){const u=ls("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 jR(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?ew:Sm,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=pc(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(!Dd(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!DR(t,e,r,a,l))return null;const g=a<e.length?a+1:a;r=xm(e,g),l+=1+r-g;continue}if(c===45){if(!_m(e,r,a))return null;const g=l;let h=r,m=l,_=null,w=null;for(;h<e.length;){const y=pc(e,h);if(!_m(e,h,y))break;const S=h+2,L=y===S+1?e[S]:e.slice(S,y);if(!PR(L))return null;_===null&&(_=HR(t,g)),w=WR(t,L,m),h=y<e.length?y+1:y,m++}if(_===null||w===null)return null;let k=h,b=m;for(;k<e.length;){if(e.charCodeAt(k)===10){k++,b++;continue}const y=pc(e,k);if(!Dd(e,k,y)){if(_m(e,k,y))return null;break}k=y<e.length?y+1:y,b++}_.map[1]=b,w.map[1]=b,UR(t),r=k,l=b;continue}if(c===96){const g=qR(e,r,a,l);if(!g)return null;t.push(g.token),r=xm(e,g.nextPos),l=g.nextLine+r-g.nextPos;continue}const u=FR(e,r,a);let d;if(n===Sm?d=Nf(u):n===Cm&&u===o?d=s:(d=Nf(u),n===ew?(i&&(n=u===o?Cm:Sm),o=u,s=d,i=!0):n===Cm&&(o=u,s=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!Dd(e,f,pc(e,f)))return null;BR(t,u,l),r=xm(e,f),l+=1+r-f}return t}const zR=/[&<>"]/,tw=/[&<>"]/g,VR=/&/g,KR=/[<>"]/g,GR={"&":"&","<":"<",">":">",'"':"""};function Tm(e){return GR[e]||e}function an(e){if(e.length===0)return"";if(e.length<32)return zR.test(e)?e.replace(tw,Tm):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(VR,"&"):t?e.replace(tw,Tm):e.replace(KR,Tm)}const YR=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),XR=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function cT(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(YR,(t,n,o)=>{if(n)return n;if(XR.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return Ih(i)?eu(i):"�"}const s=Sv(t);return s!==t?s:t})}const QR=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,ZR=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,JR=/"/g;function ea(e,t){const n=e.indexOf(`
|
|
53
|
-
`,t);return n===-1?e.length:n}function Lf(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 pd(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function eD(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!Lf(e,t,ea(e,t))}function nw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function tD(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function Fv(e){return ZR.test(e)?QR.test(e)?null:e.replace(JR,"""):e}function nD(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=Fv(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
|
|
54
|
-
`}function ow(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function oD(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 sD(e,t,n){const o=t+2;if(n===o+1)return oD(e,o);const s=Fv(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
|
|
57
|
-
`}function iD(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 rD(e,t,n,o){if(!nw(e,t,n))return null;const s=iD(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=ea(e,l);if(nw(e,l,a)&&Lf(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-${an(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${an(c)}</code></pre>
|
|
58
|
-
`,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function sw(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=ea(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!Lf(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=nD(e,t,u);if(m===null)return null;o?s.push(m):n+=m,t=pd(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const b=ea(e,m);if(!ow(e,m,b))break;m=b<e.length?b+1:b}if(m===t)return null;const _=e.slice(t,m);let w;if(_===r)w=l;else{let b=t;for(w=`<ul>
|
|
59
|
-
`;b<m;){const y=ea(e,b),S=sD(e,b,y);if(S===null)return null;w+=S,b=y<e.length?y+1:y}w+=`</ul>
|
|
60
|
-
`,r=_,l=w}let k=pd(e,m);for(;k<e.length;){if(e.charCodeAt(k)===10){k++;continue}const b=ea(e,k);if(!Lf(e,k,b)){if(ow(e,k,b))return null;break}k=b<e.length?b+1:b}o?s.push(w):n+=w,t=k;continue}if(d===96){const m=rD(e,t,u,i);if(!m)return null;o?s.push(m.html):n+=m.html,t=pd(e,m.nextPos);continue}const f=tD(e,t,u);let g;if(f===a)g=c;else{const m=Fv(f);if(m===null)return null;g=`<p>${m}</p>
|
|
61
|
-
`,a=f,c=g}const h=u<e.length?u+1:u;if(h<e.length&&e.charCodeAt(h)!==10&&eD(e,h))return null;o?s.push(g):n+=g,t=pd(e,h)}return o?s.join(""):n}const lD={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function Pf(e,t,n={},o){To(n);const s={...lD,...o||{}},i=Ho(t);if(s.fallbackOnGlobalState!==!1&&i)return km(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),pa(n,i,()=>e.core.parse(t,n,e).tokens);let r=Bd(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=dD(r,s.maxChunks)),Fd(t,r))return km(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),pa(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return km(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),pa(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),f=e.core.parse(d,n,e).tokens;l!==0&&f.length&&cD(f,l),uD(a,f),l+=u.lineCount}return a})}function Bd(e,t,n=!0){const o=[];let s=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(o.push({start:r,end:f,lineCount:l}),r=f,s=0,i=0,l=0)}for(let f=0;f<e.length;){let g=e.indexOf(`
|
|
62
|
-
`,f),h=g;g===-1?(g=e.length,h=e.length):h=g+1;const m=fD(e,f,g);if(t.fenceAware){let k=f;for(;k<g;){const y=e.charCodeAt(k);if(y===32||y===9)k++;else break}const b=e[k];if(b==="`"||b==="~"){let y=k;for(;y<g&&e[y]===b;)y++;const S=y-k;S>=3&&(u?u.marker===b&&S>=u.length&&(u=null):u={marker:b,length:S})}}const _=h-f;s+=_,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=_);const w=m;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(w)d(h);else{const k=Math.max(10,Math.floor(t.maxChunkLines*.5)),b=Math.max(t.maxChunkChars,8e3);(a>=k||c>=b)&&d(h)}f=h}return n&&d(e.length),o}function Fd(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!aD(e,t[s].end))return!0;return!1}function aD(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 cD(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 uD(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function dD(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 fD(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 uT=4e6,dT=8e4,hD=1e4,pD=200,mD=1e4,gD=200;function fT(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function vD(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 Ji(e){return e.length===0?0:En(e)+(e.charCodeAt(e.length-1)===10?0:1)}function yD(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 bD(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 yD(e,n+1,e.length-1)?!kD(e,t):!1}function wD(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??mD:e.options.fullChunkSizeChars??hD),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??gD:e.options.fullChunkSizeLines??pD);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 yu=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=Ji(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=Bd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(Fd(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,Ji(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!bD(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Ji(this.pending)),null;const n=Bd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,Ji(this.pending)),null;const o=Fd(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Ji(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=Bd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=Fd(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Ji(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:Ji(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+Ji(this.pending);return wD(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(vu(e)&&Hi(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=Ho(t);n&&($v(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&&vD(r,a),this.options.retainTokens!==!1&&fT(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&&Nv(t),n}catch(o){throw this.markedGlobalStateReason&&(Hi(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){Lx(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 _D(e,t,n={},o={}){To(n);const s=new yu(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function CD(e,t,n={},o={}){To(n);const s=new yu(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function SD(e,t,n,o={},s={}){To(o);const i=new yu(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 xD(e,t,n,o={},s={}){To(o);const i=new yu(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 hT(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??uT,s=e.options.autoUnboundedThresholdLines??dT;return t>=o||n>=s}function pT(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??uT))return"yes";const o=e.options.autoUnboundedThresholdLines??dT;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function Ac(e,t,n={},o={}){To(n);const s=Ho(t);if(vu(n)&&Hi(n),o.fallbackOnGlobalState!==!1&&s)return Lx(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:En(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),pa(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new yu(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){fT(i,l)}});if(s&&$v(n,s),r.feed(t),r.flushForce(n),s&&(Nv(n),o.fallbackOnGlobalState===!1)){const l=xi(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const ga=(e,t,n)=>e<t?t:e>n?n:e;function mT(e){return e.experimental?{...e,...e.experimental}:e}const iw=[{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"}],rw=[{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 gT(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function TD(e,t=Math.max(0,e/40|0),n={}){const o=mT(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<iw.length;l++){const a=iw[l];if(e<=a.max){if(a.strategy!=="adaptive")return gT(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:ga(Math.ceil(e/i),8e3,64e3),maxChunkLines:ga(Math.ceil(t/i),150,700),maxChunks:ga(Math.ceil(e/64e3),i,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.fullChunkSizeChars??1e4,maxChunkLines:o.fullChunkSizeLines??200,fenceAware:s,maxChunks:o.fullChunkMaxChunks}}function lw(e,t=Math.max(0,e/40|0),n={}){const o=mT(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<rw.length;l++){const a=rw[l];if(e<=a.max){if(a.strategy!=="adaptive")return gT(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:ga(Math.ceil(e/i),8e3,64e3),maxChunkLines:ga(Math.ceil(t/i),150,700),maxChunks:ga(Math.ceil(e/64e3),i,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.streamChunkSizeChars??1e4,maxChunkLines:o.streamChunkSizeLines??200,maxChunks:o.streamChunkMaxChunks,fenceAware:s}}var AD={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"]}}},MD={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},ED={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 Ph(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Hd(e,t){if(Ph(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const aw=e=>Ph(e)?e:Promise.resolve(e);function Mc(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 an(e)}}function Sr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Mc(t[0])}="${an(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${Mc(s[0])}="${an(s[1])}"`}return n}function vT(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 Ec(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="${an(`${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${Sr(r)}>${t}</code></pre>
|
|
66
|
-
`}return`<pre><code${Sr(e.attrs)}>${t}</code></pre>
|
|
67
|
-
`}function Of(e){return!e.attrs||e.attrs.length===0?`<code>${an(e.content)}</code>`:`<code${Sr(e.attrs)}>${an(e.content)}</code>`}function t1(e){const t=an(e.content);return e.attrs?`<pre${Sr(e.attrs)}><code>${t}</code></pre>
|
|
68
|
-
`:`<pre><code>${t}</code></pre>
|
|
69
|
-
`}function ID(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="${an(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${an(n[0][1])}">`}return null}function cw(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Mc(t[0][0])}="${an(t[0][1])}">`:t.length===2?`<a ${Mc(t[0][0])}="${an(t[0][1])}" ${Mc(t[1][0])}="${an(t[1][1])}">`:`<a${Sr(t)}>`}function $D(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 uw(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 Rf(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+Sr(n);return o===0&&t&&(i+=" /"),`${i}>`}const ND={langPrefix:"language-",xhtmlOut:!1,breaks:!1},md=Object.prototype.hasOwnProperty,ln={code_inline(e,t){return Of(e[t])},code_block(e,t){return t1(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?cT(i.info).trim():"",{langName:l,langAttrs:a}=vT(r),c=n.highlight,u=an(i.content);if(!c)return Ec(i,u,r,l,n);const d=c(i.content,l,a);return Ph(d)?d.then(f=>Ec(i,f||u,r,l,n)):Ec(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]],Rf(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 an(e[t].content)},text_special(e,t){return an(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function dw(e,t,n){const o=e.info?cT(e.info).trim():"",{langName:s,langAttrs:i}=vT(o),r=t.highlight,l=an(e.content);if(!r)return Ec(e,l,o,s,t);const a=r(e.content,s,i);if(Ph(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Ec(e,a||l,o,s,t)}function gd(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===ln.text)return l.content.length===0?"":an(l.content);break;case"text_special":if(s.text_special===ln.text_special)return l.content.length===0?"":an(l.content);break;case"softbreak":if(s.softbreak===ln.softbreak)return r;break;case"hardbreak":if(s.hardbreak===ln.hardbreak)return i;break;case"html_inline":if(s.html_inline===ln.html_inline)return l.content;break;case"code_inline":if(s.code_inline===ln.code_inline)return Of(l);break}const a=s[l.type];if(!a)return Rf(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:Hd(c,l.type)}var LD=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...ln}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,f,g="",h="",m=!1,_="";for(let w=0;w<e.length;w++){const k=e[w],b=k.type,y=w>0&&e[w-1].hidden?`
|
|
75
|
-
`:"";if(b==="list_item_open"&&(!k.attrs||k.attrs.length===0)&&w+3<e.length){const N=e[w+1],v=e[w+2],M=e[w+3];if(N.type==="paragraph_open"&&N.hidden&&v.type==="inline"&&M.type==="paragraph_close"&&M.hidden){_+=`${y}<li>${this.renderInlineTokens(v.children||[],o,s)}`,w+=3;continue}}if(w+2<e.length){const N=e[w+1],v=e[w+2];if(N.type==="inline"&&v.nesting===-1&&v.tag===k.tag&&!v.hidden){const M=ID(k,y);if(M!==null){_+=`${M+this.renderInlineTokens(N.children||[],o,s)}</${k.tag}>
|
|
76
|
-
`,w+=2;continue}}}if(b==="inline"){const N=k.children||[];if(N.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,g=o.xhtmlOut?`<br />
|
|
77
|
-
`:`<br>
|
|
78
|
-
`,h=o.breaks?g:`
|
|
79
|
-
`,m=!0);const v=N[0];switch(v.type){case"text":if(l===ln.text){_+=an(v.content);continue}break;case"text_special":if(a===ln.text_special){_+=an(v.content);continue}break;case"softbreak":if(c===ln.softbreak){_+=h;continue}break;case"hardbreak":if(u===ln.hardbreak){_+=g;continue}break;case"html_inline":if(d===ln.html_inline){_+=v.content;continue}break;case"code_inline":if(f===ln.code_inline){_+=Of(v);continue}break}}_+=this.renderInlineTokens(N,o,s);continue}const S=i[b];if(!S){const N=k.attrs;if(!k.hidden){if(!N||N.length===0)switch(b){case"hr":_+=r?`<hr />
|
|
80
|
-
`:`<hr>
|
|
81
|
-
`;continue;case"heading_open":_+=`<${k.tag}>`;continue;case"heading_close":_+=`</${k.tag}>
|
|
82
|
-
`;continue;case"paragraph_open":_+=`${y}<p>`;continue;case"paragraph_close":_+=`</p>
|
|
83
|
-
`;continue;case"list_item_open":{const v=e[w+1];_+=y+(v&&(v.type==="inline"||v.hidden||v.nesting===-1&&v.tag==="li")?"<li>":`<li>
|
|
84
|
-
`);continue}case"list_item_close":_+=`</li>
|
|
85
|
-
`;continue;case"bullet_list_open":_+=`${y}<ul>
|
|
86
|
-
`;continue;case"bullet_list_close":_+=`</ul>
|
|
87
|
-
`;continue;case"blockquote_open":_+=y+(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":_+=`${y}<ol>
|
|
90
|
-
`;continue;case"ordered_list_close":_+=`</ol>
|
|
91
|
-
`;continue;case"table_open":_+=`${y}<table>
|
|
92
|
-
`;continue;case"table_close":_+=`</table>
|
|
93
|
-
`;continue;case"thead_open":_+=`${y}<thead>
|
|
94
|
-
`;continue;case"thead_close":_+=`</thead>
|
|
95
|
-
`;continue;case"tbody_open":_+=`${y}<tbody>
|
|
96
|
-
`;continue;case"tbody_close":_+=`</tbody>
|
|
97
|
-
`;continue;case"tr_open":_+=`${y}<tr>
|
|
98
|
-
`;continue;case"tr_close":_+=`</tr>
|
|
99
|
-
`;continue;case"td_open":_+=`${y}<td>`;continue;case"td_close":_+=`</td>
|
|
100
|
-
`;continue;case"th_open":_+=`${y}<th>`;continue;case"th_close":_+=`</th>
|
|
101
|
-
`;continue}else if(N.length===1){const v=N[0];if(b==="ordered_list_open"&&v[0]==="start"){_+=`${y}<ol start="${an(v[1])}">
|
|
102
|
-
`;continue}if(b==="td_open"&&v[0]==="style"){_+=`${y}<td style="${an(v[1])}">`;continue}if(b==="th_open"&&v[0]==="style"){_+=`${y}<th style="${an(v[1])}">`;continue}}}_+=this.renderToken(e,w,o);continue}if(b==="code_block"&&S===ln.code_block){_+=t1(k);continue}if(b==="fence"&&S===ln.fence){_+=dw(k,o);continue}if(b==="html_block"&&S===ln.html_block){_+=k.content;continue}const L=S(e,w,o,s,this);typeof L=="string"?_+=L:_+=Hd(L,k.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 aw(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 Sr(e.attrs)}renderToken(e,t,n){const o=e[t];if(o.hidden)return"";const s=o.block,i=o.nesting,r=o.tag,l=o.attrs;let a=!1;if(s&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=s&&i!==-1&&t>0&&e[t-1].hidden?`
|
|
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+Sr(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(md.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),md.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(md.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(md.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...ND,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===ln.code_block)return t1(t);if(i==="html_block"&&s.html_block===ln.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):Rf(t,r.xhtmlOut===!0);if(i==="fence"&&a===ln.fence)return dw(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Hd(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules,s=o.text,i=o.text_special,r=o.softbreak,l=o.hardbreak,a=o.html_inline,c=o.code_inline,u=o.link_open,d=o.link_close,f=o.em_open,g=o.em_close,h=o.strong_open,m=o.strong_close,_=t.xhtmlOut===!0,w=_?`<br />
|
|
105
|
-
`:`<br>
|
|
106
|
-
`,k=t.breaks?w:`
|
|
107
|
-
`;if(e.length===1)return gd(e,t,n,this,o,w,k);let b="";for(let y=0;y<e.length;y++){const S=e[y];if(S.type==="link_open"&&!u&&!d&&y+2<e.length){const v=e[y+1];if(e[y+2].type==="link_close"&&$D(v)){const M=`${cw(S)+gd([v],t,n,this,o,w,k)}</a>`;if(r===ln.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){b+=M+k,y+=3;continue}b+=M,y+=2;continue}}if(S.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){b+=`${cw(S)}</a>`,y+=1;continue}if(S.type==="em_open"&&!f&&!g&&y+2<e.length){const v=e[y+1];if(e[y+2].type==="em_close"&&uw(v)){b+=`<em>${gd([v],t,n,this,o,w,k)}</em>`,y+=2;continue}}if(S.type==="strong_open"&&!h&&!m&&y+2<e.length){const v=e[y+1];if(e[y+2].type==="strong_close"&&uw(v)){b+=`<strong>${gd([v],t,n,this,o,w,k)}</strong>`,y+=2;continue}}switch(S.type){case"text":if(s===ln.text){const v=S.content.length===0?"":an(S.content);if(a===ln.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(b+=v+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)b+=e[++y].content;continue}b+=v;continue}break;case"text_special":if(i===ln.text_special){S.content.length!==0&&(b+=an(S.content));continue}break;case"softbreak":if(r===ln.softbreak){b+=k;continue}break;case"hardbreak":if(l===ln.hardbreak){b+=w;continue}break;case"html_inline":if(a===ln.html_inline){for(b+=S.content;y+1<e.length&&e[y+1].type==="html_inline";)b+=e[++y].content;continue}break;case"code_inline":if(c===ln.code_inline){b+=Of(S);continue}break}const L=o[S.type];if(!L){b+=S.block?this.renderToken(e,y,t):Rf(S,_);continue}const N=L(e,y,t,n,this);typeof N=="string"?b+=N:b+=Hd(N,S.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 aw(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}},PD=LD;const OD=[],Am=4096;function RD(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 DD(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 BD(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(!yT(e[n],t[n]))return!1;return!0}function yT(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||!DD(e.attrs,t.attrs)||!BD(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function fw(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var FD=class{core;cache=null;stats=fw();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=fw(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(To(o??s?.env),!s||o&&o!==s.env){const I=o??{},R=!!n.__explicitStreamChunkFallbackSetting,D=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,W=!!n.options?.streamChunkedFallback,V=!R&&D,U=W||V,J=n.options?.streamChunkAdaptive!==!1,K=n.options?.streamChunkTargetChunks??8,G=n.options?.streamChunkSizeChars,X=n.options?.streamChunkSizeLines,ke=n.options?.streamChunkMaxChunks,le=!!n.__explicitStreamChunkConfig,We=n.options?.autoTuneChunks!==!1,ue=n.options?.streamChunkFenceAware??!0,ve=n.options?.streamLargeCachePolicy??"retain",Ne=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>=Ne,!ce&&Re!==void 0&&(Q=En(e),ce=Q>=Re)),ce){const j=this.parseFullDocument(e,I,n,Q,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn(I,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!xi(I)?.unbounded}),j.tokens}else if(U){const j=(re,ge,xe)=>re<ge?ge:re>xe?xe:re;Q===void 0&&(Q=En(e));const te=We&&!le?lw(e.length,Q,n.options):null,he=te?.maxChunkChars??(J?j(Math.ceil(e.length/K),8e3,64e3):G??1e4),oe=te?.maxChunkLines??(J?j(Math.ceil(Q/K),150,700):X??200),fe=te?.maxChunks??(J?j(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>=he*2||Q>=oe*2)&&H){const re=Pf(n,e,I,{maxChunkChars:he,maxChunkLines:oe,fenceAware:te?.fenceAware??ue,maxChunks:fe});return this.cache={src:e,tokens:re,env:I,lineCount:Q,lastSegment:void 0,globalStateReason:Ho(e)},this.updateCacheLineCount(this.cache,Q),this.recordChunkedParseResult(I,W?"explicit-initial-large-doc":"default-initial-large-doc"),re}}const Se=this.parseFullDocument(e,I,n,Q);return Q=Se.lineCount,this.cache={src:e,tokens:Se.tokens,env:I,lineCount:Q,lastSegment:void 0,globalStateReason:Ho(e)},this.updateCacheLineCount(this.cache,Q),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn(I,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!xi(I)?.unbounded}),Se.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=Ho(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):Ho(e),a=r||l;if(a){const I=o??s.env;Hi(I);const R=Ho(e),D=this.parseFullDocument(e,I,n),W=D.tokens,V=D.lineCount;return this.cache={src:e,tokens:W,env:I,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(I,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!xi(I)?.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 I=o??s.env,R=this.parseFullDocument(e,I,n),D=R.tokens,W=R.lineCount;return this.cache={src:e,tokens:D,env:I,lineCount:W,lastSegment:void 0,globalStateReason:Ho(e)},this.updateCacheLineCount(this.cache,W),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn(I,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!xi(I)?.unbounded}),D}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const I=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,I);let D=null;const W=n.options?.streamContextParseStrategy??"chars",V=n.options?.streamContextParseMinChars??200,U=n.options?.streamContextParseMinLines??2;let J;const K=()=>(J===void 0&&(J=En(u)),J),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(RD(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,Ne=ve.findIndex(Re=>Re.map&&typeof Re.map[1]=="number"&&Re.map[1]>R);if(Ne!==-1){const Re=ve.slice(Ne),Q=I-R;Q!==0&&this.shiftTokenLines(Re,Q),D={tokens:Re}}}catch{D=null}}else D=null;if(!D){const ue=I;if(X)D={tokens:Ac(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 We=s.tokens.length;if(D.tokens.length>le){const ue=s.tokens,ve=D.tokens,Ne=Math.min(ue.length,ve.length-le);let Re=0;for(let Q=Ne;Q>0;Q--){let ce=!0;for(let Se=0;Se<Q;Se++){const j=ue[ue.length-Q+Se],te=ve[le+Se];if(!yT(j,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=I+(J??K()),s.tokens.length>We){const ue=this.getLastSegment(s.tokens,e,We,s.tokens.length,e.length-u.length,I);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,f=this.tryTailSegmentReparse(e,s,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",Dn(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const g=!!n.__explicitStreamChunkFallbackSetting,h=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,_=!g&&!u&&h,w=m||_,k=n.options?.streamChunkAdaptive!==!1,b=n.options?.streamChunkTargetChunks??8,y=n.options?.streamChunkSizeChars,S=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,N=!!n.__explicitStreamChunkConfig,v=n.options?.autoTuneChunks!==!1,M=n.options?.streamChunkFenceAware??!0;let $=u&&s.lineCount!==void 0?s.lineCount+En(u):void 0;if(w){$===void 0&&($=En(e));const I=(K,G,X)=>K<G?G:K>X?X:K,R=v&&!N?lw(e.length,$,n.options):null,D=R?.maxChunkChars??(k?I(Math.ceil(e.length/b),8e3,64e3):y??1e4),W=R?.maxChunkLines??(k?I(Math.ceil($/b),150,700):S??200),V=R?.maxChunks??(k?I(Math.ceil(e.length/64e3),b,32):L),U=e.length>0&&e.charCodeAt(e.length-1)===10,J=_&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&R?.strategy!=="plain";if((m||J)&&(e.length>=D*2||$>=W*2)&&U){const K=Pf(n,e,d,{maxChunkChars:D,maxChunkLines:W,fenceAware:R?.fenceAware??M,maxChunks:V});return this.cache={src:e,tokens:K,env:d,lineCount:$,lastSegment:void 0,globalStateReason:Ho(e)},this.updateCacheLineCount(this.cache,$),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),K}}const O=this.parseFullDocument(e,d,n,$),T=O.tokens;return $=O.lineCount,this.cache={src:e,tokens:T,env:d,lineCount:$,lastSegment:void 0,globalStateReason:Ho(e)},this.updateCacheLineCount(this.cache,$),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Dn(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!xi(d)?.unbounded}),T}recordChunkedParseResult(e,t){const n=xi(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:!!xi(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=Ho(e);vu(t)&&Hi(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?pT(n,e.length,o):"no";if(r==="yes"){const a=Ac(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),hT(n,e.length,l))){const a=Ac(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:pa(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??OD}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(-Am))+t,o=Ho(n);return e.globalStateCarry=n.length>Am?n.slice(n.length-Am):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,i){if(o<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,i=-1;for(;s>0;){if(i=e.indexOf(`
|
|
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 f=t.lineCount??En(t.src);f>0&&this.shiftTokenLines(d,f);const g=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),h=this.getListParagraphMode(u,0,u.length,0);(g==="loose"||h==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const m=f+En(i);t.lineCount=m;const _=this.getDocLineCount(e,m);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 f=this.getTableBodySection(d,0,d.length,0),g=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!f||!g||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const h=g.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(h.length===0)return null;const m=s.lineEnd-2;m!==0&&this.shiftTokenLines(h,m);const _=g.tbodyCloseIndex>=0?g.tbodyCloseIndex:g.tableCloseIndex,w=t.lineCount??En(t.src);t.tokens.splice(_,0,...h),t.src=e,t.env=n,t.globalStateReason=null;const k=w+En(i);t.lineCount=k;const b=this.getDocLineCount(e,k);if(r.map&&(r.map[1]=b),g.tbodyOpenIndex>=0){const y=t.tokens[g.tbodyOpenIndex];y?.map&&(y.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 hw={default:MD,zero:ED,commonmark:AD};function HD(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function WD(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 pw(e){return e.experimental?{...e,...e.experimental}:e}function As(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 mw(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(As(t,s)||As(e,s))return!0}return!1}function gw(e,t,n){return As(t,n)||As(e,n)}function vw(e,t){const n=xi(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 UD(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=hw[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=pw(n),typeof n.quotes=="string"){const v=n.quotes;v.length>=4?n.quotes=[v[0],v[1],v[2],v[3]]:n.quotes=["“","”","‘","’"]}let r=mw(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=mw(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=gw(i?.options,s,"fullChunkedFallback"),c=gw(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const g=new NR;let h=null;const m=()=>(h||(h=new PD(n)),h);let _=null;const w=()=>(_||(_=new FD(g)),_);let k=null;const b=()=>(k||(k=new Rx),k),y=v=>!u&&!!d&&!WD(v,d),S=(v,M)=>o==="default"&&!u&&h===null&&f!==null&&v.parse===f&&y(v)&&!v.stream.enabled&&M<(v.options.autoUnboundedThresholdChars??4e6)&&v.options.html===!1&&v.options.xhtmlOut===!1&&v.options.breaks===!1&&v.options.langPrefix==="language-"&&v.options.linkify===!1&&v.options.typographer===!1&&v.options.highlight===null,L=(v,M)=>o==="default"&&!u&&y(v)&&!v.stream.enabled&&!v.options.fullChunkedFallback&&M<(v.options.autoUnboundedThresholdChars??4e6)&&v.options.html===!1&&v.options.linkify===!1&&v.options.typographer===!1,N={core:g,block:g.block,inline:g.inline,get linkify(){const v=b();return Object.defineProperty(this,"linkify",{value:v,writable:!0,configurable:!0}),v},get renderer(){const v=m();return Object.defineProperty(this,"renderer",{value:v,writable:!0,configurable:!0}),v},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return y(this)},set(v){const M=pw(v);return this.options={...this.options,...M},(As(v,"fullChunkSizeChars")||As(v,"fullChunkSizeLines")||As(v,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(As(v,"streamChunkSizeChars")||As(v,"streamChunkSizeLines")||As(v,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),As(v,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),As(v,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),h&&h.set(M),typeof M.stream=="boolean"&&(this.stream.enabled=M.stream,_&&(_.reset(),_.resetStats())),this},configure(v){const M=typeof v=="string"?hw[v]:v;if(!M)throw new Error("Wrong `markdown-it` preset, can't be empty");if(M.options&&this.set(M.options),M.components){const $=M.components;$.core?.rules&&this.core.ruler.enableOnly($.core.rules),$.block?.rules&&this.block.ruler.enableOnly($.block.rules),$.inline?.rules&&this.inline.ruler.enableOnly($.inline.rules),$.inline2?.rules&&this.inline.ruler2.enableOnly($.inline2.rules)}return this},enable(v,M){const $=Array.isArray(v)?v:[v],O=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],T=new Set;for(const I of O){if(!I)continue;const R=I.enable($,!0);for(let D=0;D<R.length;D++)T.add(R[D])}if(!M){const I=$.filter(R=>!T.has(R));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(v,M){const $=Array.isArray(v)?v:[v],O=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],T=new Set;for(const I of O){if(!I)continue;const R=I.disable($,!0);for(let D=0;D<R.length;D++)T.add(R[D])}if(!M){const I=$.filter(R=>!T.has(R));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(v,...M){const $=typeof v=="function"?v:v&&typeof v.default=="function"?v.default:void 0;if(!$)throw new TypeError("MarkdownIt.use: plugin must be a function");const O=[this,...M],T=v;return u=!0,$.apply(T,O),this},render(v,M){if(S(this,v.length)){M!==void 0&&To(M);const T=sw(v);if(T!==null)return M!==void 0&&Dn(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),T}const $=M??{},O=this.parse(v,$);return m().render(O,this.options,$)},async renderAsync(v,M){if(S(this,v.length)){M!==void 0&&To(M);const T=sw(v);if(T!==null)return M!==void 0&&Dn(M,{area:"render",path:"stock-fast",reason:"stock-subset"}),T}const $=M??{},O=this.parse(v,$);return m().renderAsync(O,this.options,$)},renderIterable(v,M={}){const $=this.parseIterable(v,M);return m().render($,this.options,M)},async renderAsyncIterable(v,M={}){const $=await this.parseAsyncIterable(v,M);return m().renderAsync($,this.options,M)},renderInline(v,M={}){const $=this.parseInline(v,M);return m().render($,this.options,M)},validateLink:eT,normalizeLink:tT,normalizeLinkText:nT,utils:ZL,helpers:{...HP},parse(v,M){if(typeof v!="string")throw new TypeError("Input data should be a String");if(M!==void 0&&To(M),L(this,v.length)){const I=jR(v);if(I!==null)return M!==void 0&&Dn(M,{area:"parse",path:"stock-fast",reason:"stock-subset"}),I}const $=M??{};let O;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&y(this)){const I=pT(this,v.length);if(I==="yes"){const R=Ac(this,v,$);return Dn(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),R}I==="need-lines"&&(O=En(v))}if(!this.stream.enabled){const I=v.length,R=this.options.autoTuneChunks!==!1,D=r,W=!a&&y(this),V=!!this.options.fullChunkedFallback,U=W&&I>=2e5;let J;(V||U||O!==void 0)&&(J=O??En(v));const K=(V||U)&&R&&!D?TD(I,J,this.options):null;if(V||U){const G=J??0;if(V?I>=(this.options.fullChunkThresholdChars??2e4)||G>=(this.options.fullChunkThresholdLines??400):U){if(K&&K.strategy!=="plain"){const X=Pf(this,v,$,{maxChunkChars:K.maxChunkChars,maxChunkLines:K.maxChunkLines,fenceAware:K.fenceAware,maxChunks:K.maxChunks});return M&&vw(M,V?"explicit-full-chunk":"default-large-string"),X}if(V){const X=(ce,Se,j)=>ce<Se?Se:ce>j?j:ce,ke=this.options.fullChunkAdaptive!==!1,le=this.options.fullChunkTargetChunks??8,We=X(Math.ceil(I/le),8e3,64e3),ue=X(Math.ceil(G/le),150,700),ve=ke?We:this.options.fullChunkSizeChars??1e4,Ne=ke?ue:this.options.fullChunkSizeLines??200,Re=ke?X(Math.ceil(I/64e3),le,32):this.options.fullChunkMaxChunks,Q=Pf(this,v,$,{maxChunkChars:ve,maxChunkLines:Ne,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Re});return M&&vw(M,"explicit-full-chunk"),Q}}}if(O!==void 0&&y(this)&&hT(this,I,J??O)){const G=Ac(this,v,$);return Dn(M,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),G}}const T=Ho(v);return Dn(M,{area:"parse",path:"plain",reason:"default-plain"}),pa($,T,()=>g.parse(v,$,this).tokens)},parseIterable(v,M={}){return To(M),_D(this,v,M)},parseAsyncIterable(v,M={}){return To(M),CD(this,v,M)},parseIterableToSink(v,M,$={}){return To($),SD(this,v,M,$)},parseAsyncIterableToSink(v,M,$={}){return To($),xD(this,v,M,$)},parseInline(v,M={}){if(typeof v!="string")throw new TypeError("Input data should be a String");To(M),vu(M)&&Hi(M);const $=g.createState(v,M,this);return $.inlineMode=!0,g.process($),$.tokens}};if(N.stream={enabled:!!n.stream,parse(v,M){return N.stream.enabled?w().parse(v,M,N):N.parse(v,M??{})},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 v=i.components;v.core?.rules&&N.core.ruler.enableOnly(v.core.rules),v.block?.rules&&N.block.ruler.enableOnly(v.block.rules),v.inline?.rules&&N.inline.ruler.enableOnly(v.inline.rules),v.inline2?.rules&&N.inline.ruler2.enableOnly(v.inline2.rules)}return d=HD(N),f=N.parse,N}var qD=UD;const kT=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],jD=["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"],bT=["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"],zD=["svg","g","path"],VD=["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"],KD=["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"],GD=["action","data","href","src","srcset","poster","xlink:href","formaction"],YD=["script"],XD=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],yl=new Set(kT),QD=new Set(bT),nu=new Set([...kT,...jD,...bT,...zD]),wT=new Set([...nu,...VD]),ZD=new Set(KD),JD=new Set(GD),ku=new Set(YD),_T=new Set(XD);function CT(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 e7={amp:"&",bsol:"\\",colon:":",newline:`
|
|
117
|
-
`,sol:"/",tab:" "};function ST(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 e7[String(s??"").toLowerCase()]??t})}const vd=new Set(["http","https","mailto","tel"]),t7=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Kr=new Set(["http","https"]);function xT(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function n7(e,t,n){if(!Ic(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function Ic(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function o7(e,t){return t==="href"||t==="xlink:href"?Ic(e,t)?vd:Kr:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Kr:(Ic(e,t),vd)}function cl(e,t={}){const n=CT(ST(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=xT(n);return i?i==="file"?!n7(n,o,s):Ic(o,s)?t7.has(i):!o7(o,s).has(i):!1}function s7(e){const t=ST(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=xT(CT(t).toLowerCase());return n==="http"||n==="https"}function i7(e,t={}){const n=String(e??"").trim();return n?cl(n,t)?"":n:""}function yw(e){return i7(e,{tagName:"img",attrName:"src"})}function r7(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,g,h,m,_){return f[g].nesting===1&&f[g].attrJoin("class",t),_.renderToken(f,g,h,m,_)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(f,g,h,m){let _,w=!1,k=f.bMarks[g]+f.tShift[g],b=f.eMarks[g];if(l!==f.src.charCodeAt(k))return!1;for(_=k+1;_<=b&&r[(_-k)%a]===f.src[_];_++);const y=Math.floor((_-k)/a);if(y<i)return!1;_-=(_-k)%a;const S=f.src.slice(k,_),L=f.src.slice(_,b);if(!c(L,S))return!1;if(m)return!0;let N=g;for(;N++,!(N>=h||(k=f.bMarks[N]+f.tShift[N],b=f.eMarks[N],k<b&&f.sCount[N]<f.blkIndent));)if(l===f.src.charCodeAt(k)&&!(f.sCount[N]-f.blkIndent>=4)){for(_=k+1;_<=b&&r[(_-k)%a]===f.src[_];_++);if(!(Math.floor((_-k)/a)<y)&&(_-=(_-k)%a,_=f.skipSpaces(_),!(_<b))){w=!0;break}}const v=f.parentType,M=f.lineMax;f.parentType="container",f.lineMax=N;const $=f.push("container_"+t+"_open","div",1);$.markup=S,$.block=!0,$.info=L,$.map=[g,N],f.md.block.tokenize(f,g+1,N);const O=f.push("container_"+t+"_close","div",-1);return O.markup=f.src.slice(k,_),O.block=!0,f.parentType=v,f.lineMax=M,f.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 l7(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 f=a.slice(0,d).trim(),g=a.slice(d+1).trim();if(!f)return null;let h=f;if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{h=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(h))return null;let m;if(!g)m="";else if(g.startsWith('"')&&g.endsWith('"')||g.startsWith("'")&&g.endsWith("'"))try{m=JSON.parse(g.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=g}else/^-?\d+(?:\.\d+)?$/.test(g)?m=Number(g):g==="true"||g==="false"?m=g==="true":g==="null"?m=null:m=g;l[h]=m}return l}function a7(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(r7,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 f,g;const h=d.indexOf("{"),m=h>=0?d.slice(h).trimStart():void 0;if(h===-1)f=d||void 0;else{if(f=d.slice(0,h).trim()||void 0,m?.startsWith("{")){let S=0,L=-1;for(let N=0;N<m.length;N++)if(m[N]==="{"?S++:m[N]==="}"&&S--,S===0){L=N+1;break}L>0&&(g=m.slice(0,L))}g||(f=d||void 0)}if(s)return!0;const _=!!i.env.__markstreamFinal;let w=n+1,k=!1;for(;w<=o;){const S=i.bMarks[w]+i.tShift[w],L=i.eMarks[w];if(i.src.slice(S,L).trim()===":::"){k=!0;break}w++}k||(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:!k&&!_},f&&b.attrSet("data-args",f),g)try{const S=JSON.parse(g);for(const[L,N]of Object.entries(S)){const v=N!=null&&typeof N=="object";b.attrSet(`data-${L}`,v?JSON.stringify(N):String(N))}}catch{const S=l7(g);if(S)for(const[L,N]of Object.entries(S)){const v=N!=null&&typeof N=="object";b.attrSet(`data-${L}`,v?JSON.stringify(N):String(N))}else b.attrSet("data-attrs",g)}const y=[];for(let S=n+1;S<w;S++){const L=i.bMarks[S]+i.tShift[S],N=i.eMarks[S];y.push(i.src.slice(L,N))}if(y.some(S=>S.trim().length>0)){let S=y.join(`
|
|
119
|
-
`);S.endsWith(`
|
|
120
|
-
`)||(S+=`
|
|
121
|
-
`),S.endsWith(`
|
|
122
|
-
|
|
123
|
-
`)||(S+=`
|
|
124
|
-
`);const L=i.tokens[i.tokens.length-1];L&&(L.raw=S);const N=[];i.md.block.parse(S,i.md,i.env,N),i.tokens.push(...N)}return k&&i.push("vmr_container_close","div",-1),i.line=k?w+1:w,!0},{alt:["paragraph","reference","blockquote","list"]})}function ds(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 Oh(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 c7=/^[a-z][a-z0-9_-]*$/;function kw(e){return c7.test(String(e??"").trim().toLowerCase())}function Ds(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return kw(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)?"":kw(s)?s:""}function Ia(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=Ds(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function u7(...e){const t=new Set,n=[];for(const o of e)for(const s of Ia(o))t.has(s)||(t.add(s),n.push(s));return n}function d7(e){const t=Ia(e);return{key:t.join(","),tags:t}}function TT(e){return Ds(e)}function f7(e,t){const n=String(e??""),o=Ds(t);if(!o)return!1;const s=ds(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 AT(e,t){const n=Ds(t);return!!n&&!nu.has(n)&&!f7(e,n)}function h7(e,t){const n=String(e??""),o=Ds(t);if(!o)return n;const s=ds(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 MT=yl,p7=nu,ET=new Set(QD);ET.delete("details");const m7=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,g7=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,n1=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,v7=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Df(e){return(e.match(n1)?.[1]??"").toLowerCase()}function Hv(e){return/^\s*<\s*\//.test(e)}function Wv(e,t){return MT.has(t)||/\/\s*>\s*$/.test(e)}function y7(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=Df(i);if(r===t){if(Hv(i)){if(n===0)return o;n--;continue}Wv(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=Df(s);if(i===t){if(Hv(s)){n>0&&n--;continue}Wv(s,i)||n++}}return n}function bw(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${ds(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 b7(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${ds(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 Bf(e){const t=e;return String(t.raw??t.content??t.markup??"")}function w7(e){const t=e;return t.meta||(t.meta={}),t.meta}function Mm(e,t,n){const o=w7(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function _7(e,t){if(!t.size)return;const n=Array.from(t,g=>new RegExp(String.raw`<\s*${ds(g)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=g=>g?n.some(h=>h.test(g)):!1,r=g=>{if(!(!g||!o.length))for(const h of o)h.raw+=g,h.inner+=g},l=()=>{!o.length||!s||(r(`
|
|
125
|
-
`),s=!1)},a=g=>{r(g)},c=g=>{for(let m=0;m<o.length;m++)o[m].raw+=g,m<o.length-1&&(o[m].inner+=g);const h=o.pop();Mm(h.token,h.raw,h.inner)},u=g=>{const h=o[o.length-1]?.tag;if(!h)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${ds(h)}\s*>`,"i");return g.match(m)?.[0]??null},d=g=>!!u(g),f=(g,h,m)=>{const _=m??(g.type==="html_inline"?Df(h):"");if(!(_&&t.has(_))){r(h);return}const w=Hv(h),k=!w&&Wv(h,_);if(w){if(!o.length||o[o.length-1].tag!==_){r(h);return}c(h);return}if(r(h),k){Mm(g,h,"");return}o.push({tag:_,token:g,raw:h,inner:""})};for(const g of e){if(g.type==="inline"&&Array.isArray(g.children)){const h=String(g.content??"");if(d(h)?s=!1:l(),!o.length&&!i(h)){s=!1;continue}let m=0,_=!0;for(const w of g.children){const k=Bf(w),b=w.type==="html_inline"?Df(k):"",y=b&&t.has(b);let S=k;if(_&&h&&k&&(o.length||y)){const L=h.indexOf(k,m);if(L!==-1)a(h.slice(m,L)),S=h.slice(L,L+k.length),m=L+k.length;else{if(o.length&&!y)continue;_=!1}}f(w,S,b)}_&&h&&m<h.length&&o.length&&a(h.slice(m)),s=o.length>0;continue}if(o.length&&typeof g.content=="string"){const h=Bf(g),m=g.type==="html_block"?u(h):null;if(m){c(`${s?`
|
|
126
|
-
`:""}${m}`),s=o.length>0;continue}if(!g.content)continue;l(),r(g.content),s=!0}}for(const g of o)Mm(g.token,g.raw,g.inner)}function C7(e){return/^\s*<\s*[!?]/.test(e)}function S7(e){const t=new Set(p7);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 ww(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function x7(e,t){let n=null;for(const i of e.matchAll(m7)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();ww(l,t)&&xn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(g7)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();ww(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 T7(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function A7(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(T7(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const f=a.slice(d),g=f.match(n1);if(!g){i("<",c),u=d+1;continue}const h=xn(f);if(h===-1){i("<",c),u=d+1;continue}const m=f.slice(0,h+1),_=(g[1]??"").toLowerCase();t.has(_)?n.push({type:"html_inline",tag:"",content:m,raw:m}):i(m,c),u=d+m.length}}function l(a,c){if(!a)return;const u=x7(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+=Bf(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=Bf(a),u=(c.match(n1)?.[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 M7=["a","span","strong","em","b","i","u"];function E7(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const g=Ds(f);g&&n.add(g)}const o=f=>{const g=f,h=new Set(n),m=Array.isArray(g.env?.__markstreamCustomHtmlTags)?g.env.__markstreamCustomHtmlTags:[];for(const b of m){const y=Ds(String(b??""));y&&h.add(y)}const _=S7(Array.from(h)),w=new Set(M7);for(const b of h)w.add(b);return{autoCloseInlineTagSet:w,commonHtmlTags:_,customTagSet:h,shouldMergeHtmlBlockTag:b=>h.has(b)||!_.has(b)||ET.has(b)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const g=f.children[0];return g?.type!=="html_block"?"":String(f.content??g.content??"")},i=(f,g)=>{f.type="html_block",f.content=g,f.raw=g,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,g)=>{const h=r(f);if(!/\S/.test(h))return[];if(l(h))return[{type:"code_block",content:a(h),raw:h}];const m=h.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const _={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return g==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},_,{type:"paragraph_close",tag:"p",nesting:-1}]:g==="text"?[{type:"text",content:m,raw:m}]:[_]},u=(f,g,h)=>f[g-1]?.type==="paragraph_open"&&f[g+1]?.type==="paragraph_close"?"inline":h,d=(f,g)=>{const h=r(g);return!/\S/.test(h)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${h}`,f.children.push({type:"text",content:h,raw:h}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const g=f.tokens??[],{commonHtmlTags:h,customTagSet:m}=o(f);for(const _ of g){const w=_;if(w.type!=="inline"||!Array.isArray(w.children))continue;const k=String(w.content??""),b=w.children.length?w.children:k.includes("<")?[{type:"text",content:k,raw:k}]:null;if(b)try{const y=A7(b,h);if(w.children=y.children,y.pendingBuffer){const S=k.lastIndexOf(y.pendingBuffer);if(S!==-1){const L=k.slice(0,S);w.content=L,typeof w.raw=="string"&&(w.raw=L)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}_7(g,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const g=f.tokens??[],{autoCloseInlineTagSet:h,customTagSet:m,shouldMergeHtmlBlockTag:_}=o(f),w=[];for(let k=0;k<g.length;k++){const b=g[k];if(w.length>0){const[S,L]=w[w.length-1];if(k!==L){if(b.type==="paragraph_open"||b.type==="paragraph_close"){g.splice(k,1),k--;continue}const N=String(b.content??b.raw??"");if(N){const v=g[L],M=`${String(v.content||"")}
|
|
127
|
-
${N}`,$=xn(M),O=$===-1?null:bw(M,S,$+1);if(O){const T=M.slice(0,O.end),I=M.slice(O.end);v.content=T,v.loading=!1,g.splice(k,1),w.pop();const R=d(v,I)?[]:c(I,u(g,k,"paragraph"));R.length&&g.splice(k,0,...R),k--;continue}v.content=M,v.loading!==!1&&(v.loading=!0)}g.splice(k,1),k--;continue}}const y=s(b);if(y){if(C7(y))continue;const S=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(y);if(!S||!_(S))continue;if(i(b,y),!L)S&&!new RegExp(`^\\s*<\\s*${S}\\b[^>]*\\/\\s*>`,"i").test(y)&&b7(y,S)>0&&w.push([S,k]);else if(w.length>0&&S&&w[w.length-1][0]===S){const[,N]=w[w.length-1],v=g[N];v.content=`${String(v.content||"")}
|
|
128
|
-
${y}`,v.loading=!1,w.pop(),g.splice(k,1),k--}continue}else if(w.length>0){if(b.type==="paragraph_open"||b.type==="paragraph_close"){g.splice(k,1),k--;continue}const S=b.content||"",L=new RegExp(`<\\s*\\/\\s*${w[w.length-1][0]}\\s*>`,"i").test(S);if(S){const[,N]=w[w.length-1],v=g[N];v.content=`${v.content||""}
|
|
129
|
-
${S}`,v.loading!==!1&&(v.loading=!L)}L&&w.pop(),g.splice(k,1),k--}else continue}if(m.size>0){const k=new Map,b=new Map,y=N=>{let v=k.get(N);return v||(v=new RegExp(`<\\s*${N}\\b`,"i"),k.set(N,v)),v},S=N=>{let v=b.get(N);return v||(v=new RegExp(`<\\s*\\/\\s*${N}\\s*>`,"i"),b.set(N,v)),v},L=[];for(let N=0;N<g.length;N++){const v=g[N],M=String(v.content??"");if(L.length>0){const O=L[L.length-1],T=g[O.index],I=v.type==="html_block"?S(O.tag).exec(M):null;if(I){const W=I.index+I[0].length,V=M.slice(0,W),U=M.slice(W);T.content=`${String(T.content??"")}
|
|
130
|
-
${V}`,Array.isArray(T.children)&&T.children.push({type:"html_inline",content:`</${O.tag}>`,raw:`</${O.tag}>`}),L.pop();const J=d(T,U)?[]:c(U,u(g,N,"paragraph"));J.length?g.splice(N,1,...J):(g.splice(N,1),N--);continue}if(v.type!=="inline")continue;const R=Array.isArray(v.children)?v.children:[],D=y7(R,O.tag);if(D!==-1){const W=R.slice(0,D+1),V=R.slice(D+1),U=W.map(J=>String(J?.content??J?.raw??"")).join("");if(T.content=`${String(T.content??"")}
|
|
131
|
-
${U}`,Array.isArray(T.children)&&T.children.push(...W),V.length){const J=V.map(K=>String(K.content??K.raw??"")).join("");if(J.trim()){const K=J.replace(/^\s+/,"");if(d(T,J))g.splice(N,1),N--;else if(K.startsWith("<"))g.splice(N,1,{type:"html_block",content:K});else{const G=c(J,u(g,N,"paragraph"));g.splice(N,1,...G)}}else g.splice(N,1),N--}else g.splice(N,1),N--;L.pop();continue}T.content=`${String(T.content??"")}
|
|
132
|
-
${M}`,Array.isArray(T.children)&&T.children.push(...R),g.splice(N,1),N--;continue}if(v.type!=="inline")continue;const $=Array.isArray(v.children)?v.children:[];for(const O of m)if(($.length?k7($,O):y(O).test(M)&&!S(O).test(M)?1:0)>0){L.push({tag:O,index:N});break}}}{let k=0;for(let b=0;b<g.length;b++){const y=g[b];if(y.type==="paragraph_open"){k++;continue}y.type==="paragraph_close"&&(k>0?k--:(g.splice(b,1),b--))}}for(let k=0;k<g.length;k++){const b=g[k];if(b.type==="html_block"){const v=(b.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(v.startsWith("!")||v.startsWith("?")){b.loading=!1;continue}if(m.has(v)){const D=String(b.content??""),W=xn(D),V=W===-1?null:bw(D,v,W+1);b.loading=V?!1:b.loading!==void 0?b.loading:!0;const U=V?.start??-1,J=V?V.end-V.start:0;if(U!==-1){const K=D.slice(0,U+J);let G="";W!==-1&&W<U&&(G=D.slice(W+1,U)),b.children=[{type:v,content:G,raw:K,attrs:[],tag:v,loading:!1}],b.content=K,b.raw=K;const X=c(D.slice(U+J)||"","text");X.length&&g.splice(k+1,0,...X)}else b.children=[{type:v,content:"",raw:D,attrs:[],tag:v,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(v))continue;b.type="inline";const M=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let $;for(;($=M.exec(b.content||""))!==null;)$[1],$[2]||$[3]||$[4];const O=String(b.content??""),T=new RegExp(`<\\/\\s*${v}\\s*>`,"i").exec(O),I=T?T.index:-1,R=T?T[0].length:0;if(I!==-1){const D=O.slice(0,I+R),W=(O.slice(I+R)||"").replace(/^\s+/,"");b.children=[{type:"html_block",content:D,tag:v,loading:!1}],b.content=D,b.raw=D,W&&g.splice(k+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:v,loading:!0}];continue}if(!b||b.type!=="inline")continue;if(b.children.length===2&&b.children[0].type==="html_inline"){const v=(b.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),M=b.children[1],$=String(M?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(M?.type==="html_inline"&&$===v)continue;h.has(v)?(b.children[0].loading=!0,b.children[0].tag=v,b.children.push({type:"html_inline",tag:v,loading:!0,content:`</${v}>`})):b.children=[{type:"html_block",loading:!0,tag:v,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 v=(b.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(h.has(v))continue;b.children=[{type:"html_block",loading:!1,tag:v,content:b.children.map(M=>M.content).join("")}];continue}if(!b.content?.startsWith("<")||b.children?.length!==1)continue;const y=String(b.content),S=b,L=S.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(S.children.length=0);continue}const N=String(L.content??y).match(v7)?.[1]?.toLowerCase()??"";if(N){if(/\/\s*>\s*$/.test(y)||MT.has(N)){S.children=[{type:"html_inline",content:y}];continue}S.children.length=0}}})}function I7(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 $7(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&&!I7(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 IT=/\.([a-z0-9]{1,15})$/i,N7=/[_()[\]{}<>]/u,L7=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,P7=/[?#@]/u,O7=/[\\/]/u,R7=/^[\p{L}\p{N}./\\-]+$/u,D7=/^[A-Za-z0-9-]{1,63}$/u,B7=/^xn--[a-z0-9-]{2,59}$/i,F7=/^(?:[A-Z]{1,6}|\d{1,8})$/u,H7=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,W7=/文件名\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,U7=/文件名\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,q7=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,j7=new Set(["ai","md","py","rs","sh","zip"]),$T=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),z7=new Set([...$T,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),V7=new Set(["com","dev","io","page","site"]),K7=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),G7=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 ou(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Em(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return ou(n)?n:void 0}function _w(e,t){if(!ou(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 Cw(e){const t=bu(e);return ou(t)?t:void 0}function Y7(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Sw(e,t){if(!ou(t))return;const n=String(e??"").trim().split(/\s+/u).map(Y7).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>Ff(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>Ff(s,{marketTicker:!0}))&&(o.marketTicker=!0),ou(o)?o:void 0}function $r(e,t=!1){let n;return{options(o){return t||o==null?_w(e,n):_w(e,Em(Cw(o),Sw(o,n)))},remember(o){const s=Cw(o);n=t?Em(n,s):Em(s,Sw(o,n))},reset(){n=void 0}}}function xw(e){return D7.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function X7(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return xw(n)||B7.test(n)?t.every(xw):!1}function NT(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function Q7(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function Z7(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function LT(e,t,n){const o=Q7(t);return NT(e)&&Z7(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function bu(e){const t=String(e??"");return{explicitFilename:W7.test(t),filename:U7.test(t),marketTicker:q7.test(t)}}function J7(e){return X7(e.split(/[\\/]/)[0]??"")}function eB(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function tB(e){if(N7.test(e)||!R7.test(e))return!0;if(O7.test(e))return!J7(e);const t=e.replace(IT,"");return NT(t)?!0:t.split(".").filter(Boolean).some(eB)}function nB(e,t,n){if(!(n?z7:$T).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?H7:F7).test(o)}function Ff(e,t={}){if(!e||L7.test(e)||P7.test(e))return!1;const n=e.match(IT);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return nB(e,o,t.marketTicker===!0)?!0:G7.has(o)?!j7.has(o)||t.filename?!0:tB(e):!!(t.explicitFilename&&V7.has(o)||t.filename&&K7.has(o))}const Tw=["!"];function Bo(e){return{type:"text",content:e,raw:e}}function Gr(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 Yr(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 er(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 oB(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(Bo(t))}}function Aw(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 sB(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function iB(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 rB(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 lB(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=aB(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function aB(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=bu(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=rB(e,o,i),l=sB(s);if(s.markup==="linkify"&&r&&!LT(r,l,t)&&Ff(r,n)){e.splice(o,i-o+1,Bo(r));continue}const a=Aw(l,Tw);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=Aw(u.content,Tw);if(d===-1)continue;const f=u.content[d],g=u.content.slice(0,d);let h=u.content.slice(d);for(let w=c+1;w<i;w++){const k=e[w];k?.type==="text"&&typeof k.content=="string"&&(h+=k.content)}u.content=g,u.raw=g;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let _=l;if(a!==-1)_=l.slice(0,a);else if(h){const w=encodeURI(h);if(w&&l.endsWith(w))_=l.slice(0,l.length-w.length);else{const k=f?encodeURI(f):"",b=k?l.indexOf(k):-1;b!==-1&&(_=l.slice(0,b))}}_!==l&&iB(s,_),h&&e.splice(i+1,0,Bo(h));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(Bo(r));const c=i[1],u=l[1].length;Gr(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(er(c,d,!e[o+4]?.content?.startsWith(")"))),Yr(a,u),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)\**/,"");f&&a.push(Bo(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(Bo(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let g=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(g+=e[o+4]?.content||"",e[o+4].content=""),Gr(a,f),a.push(er(c,g,!e[o+4]?.content?.startsWith(")"))),Yr(a,f),e[o+4]?.type==="text"){const h=e[o+4].content?.replace(/^\)/,"");h&&a.push(Bo(h)),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(er(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(Bo(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}o-=a.length+1;continue}}else if(s.type==="link_open"&&s.markup==="linkify"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("(")){if(e[o-2]?.type==="link_close"){const i=[],r=e[o-3].content||"";let l=s.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[o+3]?.type==="text"){const a=(e[o+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[o+3]?.content?.slice(0,a)||"",e[o+3].content=""),i.push(er(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(Bo(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(h=>h[0]==="href")?.[1]||"",a=r.find(h=>h[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const h=d[1].length;Gr(f,h)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let h=o+1;h<e.length;h++){const m=d?d[1].length:e[o-3].markup.length,_=e[h];if(m===1&&_.type==="em_close")break;if(m===2&&_.type==="strong_close")break;if(m===3&&(_.type==="em_close"||_.type==="strong_close"))break;c+=1}}const g={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(g),d){const h=d[1].length;Yr(f,h)}e.splice(o-u,c,...f),o-=f.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].markup?.includes("*")&&e[o-4]?.type==="text"&&e[o-4].content?.endsWith("[")){const i=e[o-1].markup.length,r=[],l=e[o-4].content.slice(0,e[o-4].content.length-i);l&&r.push(Bo(l)),Gr(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(er(a,c,u)),Yr(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(Bo(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(Bo(r)),Gr(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(er(l,a,c)),Yr(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(Bo(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(Bo(r)),Gr(i,2);let[a,c]=e[o+1].content.split("](");a=l+a;let u=4;if(e[o+2]?.type==="link_open"){const f=e[o+2].attrs?.find(g=>g[0]==="href")?.[1];e[o+5]?.type==="text"&&e[o+5].content==="."?(c=(f||c)+e[o+5].content,e[o+5].content=""):c=f||c,u+=3}let d=!0;if(s.nesting===-1&&(a=a.replace(/\*+$/,"")),e[o+2]?.type==="text"){const f=(e[o+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[o+2]?.content?.slice(0,f)||"",e[o+2].content="")}i.push(er(a,c,d)),Yr(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=[];Gr(a,2),a.push(er(r,l,!1)),Yr(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;oB(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function cB(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=uB(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function uB(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 dB(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=fB(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function fB(e){let t=0;const n=new Set,o=new Set;let s=0;for(let u=0;u<e.length;u++){const d=e[u],f=d.type;if(f==="strong_open"){t++;const g=String(d.markup??"");let h=u-1;for(;h>=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const w=e[_];g==="__"&&(m?.content?.endsWith("_")||w?.content?.startsWith("_")||w?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=g,d.raw=g,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(f==="em_open"){s++;const g=String(d.markup??"");let h=u-1;for(;h>=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let _=u+1;for(;_<e.length&&e[_].type==="text"&&e[_].content==="";)_++;const w=e[_];g==="_"&&(m?.content?.endsWith("_")||w?.content?.startsWith("_")||w?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=g,d.raw=g,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,o.add(s))}else f==="em_close"&&(o.has(s)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),s--,s<0&&(s=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,f=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],g=c.slice(0,-1);g&&f.unshift({type:"text",content:g,raw:g}),l.splice(i,d,...f)}return l=hB(l),l}function hB(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const f=u.slice(0,d),g=u.slice(d+2);t.push(o),t.push(s),t.push(l),f&&t.push({...c,type:"text",content:f,raw:f}),t.push(a),g&&t.push({...c,type:"text",content:g,raw:g}),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=pB(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 pB(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 mB(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=wB(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 Mw(){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 Ew(){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 Iw(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 PT(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 Im(e){return PT(e)!==null}function OT(e){return/^:?-+:?$/.test(e.trim())}function gB(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(OT)}function vB(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function yB(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(OT)&&vB(n)}function kB(e){return e==="|"||e==="|:"}function bB(e){const t=PT(e);return t!==null&&t.every(n=>!n.includes(":"))}function wB(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)&&Im(r);if(!t&&(r.includes(`
|
|
137
|
-
`)&&u.length===0&&Im(a)&&yB(c)||d)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>Iw(h)),g=[...Mw(),...f,...Ew()];o.splice(s-1,3,...g)}else if(r.includes(`
|
|
138
|
-
`)&&u.length===0&&Im(a)&&gB(c)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>Iw(h)),g=[...Mw(),...f,...Ew()];o.splice(s-1,3,...g)}else r.includes(`
|
|
139
|
-
`)&&u.length===0&&bB(a)&&kB(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function _B(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 CB=_B;const SB=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Hf=SB.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),xB=/\\[a-z]+/i,RT="(?:\\\\|\\u0008)",TB=new RegExp(String.raw`${RT}(?:${Hf})\s*\{[^}]+\}`,"i"),AB=new RegExp(String.raw`(?:${RT})?(?:${Hf})\s*\{`,"i"),MB=/\\(?:text|frac|left|right|times)/,EB=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,IB=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,$B=/[A-Z]+\s*\([^)]+\)/i,NB=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,LB=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,PB=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,OB={"\b":"\\b","\v":"\\v","\f":"\\f"};function RB(e){let t="";for(const n of e)t+=OB[n]??n;return t}function ta(e){if(!e)return!1;const t=RB(e),n=t.trim();if(PB.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=xB.test(t),s=TB.test(t),i=AB.test(t),r=MB.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=EB.test(t)&&!IB.test(t),c=$B.test(t),u=NB.test(n),d=LB.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),g=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||g}const DT="__markstreamMathPluginApplied",o1=80,BT=2e4,$w=BT+4096;function FT(e){return!!e[DT]}function DB(e){e[DT]=!0}const HT=["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"],BB=["cdot","mathbf{","partial","mu_{"],WT=HT.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),UT="[ \r\b\f\v]",FB=new RegExp(`([^\\\\])(${BB.map(e=>e).join("|")})+`,"g"),HB=/span\{([^}]+)\}/,WB=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,UB=/(^|[^\\])\\\r?\n/g,qB=/(^|[^\\])\\$/g,jB=new RegExp(`(${UT})|(${WT})\\b`,"g"),Nw=new Map,Lw=new Map;function zB(e){if(!e)return jB;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=Nw.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${UT})|(${s})\\b`,"g");return Nw.set(n,i),i}function VB(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=Lw.get(o);if(s)return s;const i=e?[Hf,WT].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Hf].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return Lw.set(o,r),r}const Pw={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Ow(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Rw(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 tr(e,t){const n=t?.commands??HT,o=t?.escapeExclamation??!0,s=t?.commands==null,i=zB(s?void 0:n);let r=e.replace(i,(c,u,d,f,g)=>{if(u!==void 0&&Pw[u]!==void 0)return`\\${Pw[u]}`;if(d&&n.includes(d)){const h=g&&typeof f=="number"?g[f-1]:void 0;return h==="\\"||h&&/\w/.test(h)?c:`\\${d}`}return c});o&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=VB(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(HB,"span\\{$1\\}").replace(WB,"\\operatorname{span}\\{$1\\}"),l=l.replace(UB,`$1\\\\
|
|
140
|
-
`),l=l.replace(qB,"$1\\\\"),l=l.replace(FB,"$1\\$2"),l}function Dw(e){const t=e.trim();return!(!ta(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function qT(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const o=n;let s=1;for(;o+s<e.length&&e[o+s]==="`";)s++;let i=o+s,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===s){r=i;break}i+=l}if(r!==-1){t.push([o,r+s]),n=r+s;continue}n=o+s}return t}function Wf(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function KB(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 wu(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function s1(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(wu(e,o)){n=o+1;continue}return o}return-1}function $m(e,t){let n=t;for(;n<e.length;){const o=s1(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 mc(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(!wu(e,s))return s;o=s+Math.max(1,t.length)}return-1}function Bw(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=Wf(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}wu(e,a)||i++,r=a+Math.max(1,t.length)}return i}function Uv(e,t,n){const o=iu(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!iu(o.slice(0,s)).trim()||wu(o,s))return-1;const i=qT(o);if(Wf(i,s))return-1;const r=Bw(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>Bw(o,n,0,s,i))return-1;return s}function su(e){return e===" "||e===" "}function iu(e){let t=e.length;for(;t>0&&su(e[t-1]);)t--;return e.slice(0,t)}function Fw(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
141
|
-
`&&t++;return t}function Hw(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function GB(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(!su(s))return!1}return n>=3}function YB(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 XB(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(YB)}function QB(e){let t=0;if(!Hw(e[t]))return!1;for(;Hw(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:su(e[t+1])}function jT(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&&su(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&su(t[1])||QB(t)||GB(t)||XB(t))}function Ww(e,t){return e?t?`${e}
|
|
142
|
-
${t}`:e:t}function i1(e){const t=String(e??"").trim();return t?ta(t):!1}function Uw(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function zT(e){if(e.length<=$w)return{source:e,lineOffset:0};let t=e.length-$w;const n=e.indexOf(`
|
|
143
|
-
`,t);return n===-1?{source:"",lineOffset:Fw(e)}:(t=n+1,{source:e.slice(t),lineOffset:Fw(e.slice(0,t))})}function VT(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=zT(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-o1-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=iu(o[r]);if(l&&!jT(l)){for(const[a,c]of i)if(Uv(l,a,c)!==-1)return!0}}return!1}function ZB(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=zT(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-o1-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=iu(s[l]);for(const[c,u]of r){const d=Uv(a,c,u);if(d===-1)continue;let f="",g=!1;for(let h=l+1;h<s.length;h++){if(h-l>o1){g=!0;break}const m=s[h],_=mc(m,u);if(_!==-1){const w=Ww(f,m.slice(0,_));if(!i1(w)){g=!0;break}const k=m.slice(_+u.length),b=k.trim()?`suffix:${Uw(k)}`:"nosuffix";return["closed",c,o+l,d,o+h,_,Uw(w),b].join(":")}if(jT(m)){g=!0;break}if(f=Ww(f,m),f.length>BT){g=!0;break}}if(!g&&i1(f))return["pending",c,o+l,d].join(":")}}return null}function Nm(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function JB(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 Lm(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function e9(e,t){DB(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=(k,b)=>{let y=b;for(;y<k.length&&(k[y]===" "||k[y]===" ");)y++;if(y===b||!(k[y]===`
|
|
144
|
-
`||k[y]==="\r"&&k[y+1]===`
|
|
145
|
-
`))return b;const S=k.slice(b,y),L=a.push("text","",0);return L.content=S,y};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let k=a.pos+1;for(;a.src[k]==="$";)k++;const b=k-a.pos,y=a.src[k];if(b>=3&&(!y||/\s/.test(y))){const S=a.push("text","",0);return S.content=a.src.slice(a.pos,k),a.pos=k,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],g=String(a.pending??""),h=Math.max(0,a.pos-g.length);let m=h,_=h;const w=h;for(const[k,b]of f){const y=a.src,S=qT(y),L=KB(y,u);let N=!1;k==="$$"&&m!==w&&(m=w);let v=-1,M=-1,$=0;const O=T=>{if((T==="undefined"||T==null)&&(T=""),T==="\\"){a.pos=a.pos+T.length,m=a.pos;return}if(T==="\\)"||T==="\\("){const D=a.push("text_special","",0);D.content=T==="\\)"?")":"(",D.markup=T,a.pos=a.pos+T.length,m=a.pos;return}if(!T)return;if(k==="$$"&&T.includes("$")){let D=0;for(;D<T.length;){const W=s1(T,D);if(W===-1){const ue=T.slice(D);if(ue){const ve=a.push("text","",0);ve.content=ue,a.pos=a.pos+ue.length,m=a.pos}break}if(W>0&&T[W-1]==="$"||W+1<T.length&&T[W+1]==="$"){const ue=T.slice(D,W+1);if(ue){const ve=a.push("text","",0);ve.content=ue,a.pos=a.pos+ue.length,m=a.pos}D=W+1;continue}const V=T.slice(D,W);if(V){const ue=a.push("text","",0);ue.content=V,a.pos=a.pos+V.length,m=a.pos}const U=$m(T,W+1);if(U===-1){const ue=T.slice(W),ve=a.push("text","",0);ve.content=ue,a.pos=a.pos+ue.length,m=a.pos;break}const J=T.slice(W+1,U),K=J.includes("`"),G=!J||!J.trim(),X=T[U+1],ke=Nm(J,X),le=Lm(J);if(!K&&!G&&!ke&&!le){const ue=a.push("math_inline","math",0);ue.content=tr(J,t),ue.markup="$",ue.raw=`$${J}$`,ue.loading=!1,a.pos=a.pos+(U-W+1),m=a.pos,D=U+1;continue}const We=a.push("text","",0);We.content="$",a.pos=a.pos+1,m=a.pos,D=W+1}return}const I=T.indexOf("![");if(I!==-1){if(I>0){const V=T.slice(0,I),U=a.push("text","",0);U.content=V,a.pos=a.pos+V.length,m=a.pos}const D=T.slice(I).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(D){const[,V,U]=D,J=U.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),K=J?J[1]:U,G=J&&J[2]?J[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,m=a.pos;const ke=T.slice(I+D[0].length);ke&&O(ke);return}const W=a.push("text","",0);W.content=T,a.pos=a.pos+T.length,m=a.pos;return}const R=a.push("text","",0);R.content=T,a.pos=a.pos+T.length,m=a.pos};for(;!(m>=y.length);){const T=y.indexOf(k,m);if(T===-1)break;if(wu(y,T)){m=T+Math.max(1,k.length);continue}const I=Wf(S,T);if(I){m=I[1];continue}const R=Wf(L,T);if(R){m=R[1];continue}if(T===v&&m===M){if($++,$>2){m=T+Math.max(1,k.length);continue}}else $=0,v=T,M=m;if(k==="("&&T>0){let ke=T-1;for(;ke>=0&&y[ke]===" ";)ke--;if(ke>=0&&y[ke]==="]"){m=T+k.length;continue}}if(k==="$"&&T>0&&y[T-1]==="$"){m=T+1;continue}if(k==="$"&&T<y.length-1&&y[T+1]==="$"){m=T+2;continue}const D=k==="$"?$m(y,T+k.length):CB(y,T+k.length,k,b);if(D===-1){const ke=y.slice(T+k.length);if(ke.includes(k)){m=y.indexOf(k,T+k.length);continue}if(D===-1){const le=k==="$"&&JB(ke);if(u&&!c&&!le&&ta(ke)&&!ke.includes("`")){if(m=T+k.length,N=!0,!l){a.pending="";const We=_?y.slice(_,m):y.slice(0,m),ue=Ow(We)%2===1;if(_)O(y.slice(_,m));else{let ve=y.slice(0,m);ve.endsWith(k)&&(ve=ve.slice(0,ve.length-k.length)),O(ve)}if(ue){const ve=Rw(We)?.marker??"**",Ne=a.push("strong_open","",0);Ne.markup=ve;const Re=a.push("math_inline","math",0);Re.content=tr(ke,t),Re.markup=k==="$$"?"$$":k==="\\("?"\\(\\)":k==="$"?"$":"()",Re.raw=`${k}${ke}${b}`,Re.loading=!0,Ne.content=ke,a.push("strong_close","",0)}else{const ve=a.push("math_inline","math",0);ve.content=tr(ke,t),ve.markup=k==="$$"?"$$":k==="\\("?"\\(\\)":k==="$"?"$":"()",ve.raw=`${k}${ke}${b}`,ve.loading=!0}a.pos=y.length}m=y.length,_=m}break}}const W=y.slice(T+k.length,D),V=W.includes("`"),U=!W||!W.trim(),J=k==="$",K=y[D+b.length],G=J&&Nm(W,K),X=J&&Lm(W);if(c?V||U||G||X:V||U||G||X||!J&&!ta(W)){m=D+b.length;const ke=y.slice(a.pos,m);a.pending||(O(ke),_=m);continue}if(N=!0,!l){const ke=y.slice(a.pos-(a.pending??"").length,T);let le=y.slice(0,m)?y.slice(_,T):ke;const We=Ow(le)%2===1;T!==a.pos&&We&&(le=a.pending+y.slice(a.pos,T));const ue=We?Rw(le):null,ve=ue?.marker??"**";if(a.pending!==le)if(a.pending="",We)if(ue){const Ne=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=Ne,a.push("strong_close","",0)}else O(le);else O(le);if(We){const Ne=a.push("strong_open","",0);Ne.markup=ve;const Re=a.push("math_inline","math",0);Re.content=tr(W,t),Re.markup=k==="$$"?"$$":k==="\\("?"\\(\\)":k==="$"?"$":"()",Re.raw=`${k}${W}${b}`,Re.loading=!1;const Q=y.slice(D+b.length).startsWith(ve);return Q&&a.push("strong_close","",0),a.pos=d(y,D+b.length),m=a.pos,_=m,Q||a.push("strong_close","",0),!0}else{const Ne=a.push("math_inline","math",0);Ne.content=tr(W,t),Ne.markup=k==="$$"?"$$":k==="\\("?"\\(\\)":k==="$"?"$":"()",Ne.raw=`${k}${W}${b}`,Ne.loading=!1}}return m=d(y,D+b.length),_=m,a.pos=m,!0}if(N){if(l)a.pos=m;else{if(k==="$$"&&m<y.length&&y.slice(m).includes("$")){let T=m;for(;!(T>=y.length);){const I=s1(y,T);if(I===-1)break;if(I+1<y.length&&y[I+1]==="$"){T=I+2;continue}if(I>0&&y[I-1]==="$"){T=I+1;continue}const R=$m(y,I+1);if(R===-1)break;const D=y.slice(I+1,R),W=D.includes("`"),V=!D||!D.trim(),U=y[R+1],J=Nm(D,U),K=Lm(D);if(!W&&!V&&!J&&!K){const G=y.slice(m,I);G&&O(G);const X=a.push("math_inline","math",0);X.content=tr(D,t),X.markup="$",X.raw=`$${D}$`,X.loading=!1,m=R+1,T=R+1}else O("$"),T=I+1}T<y.length&&O(y.slice(T))}else m<y.length&&O(y.slice(m));a.pos=y.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,g=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],h=u.bMarks[l]+u.tShift[l];let m=u.src.slice(h,u.eMarks[l]).trim(),_=!1,w="",k="",b=!1,y="",S=!1;for(const[G,X]of g)if(m.startsWith(G))if(G.includes("["))if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){_=!0,w=G,k=X;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){_=!0,w=G,k=X;break}continue}else{const ke=u.tokens[u.tokens.length-1];if(ke&&ke.type==="list_item_open"&&ke.mark==="-"&&m.slice(G.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const le=m.indexOf("]");if(m.slice(le).trim()!=="]")continue;const We=m.slice(G.length,le);if(G==="["?Dw(We):ta(We)){_=!0,w=G,k=X;break}continue}}else{_=!0,w=G,k=X;break}else if((G==="$$"||G==="\\[")&&m.endsWith(G)&&l+1<a){const ke=Uv(m,G,X);if(ke===-1)continue;y=iu(m.slice(0,ke)),S=!0;const le=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(le,u.eMarks[l+1]).trim(),b=!0,_=!0,w=G,k=X;break}if(!_)return!1;if(c&&!S)return!0;const L=m.indexOf(w),N=L+w.length,v=!f&&w==="["?m.indexOf("\\]",N):-1,M=v>=0?"\\]":k,$=v>=0?v:mc(m,k,N);if(!b&&$>w.length){const G=m.slice(L+w.length,$),X=u.push("math_block","math",0);X.content=tr(G),X.markup=w==="$$"?"$$":w==="["?"[]":"\\[\\]",X.map=[l,l+1],X.raw=`${w}${G}${M}`,X.block=!0,X.loading=!1,u.line=l+1;const ke=m.slice($+M.length);return ke.trim()&&n(u,ke,l),!0}let O=l,T="",I=!1,R="",D=l;const W=b?m:m===w?"":m.slice(w.length),V=!f&&w==="\\["?"]":"",U=mc(W,k);if(U!==-1){const G=U;T=W.slice(0,G),R=W.slice(G+k.length),D=b?l+1:l,I=!0,O=D}else for(W&&!b&&(T=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(!f&&w==="["&&le==="\\]"){k="\\]",I=!0;break}if(V&&ke.trim()===V){k=V,I=!0;break}if(le===k){I=!0;break}else if(!f&&w==="["&&ke.includes("\\]")){I=!0;const We=ke.indexOf("\\]");k="\\]";const ue=ke.slice(0,We);ue&&(T+=(T?`
|
|
146
|
-
`:"")+ue),R=ke.slice(We+k.length),D=O;break}else if(mc(ke,k)!==-1){I=!0;const We=mc(ke,k),ue=ke.slice(0,We);ue&&(T+=(T?`
|
|
147
|
-
`:"")+ue),R=ke.slice(We+k.length),D=O;break}T+=(T?`
|
|
148
|
-
`:"")+ke}if((!d||f)&&!I)return!1;const J=/^\s*!\[/.test(T);if(!(S?!J&&i1(T):w==="$$"?!J:w==="["?Dw(T):ta(T)))return!1;if(c)return!0;y&&n(u,y,l);const K=u.push("math_block","math",0);return K.content=tr(T),K.markup=w==="$$"?"$$":w==="["?"[]":"\\[\\]",K.raw=`${w}${T}${T.startsWith(`
|
|
149
|
-
`)?`
|
|
150
|
-
`:""}${k}`,K.map=[l,O+1],K.block=!0,K.loading=!I,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],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function t9(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 n9(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 qD({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!cl(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&e9(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&a7(i),e.enableFixIndentedCodeBlock!==!1&&$7(i),lB(i),dB(i),cB(i),mB(i),t9(i),E7(i,{customHtmlTags:e.customHtmlTags}),i}function ul(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=>ul(n))),t}function o9(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function s9(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 i9(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function yd(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 qw=/\r?\n[ \t]*`+\s*$/,KT=["diff ","index ","--- ","+++ ","@@ "],r9=/\r?\n/;function l9(e){const t=String(e??"");return t?KT.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function jw(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function a9(e,t){const n=[],o=[],s=[],i=[],r=e.split(r9),l=/\r?\n$/.test(e),a=r.some(g=>g.startsWith("diff ")||g.startsWith("--- ")||g.startsWith("+++ ")||g.startsWith("@@ ")),c=g=>{const h=g;if(!KT.some(m=>h.startsWith(m)))if(h.startsWith("-")){const m=h.slice(1);s.push(!a&&m.startsWith(" ")?` ${m}`:m)}else if(h.startsWith("+")){const m=h.slice(1);i.push(!a&&m.startsWith(" ")?` ${m}`:m)}else{jw(n,o,s,i);const m=a&&h.startsWith(" ")?h.slice(1):h;n.push(m),o.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let g=0;g<u;g++){const h=r[g]??"";!t&&!l&&g===u-1&&l9(h)||c(h)}(t||s.length>0||i.length>0)&&jw(n,o,s,i);const d=n.join(`
|
|
151
|
-
`),f=o.join(`
|
|
152
|
-
`);return{original:t&&l&&d?`${d}
|
|
153
|
-
`:d,updated:t&&l&&f?`${f}
|
|
154
|
-
`:f}}function qv(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(qw.test(a)&&(a=a.replace(qw,"")),r){const{original:c,updated:u}=a9(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 c9(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function u9(){return{type:"hardbreak",raw:`\\
|
|
155
|
-
`}}function d9(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 Pm=null;const Om=new WeakMap;function zw(){return Pm||(Pm={customTagSet:null,allowedTagSet:Bh()}),Pm}function GT(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function YT(e){return/^<\s*\//.test(e)}function XT(e,t){return/\/\s*>\s*$/.test(t)||yl.has(e)}function f9(e){if(!e||e.length===0)return zw();const t=Om.get(e);if(t)return t;const n=e.map(Ds).filter(Boolean);if(!n.length){const s=zw();return Om.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:Bh({customHtmlTags:e})};return Om.set(e,o),o}function QT(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function h9(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function Uf(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 p9(e,t,n){const o=e.slice();return Uf(o,"href")||o.push(["href",t]),n!=null&&!Uf(o,"title")&&o.push(["title",n]),o}function r1(e){return e.map(QT).join("")}function Wd(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:Wd(o.children)});continue}t.push(o)}return t}function m9(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=GT(r),a=YT(r),c=XT(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function Rm(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?m9(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:r1(o),innerTokens:s,nextIndex:i}}function g9(e,t,n,o,s,i,r){const l=String(e.content??""),a=GT(l),{customTagSet:c,allowedTagSet:u}=f9(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!Rm(t,n,a).closed){const S=QT(e);return[{type:"text",content:S,raw:S},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=YT(l),f=XT(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const S=Rm(t,n,a),L=Oh(l),N=S.innerTokens,v=String(Uf(L,"href")??""),M=Uf(L,"title"),$=M==null?null:String(M),O=p9(L,v,$),T=Wd(N.length?o(N,s,i,r):[]),I=N.length?r1(N):v||"";return!T.length&&I&&T.push({type:"text",content:I,raw:I}),[{type:"link",href:v,title:$,text:I,attrs:O,children:T,loading:!S.closed,raw:S.html||l},S.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const g=Rm(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Wd(g.innerTokens.length?o(g.innerTokens,s,i,r):[]),raw:g.html},g.nextIndex];const h=Wd(g.innerTokens.length?o(g.innerTokens,s,i,r):[]);let m=g.html||l,_=!g.closed,w=!1;if(!g.closed){const S=`</${a}>`;m.toLowerCase().includes(S.toLowerCase())||(m+=S),w=!0,_=!0}const k=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=b.exec(l))!==null;){const S=y[1],L=y[2]||y[3]||y[4]||"";k.push([S,L])}if(c?.has(a)){const S=h9(e);return[{type:a,tag:a,attrs:k,content:S?S.inner:g.innerTokens.length?r1(g.innerTokens):"",children:g.innerTokens.length?o(g.innerTokens,s,i,r):[],raw:S?.raw??m,loading:e.loading||_,autoClosed:w},g.nextIndex]}return[{type:"html_inline",tag:a,attrs:k,content:m,children:h,raw:m,loading:_,autoClosed:w},g.nextIndex]}function ZT(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=>ZT(t)).join(""):String(e.content??"")}function v9(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>ZT(t)).join("")}function Vw(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=v9(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 y9(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function k9(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 b9(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 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 w9(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 kd(e,t,n){const o=e[t],s=b9(o.attrs),i=String(qf(s,"href")??""),r=qf(s,"title"),l=r==null?null:String(r),a=w9(s,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let f=u;const g=u[u.length-1];if(n?.__insideStrong&&g?.type==="text"&&String(g.content??"").endsWith("**")&&!u.some(_=>_.type==="strong_open")){const _=String(g.content??""),w=String(g.raw??_),k=ul(g);k.content=_.slice(0,-2),k.raw=w.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=k}const h=Tn(f,void 0,void 0,n),m=h.map(_=>{const w=_;return"content"in _?String(w.content??""):String(w.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:h,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function Kw(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 _9(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function Gw(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 C9=/\\([\\()[\]`$|*_\-!])/g;function S9(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(C9,"$1")===t))return n}function rc(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,S9(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function x9(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 T9(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 A9(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const M9=/[^~]*~{2,}[^~]+/,E9=/\*\*/,I9=/[[_*^~]/,$9=/\\([\\()[\]`$|*_\-!])/g,jv=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),N9=/\s/u,L9=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,P9=/\p{P}/u,O9=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,R9=/:\/\//;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 JT(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&&jv.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function xr(e){return!!e&&N9.test(e)}function Tr(e){return!!e&&(L9.test(e)||P9.test(e))}function B9(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||xr(o)?!1:!(Tr(o)&&n&&!xr(n)&&!Tr(n))}function F9(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||xr(n)?!1:!(Tr(n)&&o&&!xr(o)&&!Tr(o))}function H9(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?JT(e,o):t.indexOf("*",o);if(i===-1)break;if(F9(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function W9(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||xr(o)?!1:!(Tr(o)&&n&&!xr(n)&&!Tr(n))}function U9(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||xr(n)?!1:!(Tr(n)&&o&&!xr(o)&&!Tr(o))}function q9(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(U9(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function j9(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&&jv.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function z9(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&jv.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function V9(e,t,n){const o=z9(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 K9=/[\p{L}\p{N}]/u,G9=/^[\p{L}\p{N}]+$/u;function l1(e){return e?K9.test(e):!1}function eA(e){return e?G9.test(e):!1}function $c(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:l1(o)&&l1(s)}}function Y9(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=$c(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(!eA(e.slice(o.end,s.start)))return s.end}return-1}function X9(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function Q9(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=$c(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function Z9(e){return e?O9.test(e)||R9.test(e):!1}function J9(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=bu(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,f=e;function g(){return e===f&&(e=e.slice()),e}function h(){c=null}function m(Q,ce){const Se=e.length===1?t:String(ce.content??""),j=[],te=Y9(Q);if(te!==-1){S(Q.slice(0,te),Q.slice(0,te));const oe=Q.slice(te);return oe&&($({type:"text",content:oe,raw:oe}),u--),u++,!0}if(M9.test(Q)){const oe=Q.indexOf("~~");oe!==-1&&j.push({type:"strikethrough",index:oe})}if(E9.test(Q)){const oe=Q.indexOf("**");oe!==-1&&j.push({type:"strong",index:oe})}if(/[^*]*\*[^*]+/.test(Q)){const oe=Se?JT(Se,0):Q.indexOf("*");if(Se&&oe===-1)return!1;oe!==-1&&j.push({type:"emphasis",index:oe})}j.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 he=j[0];if(!he)return!1;if(he.type==="strikethrough"){const oe=he.index,fe=oe>-1?Q.slice(0,oe):"";if(fe&&S(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}=Gw([{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 h(),y(ge),re&&($({type:"text",content:re,raw:re}),u--),u++,!0}if(he.type==="strong"){const oe=he.index,fe=oe>-1?Q.slice(0,oe):"";if(fe&&S(fe,fe),oe===-1)return u++,!0;if(t&&oe===0){let $e=!1,se=0;for(;se<Q.length&&Q[se]==="*";)se++;if(t.startsWith("\\*")&&($e=!0),$e){let ae=0,we=0;for(;we<t.length&&ae<se;)if(t[we]==="\\"&&we+1<t.length&&t[we+1]==="*")ae+=1,we+=2;else{if(t[we]==="*")break;we++}if(ae>=2)return S(Q,Q),u++,!0}}if(t&&(Q.match(/\*/g)||[]).length>D9(t))return S(Q.slice(fe.length),Q.slice(fe.length)),u++,!0;const H=$c(Q,oe);if(H.len>=3){const $e=Q9(Q,oe+H.len);if($e!==-1){const se=Q.slice(oe+H.len,$e);if(X9(se)){const{node:ae}=rc([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:se,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);h(),y(ae);const we=Q.slice($e+3);return we&&($({type:"text",content:we,raw:we}),u--),u++,!0}}}if(!W9(Q,oe)){const $e=Q.slice(oe,oe+H.len);S($e,$e);const se=Q.slice(oe+H.len);return se&&($({type:"text",content:se,raw:se}),u--),u++,!0}const Y=q9(Q,oe+2);let re="",ge="";if(Y.index!==-1){re=Q.slice(oe+2,Y.index),ge=Q.slice(Y.index+2);const $e=Y.index,se=$c(Q,$e);if(H.intraword&&se.intraword&&!eA(re)||!re&&H.len>=4&&H.intraword)return S(Q.slice(fe.length),Q.slice(fe.length)),u++,!0}else{if(d||Y.sawInvalidClose||H.intraword)return S(Q.slice(fe.length),Q.slice(fe.length)),u++,!0;re=Q.slice(oe+2),ge=""}if(!re&&/^\*+$/.test(ge))return S(Q,Q),u++,!0;const{node:xe}=rc([{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 h(),y(xe),ge&&($({type:"text",content:ge,raw:ge}),u--),u++,!0}if(he.type==="emphasis"){let oe=he.index;oe===-1&&(oe=0);const fe=Q.slice(0,oe);if(fe&&S(fe,fe),!B9(Q,oe)){S(Q[oe],Q[oe]);const $e=Q.slice(oe+1);return $e&&($({type:"text",content:$e,raw:$e}),u--),u++,!0}const H=$c(Q,oe),Y=H9(Se,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||!l1(Q[oe+1])))return S(Q.slice(oe),Q.slice(oe)),u++,!0;const{node:xe}=yd([{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(h(),y(xe),re!==-1&&re<Q.length-1){const $e=Q.slice(re+1);$e&&($({type:"text",content:$e,raw:$e}),u--)}return u++,!0}return!1}function _(Q,ce){if(!Q.includes("`"))return!1;const j=(ge=>{for(let xe=0;xe<ge.length;xe++){if(ge[xe]!=="`")continue;let $e=0;for(let se=xe-1;se>=0&&ge[se]==="\\";se--)$e++;if($e%2===0)return xe}return-1})(Q);if(j===-1)return!1;let te=1;for(let ge=j+1;ge<Q.length&&Q[ge]==="`";ge++)te++;const he="`".repeat(te),oe=j+te,fe=Q.indexOf(he,oe);if(fe===-1){if(te===1){const xe=Q.slice(0,j),$e=Q.slice(j+1);return xe&&(m(xe,ce)?u--:S(xe,xe)),k({type:"inline_code",code:$e,raw:String($e)}),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,S(ge,ge),u++,!0}h();const H=Q.slice(0,j),Y=Q.slice(j+te,fe),re=Q.slice(fe+te);return H&&(m(H,ce)?u--:S(H,H)),k({type:"inline_code",code:Y,raw:String(Y??"")}),re&&($({type:"text",content:re,raw:re}),u--),u++,!0}function w(Q){const ce=l?.__markdownIt;if(!ce||e.length<=1||!e.some(he=>he?.type==="math_inline")||!I9.test(Q))return null;const Se=ce.parseInline(Q,{__markstreamFinal:!!o?.final});if(!Array.isArray(Se)||Se.length===0)return null;const j=(Se.find(he=>he?.type==="inline")?.children??[]).filter(he=>!(he?.type==="text"&&String(he.content??"")===""));if(!j.length||!j.some(he=>he?.type!=="text")||j.length===1&&j[0]?.type==="text"&&String(j[0].content??"")===Q)return null;const te=Tn(j,Q,n,o);return te.length?te:null}function k(Q){h(),a.push(Q)}function b(Q){h();const ce=ul(Q);a.push(ce)}function y(Q){k(Q)}function S(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 Se=Tn([{...ce,type:"text",content:Q,raw:Q}],Q,n,o);if(Se.length===1&&Se[0]?.type==="text"){const j=Se[0];S(String(j.content??""),String(j.raw??j.content??""));return}for(const j of Se)y(j)}function N(Q,ce){return String(Q.markup??"").startsWith(ce)}function v(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 M(Q,ce){let Se=Q;const j=String(ce.content??"");return Se.endsWith("\\")&&!N(ce,"\\\\")&&!j.endsWith("\\\\")&&(Se=Se.slice(0,-1)),Se.endsWith("(")&&!N(ce,"\\(")&&!j.endsWith("\\(")&&(Se=Se.slice(0,-1)),/\*+$/.test(Se)&&!N(ce,"\\*")&&!j.endsWith("\\*")&&(Se=Se.replace(/\*+$/,"")),Se}for(;u<e.length;){const Q=e[u];$(Q)}function $(Q){switch(Q.type){case"text":T(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":y(y9(Q)),u++;break;case"html_inline":{const[ce,Se]=g9(Q,e,u,Tn,t,n,o);y(ce),u=Se;break}case"link_open":I(Q);break;case"image":ke(Q)||(h(),y(Vw(Q)),u++);break;case"strong_open":{h();const{node:ce,nextIndex:Se}=rc(e,u,Q.content,o);y(ce),u=Se;break}case"em_open":{h();const{node:ce,nextIndex:Se}=yd(e,u,o);y(ce),u=Se;break}case"s_open":{h();const{node:ce,nextIndex:Se}=Gw(e,u,o);y(ce),u=Se;break}case"mark_open":{h();const{node:ce,nextIndex:Se}=d9(e,u,o);y(ce),u=Se;break}case"ins_open":{h();const{node:ce,nextIndex:Se}=k9(e,u,o);y(ce),u=Se;break}case"sub_open":{h();const{node:ce,nextIndex:Se}=x9(e,u,o);y(ce),u=Se;break}case"sup_open":{h();const{node:ce,nextIndex:Se}=T9(e,u,o);y(ce),u=Se;break}case"sub":h(),y({type:"subscript",children:[{type:"text",content:String(Q.content??""),raw:String(Q.content??"")}],raw:`~${String(Q.content??"")}~`}),u++;break;case"sup":h(),y({type:"superscript",children:[{type:"text",content:String(Q.content??""),raw:String(Q.content??"")}],raw:`^${String(Q.content??"")}^`}),u++;break;case"emoji":{h();const ce=e[u-1];ce?.type==="text"&&/\|:-+/.test(String(ce.content??""))?S("",""):y(i9(Q)),u++;break}case"checkbox":h(),y(o9(Q)),u++;break;case"checkbox_input":h(),y(s9(Q)),u++;break;case"footnote_ref":h(),y(c9(Q)),u++;break;case"footnote_anchor":{h();const ce=Q.meta??{};k({type:"footnote_anchor",id:String(ce.label??Q.content??""),raw:String(Q.content??"")}),u++;break}case"hardbreak":h(),y(u9()),u++;break;case"fence":h(),y(qv(e[u])),u++;break;case"math_inline":h(),!Q.content&&Q.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(Kw({...Q,content:e[u+1].content})),u+=2):y(Kw(Q)),u++;break;case"reference":D(Q);break;case"text_special":S(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))){h();const Se=String(ce.text??"");S(Se,Se),u++}else le(Q)||V(Q)||J(Q)||W(Q)||b(Q),u++;break}}}function O(Q,ce,Se,j){const te=A9({...ce,content:Q});if(c){c.content+=M(te.content,ce),c.raw+=te.raw;return}const he=Se?.tag==="br"&&e[u-2]?.content==="[";j||(te.content=M(te.content,ce)),c=te,c.center=he,a.push(c)}function T(Q){const ce=String(Q.content??""),Se=e.length===1&&ce.includes("\\")&&typeof t=="string"?String(t):"";let j=Se?j9(Se):ce.replace($9,"$1");if(Q.content==="<"||j==="1"&&e[u-1]?.tag==="br"){u++;return}const te=j.indexOf("$");te!==-1&&te===j.lastIndexOf("$")&&j.endsWith("$")&&(j=j.slice(0,-1)),j.endsWith("undefined")&&!t?.endsWith("undefined")&&(j=j.slice(0,-9));let he=a.length,oe="";for(let re=a.length-1;re>=0;re--){const ge=a[re];if(ge.type!=="text")break;he=re,oe=String(ge.content??"")+oe}he<a.length&&(j.startsWith(oe)?(c=null,a.length=he):c=a[a.length-1]);const fe=e[u+1];if((j==="`"||j==="|"||j==="$")&&!N(Q,`\\${j}`)||/^\*+$/.test(j)&&!N(Q,"\\*")){u++;return}if(!fe&&/[^\]]\s*\(\s*$/.test(j)&&(j=j.replace(/\(\s*$/,"")),!j){u++;return}if(X(j)||We(j))return;if(!(j.includes("*")||j.includes("_")||j.includes("~")||j.includes("`")||j.includes("[")||j.includes("!")||j.includes("$")||j.includes("|")||j.includes("("))){O(j,Q,e[u-1],fe),u++;return}if(Re(j))return;const H=e[u-1];if(j==="["&&!fe?.markup?.includes("*")&&!N(Q,"\\[")||j==="]"&&!H?.markup?.includes("*")&&!N(Q,"\\]")){u++;return}if(_(ce,Q)||Ne(j)||(e[u+1]?.type!=="link_open"||v(j))&&ve(j,Q))return;const Y=w(ce);if(Y){h();for(const re of Y)y(re);u++;return}m(j,Q)||(O(j,Q,H,fe),u++)}function I(Q){if(R(Q))return;if(ue()){const{node:fe,nextIndex:H}=kd(e,u,o),Y=String(fe.text||fe.href||"");S(Y,Y),u=H;return}h();const{node:ce,nextIndex:Se}=kd(e,u,o);u=Se;const j=ce.text||ce.href||"";if(Q.markup==="linkify"&&!LT(j,ce.href,t)&&Ff(j,l?.__linkifyDemotionContext)){S(j,j);return}const te=ce.children.length===1&&ce.children[0]?.type==="text";if(ce.loading&&t&&ce.text===ce.href&&te){const fe=J9(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)){S(ce.text,ce.text);return}const he=Q.attrs?.find(([fe])=>fe==="href")?.[1],oe=String(he??"");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)||k(ce)}function R(Q){if(Q.markup!=="linkify")return!1;const{node:ce,nextIndex:Se}=kd(e,u,o);return U(ce,Se)?(u=Se,!0):!1}function D(Q){h(),y(_9(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 Se=String(ce.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!Se)return!1;const j=Q,te=String(j.href??""),he=String(j.text??""),oe=String(Se[2]??""),fe=te.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!te||!(he===te||he===fe||Z9(he)))return!1;const H=String(Se[1]??"");return H?(ce.content=H,ce.raw=H):a.pop(),k({...Q,text:oe,children:[{type:"text",content:oe,raw:oe}],raw:`[${oe}](${te}${j.title?` "${j.title}"`:""})`}),!0}function V(Q){if(Q.type!=="link")return!1;const ce=Q,Se=String(ce.href??"");return Se?U({href:Se,title:ce.title==null||ce.title===""?null:String(ce.title),loading:!!ce.loading},u+1):!1}function U(Q,ce){const Se=a[a.length-1];if(Se?.type!=="image"||Se.src||!Se.loading||!String(Se.raw??"").endsWith("]("))return!1;const j=e[ce],te=String(j?.content??"");if(j?.type!=="text"||!te.startsWith(")"))return!1;a.pop(),c=null;const he=String(Se.alt??"");k({type:"image",src:Q.href,alt:he,title:Q.title,raw:``,loading:!!Q.loading});const oe=te.slice(1),fe=ul(j);return fe.content=oe,fe.raw=oe,g()[ce]=fe,!0}function J(Q){if(Q.type!=="link")return!1;const ce=a[a.length-1],Se=e[u-1];if(!ce||ce.type!=="text"||Se?.type!=="text")return!1;const j=String(ce.content??""),te=String(Se.content??"");if(!j.endsWith("!")||!te.endsWith("!")||N(Se,"\\!"))return!1;const he=j.slice(0,-1);he?(ce.content=he,ce.raw=he,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 k({type:"image",src:H,alt:fe,title:Y,raw:``,loading:!!oe.loading}),!0}function K(Q,ce="",Se=null){const j=String(Q.alt??Q.raw??"");return{type:"link",href:ce,title:Se,text:j,children:[Q],raw:`[${j}](${ce}${Se?` "${Se}"`:""})`,loading:!0}}function G(Q){const ce=Q.startsWith(";return{type:"image",src:"",alt:j===-1?Se.replace(/\]$/,""):Se.slice(0,j),title:null,raw:ce,loading:!0}}function X(Q){const ce=Q.indexOf("[![");if(ce===-1||typeof t=="string"&&e.length===1&&V9(t,ce,"["))return!1;const Se=Q.slice(0,ce);return Se&&S(Se,Se),k(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 Se=a[a.length-1];if(Se?.type==="text"&&Se.content.endsWith("[")){const j=Se.content.slice(0,-1);j?(Se.content=j,Se.raw=j,c=Se):(a.pop(),c=null)}return k(K(Vw(Q))),u++,!0}function le(Q){if(Q.type!=="link")return!1;const ce=Q,Se=String(ce.raw??""),j=String(ce.text??"");if(!Se.startsWith("[![")&&!j.startsWith("!["))return!1;const te=ce.title==null||ce.title===""?null:String(ce.title);return k(K({type:"image",src:String(ce.href??""),alt:j.replace(/^!\[/,"").replace(/\]$/,""),title:te,raw:Se.startsWith("[)return!1;const ce=e[u-2];if(ce?.type==="text"&&String(ce.content??"").endsWith("[")&&N(ce,"\\["))return!1;const Se=a[a.length-1];if(Se?.type!=="image"&&Se?.type!=="link")return!1;const j=Se,te=Se?.type==="link"&&Array.isArray(j.children)&&j.children.length===1&&j.children[0]?.type==="image"?a.pop():null,he=te?te.children[0]:a.pop();if(!he||he.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}=kd(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(he,fe,H);return re.loading=Y,k(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 Se=Q.indexOf("[");if(Se===-1)return!1;let j=Q.slice(0,Se);const te=Q.indexOf("](",Se);if(te!==-1){const he=e[u+2];let oe=Q.slice(Se+1,te);if(oe.includes("[")){const $e=oe.indexOf("[");j+=Q.slice(0,Se+$e+1);const se=Se+$e+1;oe=Q.slice(se+1,te)}const fe=e[u+1];if(Q.endsWith("](")&&fe?.type==="link_open"&&he){const $e=e[u+4];let se=4,ae=!0;if($e?.type==="text"){const qe=String($e.content??"");if(qe.startsWith(")")){ae=!1;const nt=qe.slice(1);if(nt){const ct=ul($e);ct.content=nt,ct.raw=nt,g()[u+4]=ct}else se++}else qe==="."&&se++}L(j,ce);const we=String(he.content??"");return o?.validateLink&&!o.validateLink(we)?S(oe,oe):k({type:"link",href:we,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:ae}),u+=se,!0}const H=Q.indexOf(")",te),Y=H!==-1?Q.slice(te+2,H):"",re=H===-1;let ge=j.match(/\*+$/);if(ge&&(j=j.replace(/\*+$/,"")),L(j,ce),ge||(ge=oe.match(/^\*+/)),!d&&ge){const $e=ge[0].length;oe=oe.replace(/^\*+/,"").replace(/\*+$/,"");const se=[];if($e===1?se.push({type:"em_open",tag:"em",nesting:1}):$e===2?se.push({type:"strong_open",tag:"strong",nesting:1}):$e===3&&(se.push({type:"strong_open",tag:"strong",nesting:1}),se.push({type:"em_open",tag:"em",nesting:1})),se.push({type:"link",href:Y,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:re}),$e===1){se.push({type:"em_close",tag:"em",nesting:-1});const{node:ae}=yd(se,0,o);y(ae)}else if($e===2){se.push({type:"strong_close",tag:"strong",nesting:-1});const{node:ae}=rc(se,0,void 0,o);y(ae)}else if($e===3){se.push({type:"em_close",tag:"em",nesting:-1}),se.push({type:"strong_close",tag:"strong",nesting:-1});const{node:ae}=rc(se,0,void 0,o);y(ae)}else{const{node:ae}=yd(se,0,o);y(ae)}}else o?.validateLink&&!o.validateLink(Y)?S(oe,oe):k({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&&($({type:"text",content:xe,raw:xe}),u--),u++,!0}return!1}function Ne(Q){const ce=Q.indexOf("![");if(ce===-1)return!1;const Se=Q.slice(0,ce);return Se&&!c?c={type:"text",content:Se,raw:Se}:Se&&c&&(c.content+=Se),c&&(a.push(c),c=null),k(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 Se=ce[0]==="x"||ce[0]==="X";return k({type:"checkbox_input",checked:Se,raw:Se?"[x]":"[ ]"}),u++,!0}return!1}return a}function eF(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 tF(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 nF(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function $a(e,t,n){const o=e[t],s=[],i=$r(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=nF(c)?ul(c):c,d=e[a-1];u!==c&&(tF(u),eF(u));const f=String(u.content??"");l.push({type:"paragraph",children:Tn(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=Na(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]=$a(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=Vv(e,a,i.options(),zv);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 oF(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=$r(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]=$a(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=Na(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Rh(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 sF=new Set(["warning","info","note","tip","danger","caution"]);function iF(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 sF.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function rF(e,t,n){const o=e[t];let s="note",i="";const r=o.type.match(/^container_(\w+)_open$/);if(r){s=r[1];const d=String(o.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(s)){const f=d.slice(s.length).trim();f&&(i=f)}}else{const d=iF(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=$r(n,!0);let c=t+1;const u=new RegExp(`^container_${s}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const f=d.children||[];let g=-1;for(let m=f.length-1;m>=0;m--){const _=f[m];if(_.type==="text"&&/:+/.test(_.content)){g=m;break}}const h={type:"paragraph",children:Tn((g!==-1?f.slice(0,g):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(h),a.remember(h.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=$a(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=Na(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Rh(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 lF=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function aF(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=lF.exec(String(o.info??""));return s?oF(e,t,s,n):null}const zv={parseContainer:(e,t,n)=>rF(e,t,n),matchAdmonition:aF};function Na(e,t,n){const o=[],s=$r(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]=$a(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=Na(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}default:{const r=Vv(e,i,s.options(),zv);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 cF(e){if(e.info?.startsWith("diff"))return qv(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 uF(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=$r(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 dF(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=$r(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 fF(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 hF(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 tA(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=yl.has(n),l=Oh(s),a=(o===-1?-1:hF(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 pF(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 mF(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 nA(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function oA(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return nA(n)?n:void 0}function gF(e,t,n){const o=oA(bu(t),n);if(!nA(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 vF(e,t,n){let o=t+1,s=null;const i=[];let r=!1;for(;o<e.length&&e[o].type!=="table_close";)if(e[o].type==="thead_open")r=!0,o++;else if(e[o].type==="thead_close")r=!1,o++;else if(e[o].type==="tbody_open"||e[o].type==="tbody_close")o++;else if(e[o].type==="tr_open"){const a=[];let c=o+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",g=e[c+1],h=String(g.content??""),m=mF(e[c].attrs),_=a.length,w=!f&&!r,k=w?s?.cells[_]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:Tn(g.children||[],h,void 0,gF(n,k,w?u:void 0)),raw:h,align:m}),w&&(u=oA(u,bu(h))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?s=d:i.push(d),o=c+1}else o++;s||(s={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:s,rows:i,loading:l&&!n?.final&&i.length===0,raw:[s,...i].map(a=>a.raw).join(`
|
|
172
|
-
`)},o+1]}function yF(){return{type:"thematic_break",raw:"---"}}let Dm=null;const Bm=new WeakMap;function Yw(){return Dm||(Dm={allowedTagSet:Bh(),customTagSet:null}),Dm}function kF(e){if(!e||e.length===0)return Yw();const t=Bm.get(e);if(t)return t;const n=e.map(Ds).filter(Boolean);if(!n.length){const s=Yw();return Bm.set(e,s),s}const o={allowedTagSet:Bh({customHtmlTags:e}),customTagSet:new Set(n)};return Bm.set(e,o),o}function bF(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[g,h]of s)if(g==="class"){const m=h.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(g.startsWith("data-")){const m=g.slice(5);try{r[m]=JSON.parse(h)}catch{r[m]=h}}}const l=[],a=$r(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const g=e[c+1];if(g){const h={type:"paragraph",children:Tn(g.children||[],void 0,void 0,a.options()),raw:String(g.content??"")};l.push(h),a.remember(h.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[g,h]=$a(e,c,a.options());l.push(g),a.remember(g.raw),c=h}else if(e[c].type==="blockquote_open"){const[g,h]=Na(e,c,a.options());l.push(g),a.remember(g.raw),c=h}else{const g=Rh(e,c,a.options());g?(l.push(g[0]),a.remember(g[0].raw),c=g[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
|
|
173
|
-
`,l.length>0&&(f+=o.raw??l.map(g=>g.raw).join(`
|
|
174
|
-
`),f+=`
|
|
175
|
-
`),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function wF(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function _F(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function CF(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${ds(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${ds(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 SF(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 h=c+1;return{raw:e.slice(r,h),end:h}}let u=1,d=c+1;const f=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(m)},g=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const h=e.indexOf("<",d);if(h===-1)return{raw:e.slice(r),end:e.length};if(g(h)){const m=e.indexOf(">",h);if(m===-1)return null;if(u--,u===0){const _=m+1;return{raw:e.slice(r,_),end:_}}d=m+1;continue}if(f(h)){const m=xn(e.slice(h));if(m===-1)return null;u++,d=h+m+1;continue}d=h+1}return{raw:e.slice(r),end:e.length}}function a1(e){return Number.isFinite(e)&&e>0?e:0}function xF(e,t){const n=a1(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 Rh(e,t,n){const o=e[t];switch(o.type){case"heading_open":return[fF(e,t,n),t+3];case"code_block":return[cF(o),t+1];case"fence":return[qv(o),t+1];case"math_block":return[pF(o),t+1];case"html_block":{const s=tA(o),i=s.tag?kF(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)?xF(l,Number(o.map?.[0]??0)):0,u=SF(l,r,Math.max(a1(a),a1(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??s.raw??""),f=xn(d),g=f!==-1?d.slice(0,f+1):d,h=f!==-1&&/\/\s*>\s*$/.test(g),m=f===-1?null:CF(d,r,f+1),_=m?.start??-1;let w="";f!==-1&&(_!==-1&&f<_?w=d.slice(f+1,_):w=d.slice(f+1)),_===-1&&(w=_F(w,r));const k=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=b.exec(g))!==null;){const L=y[1];if(!L||L.toLowerCase()===r)continue;const N=y[2]||y[3]||y[4]||"";k.push([L,N])}const S=!n?.final&&!h&&m==null;return[{type:r,tag:r,content:wF(w),raw:String(u?.raw??s.raw??d),loading:S,attrs:k.length?k:void 0},t+1]}return[s,t+1]}case"table_open":{const[s,i]=vF(e,t,n);return[s,i]}case"dl_open":{const[s,i]=uF(e,t,n);return[s,i]}case"footnote_open":{const[s,i]=dF(e,t,n);return[s,i]}case"hr":return[yF(),t+1]}return null}function Vv(e,t,n,o){const s=Rh(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 bF(e,t,n)}return null}function TF(){return{type:"hardbreak",raw:`\\
|
|
177
|
-
`}}function AF(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 Xw=new WeakMap,Dh=new WeakMap,MF=["$$","\\["];function xa(){return typeof performance<"u"?performance.now():Date.now()}function Kv(e,t,n){e&&(e[t]=(e[t]??0)+n)}function sA(e){return e.__timing}function Fm(e,t,n){return t&&Kv(t,"parseMarkdownToStructureTotalMs",xa()-n),e}function Qw(e,t,n){if(!n)return i_(e,t);const o=xa(),s=i_(e,t);return Kv(n,"processTokensMs",xa()-o),s}function EF(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=Ia(t);return n.length?new Set(n):null}function IF(e,t){const n=e;let o=Xw.get(n);o||(o=new Map,Xw.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 $F(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function bd(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]=Jr(s.value,n))}}function Jr(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(Jr(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Jr(l,t),Jr(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Jr(l,t));return r}if(e instanceof Date){const r=new Date(e.getTime());return t.set(n,r),r}if(e instanceof RegExp){const r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,t.set(n,r),r}if(typeof URL<"u"&&e instanceof URL){const r=new URL(e.href);return t.set(n,r),bd(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),bd(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),bd(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!$F(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),bd(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=Jr(i[r],t);return s}function iA(e,t=!0){if(!t)return ul(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=>iA(a,t)):t&&r&&typeof r=="object"&&(l=Jr(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function Zw(e,t=!0){return e.map(n=>iA(n,t))}function rA(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 NF(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 LF(e){Dh.delete(e)}function PF(e,t,n){Dh.set(e,{source:t,key:n,pendingCandidate:n===null&&VT(t)})}function OF(e){return e.endsWith("$")||e.endsWith("\\")}function RF(e){const t=Math.max(e.lastIndexOf(`
|
|
178
|
-
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return MF.some(o=>n.endsWith(o))}function DF(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||RF(e)&&/[\r\n]/.test(t)):!1}function BF(e,t){if(!FT(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=Dh.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&&!DF(s.source,l)&&!OF(t)){s.source=t;return}}const i=ZB(t),r=s?!t.startsWith(s.source):!1;(s&&(r||s.key!==i)||!s&&i)&&n.reset(),PF(e,t,i)}function FF(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function HF(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 Hm(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&&HF(e,t)}function Jw(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function WF(e){for(let t=0;t+5<e.length;t++)if(Jw(e,t)&&Jw(e,t+3)&&Hm(e[t],e[t+3])&&Hm(e[t+1],e[t+4])&&Hm(e[t+2],e[t+5]))return!0;return!1}function UF(e,t,n){return FT(e)&&VT(t)&&WF(n)}function qF(e){const t=Dh.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function e_(e,t,n,o){if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!rA(e,o)||(BF(e,t),qF(e)))return e.parse(t,n);const s=e.stream.parse(t,IF(e,n));if(UF(e,t,s))return e.stream?.reset?.(),e.parse(t,n);if(!FF(o))return s;const i=sA(o);if(!i)return Zw(s,!0);const r=xa(),l=Zw(s,!0);return Kv(i,"tokenCloneMs",xa()-r),l}function Bh(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return nu;const n=new Set(nu);for(const o of Ia(t))o&&n.add(o);return n}function jF(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 t_(e){return{type:"paragraph",children:e,raw:e.map(jF).join("")}}function n_(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=EF(t);if(!s?.size)return null;let i=-1;for(let u=0;u<o.length;u++){const d=o[u];if(!s.has(String(d?.type??"").toLowerCase()))continue;const f=o.slice(0,u);if(String(d.content??"").trim()&&f.some(g=>g?.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(t_(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(t_(c)),a}function zF(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 Nc(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function VF(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*${ds(t)}\s*>\s*$`,"i").test(n)}function Gv(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${ds(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(yl.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*${ds(o)}(?=\s|>|/)`,"i").test(m)},g=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${ds(o)}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const h=e.indexOf("<",d);if(h===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(g(h)){const m=xn(e.slice(h));if(m===-1)return null;u--;const _=h+m+1;if(u===0)return{raw:e.slice(r,_),start:r,end:_,closed:!0};d=_;continue}if(f(h)){const m=xn(e.slice(h));if(m===-1)return null;const _=e.slice(h,h+m+1);/\/\s*>$/.test(_)||u++,d=h+m+1;continue}d=h+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function KF(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 GF(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
|
|
180
|
-
</${t}>`}function o_(e){return e.replace(/\r\n/g,`
|
|
181
|
-
`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function YF(e,t,n){return n?e.includes(n,t)?!0:o_(e.slice(Math.max(0,t))).includes(o_(n)):!1}function XF(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 s_(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 QF(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function Yv(e,t){const n=new RegExp(String.raw`<\s*\/\s*${ds(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function lA(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const ZF=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),JF=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function eH(e){return/\n\s*\n/.test(e)||JF.test(e)}function tH(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>ZF.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(!eH(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function nH(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"||_T.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=Yv(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return s;const d=Lc(u,t,lA(n,o));return tH(u,d)?{...s,children:d}:s})}function Lc(e,t,n){return e.trim()?cA(e,t,{...n,__disableStreamParse:!0}):[]}function oH(e,t,n){const o=Lc(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function sH(e,t,n){const o=tA({content:e}),s=xn(e),i=Yv(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=oH(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function iH(e,t,n){const o=xn(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=Gv(s,"summary",0);if(!i)return Lc(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...Lc(r,t,n),sH(i.raw,t,n),...Lc(l,t,n)]}function aA(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=Nc(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!s_(c)){r.push(c);continue}const f=String(c.raw??Nc(c)??""),g=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(g===-1){r.push(c);continue}let h=1,m=-1;for(let J=a+1;J<e.length;J++){const K=e[J];if(s_(K)){h++;continue}if(QF(K)&&(h--,h===0)){m=J;break}}const _=Gv(t,"details",g),w=m===-1&&_?.closed===!0,k=w?(()=>{const J=Yv(f,"details");return J!==-1?f.slice(0,J):f})():f,[b]=aA(w?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,o,s,g+f.length),y=iH(k,n,lA(o,s)),S=m===-1?"</details>":String(e[m].raw??Nc(e[m])??"</details>"),L=w||m!==-1&&_?.closed===!0,N=S.replace(/[\t\r\n ]+$/,""),v=L?(()=>{const J=(_?.raw??"").lastIndexOf(N);return J===-1?t.length:g+J})():t.length,M=xn(f),$=w&&M!==-1?g+M+1:g+f.length,O=t.slice($,v===-1?t.length:v),T=n.parse(O,{__markstreamFinal:s}),I=n.renderer.render(T,n.options,{__markstreamFinal:s}),R=v+N.length,D=L?Math.max(v+S.length,XF(t,R)):t.length,W=L?t.slice(v,D):S,V=L?t.slice(g,D):t.slice(g),U=w&&M!==-1?f.slice(0,M+1):f;if(r.push({...c,tag:"details",attrs:Oh(f.slice(0,M+1)),raw:V,content:`${U}${I}${W}`,children:[...y,...b],loading:!s&&!L}),l=L?D:t.length,m===-1&&!w)break;m!==-1&&(a=m)}return[r,l]}function rH(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=Nc(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=Gv(n,c,a!==-1?a:s);if(!u)continue;s=u.end;const d=String(r.content??l),f=String(r.raw??d),g=GF(u.raw,c,u.closed),h=!t&&!u.closed,m=d!==g||f!==u.raw||!!r.loading!==h,_=xn(u.raw),w=_===-1?"":u.raw.slice(0,_+1),k=w?Oh(w):[];if(r.content=g,r.raw=u.raw,r.loading=h,r.attrs=k.length?k:void 0,!m)continue;let b=KF(u.raw,f);b===-1&&(b=0);const y=i+1;for(;y<o.length;){if(u.closed&&VF(o[y],c)){o.splice(y,1);continue}const S=Nc(o[y]);if(!S)break;const L=u.raw.indexOf(S,b);if(L===-1){if(YF(n,u.end,S))break;o.splice(y,1);continue}b=L+S.length,o.splice(y,1)}}return o}function lH(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=m=>{const _=m.charCodeAt(0);return _>=65&&_<=90||_>=97&&_<=122},u=m=>{const _=m.charCodeAt(0);return _>=48&&_<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",g=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",h=g;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!g(l[a]))return!1;for(a++;a<l.length&&h(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const m=l[a];if(m==='"'||m==="'"){for(a++;a<l.length&&l[a]!==m;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const _=l[a];if(t(_)||_==="<"||_===">"||_==='"'||_==="'"||_==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=k=>k===" "||k===" ",g=k=>{let b=0;for(;b<k.length&&f(k[b]);)b++;const y=k[b];if(y!=="`"&&y!=="~")return null;let S=b;for(;S<k.length&&k[S]===y;)S++;const L=S-b;return L<3?null:{markerChar:y,markerLen:L,rest:k.slice(S)}},h=k=>{let b=0;for(;b<k.length&&f(k[b]);)b++;let y=!1;for(;b<k.length&&k[b]===">";)for(y=!0,b++;b<k.length&&f(k[b]);)b++;return y?k.slice(b):null},m=k=>{const b=g(k);if(b)return b;const y=h(k);return y==null?null:g(y)};let _=0;const w=l.split(/\r?\n/);for(const k of w){const b=_,y=_+k.length;if(a<b)break;const S=m(k);if(S){const L=S.markerChar,N=S.markerLen;c?L===u&&N>=d&&/^\s*$/.test(S.rest)&&(c=!1,u="",d=0):(c=!0,u=L,d=N)}if(a<=y)break;_=y+1}return c},s=String(e??""),i=s.lastIndexOf("<");if(i===-1||o(s,i))return s;if(i>0){const l=s[i-1],a=l===" "||l===" "||l===`
|
|
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 aH(e,t){if(!e||!t.length)return e;const n=new Set(t.map(h=>String(h??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=h=>h===" "||h===" ",s=h=>{const m=h.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||h==="_"||h==="-"||h===":"},i=h=>{if(!h)return!1;if(h[0]===" ")return!0;let m=0;for(let _=0;_<h.length;_++){const w=h[_];if(w===" "){if(m++,m>=4)return!0;continue}if(w===" ")return!0;break}return!1},r=h=>{let m=!1,_=!1;for(let w=0;w<h.length;w++){const k=h[w];if(k==="\\"){w++;continue}if(!_&&k==="'"){m=!m;continue}if(!m&&k==='"'){_=!_;continue}if(!m&&!_&&k===">")return w}return-1},l=h=>{let m=0;for(;m<h.length&&o(h[m]);)m++;const _=h[m];if(_!=="`"&&_!=="~")return null;let w=m;for(;w<h.length&&h[w]===_;)w++;const k=w-m;return k<3?null:{markerChar:_,markerLen:k,rest:h.slice(w)}},a=(h,m)=>{if(i(h))return-1;const _=h.replace(/^[ \t]+/,"");if(!_||_.startsWith(">")||_.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(_))return-1;let w=!1,k=0;for(;k<h.length;){const b=h[k];if(b!=="<"){o(b)||(w=!0),k++;continue}const y=r(h.slice(k));if(y===-1){w=!0,k++;continue}const S=h.slice(k,k+y+1);let L=1;for(;L<S.length&&o(S[L]);)L++;if(L>=S.length){w=!0,k++;continue}const N=S[L];if(N==="!"||N==="?"){w=!0,k+=y+1;continue}if(N==="/"){w=!0,k+=y+1;continue}const v=L;for(;L<S.length&&s(S[L]);)L++;if(L===v){w=!0,k++;continue}const M=S.slice(v,L).toLowerCase(),$=S[L];if($&&$!==" "&&$!==" "&&$!==">"&&$!=="/"){w=!0,k++;continue}const O=new RegExp(String.raw`<\s*\/\s*${M}\s*>`,"i"),T=/\/\s*>$/.test(S),I=O.test(h.slice(k+y+1)),R=O.test(e.slice(m+k+y+1)),D=/[\r\n]/.test(e.slice(m+k+y+1));if(w&&n.has(M)&&!T&&!I&&(R||D))return k;w=!0,k+=y+1}return-1};let c=!1,u="",d=0,f="",g=0;for(;g<e.length;){const h=e.indexOf(`
|
|
187
|
-
`,g),m=h!==-1,_=m&&h>g&&e[h-1]==="\r",w=m?_?h-1:h:e.length,k=e.slice(g,w),b=m?_?`\r
|
|
188
|
-
`:`
|
|
189
|
-
`:"",y=l(k);let S=k;if(!c&&!y){const L=a(k,g);if(L!==-1){const N=b||`
|
|
190
|
-
`;S=`${k.slice(0,L).replace(/[ \t]+$/,"")}${N}${N}${k.slice(L).replace(/^[ \t]+/,"")}`}}f+=S,f+=b,y&&(c?y.markerChar===u&&y.markerLen>=d&&/^\s*$/.test(y.rest)&&(c=!1,u="",d=0):(c=!0,u=y.markerChar,d=y.markerLen)),g=m?h+1:e.length}return f}function cH(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},i=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,g=!1;for(let h=0;h<d.length;h++){const m=d[h];if(m==="\\"){h++;continue}if(!g&&m==="'"){f=!f;continue}if(!f&&m==='"'){g=!g;continue}if(!f&&!g&&m===">")return h}return-1},l=(d,f,g)=>{const h=g.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let _=m+1;for(;_<d.length&&o(d[_]);)_++;if(_>=d.length||d[_]!=="/"){m=d.indexOf("<",m+1);continue}for(_++;_<d.length&&o(d[_]);)_++;if(_+h.length>d.length){m=d.indexOf("<",m+1);continue}let w=!0;for(let b=0;b<h.length;b++){const y=d[_+b];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==h[b]){w=!1;break}}if(!w){m=d.indexOf("<",m+1);continue}let k=_+h.length;if(k<d.length&&s(d[k])){m=d.indexOf("<",m+1);continue}for(;k<d.length&&o(d[k]);)k++;if(k<d.length&&d[k]===">")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const g=f;for(;f<d.length&&s(d[f]);)f++;if(f===g)return d;const h=d.slice(g,f).toLowerCase();if(!n.has(h))return d;const m=r(d.slice(f));if(m===-1)return d;const _=f+m;if(l(d,_+1,h))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 f=d>u&&e[d-1]==="\r",g=f?d-1:d,h=e.slice(u,g);c+=a(h),c+=f?`\r
|
|
193
|
-
`:`
|
|
194
|
-
`,u=d+1}return c}function uH(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{let g=0,h=!1,m=0;for(;g<f.length;){for(;g<f.length&&o(f[g]);)g++;if(g>=f.length||f[g]!==">")break;for(h=!0,g++;g<f.length&&o(f[g]);)g++;m=g}return h?{prefix:f.slice(0,m),content:f.slice(m)}:null},i=f=>{let g=0;for(;g<f.length&&o(f[g]);)g++;const h=f[g];if(h!=="`"&&h!=="~")return null;let m=g;for(;m<f.length&&f[m]===h;)m++;const _=m-g;return _<3?null:{markerChar:h,markerLen:_,rest:f.slice(m)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const f=e.indexOf(`
|
|
195
|
-
`,d),g=f!==-1,h=g&&f>d&&e[f-1]==="\r",m=g?h?f-1:f:e.length,_=e.slice(d,m),w=g?h?`\r
|
|
196
|
-
`:`
|
|
197
|
-
`:"",k=s(_),b=k?.prefix??"",y=k?.content??_,S=i(y);S&&(l?S.markerChar===a&&S.markerLen>=c&&/^\s*$/.test(S.rest)&&(l=!1,a="",c=0):(l=!0,a=S.markerChar,c=S.markerLen));let L=y;if(!l&&L.includes("</"))for(const N of r)L=L.replace(N,(v,M,$,O)=>{if(O.replace(/^[\t ]+/,"").startsWith("|"))return v;const T=O.slice(0,$).replace(/^[\t ]+/,"");if(T.length>0){const I=M.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",R=T.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!I||!R||I!==R)return v}return`${M}
|
|
198
|
-
|
|
199
|
-
`});if(b){const N=b+L.split(`
|
|
200
|
-
`).join(`
|
|
201
|
-
${b}`);u+=N}else u+=L;u+=w,d=g?f+1:e.length}return u}function dH(e,t){if(!e||!t.length)return e;const n=new Set(t.map(T=>String(T??"").toLowerCase()));if(!n.size)return e;const o=T=>T===" "||T===" ",s=T=>{if(!T)return!1;if(T[0]===" ")return!0;let I=0;for(let R=0;R<T.length;R++){const D=T[R];if(D===" "){if(I++,I>=4)return!0;continue}if(D===" ")return!0;break}return!1},i=T=>{const I=T.charCodeAt(0);return I>=65&&I<=90||I>=97&&I<=122||I>=48&&I<=57||T==="_"||T==="-"||T===":"},r=T=>{let I=0;for(;I<T.length&&o(T[I]);)I++;return T.slice(I)},l=T=>{let I=0,R=!1,D=0;for(;I<T.length;){for(;I<T.length&&o(T[I]);)I++;if(I>=T.length||T[I]!==">")break;for(R=!0,I++;I<T.length&&o(T[I]);)I++;D=I}if(!R)return null;const W=T.slice(0,D);return{prefix:W,key:W.replace(/[ \t]+$/,""),content:T.slice(D)}},a=T=>r(T).startsWith("<"),c=T=>{for(let I=0;I<T.length;I++){const R=T[I];if(R!==" "&&R!==" ")return!1}return!0},u=T=>{if(s(T))return"";const I=r(T);if(!I.startsWith("<"))return"";let R=1;for(;R<I.length&&o(I[R]);)R++;if(R>=I.length||I[R]==="/"||I[R]==="!"||I[R]==="?")return"";const D=R;for(;R<I.length&&i(I[R]);)R++;if(R===D)return"";const W=I.slice(D,R).toLowerCase();if(!n.has(W))return"";const V=I[R];return V&&V!==" "&&V!==" "&&V!==">"&&V!=="/"?"":W},d=T=>{if(s(T))return null;const I=r(T);if(!I.startsWith("<"))return null;let R=1;for(;R<I.length&&o(I[R]);)R++;if(R>=I.length)return null;const D=I[R]==="/";if(D)for(R++;R<I.length&&o(I[R]);)R++;const W=I[R];if(!W||W==="!"||W==="?")return null;const V=R;for(;R<I.length&&i(I[R]);)R++;if(R===V)return null;const U=I.slice(V,R).toLowerCase();if(!n.has(U))return null;const J=I[R];if(J&&J!==" "&&J!==" "&&J!==">"&&J!=="/")return null;if(D)return{type:"close",name:U};if(/\/\s*>\s*$/.test(I))return{type:"open",name:U,complete:!0};const K=I.indexOf(">",R);if(K!==-1){const G=I.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}},f=T=>{if(s(T))return null;const I=r(T).replace(/[ \t]+$/,"");if(!I.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(I))return null;const R=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(R?.[1])return R[1].toLowerCase();const D=I.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!D?.[1]||!D[2])return null;const W=D[1].toLowerCase();return W===D[2].toLowerCase()?W:null};let g=!1,h="",m=0;const _=T=>{let I=0;for(;I<T.length&&o(T[I]);)I++;const R=T[I];if(R!=="`"&&R!=="~")return null;let D=I;for(;D<T.length&&T[D]===R;)D++;const W=D-I;return W<3?null:{markerChar:R,markerLen:W,rest:T.slice(D)}},w=T=>_(T),k=T=>{const I=r(T);return I?s(T)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(I):!1},b=(T,I,R)=>{let D=T,W=0;for(;D<e.length;){const V=e.indexOf(`
|
|
202
|
-
`,D),U=V!==-1,J=U&&V>D&&e[V-1]==="\r",K=U?J?V-1:V:e.length,G=e.slice(D,K),X=l(G),ke=X?.key??"";if(W>0&&I&&ke!==I)break;const le=X?.content??G,We=d(le);if(We?.name===R){if(We.type==="open")We.complete||W++;else if(W>0&&(W--,W===0))return!1}else if(W>0&&(c(le)||k(le)))return!0;if(U)D=V+1;else break}return!1};let y="",S=0,L=!0,N=!1,v=!1,M=`
|
|
203
|
-
`;const $=[];let O="";for(;S<e.length;){const T=e.indexOf(`
|
|
204
|
-
`,S),I=T!==-1,R=I&&T>S&&e[T-1]==="\r",D=I?R?T-1:T:e.length,W=e.slice(S,D),V=I?R?`\r
|
|
205
|
-
`:`
|
|
206
|
-
`:"",U=l(W),J=U?.key??"",K=U?.content??W,G=w(K);G&&(g?G.markerChar===h&&G.markerLen>=m&&/^\s*$/.test(G.rest)&&(g=!1,h="",m=0):(g=!0,h=G.markerChar,m=G.markerLen));const X=$.length>0;if(!g&&!X){const le=u(K),We=!!le&&!L&&N&&v&&b(S,J,le);le&&!L&&(!N||We)&&(J&&O&&J===O?y+=`${J}${M}`:J||(y+=M))}if(y+=W,y+=V,V&&(M=V),!g){const le=d(K);if(le){if(le.type==="open")le.complete||$.push(le.name);else for(let We=$.length-1;We>=0;We--)if($[We]===le.name){$.length=We;break}}}const ke=c(K);L=ke,N=!ke&&a(K),v=!ke&&!!f(K),O=J,S=I?T+1:e.length}return y}function cA(e,t,n={}){const o=sA(n),s=o?xa():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(NF(t,n)&&(t.stream.reset(),LF(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,k)=>`${w}${k.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 _=Ia(n.customHtmlTags);if(_.length&&(r=aH(r,_),r=cH(r,_),r=dH(r,_),r=uH(r,_),r.includes("</")))for(const w of _){const k=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${w}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(k,"$1$2$2")}}i||(r=lH(r));const l=zF(r);if(l){const _=n.preTransformTokens,w=n.postTransformTokens;if(rA(t,n)||typeof _=="function"||typeof w=="function"){const k=e_(t,r,{__markstreamFinal:i},n),b=typeof _=="function"&&_(k)||k;typeof w=="function"&&w(b)}return Fm(l,o,s)}const a=e_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return Fm([],o,s);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,g=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),h={...n,validateLink:g,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let m=Qw(d,h,o);if(u&&typeof u=="function"){const _=u(d);if(Array.isArray(_)){const w=_[0],k=w?.type;w&&typeof k=="string"?m=Qw(_,void 0,o):m=_}}if(m=rH(m,i,r),m=aA(m,r,t,n,i)[0],m=nH(m,t,n,i),i){const _=new WeakSet,w=k=>{if(!k||typeof k!="object"||_.has(k))return;if(_.add(k),Array.isArray(k)){for(const y of k)w(y);return}const b=k;b.type==="html_block"&&b.loading===!0&&(b.loading=!1);for(const y of Object.values(b))w(y)};w(m)}return n.debug&&console.log("Parsed Markdown Tree Structure:",m),Fm(m,o,s)}function i_(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=$r(t);let s=0;for(;s<e.length;){const i=Vv(e,s,o.options(),zv);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=AF(e,s,o.options(l)),c=n_(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]=$a(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"blockquote_open":{const[l,a]=Na(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(TF()),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=n_(c,t);u?n.push(...u):n.push(c)}o.remember(l)}s+=1;break;default:s+=1;break}}return n}const fH=new Set([...ku,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),hH=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"]),r_=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function l_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function pH(e){return typeof e=="string"?e:e==null?"":String(e)}function uA(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function dr(e){return pH(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function dA(e){return dr(e).replace(/`/g,"`")}function Fh(e){return String(e??"").trim().toLowerCase()}function Xv(e,t="safe"){const n=Fh(e);return n?t==="escape"?!0:t==="trusted"?ku.has(n):!hH.has(n):!1}function fA(e,t="safe"){const n=Fh(e);return n?t==="escape"?!0:t==="trusted"?ku.has(n):fH.has(n):!1}function a_(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${dA(o)}"`).join("")}function mH(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||cl(s,{tagName:t,attrName:"srcset"})})}function hA(e,t,n,o){return ZD.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?mH(t,o):!!(JD.has(e)&&t&&cl(t,{tagName:o,attrName:e}))}function el(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function pA(e,t,n,o=!1){if(t!=="safe"||Fh(n)!=="a")return e;const s=el(e,"href");if(o&&(!s||!e[s])){const a=el(e,"target"),c=el(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=el(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=el(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 c_(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!uA(r)||hA(l,i,t,n)||(o[r]=i)}return pA(o,t,n,!!el(e,"href"))}function mA(e,t){const n=e.toLowerCase();return wT.has(n)?!1:l_(t,n)||l_(t,e)}function Qv(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!uA(r)||hA(l,i,t,n)||(o[r]=i)}return pA(o,t,n,!!el(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 c1(e,t="safe",n){const o=Qv(jf(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function gH(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 vH(e){const t={};for(const[n,o]of Object.entries(e))t[n]=gH(o,n);return t}function u_(e){return e.trim().length>0}function yH(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);u_(a)&&t.push({type:"text",content:a})}break}if(o>n){const a=e.slice(n,o);u_(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",o+1)){const a=e.indexOf("]]>",o);if(a!==-1){t.push({type:"text",content:e.slice(o,a+3)}),n=a+3;continue}break}if(e.startsWith("!",o+1)){const a=e.indexOf(">",o);if(a!==-1){n=a+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let g;for(;(g=f.exec(u))!==null;){const h=g[1],m=g[2]??g[3]??g[4]??"";h&&!h.endsWith("/")&&(d[h]=m)}}t.push({type:l||yl.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 f=e.indexOf("-->",n);if(f!==-1){n=f+3;continue}break}const o=e.indexOf("<",n);if(o===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(o>n&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const f=e.indexOf("]]>",o);if(f!==-1){t.push({type:"text",content:e.slice(o,f+3)}),n=f+3;continue}break}if(e.startsWith("!",o+1)){const f=e.indexOf(">",o);if(f!==-1){n=f+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim();if(!i){n=s+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=s+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let g;for(;(g=f.exec(u))!==null;){const h=g[1],m=g[2]??g[3]??g[4]??"";h&&!h.endsWith("/")&&(d[h]=m)}}t.push({type:l||yl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=s+1}return t}function bH(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${dr(t)}>`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${dr(o)}`:` ${dr(o)}="${dA(s)}"`).join("");return e.type==="self_closing"?`<${dr(t)}${n} />`:`<${dr(t)}${n}>`}function wH(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;r_.lastIndex=0;let n;for(;(n=r_.exec(e))!==null;)if(mA(n[1],t))return!0;return!1}function va(e,t="safe"){if(!e)return"";if(t==="escape")return dr(e);const n=kH(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(dr(r.content??""));continue}const l=Fh(r.tagName);if(!l)continue;if(fA(l,t)){r.type==="tag_open"?i.push(l):r.type==="tag_close"&&i[i.length-1]===l&&i.pop();continue}if(i.length>0)continue;if(t==="safe"&&Xv(l,t)){s.push(bH(r));continue}if(r.type==="self_closing"){s.push(`<${l}${a_(c_(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${a_(c_(r.attrs??{},t,l))}>`),yl.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 _H=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],d_="http://www.w3.org/2000/svg",CH=new Set(["script","style","iframe","object","embed","link","meta"]),SH=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"]),xH=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),TH=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),AH=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function MH(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function EH(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function IH(e){const t=e.nodeName.toLowerCase();return t==="use"?MH(e):t==="image"?EH(e):t==="text"||t==="tspan"?!!e.textContent?.trim():AH.has(t)}function $H(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 NH(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")?cl(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?cl(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":cl(i,{tagName:o,attrName:s})?"":i:""}function LH(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 gA(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 vA(e){const t=gA(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=LH(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function f_(e){const t=gA(e);return _H.some(n=>n.test(t))||vA(t)}function PH(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 wd(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function yA(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(!CH.has(o)){if(o==="br"){t.push(`
|
|
219
|
-
`);return}for(const s of Array.from(n.childNodes))yA(s,t)}}function OH(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];yA(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=wd(t.getAttribute("width")),i=wd(t.getAttribute("height")),r=wd(t.getAttribute("x")),l=wd(t.getAttribute("y")),a=e.ownerDocument.createElementNS(d_,"text");a.setAttribute("x",String(r+s/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,f]of o.entries()){const g=e.ownerDocument.createElementNS(d_,"tspan");g.setAttribute("x",String(r+s/2)),g.setAttribute("dy",d===0?`${u}em`:"1.2em"),g.textContent=f,a.appendChild(g)}}t.parentNode?.replaceChild(a,t)}}function RH(e){OH(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!SH.has(o)){n.remove();continue}if(o==="style"&&f_(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&&f_(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(xH.has(r)&&i.value){const l=NH(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(TH.has(r)&&i.value&&vA(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=$H(i.value);l!==i.value&&n.setAttribute(i.name,l)}}PH(n)}}function Vpe(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 RH(n),DH(n)?null:n}catch{return null}}function DH(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){IH(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 h_=[];function Wm(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function BH(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function FH(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function p_(e=`editor-${Date.now()}`,t={}){const n=n9(t),o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;s=g=>f[g]??o[g]??g}else s=f=>o[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const g=f;if(Array.isArray(g)){const[h,...m]=g;typeof h=="function"&&n.use(h,...m)}else typeof g=="function"&&n.use(g)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(g){console.error("[getMarkdown] apply function threw an error",g)}if(h_.length)for(const f of h_)if(Array.isArray(f)){const[g,...h]=f;typeof g=="function"&&n.use(g,...h)}else typeof f=="function"&&n.use(f);n.use(bL),n.use(CL),n.use(vL);const i=DL,r=i.default??i;n.use(r),n.use(gL),n.use(mL),n.core.ruler.after("block","mark_fence_closed",f=>{const g=f,h=g.src,m=!!g.env?.__markstreamFinal,_=h.split(/\r?\n/);for(const w of g.tokens){if(w.type!=="fence"||!w.map||!w.markup)continue;const k=w.map[0],b=w.map[1],y=w.markup,S=y[0],L=y.length,N=_[Math.max(0,b-1)]??"";let v=0;for(;v<N.length&&(N[v]===" "||N[v]===" ");)v++;let M=0;for(;v+M<N.length&&N[v+M]===S;)M++;let $=v+M;for(;$<N.length&&(N[$]===" "||N[$]===" ");)$++;const O=m?!0:b>k+1&&M>=L&&$===N.length,T=w;T.meta=T.meta??{},T.meta.unclosed=!O,T.meta.closed=!!O}});const l=(f,g)=>{const h=f,m=h.pos;if(h.src[m]!=="~")return!1;const _=h.src[m-1],w=h.src[m+1];if(/\d/.test(_)&&/\d/.test(w)){if(!g){const k=h.push("text","",0);k.content="~"}return h.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,g)=>{const h=f[g],m=String(h.info??"").trim(),_=String(h.content??""),w=btoa(unescape(encodeURIComponent(_))),k=BH(m),b=Wm(k),y=FH(`editor-${e}-${g}-${k}`),S=Wm(s("common.copy"));return`<div class="code-block" data-code="${w}" data-lang="${b}" id="${y}">
|
|
220
|
-
<div class="code-header">
|
|
221
|
-
<span class="code-lang">${Wm(k.toUpperCase())}</span>
|
|
222
|
-
<button class="copy-button" data-code="${w}">${S}</button>
|
|
223
|
-
</div>
|
|
224
|
-
<div class="code-editor"></div>
|
|
225
|
-
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const g=c.exec(f);if(!g)return f!=="["&&!/^\[\d+$/.test(f);const h=String(g[1]??"");return f.slice(g[0].length).startsWith("(")?!1:!/^\d+$/.test(h)},d=(f,g)=>{const h=f;if(h.src[h.pos]!=="[")return!1;const m=a.exec(h.src.slice(h.pos));if(!m)return!1;const _=h.src.slice(Math.max(0,h.pos-120),h.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(_))return!1;const w=h.src.slice(h.pos+m[0].length);if(w.startsWith("](")||w.startsWith("(")||u(w))return!1;if(!g){const k=m[1],b=h.push("reference","span",0);b.content=k,b.markup=m[0],b.raw=m[0]}return h.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,g)=>{const m=String(f[g].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}const HH="modulepreload",WH=function(e){return"/"+e},m_={},cs=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=WH(c),c in m_)return;m_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":HH,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((g,h)=>{f.addEventListener("load",g),f.addEventListener("error",()=>h(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 UH({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 kA({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}:UH({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const g_=new WeakMap;function qH(e){let t=g_.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},g_.set(e,t)),t}function v_(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 Zv(e){return!!(e.themes?.length||e.langs?.length)}function bA(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(o=>n.has(o))}function jH(e,t){return!t?.length||e.registeredAllLangs?!0:bA(e.registeredLangs,t)}function Um(e,t){return Zv(t)&&bA(e.registeredThemes,t.themes)&&jH(e,t.langs)}function zH(e,t){if(!Zv(t))return t;const n=v_(e.registeredThemes,t.themes),o=e.registeredAllLangs?[]:v_(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...o.length?{langs:o}:{}}}const VH={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 KH(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function wA(e){const t=KH(e);return VH[t]??t}function _A(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>wA(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function CA(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 GH(e){return CA(e)?.join("\0")??""}function SA(e,t){const n=CA(e),o=_A(t);return{...n?.length?{themes:n}:{},...o?.length?{langs:o}:{}}}function zf(e,t){return`${GH(e)}\0\0${_A(t)?.join("\0")??""}`}function Kpe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const o=SA(e,t),s={...o},i=!!(s.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete o.langs,delete s.langs),{key:zf(s.themes,s.langs),registerOptions:o,rendererOptions:s,ignoredLangs:i}}async function Gpe(e,t={},n){if(!e)return"ready";const o=SA(t.themes,t.langs),s=zf(o.themes,o.langs),i=n&&n===s?n:s,r=qH(e);if(r.completed.has(i))return"ready";if(Um(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)||Um(r,o))return r.completed.add(i),"ready";const c=zH(r,o),u=zf(c.themes,c.langs);return r.completed.has(u)||Um(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(Zv(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 Wl(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function y_(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var YH=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,g=this.pendingChars<=0;if(this.source+=d,g){const h=k_();this.startedAt=f&&this.hasStarted?h-this.normalizedStartDelayMs:h,this.lastTick=h,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=k_();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const f=1e3/Math.max(1,this.maxCommitFps),g=Math.min(100,Math.max(0,d-this.lastTick));if(g<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const h=this.pendingChars,m=h>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,_=JH(h/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(_-this.currentCps)*.2,this.charBudget+=this.currentCps*(g/1e3),this.charBudget<1){this.ensureLoop();return}const w=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),k=ZH(this.source.slice(this.visible.length),w,this.segmenter);k.text&&(this.visible+=k.text,this.charBudget=Math.max(0,this.charBudget-k.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=Wl(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Wl(o,1e3,1)),this.normalizedTargetLatencyMs=Wl(s,900,1),this.normalizedCatchUpLatencyMs=Wl(i,350,1),this.normalizedCatchUpThreshold=y_(r,600),this.normalizedStartDelayMs=y_(a,80),this.maxCommitFps=Math.trunc(Wl(l,30,1)),this.maxCharsPerCommit=Math.trunc(Wl(c,80,1)),this.flushOnFinish=u,this.segmenter=QH(),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 XH(e={},t){const n=new YH(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 QH(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function ZH(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 k_(){return typeof performance<"u"?performance.now():Date.now()}function JH(e,t,n){return Math.min(n,Math.max(t,e))}var eW=(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 u1=Symbol.for("markstream-vue:node-lifecycle"),b_='<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>',w_='<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>',tW={id:"material",core:{"":w_,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:w_,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:b_,csharp:b_,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:()=>cs(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},d1=new Map;let __="material";const na=new Map,C_=new Map;let f1=null;function nW(e){d1.set(e.id,e)}function oW(e){return eW(this,null,function*(){var t,n,o;if(na.has(e.id))return(t=na.get(e.id))!=null?t:null;let s=C_.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(na.set(e.id,i),f1?.(),i)).catch(()=>(na.set(e.id,null),null)),C_.set(e.id,s)),s})}const sW=gl(0);f1=()=>{sW.value++},nW(tW);const iW={"":"",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 Jv(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=iW[n])!=null?t:n}function Ype(e){const t=Jv(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function Xpe(e){return(function(o){const s=d1.get(__);if(!s)return;const i=s.core[o];if(i)return i;const r=na.get(s.id);if(r){const l=r[o];if(l)return l}s.loadExtended&&!na.has(s.id)&&oW(s)})(Jv(e))||((n=(t=d1.get(__))==null?void 0:t.fallback)!=null?n:"");var t,n}const Qpe={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 xA=!1;function Zpe(){return xA}function Jpe(){xA=!0}var Hh=(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 rs=null,Ud=!1,Wh=t0;function Uh(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function e0(){try{const e=globalThis;return Uh(e?.katex)}catch{return null}}function t0(){return Hh(null,null,function*(){const e=e0();if(e)return e;const t=yield cs(()=>import("./katex-DnlPpQZa.js"),[]);try{yield cs(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Uh(t)})}function rW(e){Wh=e,rs=null,Ud=!1}function lW(e){rW(t0)}function TA(){return typeof Wh=="function"}function eme(){var e;const t=Wh;if(!t||t===t0)return null;if(rs)return rs;const n=e0();if(n)return rs=n,rs;try{const o=t();return o&&typeof o?.then!="function"?(rs=(e=Uh(o))!=null?e:o,rs):null}catch{return null}}function n0(){return Hh(this,null,function*(){var e;const t=e0();if(t)return rs=t,rs;if(rs)return rs;if(Ud)return null;const n=Wh;if(!n)return Ud=!0,null;try{const o=yield n();if(o)return rs=(e=Uh(o))!=null?e:o,rs}catch{}return Ud=!0,null})}function AA(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Ul=null;const MA=new Map,gc=new Map;let EA=5;const sl=new Set;function aW(){if(MA.size<EA&&sl.size){const e=Array.from(sl);sl.clear();for(const t of e)try{t()}catch{}}}function cW(e,t=!0,n=2e3,o){return Hh(this,null,function*(){performance.now();const s=AA(e);if(!TA()){const l=new Error("KaTeX rendering disabled");return l.name="KaTeXDisabled",l.code="KATEX_DISABLED",Promise.reject(l)}if(Ul)return Promise.reject(Ul);const i=`${t?"d":"i"}:${s}`,r=gc.get(i);return r?Promise.resolve(r):(Ul=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ul.name="WorkerInitError",Ul.code="WORKER_INIT_ERROR",Promise.reject(Ul))})}function tme(e,t=!0,n){const o=`${t?"d":"i"}:${AA(e)}`;if(gc.set(o,n),gc.size>200){const s=gc.keys().next().value;gc.delete(s)}}const uW="WORKER_BUSY";function dW(e=2e3,t){return MA.size<EA?Promise.resolve():new Promise((n,o)=>{let s,i=!1;const r=()=>{i||(i=!0,s&&globalThis.clearTimeout(s),sl.delete(r),n())};if(sl.add(r),s=globalThis.setTimeout(()=>{if(i)return;i=!0,sl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",o(l)},e),queueMicrotask(()=>aW()),t){const l=()=>{if(i)return;i=!0,s&&globalThis.clearTimeout(s),sl.delete(r);const a=new Error("Aborted");a.name="AbortError",o(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const lc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function nme(e){return Hh(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!TA()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(s=o.timeout)!=null?s:lc.timeout,c=(i=o.waitTimeout)!=null?i:lc.waitTimeout,u=(r=o.backoffMs)!=null?r:lc.backoffMs,d=(l=o.maxRetries)!=null?l:lc.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):lc.maxRetries,g=o.signal;let h=0;for(;;){if(g?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield cW(t,n,a,g)}catch(m){if(m?.code!==uW||h>=f)throw m;if(h++,yield dW(c,g).catch(()=>{}),g?.aborted){const _=new Error("Aborted");throw _.name="AbortError",_}u>0&&(yield new Promise(_=>globalThis.setTimeout(_,u*h)))}}})}function oa(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function fW(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 h1(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=fW(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 p1(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 IA(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function m1(e,t=360,n=500){return IA(e,t,n)}function g1(e,t=360,n=500){return IA(e,t,n)}var hW=Object.defineProperty,pW=Object.defineProperties,mW=Object.getOwnPropertyDescriptors,S_=Object.getOwnPropertySymbols,gW=Object.prototype.hasOwnProperty,vW=Object.prototype.propertyIsEnumerable,x_=(e,t,n)=>t in e?hW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,et=(e,t)=>{for(var n in t||(t={}))gW.call(t,n)&&x_(e,n,t[n]);if(S_)for(var n of S_(t))vW.call(t,n)&&x_(e,n,t[n]);return e},At=(e,t)=>pW(e,mW(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 yW="__global__",qm="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",v1=(()=>{const e=globalThis;if(e[qm])return e[qm];const t={scopedCustomComponents:{},revision:gl(0)};return e[qm]=t,t})(),T_=v1.revision,kW=Symbol("markstreamCustomComponents"),bW=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 _u(e){return bW.has(String(e).trim().toLowerCase())}function wW(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function jm(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([Ds(n),Ds(wW(n))]))!s||_u(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function qn(e){const t=Bt(kW,null);return F(()=>{var n;return T_.value,(function(o,s={}){return T_.value,et(et(et({},jm(v1.scopedCustomComponents[yW]||{})),jm(s)),jm((function(i){return i&&v1.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const _W=["aria-label"],CW={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"},SW={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},fs=Jt(Qe({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(C(),E("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(C(),E("svg",SW,[...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(),E("svg",CW,[...n[0]||(n[0]=[p("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,_W))}),[["__scopeId","data-v-be21ab83"]]);fs.install=e=>{e.component(fs.__name,fs)};const xW={class:"emoji-node"},jo=Jt(Qe({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(C(),E("span",xW,P(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);jo.install=e=>{e.component(jo.__name,jo)};const TW=["id"],AW=["title"],hs=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(),E("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,AW)],8,TW))}}),[["__scopeId","data-v-c1463a29"]]);hs.install=e=>{e.component(hs.__name,hs)};const $A=(()=>{try{return!1}catch{}return!1})();function zm(e){$A&&console.warn(e)}function A_(e,t="safe",n){return Qv(e,t,n)}function NA(e){return vH(e)}function Vm(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function o0(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=c1((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),Vm(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Vm(r.value)]):Object.entries(s).map(([r,l])=>[r,Vm(l)]):null,t,n);var s;if(!o)return;const i=NA(jf(o));return Object.keys(i).length>0?i:void 0}function M_(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 ac(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Km(e,t,n,o,s,i,r=!1){const l=(function(d,f){return mA(d,f)})(e,o);if(ku.has(e.toLowerCase())||!l&&fA(e,i))return null;if(!l&&Xv(e,i))return r?[M_(e,t,!0)]:[M_(e,t),...n,`</${e}>`];const a=Qv(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=NA(a);return Zt(d,At(et({},f),{key:u}),n.length>0?n:void 0)}return Zt(e,At(et({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function LA(e,t){return wH(e,t)}function Vf(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const f=Km(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);ac(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let g=-1;for(let h=c.length-1;h>=0;h--)if(c[h].tagName.toLowerCase()===f){g=h;break}if(g!==-1)for(;c.length>g;){const h=c.pop(),m=Km(h.tagName,h.attrs||{},h.children,r,h.autoKey,l);c.length>0?ac(c[c.length-1].children,m):ac(u,m),h.tagName.toLowerCase()!==f&&c.length>g&&zm(`Auto-closing unclosed tag: <${h.tagName}>`)}else zm(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=Km(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?ac(c[c.length-1].children,f):ac(u,f),zm(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(yH(e),t,n)}catch(s){return o=s,$A&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const MW=["innerHTML"],ps=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=qn(()=>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:va(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Vf(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!LA(l,s.value))return{mode:"html",content:va(l,o.value)};const a=Vf(l,s.value,o.value);return a===null?{mode:"html",content:va(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(C(),E("span",{key:0,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[vt(x(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(C(),E("span",{key:1,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},P(r.value.content),3)):(C(),E("span",{key:2,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,MW))}}),[["__scopeId","data-v-d17f12b0"]]);ps.install=e=>{e.component(ps.__name,ps)};const EW={class:"inline-code"},IW={key:0},_o=Jt(Qe({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=mu(),o=Bt("markstreamFade",void 0),s=Bt("markstreamTextStreamState",void 0),i=Bt("markstreamStreamVersion",void 0),r=F(()=>{const k=n.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),l=F(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=F(()=>{var k;return String((k=t.node.code)!=null?k:"")}),c=F(()=>!l.value),u=F(()=>{var k;const b=(k=n["index-key"])!=null?k:n.indexKey;return b==null||b===""?"":String(b)}),d=ne(t.node.code),f=ne("");let g=i?.value;const h=ne(0);function m(){return d.value+f.value}function _(){f.value&&(d.value=m(),f.value="")}ze([()=>t.node.code,u,l,()=>i?.value],([k,b,y,S])=>{const L=String(k??""),N=u.value,v=S!==g;g=S;const M=kA({nextContent:L,persistedContent:N?s?.get(N):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:v});d.value=M.settledContent,f.value=M.streamedDelta,M.appended&&(h.value+=1),N&&s?.set(N,L)},{immediate:!0}),ze(l,k=>{var b;k||(b=m(),d.value=b,f.value="")});const w=F(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(k,b)=>(C(),E("code",EW,[c.value?(C(),E(Oe,{key:0},[ft(P(a.value),1)],64)):(C(),E(Oe,{key:1},[d.value?(C(),E("span",IW,P(d.value),1)):ie("",!0),f.value?(C(),E("span",{key:1,class:Pe(["inline-code-stream-delta",[w.value]]),onAnimationend:_},P(f.value),35)):ie("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);_o.install=e=>{e.component(_o.__name,_o)};const y1=ne(!1),E_=ne(""),I_=ne("top"),Pc=ne(null),Oc=ne(null),k1=ne(null),b1=ne(null),$_=ne(null);let qd=null,jd=null,w1=0;function PA(){qd&&(clearTimeout(qd),qd=null),jd&&(clearTimeout(jd),jd=null)}let _d=!1,Cd=null,N_=!1;function $W(e,t,n="top",o=!1,s,i){if(!e)return;const r=++w1;PA();const l=()=>Cn(null,null,function*(){var a,c;if(yield(function(){return Cn(this,null,function*(){if(!_d&&!N_&&typeof document<"u"){Cd!=null||(Cd=Cn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([cs(()=>import("./vue.runtime.esm-bundler-C_eIrEdV.js"),[]),cs(()=>import("./Tooltip-DjdYJu5x.js"),[])]),g=document.createElement("div");g.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(g),u({setup:()=>()=>{var h;return d(f,{visible:y1.value,"anchor-el":Pc.value,content:E_.value,placement:I_.value,id:Oc.value,originX:k1.value,originY:b1.value,isDark:(h=$_.value)!=null?h:void 0})}}).mount(g),_d=!0}));try{yield Cd}catch(u){_d=!1,Cd=null,N_=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),_d&&r===w1){Oc.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Pc.value=e,E_.value=t,I_.value=n,k1.value=(a=s?.x)!=null?a:null,b1.value=(c=s?.y)!=null?c:null,$_.value=typeof i=="boolean"?i:null,y1.value=!0;try{e.setAttribute("aria-describedby",Oc.value)}catch{}}});o?l():qd=setTimeout(l,80)}function NW(e=!1){w1+=1,PA();const t=()=>{if(Pc.value&&Oc.value)try{Pc.value.removeAttribute("aria-describedby")}catch{}y1.value=!1,Pc.value=null,Oc.value=null,k1.value=null,b1.value=null};e?t():jd=setTimeout(t,120)}const _1={"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..."},C1=e=>{var t;return(t=_1[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 L_(e){return{t(t){if(e.te&&_1[t]&&!e.te(t))return C1(t);const n=e.t(t);return n===t&&_1[t]?C1(t):n}}}function LW(){const e=(function(){var t,n;try{const o=fo(),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 L_(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return L_({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:C1}}function PW(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 OW=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],RW={key:1,class:"image-placeholder"},DW={key:1,class:"image-node__raw-text"},BW={key:0,class:"image-shimmer-overlay"},FW={key:1,class:"image-node__raw-text"},HW={key:2,class:"image-error"},yr=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=mu(),u=Bt(u1,null);let d="",f=null;const g=F(()=>yw(n.node.src)),h=F(()=>yw(n.fallbackSrc)),m=F(()=>r.value),_=F(()=>!n.lazy),w=F(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),k=F(()=>l.value==="failed"),b=F(()=>!_.value&&!s.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=F(()=>PW(n,c));function S(R=y.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function L(R=y.value){R&&ht(()=>{S(R)})}function N(){f&&(clearTimeout(f),f=null)}function v(){const R=y.value;R&&d!==R&&(d&&u?.markSettled(d),N(),d=R,u?.markPending(R),typeof window<"u"&&(f=window.setTimeout(()=>{d===R&&(L(R),M())},8e3)))}function M(){return Cn(this,null,function*(){const R=d;R&&(N(),d="",yield ht(),S(R),u?.markSettled(R))})}function $(){if(l.value==="primary"&&h.value&&h.value!==r.value)return l.value="fallback",r.value=h.value,s.value=!1,i.value=!1,void L();l.value="failed",i.value=!0,o("error",r.value),L()}function O(){s.value=!0,i.value=!1,o("load",m.value),L()}function T(R){R.preventDefault(),s.value&&!i.value&&o("click",[R,m.value])}const{t:I}=LW();return ze([g,h,()=>n.node.loading],()=>(s.value=!1,i.value=!1,n.node.loading||g.value?(r.value=g.value,void(l.value="primary")):h.value?(r.value=h.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),ze([w,s,i,m,()=>n.lazy],([R,D,W,V,U])=>R&&V&&!W?D?(M(),void L()):U?(v(),void L()):void(D||W||v()):(M(),void L()),{flush:"post",immediate:!0}),Yo(()=>{(function(){const R=d;R&&(N(),d="",u?.markSettled(R))})()}),(R,D)=>{var W,V,U,J,K;return C(),E("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[w.value?(C(),E("img",{key:0,src:m.value,alt:String((V=(W=n.node.alt)!=null?W:n.node.title)!=null?V:""),title:String((J=(U=n.node.title)!=null?U:n.node.alt)!=null?J:""),class:Pe(["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:x(I)("image.preview"),onError:$,onLoad:O,onClick:T},null,42,OW)):ie("",!0),e.node.loading&&!i.value?(C(),E("span",RW,[n.usePlaceholder?ca(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=p("span",{class:"image-shimmer"},null,-1))],!0):(C(),E("span",DW,P(e.node.raw),1))])):ie("",!0),vt(Fi,{name:"shimmer-fade"},{default:$n(()=>[b.value&&!e.node.loading?(C(),E("span",BW,[n.usePlaceholder?ca(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=p("span",{class:"image-shimmer"},null,-1))],!0):(C(),E("span",FW,P(e.node.raw),1))])):ie("",!0)]),_:3}),k.value?(C(),E("span",HW,[ca(R.$slots,"error",{node:n.node,displaySrc:m.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(x(I)("image.loadError")),1)],!0)])):ie("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);yr.install=e=>{e.component(yr.__name,yr)};const WW={key:2},di=Qe({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=qn(()=>t.customId),o=Bt("markstreamHtmlPolicy",void 0),s=Bt("markstreamNestedRendererProps",void 0),i=F(()=>{var h;return(h=o?.value)!=null?h:"safe"}),r=F(()=>{var h,m;const _=(h=s?.value)!=null?h:{};return At(et({},_),{customId:(m=t.customId)!=null?m:_.customId,htmlPolicy:i.value})}),l=ai({loader:()=>Promise.resolve().then(()=>u0),suspensible:!1}),a=F(()=>t.components[String(t.node.type)]),c=F(()=>!!(a.value&&n.value[t.node.type]&&!_u(String(t.node.type)))),u=F(()=>c.value?o0(t.node,i.value):void 0),d=F(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=F(()=>{var h;return String((h=t.node.content)!=null?h:"")}),g=F(()=>{var h,m;return String((m=(h=t.node.content)!=null?h:t.node.raw)!=null?m:"")});return(h,m)=>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(x(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"])):f.value?(C(),Ve(x(l),en({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(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(),E("span",WW,P(g.value),1)):ie("",!0)}}),UW=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],qW={key:0,translate:"no",class:"markstream-pre__diff-code"},jW={class:"markstream-pre__diff-number","aria-hidden":"true"},zW={class:"markstream-pre__diff-content"},VW={class:"markstream-pre__diff-content-inner"},KW={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},GW=["textContent"],ss=Qe({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=F(()=>{var T,I,R;const D=String((I=(T=t.node)==null?void 0:T.language)!=null?I:"");return String((R=String(D).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=F(()=>`language-${n.value}`),s=F(()=>{var T,I,R,D,W;return((T=t.node)==null?void 0:T.diff)===!0?String((R=(I=t.node)==null?void 0:I.code)!=null?R:""):(function(V,U){const J=String(V??"");return U?J:J.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)},(T,I)=>I+1)),l=F(()=>{var T;return t.showLineNumbers===!0&&((T=t.node)==null?void 0:T.diff)===!0}),a=F(()=>l.value&&t.diffInline===!0),c=F(()=>{const T=Number(t.reservedHeightPx);if(!Number.isFinite(T)||T<=0)return;const I=`${Math.ceil(T)}px`;return{height:I,minHeight:I,maxHeight:I,overflow:"auto"}});function u(T){return String(T??"").trim().length===0}function d(T,I="context",R={}){const D=u(T);return{code:T,kind:D&&I!=="hunk"&&!R.preserveBlankKind?"context":I,empty:D}}function f(T){const I=String(T??"");return I?I.split(/\r\n|\n|\r/):[]}function g(T,I){return!u(T[I])||I<T.length-1}function h(T){return T.startsWith("-")&&!T.startsWith("---")}function m(T){return T.startsWith("+")&&!T.startsWith("+++")}function _(T,I){const R=f(T),D=f(I),W=(function(X,ke){const le=X.length,We=ke.length;if((le+1)*(We+1)>15e5)return null;const ue=We+1,ve=new Uint32Array((le+1)*(We+1));for(let ce=1;ce<=le;ce++)for(let Se=1;Se<=We;Se++){const j=ce*ue+Se;if(X[ce-1]===ke[Se-1])ve[j]=ve[(ce-1)*ue+(Se-1)]+1;else{const te=ve[(ce-1)*ue+Se],he=ve[ce*ue+(Se-1)];ve[j]=te>=he?te:he}}const Ne=[];let Re=le,Q=We;for(;Re>0&&Q>0;)X[Re-1]===ke[Q-1]?(Ne.push({originalIndex:Re-1,modifiedIndex:Q-1}),Re--,Q--):ve[(Re-1)*ue+Q]>=ve[Re*ue+(Q-1)]?Re--:Q--;return Ne.reverse(),Ne})(R,D);if(W){const X=[];let ke=0,le=0;for(const We of W){for(;ke<We.originalIndex;)X.push(At(et({},d(R[ke],"removed",{preserveBlankKind:g(R,ke)})),{key:`inline-removed-source-${ke}`,number:""})),ke++;for(;le<We.modifiedIndex;)X.push(At(et({},d(D[le],"added",{preserveBlankKind:g(D,le)})),{key:`inline-added-source-${le}`,number:le+1})),le++;X.push(At(et({},d(D[We.modifiedIndex])),{key:`inline-context-source-${We.originalIndex}-${We.modifiedIndex}`,number:We.modifiedIndex+1})),ke=We.originalIndex+1,le=We.modifiedIndex+1}for(;ke<R.length;)X.push(At(et({},d(R[ke],"removed",{preserveBlankKind:g(R,ke)})),{key:`inline-removed-source-${ke}`,number:""})),ke++;for(;le<D.length;)X.push(At(et({},d(D[le],"added",{preserveBlankKind:g(D,le)})),{key:`inline-added-source-${le}`,number:le+1})),le++;return X}const V=[];let U=0,J=R.length-1,K=D.length-1;for(;U<=J&&U<=K&&R[U]===D[U];)V.push(At(et({},d(D[U])),{key:`inline-prefix-${U}`,number:U+1})),U++;const G=[];for(;J>=U&&K>=U&&R[J]===D[K];)G.unshift(At(et({},d(D[K])),{key:`inline-suffix-${K}`,number:K+1})),J--,K--;for(let X=U;X<=J;X++)V.push(At(et({},d(R[X],"removed",{preserveBlankKind:g(R,X)})),{key:`inline-removed-source-${X}`,number:""}));for(let X=U;X<=K;X++)V.push(At(et({},d(D[X],"added",{preserveBlankKind:g(D,X)})),{key:`inline-added-source-${X}`,number:X+1}));return V.concat(G)}const w=F(()=>{var T,I,R,D;const W=(function(K){const G=K.some(ke=>h(ke)),X=K.some(ke=>m(ke));return G&&X||(function(){var ke,le,We,ue;if(n.value==="diff")return!0;const ve=(ue=(We=String((le=(ke=t.node)==null?void 0:ke.raw)!=null?le:"").split(/\r?\n/,1)[0])==null?void 0:We.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(At(et({},d(le,"hunk")),{key:`inline-hunk-${ke}`,number:""}));else if(h(le))G.push(At(et({},d(le.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ke}`,number:""}));else if(m(le))G.push(At(et({},d(le.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${ke}`,number:X++}));else{const We=le.startsWith(" ")?le.slice(1):le;G.push(At(et({},d(We)),{key:`inline-context-${ke}`,number:X})),X++}return G})(i.value):_((T=t.node)==null?void 0:T.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!W&&V){const K=f((R=t.node)==null?void 0:R.originalCode),G=f((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 At(et({},d(X,le,{preserveBlankKind:g(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 At(et({},d(X,le,{preserveBlankKind:g(G,ke)})),{key:`modified-${ke}`,number:ke+1})})}]}const U=[],J=[];for(const K of i.value)if(K.startsWith("@@"))U.push(d(K,"hunk")),J.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("+++"))J.push(d(K.slice(1),"added",{preserveBlankKind:!0}));else{const G=K.startsWith(" ")?K.slice(1):K;U.push(d(G)),J.push(d(G))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((K,G)=>At(et({},K),{key:`original-${G}`,number:G+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:J.map((K,G)=>At(et({},K),{key:`modified-${G}`,number:G+1}))}]}),k=F(()=>{const T=n.value;return T?`Code block: ${T}`:"Code block"}),b=ne(null),y=ne([]);let S=null,L=null;function N(T){const I=Number.parseFloat(String(T??""));return Number.isFinite(I)&&I>0?I:0}function v(T,I){var R;if(!T)return I;const D=T.querySelector(".markstream-pre__diff-content"),W=D?.getBoundingClientRect(),V=(R=W?.height)!=null?R:0;return Math.max(I,Math.ceil(V))}function M(){typeof window<"u"&&(S!=null&&window.cancelAnimationFrame(S),S=window.requestAnimationFrame(()=>{(function(){var T,I;S=null;const R=b.value;if(!R||!l.value)return void(y.value.length&&(y.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 We=N(ke.lineHeight);return We>0?We: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),J=[];for(let X=0;X<U;X++){const ke=v((T=W[X])!=null?T:null,D),le=v((I=V[X])!=null?I:null,D),We=Math.max(D,ke,le);J.push({rowHeight:We,originalHeight:ke,modifiedHeight:le})}var K,G;K=y.value,G=J,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})||(y.value=J)})()}))}function $(T){L?.disconnect(),L=null,T&&l.value&&typeof ResizeObserver<"u"&&(L=new ResizeObserver(()=>{M()}),L.observe(T))}function O(T,I){const R=y.value[T];if(!R)return;const D=I==="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,T=>{$(T),ht(()=>M())},{flush:"post"}),ze([l,w],()=>{$(b.value),ht(()=>M())},{flush:"post",immediate:!0}),Yo(()=>{S!=null&&(window.cancelAnimationFrame(S),S=null),L?.disconnect(),L=null}),(T,I)=>(C(),E("pre",{ref_key:"preRef",ref:b,style:Wt(c.value),class:Pe([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":k.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(C(),E("code",qW,[(C(!0),E(Oe,null,Xe(w.value,R=>(C(),E("span",{key:R.key,class:Pe(["markstream-pre__diff-pane",R.className])},[(C(!0),E(Oe,null,Xe(R.lines,(D,W)=>(C(),E("span",{key:D.key,class:Pe(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:Wt(O(W,R.key))},[I[0]||(I[0]=p("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),p("span",jW,P(D.number),1),p("span",zW,[p("span",VW,P(D.code),1)])],6))),128))],2))),128))])):(C(),E(Oe,{key:1},[t.showLineNumbers?(C(),E("span",KW,[(C(!0),E(Oe,null,Xe(r.value,R=>(C(),E("span",{key:R,class:"markstream-pre__line-number"},P(R),1))),128))])):ie("",!0),p("code",{translate:"no",class:"markstream-pre__code",textContent:P(s.value)},null,8,GW)],64))],14,UW))}});ss.install=e=>{e.component(ss.__name,ss)};const Gm=gl(!1);let P_=null;const YW={key:0},Nn=Jt(Qe({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(P_||(P_=n0().then(w=>{Gm.value=!!w}).catch(()=>{Gm.value=!1})),tf(Gm)),o=mu(),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 k=(w=o["index-key"])!=null?w:o.indexKey;return k==null||k===""?"":String(k)}),u=ne(t.node.content),d=ne("");let f=r?.value;const g=ne(0);function h(){return u.value+d.value}function m(){d.value&&(u.value=h(),d.value="")}ze([()=>t.node.content,c,a,()=>r?.value],([w,k,b,y])=>{const S=String(w??""),L=c.value,N=y!==f;f=y;const v=kA({nextContent:S,persistedContent:L?i?.get(L):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:N});u.value=v.settledContent,d.value=v.streamedDelta,v.appended&&(g.value+=1),L&&i?.set(L,S)},{immediate:!0}),ze(a,w=>{var k;w||(k=h(),u.value=k,d.value="")});const _=F(()=>g.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(w,k)=>(C(),E("span",{class:Pe([[x(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(C(),E("span",YW,P(u.value),1)):ie("",!0),d.value?(C(),E("span",{key:1,class:Pe(["text-node-stream-delta",[_.value]]),onAnimationend:m},P(d.value),35)):ie("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Nn.install=e=>{e.component(Nn.__name,Nn)};const OA=Qe({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var o;return Zt(ss,At(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"}))}}}),Ym=ai({loader:()=>Cn(null,null,function*(){try{return(yield cs(()=>import("./CodeBlockNode-QzsUDFhj.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),ss}}),loadingComponent:OA,delay:0,suspensible:!1}),Gs=ai(()=>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,At(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 n0())return(yield cs(()=>import("./index6-BsyLzjzN.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,At(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:""}$`}}))}})),RA=ai(()=>Cn(null,null,function*(){try{if(yield n0())return(yield cs(()=>import("./index5-BD3g_HrT.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,At(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:""}$$`}}))}})),Eo=Jt(Qe({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(C(),E("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"]]);Eo.install=e=>{e.component(Eo.__name,Eo)};const XW={class:"superscript-node"},zo=Jt(Qe({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:No,html_inline:ps,strong:Io,emphasis:Lo,footnote_reference:hs,strikethrough:$o,highlight:ms,insert:Ko,subscript:Vo,emoji:jo,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("sup",XW,[(C(!0),E(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(x(di),{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"]]);zo.install=e=>{e.component(zo.__name,zo)};const QW={class:"subscript-node"},Vo=Jt(Qe({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:No,html_inline:ps,strong:Io,emphasis:Lo,footnote_reference:hs,strikethrough:$o,highlight:ms,insert:Ko,superscript:zo,emoji:jo,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("sub",QW,[(C(!0),E(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(x(di),{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"]]);Vo.install=e=>{e.component(Vo.__name,Vo)};const ZW={class:"strong-node"},Io=Jt(Qe({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:No,html_inline:ps,emphasis:Lo,strikethrough:$o,highlight:ms,insert:Ko,subscript:Vo,superscript:zo,emoji:jo,footnote_reference:hs,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("strong",ZW,[(C(!0),E(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(x(di),{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"]]);Io.install=e=>{e.component(Io.__name,Io)};const JW={class:"strikethrough-node"},$o=Jt(Qe({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:No,html_inline:ps,strong:Io,emphasis:Lo,highlight:ms,insert:Ko,subscript:Vo,superscript:zo,emoji:jo,footnote_reference:hs,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("del",JW,[(C(!0),E(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(x(di),{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"]]);$o.install=e=>{e.component($o.__name,$o)};const eU=["href","title","aria-label","aria-hidden","target","rel"],tU=["aria-hidden"],nU={class:"link-text-wrapper relative inline-flex"},oU={class:"leading-[normal] link-text"},No=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,k,b,y,S;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",N=(w=t.animationOpacity)!=null?w:.35,v=Math.max(.12,Math.min(.5*N,N)),M={"--underline-height":`${(k=t.underlineHeight)!=null?k:2}px`,"--underline-bottom":L,"--underline-opacity":String(N),"--underline-rest-opacity":String(v),"--underline-duration":`${(b=t.animationDuration)!=null?b:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(S=t.animationIteration)!=null?S:"infinite"};return t.color&&(M["--link-color"]=t.color),M}),i=qn(()=>t.customId),r=F(()=>et({text:Nn,strong:Io,strikethrough:$o,emphasis:Lo,image:yr,html_inline:ps,inline_code:_o},i.value)),l=mu(),a=F(()=>{var w,k;const b=(w=t.node)==null?void 0:w.attrs;if(!b||typeof b!="object")return{};const y={};if(Array.isArray(b))for(const S of b)Array.isArray(S)&&S[0]&&(y[String(S[0])]=String((k=S[1])!=null?k:""));else for(const[S,L]of Object.entries(b))S&&L!=null&&L!==!1&&(y[S]=L===!0?"":String(L));return A_(y,"safe","a")}),c=F(()=>et(et({},l),a.value)),u=F(()=>{var w,k;return A_({href:String((k=(w=t.node)==null?void 0:w.href)!=null?k:"")},"safe","a").href}),d=F(()=>{if(!u.value)return;const w=c.value.target;return(typeof w=="string"?w.trim():String(w??"").trim())||(s7(u.value)?"_blank":void 0)}),f=F(()=>{var w;return String((w=d.value)!=null?w:"").trim().toLowerCase()==="_blank"}),g=F(()=>{if(!u.value)return;const w=c.value.rel,k=new Set((typeof w=="string"?w:String(w??"")).split(/\s+/).filter(Boolean)),b=new Set(Array.from(k).filter(y=>y.toLowerCase()!=="opener"));return f.value&&(b.add("noopener"),b.add("noreferrer")),b.size>0?Array.from(b).join(" "):void 0}),h=F(()=>{const w=et({},c.value);return delete w.title,delete w.href,delete w.target,delete w.rel,w});function m(){o.value&&NW()}const _=F(()=>{var w,k;const b=(w=t.node)==null?void 0:w.title;return typeof b=="string"&&b.trim().length>0?b:String((k=u.value)!=null?k:"")});return(w,k)=>{var b,y;return e.node.loading?(C(),E("span",en({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},x(l),{style:s.value}),[p("span",nU,[p("span",oU,[vt(x(Nn),{class:"leading-[normal] link-text",node:{type:"text",content:String((b=e.node.text)!=null?b:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),k[1]||(k[1]=p("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,tU)):(C(),E("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:g.value},h.value,{style:s.value,onMouseenter:k[0]||(k[0]=S=>(function(L){var N,v,M,$;if(!o.value)return;const O=L,T=O?.clientX!=null&&O?.clientY!=null?{x:O.clientX,y:O.clientY}:void 0,I=((N=t.node)==null?void 0:N.title)||((v=u.value)!=null&&v.includes("xn--")&&(($=(M=t.node)==null?void 0:M.text)!=null&&$.includes("://"))?t.node.text:u.value)||"";$W(L.currentTarget,I,"top",!1,T)})(S)),onMouseleave:m}),[(C(!0),E(Oe,null,Xe(e.node.children,(S,L)=>(C(),Ve(x(di),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:S,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,eU))}}}),[["__scopeId","data-v-367e6ca4"]]);No.install=e=>{e.component(No.__name,No)};const sU={class:"insert-node"},Ko=Jt(Qe({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:No,html_inline:ps,strong:Io,emphasis:Lo,strikethrough:$o,highlight:ms,subscript:Vo,superscript:zo,emoji:jo,footnote_reference:hs,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("ins",sU,[(C(!0),E(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(x(di),{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"]]);Ko.install=e=>{e.component(Ko.__name,Ko)};const iU={class:"highlight-node"},ms=Jt(Qe({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:No,html_inline:ps,strong:Io,emphasis:Lo,strikethrough:$o,insert:Ko,subscript:Vo,superscript:zo,emoji:jo,footnote_reference:hs,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("mark",iU,[(C(!0),E(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(x(di),{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"]]);ms.install=e=>{e.component(ms.__name,ms)};const rU={class:"emphasis-node"},Lo=Jt(Qe({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=F(()=>et({text:Nn,inline_code:_o,link:No,html_inline:ps,strong:Io,strikethrough:$o,highlight:ms,insert:Ko,subscript:Vo,superscript:zo,emoji:jo,footnote_reference:hs,math_inline:Gs,reference:Eo},n.value));return(s,i)=>(C(),E("em",rU,[(C(!0),E(Oe,null,Xe(e.node.children,(r,l)=>(C(),Ve(x(di),{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"]]);Lo.install=e=>{e.component(Lo.__name,Lo)};const lU={class:"hard-break"},kr=Jt(Qe({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(C(),E("br",lU))}),[["__scopeId","data-v-50c58f70"]]);kr.install=e=>{e.component(kr.__name,kr)};const ru=Qe({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=fr({checkbox:fs,checkbox_input:fs,emoji:jo,emphasis:Lo,hardbreak:kr,highlight:ms,inline_code:_o,insert:Ko,link:No,reference:Eo,strikethrough:$o,strong:Io,subscript:Vo,superscript:zo,text:Nn}),o=qn(()=>t.customId),s=F(()=>{const i=o.value;return Object.keys(i).length>0?et(et({},n),i):n});return(i,r)=>(C(!0),E(Oe,null,Xe(e.nodes,(l,a)=>(C(),Ve(x(di),{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 S1(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(S1)}function Kf(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(S1))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(S1)?s:null}function Ta(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 aU=["cite"],cU={key:0,dir:"auto",class:"paragraph-node"},uU=["custom-id"],zd=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=qn(()=>t.customId),o=F(()=>!!n.value.paragraph),s=F(()=>!!n.value.text),i=F(()=>Kf(t.node.children,!o.value)),r=F(()=>t.fade!==!1||s.value?null:Ta(i.value));return yn("markstreamShowTooltips",F(()=>t.showTooltips)),yn("markstreamFade",F(()=>t.fade)),(l,a)=>(C(),E("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(C(),E("p",cU,[r.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},P(r.value),9,uU)):(C(),Ve(x(ru),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(C(),Ve(x(Go),{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,aU))}}),[["__scopeId","data-v-abfecebc"]]);zd.install=e=>{e.component(zd.__name,zd)};const dU={class:"definition-list"},fU={class:"definition-term"},hU={class:"definition-desc"},Vd=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(),E("dl",dU,[(C(!0),E(Oe,null,Xe(t.node.items,(s,i)=>(C(),E(Oe,{key:i},[p("dt",fU,[vt(x(Go),{"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",hU,[vt(x(Go),{"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"]]);Vd.install=e=>{e.component(Vd.__name,Vd)};const pU=["href","title"],Rc=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(),E("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,pU))}}),[["__scopeId","data-v-e1eb37b6"]]);Rc.install=e=>{e.component(Rc.__name,Rc)};const mU=["id"],gU={class:"flex-1"},Kd=Qe({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(C(),E("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[p("div",gU,[vt(x(Go),{"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,mU))}});Kd.install=e=>{e.component(Kd.__name,Kd)};const vU=["custom-id"],x1=Jt(Qe({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=qn(()=>t.customId),o=Bt("markstreamFade",void 0),s=F(()=>o?.value!==!1||n.value.text?null:Ta(t.node.children)),i=F(()=>et({text:Nn,inline_code:_o,link:No,image:yr,strong:Io,emphasis:Lo,strikethrough:$o,highlight:ms,insert:Ko,subscript:Vo,superscript:zo,emoji:jo,checkbox:fs,checkbox_input:fs,footnote_reference:hs,hardbreak:kr,math_inline:Gs,reference:Eo},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(),E("span",{key:0,class:"text-node","custom-id":t.customId},P(s.value),9,vU)):(C(!0),E(Oe,{key:1},Xe(e.node.children,(a,c)=>(C(),Ve(x(di),{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"]]),Gf=x1;Gf.install=e=>{e.component(x1.__name,x1)};const yU={key:0,dir:"auto",class:"paragraph-node"},kU=["custom-id"],bU={dir:"auto",class:"paragraph-node"},wU=["custom-id"],ya=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 g;return(g=t.node)!=null?g:t.item}),o=qn(()=>t.customId),s=F(()=>!!o.value.paragraph),i=F(()=>!!o.value.text),r=F(()=>{var g;return Kf((g=n.value)==null?void 0:g.children,!s.value)}),l=F(()=>{var g;if(s.value)return null;const h=(g=n.value)==null?void 0:g.children;if(!Array.isArray(h)||h.length<2)return null;const m=h[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const _=h.slice(1);if(!_.every(k=>k?.type==="list"))return null;const w=Kf([m]);return w?{paragraphChildren:w,nestedLists:_}:null});function a(){return t.fade===!1&&!i.value}const c=F(()=>a()?Ta(r.value):null),u=F(()=>{var g;return a()?Ta((g=l.value)==null?void 0:g.paragraphChildren):null}),d=Object.freeze({}),f=F(()=>{const{value:g}=t;return typeof g=="number"&&Number.isFinite(g)?{value:g}:d});return yn("markstreamShowTooltips",F(()=>t.showTooltips)),yn("markstreamFade",F(()=>t.fade)),(g,h)=>{var m,_;return C(),E("li",en({class:"list-item",dir:"auto"},f.value),[r.value?(C(),E("p",yU,[c.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},P(c.value),9,kU)):(C(),Ve(x(ru),{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(),E(Oe,{key:1},[p("p",bU,[u.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},P(u.value),9,wU)):(C(),Ve(x(ru),{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),E(Oe,null,Xe(l.value.nestedLists,(w,k)=>(C(),Ve(x(Go),{key:k,nodes:[w],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${k}`,"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:h[0]||(h[0]=b=>g.$emit("copy",b))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(C(),Ve(x(Go),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(_=(m=n.value)==null?void 0:m.children)!=null?_:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:h[1]||(h[1]=w=>g.$emit("copy",w))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);ya.install=e=>{e.component(ya.__name,ya)};const ka=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=qn(()=>e.customId),n=F(()=>t.value.list_item||ya);return(o,s)=>(C(),Ve(ko(e.node.ordered?"ol":"ul"),{class:Pe(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:$n(()=>[(C(!0),E(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"]]);ka.install=e=>{e.component(ka.__name,ka)};const DA=Symbol("ViewportPriority");function _U(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:k=>window.setTimeout(()=>k({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:k=>window.clearTimeout(k):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function g(){if(f!=null){try{l?.(f)}catch{}f=null}}function h(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||g()}}function m(k){const b=u.get(k);if(b){if(!b.visible.value){b.visible.value=!0;try{b.resolve()}catch{}}try{a?.unobserve(k)}catch{}u.delete(k),d.delete(k),h()}}function _(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const k=d.values().next().value;k&&(d.delete(k),m(k),d.size&&_())},{timeout:1200}))}ze(i,k=>{if(!k){for(const b of Array.from(u.keys()))m(b);g()}},{flush:"sync"});const w=(k,b)=>{const y=ne(!1);let S,L=!1;const N=new Promise($=>{S=()=>{L||(L=!0,$())}}),v=()=>{try{a?.unobserve(k)}catch{}u.delete(k),d.delete(k),h()};if(!s||!i.value)return y.value=!0,S(),{isVisible:y,whenVisible:N,destroy:v};const M=(function($,O){if(!s)return a;if(typeof IntersectionObserver>"u")return null;const T=(function(D,W){var V,U,J;return{root:(V=e?.(D??null))!=null?V:null,rootMargin:(U=W?.rootMargin)!=null?U:"300px",threshold:(J=W?.threshold)!=null?J:0}})($,O);if(a&&(R=T,(I=c)&&I.root===R.root&&I.rootMargin===R.rootMargin&&I.threshold===R.threshold))return a;var I,R;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const W of D)(W.isIntersecting||W.intersectionRatio>0)&&m(W.target)},{root:T.root,rootMargin:T.rootMargin,threshold:T.threshold}),c=T;for(const D of u.keys())a.observe(D);return a})(k,b);return M?(u.set(k,{resolve:S,visible:y}),M.observe(k),d.add(k),_(),{isVisible:y,whenVisible:N,destroy:v}):(y.value=!0,S(),{isVisible:y,whenVisible:N,destroy:v})};return yn(DA,w),w}function CU(){var e,t;const n=Bt(DA,void 0);if(n)return n;const o=new WeakMap;let s=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const g=o.get(f);if(g){if(!g.visible.value){g.visible.value=!0;try{g.resolve()}catch{}}try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const g=ne(!1);let h,m=!1;const _=new Promise(b=>{h=()=>{m||(m=!0,b())}}),w=()=>{try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()},k=s||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(s=new IntersectionObserver(b=>{for(const y of b)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),s));return k?(o.set(f,{resolve:h,visible:g}),k.observe(f),i.add(f),d(),{isVisible:g,whenVisible:_,destroy:w}):(g.value=!0,h(),{isVisible:g,whenVisible:_,destroy:w})}}const SU={key:2,class:"html-block-node__raw"},xU=["innerHTML"],TU={key:1,class:"html-block-node__placeholder"},Dc=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 v=(L=o?.value)!=null?L:{};return At(et({},v),{customId:(N=t.customId)!=null?N:v.customId,htmlPolicy:s.value})}),r=ai({loader:()=>Promise.resolve().then(()=>u0),suspensible:!1}),l=F(()=>{const L=c1(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=c1(t.node.attrs,s.value,L);if(!N)return;const v=jf(N);return Object.keys(v).length>0?v:void 0}),c=qn(()=>t.customId),u=Qe({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=ne(null),f=ne(typeof window>"u"),g=ne(t.node.content),h=F(()=>Array.isArray(t.node.children)?t.node.children:[]),m=F(()=>String(t.node.tag||"div")),_=F(()=>{const L=m.value.trim().toLowerCase();return _T.has(L)||Xv(L,s.value)}),w=F(()=>h.value.length>0&&!!t.node.tag&&!_.value),k=F(()=>{var L,N,v;if(w.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(L=g.value)!=null?L:""};const M=(N=g.value)!=null?N:t.node.content;if(!M)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:va(M,s.value)};if(t.node.loading){const O=Vf(M,c.value,s.value);return O===null?{mode:"text",content:(v=t.node.raw)!=null?v:M}:{mode:"dynamic",nodes:O}}if(!LA(M,c.value))return{mode:"html",content:va(M,s.value)};const $=Vf(M,c.value,s.value);return $===null?{mode:"html",content:va(M,s.value)}:{mode:"dynamic",nodes:$}}),b=CU(),y=ne(null),S=!!t.node.loading;return typeof window<"u"?(ze(d,L=>{var N,v;if((v=(N=y.value)==null?void 0:N.destroy)==null||v.call(N),y.value=null,!S)return f.value=!0,void(g.value=t.node.content);if(!L)return void(f.value=!1);const M=b(L,{rootMargin:"400px"});y.value=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),ze(()=>t.node.content,L=>{S&&!f.value||(g.value=L)})):f.value=!0,Yo(()=>{var L,N;(N=(L=y.value)==null?void 0:L.destroy)==null||N.call(L),y.value=null}),(L,N)=>(C(),Ve(ko(w.value?m.value:"div"),en({ref_key:"htmlRef",ref:d,class:"html-block-node"},w.value?a.value:void 0),{default:$n(()=>[f.value?(C(),E(Oe,{key:0},[k.value.mode==="structured"?(C(),Ve(x(r),en({key:0},i.value,{nodes:h.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):k.value.mode==="dynamic"?(C(),Ve(x(u),{key:1,nodes:k.value.nodes},null,8,["nodes"])):k.value.mode==="text"?(C(),E("pre",SU,P(k.value.content),1)):(C(),E("div",en({key:3},l.value,{innerHTML:k.value.content}),null,16,xU))],64)):(C(),E("div",TU,[ca(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"]]);Dc.install=e=>{e.component(Dc.__name,Dc)};const AU={dir:"auto",class:"paragraph-node"},MU=["custom-id"],dl=Jt(Qe({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=qn(()=>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 v;return(v=o?.value)!=null?v:"safe"}),c=F(()=>{var v;return(v=t.parseOptions)!=null?v:i?.value}),u=F(()=>{var v;return(v=t.customMarkdownIt)!=null?v:r?.value}),d=F(()=>{var v,M;return(M=t.customHtmlTags)!=null?M:(v=l?.value)==null?void 0:v.customHtmlTags}),f=F(()=>{var v,M;const $=(v=l?.value)!=null?v:{};return At(et({},$),{customId:(M=t.customId)!=null?M:$.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),g=ai({loader:()=>Promise.resolve().then(()=>u0),suspensible:!1});function h(v){var M;return v.type==="text"&&String((M=v.content)!=null?M:"").trim()===""}const m=F(()=>t.node.children.filter(v=>!h(v))),_=F(()=>m.value.length>0&&m.value.every(v=>v.type==="image"||(function(M){var $;const O=(function(T){return T.type==="link"&&Array.isArray(T.children)?T.children.filter(I=>!h(I)):[]})(M);return O.length===1&&(($=O[0])==null?void 0:$.type)==="image"})(v))),w=F(()=>new Set(Ia(d.value))),k=F(()=>{if(!_.value||m.value.length<=1)return t.node.children;const v=[];for(let M=0;M<t.node.children.length;M++){const $=t.node.children[M];if(!h($)){v.push($);continue}const O=v.length>0,T=t.node.children.slice(M+1).some(I=>!h(I));O&&T&&v.push(At(et({},$),{content:" ",raw:" "}))}return v}),b=F(()=>s?.value===!1&&!n.value.text),y=F(()=>b.value?Ta(k.value):null);function S(v,M){return{node:v,"index-key":`${t.indexKey}-${M}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=F(()=>et({inline_code:_o,image:yr,link:No,hardbreak:kr,emphasis:Lo,strong:Io,strikethrough:$o,highlight:ms,insert:Ko,subscript:Vo,superscript:zo,html_inline:ps,html_block:Dc,emoji:jo,checkbox:fs,math_inline:Gs,checkbox_input:fs,reference:Eo,footnote_anchor:Rc,footnote_reference:hs,text:Nn},n.value)),N=F(()=>k.value.map((v,M)=>{var $;const O=(function(T){var I,R,D,W;if(T.type==="html_block"||T.type==="html_inline"){const V=String((I=T.tag)!=null?I:"").trim().toLowerCase()||TT(T.content);if(V&&!w.value.has(V)&&AT((R=T.content)!=null?R:T.raw,V)){const U=String((W=(D=T.content)!=null?D:T.raw)!=null?W:"");return{child:{type:"text",content:U,raw:U},component:Nn,isCustomComponent:!1}}}return{child:T,component:L.value[T.type],isCustomComponent:!!(n.value[T.type]&&!_u(String(T.type)))}})(v);return At(et({},O),{index:M,key:`${t.indexKey||"paragraph"}-${M}`,customAttrs:O.isCustomComponent?o0(O.child,a.value):void 0,hasSlotChildren:Array.isArray(O.child.children)&&O.child.children.length>0,slotContent:String(($=O.child.content)!=null?$:""),originalChild:v})}));return(v,M)=>(C(),E("p",AU,[y.value!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},P(y.value),9,MU)):(C(!0),E(Oe,{key:1},Xe(N.value,$=>{return C(),E(Oe,{key:$.key},[_.value&&h($.originalChild)?(C(),E(Oe,{key:0},[ft(P((O=$.originalChild,String((T=O.content)!=null?T:""))),1)],64)):$.isCustomComponent?(C(),Ve(ko($.component),en({key:1,ref_for:!0},$.customAttrs,{node:$.child,loading:$.child.loading,"index-key":$.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:$n(()=>[$.hasSlotChildren?(C(),Ve(x(g),en({key:0,ref_for:!0},f.value,{nodes:$.child.children,"index-key":$.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):$.slotContent?(C(),Ve(x(g),en({key:1,ref_for:!0},f.value,{content:$.slotContent,final:!$.child.loading,"index-key":`${$.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(C(),Ve(ko($.component),en({key:2,ref_for:!0},S($.child,$.index)),null,16))],64);var O,T}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);dl.install=e=>{e.component(dl.__name,dl)};const EU={class:"table-node-wrapper"},IU=["aria-busy"],$U={key:0},NU=["custom-id"],LU=["aria-label","onPointerdown"],PU=["custom-id"],OU={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Bc=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=qn(()=>t.customId),d=F(()=>!!u.value.text),f=F(()=>!!u.value.paragraph),g=new WeakMap;function h(w){const k=t.fade===!1&&!d.value,b=!f.value,y=g.get(w);if(y?.children===w.children&&y.textFastPath===k&&y.paragraphFastPath===b)return y.info;const S=Kf(w.children,b,!0),L={simpleChildren:S,plainText:S&&k?Ta(S):null};return g.set(w,{children:w.children,textFastPath:k,paragraphFastPath:b,info:L}),L}function m(w){if(!r)return;w.preventDefault();const k=r.startWidth+r.nextStartWidth,b=Math.min(48,Math.floor(k/2)),y=Math.max(b,Math.min(k-b,Math.round(r.startWidth+w.clientX-r.startX))),S=[...r.widths];S[r.index]=y,S[r.index+1]=k-y,i.value=S}function _(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),r=null)}return ze(l,()=>{_(),i.value=[]}),Yo(_),(w,k)=>(C(),E("div",EU,[p("table",{ref_key:"tableRef",ref:s,class:Pe(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(C(),E("colgroup",$U,[(C(!0),E(Oe,null,Xe(e.node.header.cells,(b,y)=>(C(),E("col",{key:y,style:Wt(c.value[y])},null,4))),128))])):ie("",!0),p("thead",null,[p("tr",null,[(C(!0),E(Oe,null,Xe(e.node.header.cells,(b,y)=>(C(),E("th",{key:y,dir:"auto",class:Pe([b.align==="right"?"text-right":b.align==="center"?"text-center":"text-left"])},[h(b).plainText!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},P(h(b).plainText),9,NU)):h(b).simpleChildren?(C(),Ve(x(ru),{key:1,nodes:h(b).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(C(),Ve(x(Go),{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:k[0]||(k[0]=S=>w.$emit("copy",S))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(C(),E("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:S=>(function(L,N){if(N.button!==0)return;const v=(function(){var O;const T=(O=s.value)==null?void 0:O.querySelectorAll("thead th");return Array.from(T??[],I=>Math.round(I.getBoundingClientRect().width))})(),M=v[L],$=v[L+1];M&&$&&(N.preventDefault(),r={index:L,startX:N.clientX,startWidth:M,nextStartWidth:$,widths:v},i.value=v,window.addEventListener("pointermove",m),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_))})(y,S)},null,40,LU)):ie("",!0)],2))),128))])]),p("tbody",null,[(C(!0),E(Oe,null,Xe(o.value,(b,y)=>(C(),E("tr",{key:y},[(C(!0),E(Oe,null,Xe(b.cells,(S,L)=>(C(),E("td",{key:L,class:Pe([S.align==="right"?"text-right":S.align==="center"?"text-center":"text-left"]),dir:"auto"},[h(S).plainText!==null?(C(),E("span",{key:0,class:"text-node","custom-id":t.customId},P(h(S).plainText),9,PU)):h(S).simpleChildren?(C(),Ve(x(ru),{key:1,nodes:h(S).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${L}`},null,8,["nodes","custom-id","index-key"])):(C(),Ve(x(Go),{key:2,nodes:S.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:k[1]||(k[1]=N=>w.$emit("copy",N))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,IU),vt(Fi,{name:"table-node-fade"},{default:$n(()=>[n.value?(C(),E("div",OU,[ca(w.$slots,"loading",{isLoading:n.value},()=>[k[2]||(k[2]=p("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),k[3]||(k[3]=p("span",{class:"sr-only"},"Loading",-1))],!0)])):ie("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Bc.install=e=>{e.component(Bc.__name,Bc)};const RU={class:"hr-node"},Gd=Jt({},[["render",function(e,t){return C(),E("hr",RU)}],["__scopeId","data-v-39b2349c"]]);Gd.install=e=>{e.component(Gd.__name,Gd)};const DU={class:"unknown-node"},T1=Qe({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(C(),E("div",DU,P(e.node.raw),1))}),Yd=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=qn(()=>t.customId),s=F(()=>et({text:Nn,paragraph:dl,heading:Gf,inline_code:_o,link:No,image:yr,strong:Io,emphasis:Lo,strikethrough:$o,insert:Ko,subscript:Vo,superscript:zo,checkbox:fs,checkbox_input:fs,hardbreak:kr,math_inline:Gs,reference:Eo,list:ka,math_block:RA,table:Bc},o.value));return(i,r)=>(C(),E("div",en({class:n.value},e.node.attrs),[(C(!0),E(Oe,null,Xe(e.node.children,(l,a)=>{return C(),Ve(ko((c=l.type,s.value[c]||T1)),{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"]]);Yd.install=e=>{e.component(Yd.__name,Yd)};const BU=["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"],O_=[[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 FU(e){if(e<=255)return BU[e];let t=0,n=O_.length-1;for(;t<=n;){const o=t+n>>1,s=O_[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const HU=/[ \t\n\r\f]+/g,WU=/[\t\n\r\f]| {2,}|^ | $/;let Xm=null;const UU=new RegExp("\\p{Script=Arabic}","u"),qh=new RegExp("\\p{M}","u"),BA=new RegExp("\\p{Nd}","u");function R_(e){return UU.test(e)}function D_(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 Li(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(D_(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(D_(n))return!0}}return!1}const qU=new Set([" "," ","","\uFEFF"]);function jU(e){return Li(e)}function A1(e){return!(function(t){const n=Yf(t);return n!==null&&(s0.has(n)||pl.has(n))})(e)&&!(function(t){const n=Yf(t);return n!==null&&qU.has(n)})(e)}const s0=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),jh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),i0=new Set(["'","’"]),pl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),zU=new Set([":",".","،","؛"]),VU=new Set(["၏"]),KU=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function GU(e){if(r0(e))return!0;let t=!1;for(const n of e)if(pl.has(n))t=!0;else if(!t||!qh.test(n))return!1;return t}function YU(e){for(const t of e)if(!s0.has(t)&&!pl.has(t))return!1;return e.length>0}function XU(e){if(r0(e))return!0;for(const t of e)if(!jh.has(t)&&!i0.has(t)&&!qh.test(t))return!1;return e.length>0}function r0(e){let t=!1;for(const n of e)if(n!=="\\"&&!qh.test(n)){if(!(jh.has(n)||pl.has(n)||i0.has(n)))return!1;t=!0}return t}function FA(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 Yf(e){if(e.length===0)return null;const t=FA(e,e.length);return e.slice(t)}function QU(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(qh.test(o))n--;else{if(!jh.has(o)&&!i0.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function ZU(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function B_(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 F_(e,t){return e&&t!==null&&zU.has(t)}function JU(e){const t=Yf(e);return t!==null&&VU.has(t)}function eq(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 M1(e){let t=e.length;for(;t>0;){const n=FA(e,t),o=e.slice(n,t);if(KU.has(o))return!0;if(!pl.has(o))return!1;t=n}return!1}function tq(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 nq=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ms(e){return e.length===1?e[0]:e.join("")}function oq(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Ms(n)}function sq(e,t,n,o){if(!nq.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=tq(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:Ms(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&s.push({text:Ms(r),isWordLike:a,kind:i,start:l}),s}function Qm(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const iq=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function rq(e,t){const n=e.texts[t];return!!n.startsWith("www.")||iq.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function lq(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const aq=new Set([":","-","/","×",",",".","+","–","—"]),H_=/^[A-Za-z0-9_]+[,:;]*$/,W_=/[,:;]+$/;function U_(e){for(const t of e)if(BA.test(t))return!0;return!1}function Xd(e){if(e.length===0)return!1;for(const t of e)if(!BA.test(t)&&!aq.has(t))return!1;return!0}function q_(e,t,n){var o,s,i;const r=(Xm===null&&(Xm=new Intl.Segmenter(void 0,{granularity:"word"})),Xm);let l=0;const a=[],c=[],u=[],d=[],f=[],g=[],h=[],m=[],_=[],w=[],k=[],b=[];for(const v of r.segment(e))for(const M of sq(v.segment,(o=v.isWordLike)!=null&&o,v.index,n)){let $=function(){g[U]!==null&&(c[U]=[B_(a,g,h,U)],g[U]=null),c[U].push(M.text),u[U]=u[U]||M.isWordLike,m[U]=m[U]||I,_[U]=_[U]||R,w[U]=W,k[U]=V,b[U]=F_(_[U],D)};const O=M.kind==="text",T=ZU(M.text,M.isWordLike,M.kind),I=Li(M.text),R=R_(M.text),D=Yf(M.text),W=M1(M.text),V=JU(M.text),U=l-1;t.carryCJKAfterClosingQuote&&O&&l>0&&d[U]==="text"&&I&&m[U]&&w[U]||O&&l>0&&d[U]==="text"&&YU(M.text)&&m[U]||O&&l>0&&d[U]==="text"&&k[U]?$():O&&l>0&&d[U]==="text"&&M.isWordLike&&R&&b[U]?($(),u[U]=!0):T!==null&&l>0&&d[U]==="text"&&g[U]===T?h[U]=((s=h[U])!=null?s:1)+1:O&&!M.isWordLike&&l>0&&d[U]==="text"&&(GU(M.text)||M.text==="-"&&u[U])?$():(a[l]=M.text,c[l]=[M.text],u[l]=M.isWordLike,d[l]=M.kind,f[l]=M.start,g[l]=T,h[l]=T===null?0:1,m[l]=I,_[l]=R,w[l]=W,k[l]=V,b[l]=F_(R,D),l++)}for(let v=0;v<l;v++)g[v]===null?a[v]=Ms(c[v]):a[v]=B_(a,g,h,v);for(let v=1;v<l;v++)d[v]==="text"&&!u[v]&&r0(a[v])&&d[v-1]==="text"&&(a[v-1]+=a[v],u[v-1]=u[v-1]||u[v],a[v]="");const y=Array.from({length:l},()=>null);let S=-1;for(let v=l-1;v>=0;v--){const M=a[v];if(M.length!==0){if(d[v]==="text"&&!u[v]&&XU(M)&&S>=0&&d[S]==="text"){const $=(i=y[S])!=null?i:[];$.push(M),y[S]=$,f[S]=f[v],a[v]="";continue}S=v}}for(let v=0;v<l;v++){const M=y[v];M!=null&&(a[v]=oq(M,a[v]))}let L=0;for(let v=0;v<l;v++){const M=a[v];M.length!==0&&(L!==v&&(a[L]=M,u[L]=u[v],d[L]=d[v],f[L]=f[v]),L++)}a.length=L,u.length=L,d.length=L,f.length=L;const N=(function(v){const M=v.texts.slice(),$=v.isWordLike.slice(),O=v.kinds.slice(),T=v.starts.slice();for(let I=0;I<M.length-1;I++){if(O[I]!=="text"||O[I+1]!=="text"||!Li(M[I])||!Li(M[I+1]))continue;const R=QU(M[I]);R!==null&&(M[I]=R.head,M[I+1]=R.tail+M[I+1],T[I+1]=T[I]+R.head.length)}return{len:M.length,texts:M,isWordLike:$,kinds:O,starts:T}})((function(v){const M=[],$=[],O=[],T=[];for(let I=0;I<v.len;I++){const R=v.texts[I],D=v.kinds[I],W=v.isWordLike[I];if(D==="text"&&W&&H_.test(R)){const V=[R];let U=W_.test(R),J=I+1;for(;U&&J<v.len&&v.kinds[J]==="text"&&v.isWordLike[J]&&H_.test(v.texts[J]);){const K=v.texts[J];V.push(K),U=W_.test(K),J++}M.push(Ms(V)),$.push(!0),O.push("text"),T.push(v.starts[I]),I=J-1;continue}M.push(R),$.push(W),O.push(D),T.push(v.starts[I])}return{len:M.length,texts:M,isWordLike:$,kinds:O,starts:T}})((function(v){const M=[],$=[],O=[],T=[];for(let I=0;I<v.len;I++){const R=v.texts[I];if(v.kinds[I]==="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&&U_(U)&&Xd(U)||(W=!1)}if(W){let V=0;for(let U=0;U<D.length;U++){const J=D[U],K=U<D.length-1?`${J}-`:J;M.push(K),$.push(!0),O.push("text"),T.push(v.starts[I]+V),V+=K.length}continue}}M.push(R),$.push(v.isWordLike[I]),O.push(v.kinds[I]),T.push(v.starts[I])}return{len:M.length,texts:M,isWordLike:$,kinds:O,starts:T}})((function(v){const M=[],$=[],O=[],T=[];for(let I=0;I<v.len;I++){const R=v.texts[I],D=v.kinds[I];if(D==="text"&&Xd(R)&&U_(R)){const W=[R];let V=I+1;for(;V<v.len&&v.kinds[V]==="text"&&Xd(v.texts[V]);)W.push(v.texts[V]),V++;M.push(Ms(W)),$.push(!0),O.push("text"),T.push(v.starts[I]),I=V-1;continue}M.push(R),$.push(v.isWordLike[I]),O.push(D),T.push(v.starts[I])}return{len:M.length,texts:M,isWordLike:$,kinds:O,starts:T}})((function(v){const M=[],$=[],O=[],T=[];for(let I=0;I<v.len;I++){const R=v.texts[I];if(M.push(R),$.push(v.isWordLike[I]),O.push(v.kinds[I]),T.push(v.starts[I]),!lq(R))continue;const D=I+1;if(D>=v.len||Qm(v.kinds[D]))continue;const W=[],V=v.starts[D];let U=D;for(;U<v.len&&!Qm(v.kinds[U]);)W.push(v.texts[U]),U++;W.length>0&&(M.push(Ms(W)),$.push(!0),O.push("text"),T.push(V),I=U-1)}return{len:M.length,texts:M,isWordLike:$,kinds:O,starts:T}})((function(v){const M=v.texts.slice(),$=v.isWordLike.slice(),O=v.kinds.slice(),T=v.starts.slice();for(let R=0;R<v.len;R++){if(O[R]!=="text"||!rq(v,R))continue;const D=[M[R]];let W=R+1;for(;W<v.len&&!Qm(O[W]);){D.push(M[W]),$[R]=!0;const V=M[W].includes("?");if(O[W]="text",M[W]="",W++,V)break}M[R]=Ms(D)}let I=0;for(let R=0;R<M.length;R++){const D=M[R];D.length!==0&&(I!==R&&(M[I]=D,$[I]=$[R],O[I]=O[R],T[I]=T[R]),I++)}return M.length=I,$.length=I,O.length=I,T.length=I,{len:I,texts:M,isWordLike:$,kinds:O,starts:T}})((function(v){const M=[],$=[],O=[],T=[];let I=0;for(;I<v.len;){const R=[v.texts[I]];let D=v.isWordLike[I],W=v.kinds[I],V=v.starts[I];if(W==="glue"){const U=[R[0]],J=V;for(I++;I<v.len&&v.kinds[I]==="glue";)U.push(v.texts[I]),I++;const K=Ms(U);if(!(I<v.len&&v.kinds[I]==="text")){M.push(K),$.push(!1),O.push("glue"),T.push(J);continue}R[0]=K,R.push(v.texts[I]),D=v.isWordLike[I],W="text",V=J,I++}else I++;if(W==="text")for(;I<v.len&&v.kinds[I]==="glue";){const U=[];for(;I<v.len&&v.kinds[I]==="glue";)U.push(v.texts[I]),I++;const J=Ms(U);I<v.len&&v.kinds[I]==="text"?(R.push(J,v.texts[I]),D=D||v.isWordLike[I],I++):R.push(J)}M.push(Ms(R)),$.push(D),O.push(W),T.push(V)}return{len:M.length,texts:M,isWordLike:$,kinds:O,starts:T}})({len:L,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let v=0;v<N.len-1;v++){const M=eq(N.texts[v]);M!==null&&(N.kinds[v]!=="space"&&N.kinds[v]!=="preserved-space"||N.kinds[v+1]!=="text"||!R_(N.texts[v+1])||(N.texts[v]=M.space,N.isWordLike[v]=!1,N.kinds[v]=N.kinds[v]==="preserved-space"?"preserved-space":"space",N.texts[v+1]=M.marks+N.texts[v+1],N.starts[v+1]=N.starts[v]+M.space.length))}return N}function cq(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 ql=null;const j_=new Map;let jl=null;const uq=new RegExp("\\p{Emoji_Presentation}","u"),dq=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Zm=null;const z_=new Map;function E1(){if(ql!==null)return ql;if(typeof OffscreenCanvas<"u")return ql=new OffscreenCanvas(1,1).getContext("2d"),ql;if(typeof document<"u")return ql=document.createElement("canvas").getContext("2d"),ql;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function nr(e,t){let n=t.get(e);return n===void 0&&(n={width:E1().measureText(e).width,containsCJK:Li(e)},t.set(e,n)),n}function zh(){if(jl!==null)return jl;if(typeof navigator>"u")return jl={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},jl;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 jl={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},jl}function HA(){return Zm===null&&(Zm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Zm}function fq(e){return uq.test(e)||e.includes("️")}function Xr(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=HA();for(const a of l.segment(i))fq(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function hq(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 pq(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function V_(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i}=e;if(o.length===0)return 0;const r=t+zh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,g=0;function h(y=u,S=d,L=a){l++,a=0,c=!1,f=-1,g=0}function m(y,S){c=!0,u=y+1,d=0,a=S}function _(y,S,L){c=!0,u=y,d=S+1,a=L}function w(y,S){c?(a+=S,u=y+1,d=0):m(y,S)}function k(y,S){const L=i[y];for(let N=S;N<L.length;N++){const v=L[N];c?a+v>r?(h(),_(y,N,v)):(a+=v,u=y,d=N+1):_(y,N,v)}c&&u===y&&d===L.length&&(u=y+1,d=0)}let b=0;for(;b<o.length&&(c||(b=hq(e,b),!(b>=o.length)));){const y=o[b],S=s[b],L=S==="space"||S==="preserved-space"||S==="tab"||S==="zero-width-break"||S==="soft-hyphen";if(c)if(a+y>r){if(L){w(b,y),h(b+1,0,a-y),b++;continue}if(f>=0){if(u>f||u===f&&d>0){h();continue}h(f,0,g);continue}if(y>t&&i[b]!==null){h(),k(b,0),b++;continue}h()}else w(b,y),L&&(f=b+1,g=a-y),b++;else y>t&&i[b]!==null?k(b,0):m(b,y),L&&(f=b+1,g=a-y),b++}return c&&h(),l}let Jm=null;function mq(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,g){o=[d],s=f,i=g,r=M1(d),l=jh.has(d)}function u(d,f){o.push(d),i=i||f;const g=M1(d);r=d.length===1&&pl.has(d)&&r||g,l=!1}for(const d of(Jm===null&&(Jm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Jm).segment(e)){const f=d.segment,g=Li(f);o.length!==0?l||s0.has(f)||pl.has(f)||t.carryCJKAfterClosingQuote&&g&&r?u(f,g):i||g?(a(),c(f,d.index,g)):u(f,g):c(f,d.index,g)}return a(),n}function gq(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],o=e[0].start,s=Li(e[0].text),i=A1(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=Li(a.text),u=A1(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 vq(e,t,n,o){const s=zh(),{cache:i,emojiCorrection:r}=(function(N,v){E1().font=N;const M=(function(T){let I=j_.get(T);return I||(I=new Map,j_.set(T,I)),I})(N),$=(function(T){const I=T.match(/(\d+(?:\.\d+)?)\s*px/);return I?parseFloat(I[1]):16})(N),O=v?(function(T,I){let R=z_.get(T);if(R!==void 0)return R;const D=E1();D.font=T;const W=D.measureText("😀").width;if(R=0,W>I+.5&&typeof document<"u"&&document.body!==null){const V=document.createElement("span");V.style.font=T,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 z_.set(T,R),R})(N,$):0;return{cache:M,fontSize:$,emojiCorrection:O}})(t,(l=e.normalized,dq.test(l)));var l;const a=Xr("-",nr("-",i),r),c=8*Xr(" ",nr(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],g=[];let h=e.chunks.length<=1;const m=null,_=[],w=n?[]:null,k=Array.from({length:e.len});function b(N,v,M,$,O,T,I){O!=="text"&&O!=="space"&&O!=="zero-width-break"&&(h=!1),u.push(v),d.push(M),f.push($),g.push(O),_.push(I),w!==null&&w.push(N)}function y(N,v,M,$,O){const T=nr(N,i),I=Xr(N,T,r),R=v==="space"||v==="preserved-space"||v==="zero-width-break"?0:I,D=v==="space"||v==="zero-width-break"?0:I;if(O&&$&&N.length>1){let W="sum-graphemes";Xd(N)?W="pair-context":s.preferPrefixWidthsForBreakableRuns&&(W="segment-prefixes");const V=(function(U,J,K,G,X){if(J.breakableFitAdvances!==void 0)return J.breakableFitAdvances;const ke=HA(),le=[];for(const Ne of ke.segment(U))le.push(Ne.segment);if(le.length<=1)return J.breakableFitAdvances=null,J.breakableFitAdvances;if(X==="sum-graphemes"){const Ne=[];for(const Re of le){const Q=nr(Re,K);Ne.push(Xr(Re,Q,G))}return J.breakableFitAdvances=Ne,J.breakableFitAdvances}if(X==="pair-context"||le.length>96){const Ne=[];let Re=null,Q=0;for(const ce of le){const Se=Xr(ce,nr(ce,K),G);if(Re===null)Ne.push(Se);else{const j=Re+ce,te=nr(j,K);Ne.push(Xr(j,te,G)-Q)}Re=ce,Q=Se}return J.breakableFitAdvances=Ne,J.breakableFitAdvances}const We=[];let ue="",ve=0;for(const Ne of le){ue+=Ne;const Re=Xr(ue,nr(ue,K),G);We.push(Re-ve),ve=Re}return J.breakableFitAdvances=We,J.breakableFitAdvances})(N,T,i,r,W);return void b(N,I,R,D,v,M,V)}b(N,I,R,D,v,M,null)}for(let N=0;N<e.len;N++){k[N]=u.length;const v=e.texts[N],M=e.isWordLike[N],$=e.kinds[N],O=e.starts[N];if($==="soft-hyphen"){b(v,0,a,a,$,O,null);continue}if($==="hard-break"){b(v,0,0,0,$,O,null);continue}if($==="tab"){b(v,0,0,0,$,O,null);continue}const T=nr(v,i);if($==="text"&&T.containsCJK){const I=mq(v,s),R=o==="keep-all"?gq(I):I;for(let D=0;D<R.length;D++){const W=R[D];y(W.text,"text",O+W.start,M,o==="keep-all"||!Li(W.text))}continue}y(v,$,O,M,!0)}const S=(function(N,v,M){const $=[];for(let O=0;O<N.length;O++){const T=N[O],I=T.startSegmentIndex<v.length?v[T.startSegmentIndex]:M,R=T.endSegmentIndex<v.length?v[T.endSegmentIndex]:M,D=T.consumedEndSegmentIndex<v.length?v[T.consumedEndSegmentIndex]:M;$.push({startSegmentIndex:I,endSegmentIndex:R,consumedEndSegmentIndex:D})}return $})(e.chunks,k,u.length),L=m===null?null:(function(N,v){const M=(function(O){const T=O.length;if(T===0)return null;const I=new Array(T);let R=!1;for(let K=0;K<T;){const G=O.charCodeAt(K);let X=G,ke=1;if(G>=55296&&G<=56319&&K+1<T){const We=O.charCodeAt(K+1);We>=56320&&We<=57343&&(X=We-56320+(G-55296<<10)+65536,ke=2)}const le=FU(X);le!=="R"&&le!=="AL"&&le!=="AN"||(R=!0);for(let We=0;We<ke;We++)I[K+We]=le;K+=ke}if(!R)return null;let D=0;for(let K=0;K<T;K++){const G=I[K];if(G==="L"){D=0;break}if(G==="R"||G==="AL"){D=1;break}}const W=new Int8Array(T);for(let K=0;K<T;K++)W[K]=D;const V=1&D?"R":"L",U=V;let J=U;for(let K=0;K<T;K++)I[K]==="NSM"?I[K]=J:J=I[K];J=U;for(let K=0;K<T;K++){const G=I[K];G==="EN"?I[K]=J==="AL"?"AN":"EN":G!=="R"&&G!=="L"&&G!=="AL"||(J=G)}for(let K=0;K<T;K++)I[K]==="AL"&&(I[K]="R");for(let K=1;K<T-1;K++)I[K]==="ES"&&I[K-1]==="EN"&&I[K+1]==="EN"&&(I[K]="EN"),I[K]!=="CS"||I[K-1]!=="EN"&&I[K-1]!=="AN"||I[K+1]!==I[K-1]||(I[K]=I[K-1]);for(let K=0;K<T;K++){if(I[K]!=="EN")continue;let G;for(G=K-1;G>=0&&I[G]==="ET";G--)I[G]="EN";for(G=K+1;G<T&&I[G]==="ET";G++)I[G]="EN"}for(let K=0;K<T;K++){const G=I[K];G!=="WS"&&G!=="ES"&&G!=="ET"&&G!=="CS"||(I[K]="ON")}J=U;for(let K=0;K<T;K++){const G=I[K];G==="EN"?I[K]=J==="L"?"L":"EN":G!=="R"&&G!=="L"||(J=G)}for(let K=0;K<T;K++){if(I[K]!=="ON")continue;let G=K+1;for(;G<T&&I[G]==="ON";)G++;const X=(K>0?I[K-1]:U)!=="L"?"R":"L";if(X===((G<T?I[G]:U)!=="L"?"R":"L"))for(let ke=K;ke<G;ke++)I[ke]=X;K=G-1}for(let K=0;K<T;K++)I[K]==="ON"&&(I[K]=V);for(let K=0;K<T;K++){const G=I[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(M===null)return null;const $=new Int8Array(v.length);for(let O=0;O<v.length;O++)$[O]=M[v[O]];return $})(e.normalized,m);return w!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:g,simpleLineWalkFastPath:h,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:S,segments:w}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:g,simpleLineWalkFastPath:h,segLevels:L,breakableFitAdvances:_,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:S}}function yq(e,t,n){return(function(o,s,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return vq((function(c,u,d="normal",f="normal"){const g=(function(_){const w=_??"normal";return w==="pre-wrap"?{mode:w,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:w,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),h=g.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(!WU.test(_))return _;let w=_.replace(HU," ");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(h.length===0)return{normalized:h,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const m=f==="keep-all"?(function(_){if(_.len<=1)return _;const w=[],k=[],b=[],y=[];let S=null,L=!1,N=0,v=!1,M=!1;function $(){S!==null&&(w.push(Ms(S)),k.push(L),b.push("text"),y.push(N),S=null)}for(let O=0;O<_.len;O++){const T=_.texts[O],I=_.kinds[O],R=_.isWordLike[O],D=_.starts[O];if(I==="text"){const W=jU(T),V=A1(T);if(S!==null&&v&&M){S.push(T),L=L||R,v=v||W,M=V;continue}$(),S=[T],L=R,N=D,v=W,M=V;continue}$(),w.push(T),k.push(R),b.push(I),y.push(D)}return $(),{len:w.length,texts:w,isWordLike:k,kinds:b,starts:y}})(q_(h,u,g)):q_(h,u,g);return et({normalized:h,chunks:cq(m,g)},m)})(o,zh(),r?.whiteSpace,a),s,!1,a)})(e,t,0,n)}const eg="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Gn=(()=>{const e=globalThis;if(e[eg])return e[eg];const t={configs:{},controllers:{},revision:gl(0),preparedCache:new Map,blockEstimateCache:new Map};return e[eg]=t,t})();let cc=null;const K_=Gn.revision;function G_(e){var t;return e&&(t=Gn.configs[e])!=null?t:null}function Y_(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function kq(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function tg(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!kq(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 ng(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(cc!=null)return cc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return cc=!!((i=r.getContext)!=null&&i.call(r,"2d")),cc}catch{return cc=!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(g,h,m){const _=`${m}\0${h}\0${g}`,w=Gn.preparedCache.get(_);if(w)return Gn.preparedCache.delete(_),Gn.preparedCache.set(_,w),w.prepared;const k=yq(g,h,{whiteSpace:m});for(Gn.preparedCache.set(_,{prepared:k});Gn.preparedCache.size>240;){const b=Gn.preparedCache.keys().next().value;if(!b)break;Gn.preparedCache.delete(b)}return k})(e,n.font,a),u=(function(g,h,m){const _=(function(w,k){return w.simpleLineWalkFastPath?V_(w,k):(function(b,y){if(b.simpleLineWalkFastPath)return V_(b,y);const{widths:S,lineEndFitAdvances:L,lineEndPaintAdvances:N,kinds:v,breakableFitAdvances:M,discretionaryHyphenWidth:$,tabStopAdvance:O,chunks:T}=b;if(S.length===0||T.length===0)return 0;const I=zh(),R=I.lineFitEpsilon,D=y+R;let W=0,V=0,U=!1,J=0,K=0,G=-1,X=0,ke=0,le=null;function We(){G=-1,X=0,ke=0,le=null}function ue(te=J,he=K,oe=V){W++,V=0,U=!1,We()}function ve(te,he){U=!0,J=te+1,K=0,V=he}function Ne(te,he,oe){U=!0,J=te,K=he+1,V=oe}function Re(te,he){U?(V+=he,J=te+1,K=0):ve(te,he)}function Q(te,he,oe,fe){if(!he)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,he){const oe=M[te];for(let fe=he;fe<oe.length;fe++){const H=oe[fe];U?V+H>D?(ue(),Ne(te,fe,H)):(V+=H,J=te,K=fe+1):Ne(te,fe,H)}U&&J===te&&K===oe.length&&(J=te+1,K=0)}function Se(te){if(le!=="soft-hyphen")return!1;const he=M[te];if(he==null)return!1;const{fitCount:oe,fittedWidth:fe}=(function(H,Y,re,ge,xe){let $e=0,se=Y;for(;$e<H.length;){const ae=se+H[$e];if(($e+1<H.length?ae+xe:ae)>re+ge)break;se=ae,$e++}return{fitCount:$e,fittedWidth:se}})(he,V,y,R,$);return oe!==0&&(V=fe,J=te,K=oe,We(),oe===he.length?(J=te+1,K=0,!0):(ue(te,oe,fe+$),ce(te,oe),!0))}function j(te){W++,We()}for(let te=0;te<T.length;te++){const he=T[te];if(he.startSegmentIndex===he.endSegmentIndex){j();continue}U=!1,V=0,he.startSegmentIndex,J=he.startSegmentIndex,K=0,We();let oe=he.startSegmentIndex;for(;oe<he.endSegmentIndex;){const fe=v[oe],H=fe==="space"||fe==="preserved-space"||fe==="tab"||fe==="zero-width-break"||fe==="soft-hyphen",Y=fe==="tab"?pq(V,O):S[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"&&I.preferEarlySoftHyphenBreak&&X<=D){ue(G,0,ke);continue}if(le==="soft-hyphen"&&Se(oe)){oe++;continue}if(H&&re<=D){Re(oe,Y),ue(oe+1,0,ge),oe++;continue}if(G>=0&&X<=D){if(J>G||J===G&&K>0){ue();continue}const xe=G;ue(xe,0,ke),oe=xe;continue}if(Y>y&&M[oe]!==null){ue(),ce(oe,0),oe++;continue}ue();continue}Re(oe,Y),Q(fe,H,oe,Y),oe++}else Y>y&&M[oe]!==null?ce(oe,0):ve(oe,Y),Q(fe,H,oe,Y),oe++;else U&&(J=oe+1,K=0,G=oe+1,X=V+$,ke=V+$,le=fe),oe++}if(U){const fe=G===he.consumedEndSegmentIndex?ke:V;ue(he.consumedEndSegmentIndex,0,fe)}}return W})(w,k)})(g,h);return{lineCount:_,height:_*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Gn.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Gn.blockEstimateCache.size>4e3;){const g=Gn.blockEstimateCache.keys().next().value;if(!g)break;Gn.blockEstimateCache.delete(g)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function WA(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=tg(e.children);return i&&n.paragraph?ng(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=tg(e.children),l=n.headings[i];return r&&l?ng(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=tg((s=i[0])==null?void 0:s.children);return r?ng(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=WA(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 Sd(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function bq(e,t){var n;if(!e||e.type!=="code_block")return null;const o=t.rendererKind,s=t.showHeader!==!1,i=(function(u){var d,f,g;return u.diff?Math.max(Sd(String((d=u.originalCode)!=null?d:"")),Sd(String((f=u.updatedCode)!=null?f:"")),Sd(String((g=u.code)!=null?g:""))):Sd((function(h,m){const _=String(h??"");return m?_:_.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(g,h){const m=typeof g?.fontSize=="number"&&g.fontSize>0?g.fontSize:h?13:12;return typeof g?.lineHeight=="number"&&g.lineHeight>0?g.lineHeight:h?30:Math.round(1.5*m)})(u,r),f=(function(g,h){var m,_;if(!h)return 0;const w=typeof((m=g?.padding)==null?void 0:m.top)=="number"?g.padding.top:10,k=typeof((_=g?.padding)==null?void 0:_.bottom)=="number"?g.padding.bottom:22;return Math.max(0,w)+Math.max(0,k)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else o==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(s?40:0)),contentHeight:c,rendererKind:o}}function wq(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function og(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=Y_(o.lineHeight,1.5*Y_(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:wq(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const _q=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function X_(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))_q.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}const Cq=!1;function ome(){return Cq}function Q_(e,t,n,o){var s;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,g){return Number.isFinite(f)?Math.min(Math.max(0,f),g):0})(n,i);if(!o.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const g=o.getNormalizedScrollTop(e,t,!1),h=Math.abs(g-r);h<u&&(u=h,c=f)}e.scrollTop=c;const d=(s=o.epsilonPx)!=null?s:2;Math.abs(o.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const UA=Symbol("MarkstreamMathBlockMinHeightCache");function sme(){return Bt(UA,null)}const Sq=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],xq=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],Tq=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),qA=["raw","content","code","originalCode","updatedCode"],Z_=new WeakMap,J_=new WeakMap;let Aq=1;function Us(){return typeof performance<"u"?performance.now():Date.now()}function e2(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function $s(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=Z_.get(t);return n||(n=Aq++,Z_.set(t,n)),String(n)}function t2(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:$s(t),customMarkdownIt:$s(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:$s(e.validateLink),preTransformTokens:$s(e.preTransformTokens),postTransformTokens:$s(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function n2(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 o2(e){const t=jA(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function jA(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function zA(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 l0(e){const t=String(e??"");return`${t.length}:${zA(t)}`}function I1(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?l0(r):`${r.length}:${zA(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${$s(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:${$s(o)}`;const i=$s(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>I1(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}:${I1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Xf(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function VA(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>Xf(o)?Ar(o,t,n+1):VA(o,t,n+1)).join(",")}`:Xf(e)?Ar(e,t,n):I1(e,t,n)}function Mq(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!qA.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${l0(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${$s(s)}`:Tq.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${VA(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${$s(s)}`:""}).filter(Boolean).join(";")}function Eq(e){return qA.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${l0(n)}`:""}).filter(Boolean).join(";")}function Ar(e,t=new WeakMap,n=0){const o=J_.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}:${$s(s)}`;const r=$s(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],g=f.length?f.slice(0,200).map(h=>Ar(h,c,u+1)).join("|"):"";return[a.type,Eq(d),Mq(d,c,u),f.length,g].join(":")})(e,t,n);return J_.set(s,l),l}function KA(e,t){return Ar(e)===Ar(t)}function a0(e,t,n){const o=Us(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Us()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function s2(e,t,n){return a0(t,n,()=>Ar(e))}function GA(e,t,n){return s2(e,n,"stabilizeSignatureMs")===s2(t,n,"stabilizeSignatureMs")}function sg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function i2(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function Iq(e,t){return e.length===t.length&&e===t}function c0(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const f=o[d],g=s[d];if(typeof f!=typeof g)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,g))return!1}else if(typeof g!="string"||!Iq(f,g))return!1}const l=Object.prototype.hasOwnProperty.call(o,"children");if(l!==Object.prototype.hasOwnProperty.call(s,"children"))return!1;if(!l)return!0;const a=o.children,c=s.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!Xf(d)||!Xf(f))return null;const g=c0(d,f,n+1);if(g==null)return null;if(!g)return!1}return!0}function $q(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=c0(e,t);return n??KA(e,t)}function Nq(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return a0(n,"stabilizeSignatureMs",()=>{o=c0(e,t)}),o??GA(e,t,n)}function Lq(e,t){const n={};for(const o of Sq){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function Pq(e,t){var n;const o=p_(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:F(()=>!1),r=ne(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,g=0,h=Us();function m(){l&&(clearTimeout(l),l=void 0)}function _(){m();const M=t.renderContent.value;r.value!==M&&(r.value=M),h=Us()}ze([t.renderContent,t.effectiveFinal,i],([M,$,O])=>{r.value!==M&&(!O||$||(function(T,I){if(!T&&I||I.length<=80||I.length<T.length||!I.startsWith(T))return!0;const R=I.slice(T.length);return!!R&&(!!o2(n2(I))||!(!R.includes(`
|
|
232
|
-
|
|
233
|
-
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(R))||R.endsWith(`
|
|
234
|
-
`)&&!(function(D){const W=n2(D);if(o2(W))return!1;const V=jA(W);return V.length>=2&&V.some(U=>U.trim())})(I))})(r.value,M)?_():(function(){if(g+=1,l)return;const T=Math.max(0,(function(I){const R=I.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(Us()-h));T<=0?_():l=setTimeout(_,T)})())},{flush:"sync",immediate:!0}),G1(m);const w=F(()=>{var M,$,O,T;return u7(e.customHtmlTags,(M=e.parseOptions)==null?void 0:M.customHtmlTags,(T=(O=($=t.customComponentsMap)==null?void 0:$.value)!=null?O:{},Object.entries(T).map(([I,R])=>{const D=Ds(I);return R==null||!D||_u(D)||wT.has(D)||ku.has(D)?"":D}).filter(Boolean)))}),k=F(()=>{const{key:M,tags:$}=d7(w.value);if(!M)return o;const O=s.get(M);if(O)return O;const T=p_(t.instanceMsgId,{customHtmlTags:$});return s.set(M,T),T}),b=F(()=>{const M=k.value;return e.customMarkdownIt?e.customMarkdownIt(M):M}),y=F(()=>{var M,$;const O=(M=e.parseOptions)!=null?M:{},T=t.effectiveFinal.value,I=w.value,R=T!=null,D=I.length>0;return R||D||O.streamParse==null?et(et(At(et({},O),{streamParse:($=O.streamParse)==null||$}),R?{final:T}:{}),D?{customHtmlTags:I}:{}):O}),S=F(()=>{var M;return new Set(((M=y.value.customHtmlTags)!=null?M:[]).map($=>String($).trim().toLowerCase()).filter(Boolean))}),L=F(()=>t2(y.value,b.value,e.customMarkdownIt,{includeFinal:!0})),N=F(()=>t2(y.value,b.value,e.customMarkdownIt,{includeFinal:!1}));ze([L,N],([M,$],[O,T])=>{O&&(M===O&&$===T||(_(),$!==T&&(a=[],d="")))},{flush:"sync"});const v=F(()=>{var M,$,O,T,I,R,D,W;if((M=e.nodes)!=null&&M.length)return a=[],d="",fr(e.nodes.slice());const V=r.value;if(!V)return a=[],d="",[];const U=t.debugPerformanceEnabled.value,J=U?Us():0,K=b.value,G=L.value,X=N.value;c&&G!==c&&(function(he){var oe,fe;(fe=(oe=he.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?e2(K):null,We=U?{}:void 0,ue=We?At(et({},y.value),{__timing:We}):y.value,ve=cA(V,K,ue),Ne=U?Us():0,Re=U?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Q,ce=U?sg(ve.length):void 0,Se=0,j=0;if(ke){const he=U?Us():0;if(Re){const oe=(function(fe,H,Y){if(!H.length)return{nodes:fe,metrics:sg(fe.length)};const re=(function($e,se,ae){const we=Math.min($e.length,se.length);for(let qe=0;qe<we;qe++)if(!Nq(se[qe],$e[qe],ae))return qe;return $e.length===se.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 $e=0;$e<re;$e++)ge[$e]=H[$e];for(let $e=re;$e<fe.length;$e++){const se=H[$e],ae=fe[$e];se&&GA(se,ae,Y)&&(ge[$e]=se,xe+=1)}return{nodes:ge,metrics:{reusedNodeCount:xe,dirtyStartIndex:re,stablePrefixNodeCount:re,dirtyTailNodeCount:i2(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:sg(fe.length)};const Y=(function(xe,$e){const se=Math.min(xe.length,$e.length);for(let ae=0;ae<se;ae++)if(!$q($e[ae],xe[ae]))return ae;return xe.length===$e.length?-1:se})(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 $e=H[xe],se=fe[xe];$e&&KA($e,se)&&(re[xe]=$e,ge+=1)}return{nodes:re,metrics:{reusedNodeCount:ge,dirtyStartIndex:Y,stablePrefixNodeCount:Y,dirtyTailNodeCount:i2(Y,fe,H)}}})(ve,a);Q=oe.nodes,ce=oe.metrics}Se=U?Us()-he:0,j=ce?.dirtyStartIndex==null||ce.dirtyStartIndex<0?Q.length:ce.dirtyStartIndex}else Q=ve;Re?(function(he,oe,fe=0){for(let H=Math.max(0,fe);H<he.length;H++)a0(oe,"primeSignatureMs",()=>Ar(he[H]))})(Q,Re,j):(function(he,oe=0){for(let fe=Math.max(0,oe);fe<he.length;fe++)Ar(he[fe])})(Q,j);const te=U?Us()-Ne:0;if(f+=1,d=V,c=G,u=X,a=Q,U){const he=e2(K),oe=typeof he?.total=="number"&&he.total>(($=le?.total)!=null?$:0);t.logPerf(oe?"parse(stream)":"parse(sync)",et(et(et({rendererId:t.instanceMsgId,ms:Math.round(Us()-J),nodes:Q.length,contentLength:V.length,parseCommitCount:f,parseCoalescedCount:g,nodeReuseMs:te,signatureMs:(O=Re?.signatureMs)!=null?O:0,stabilizeSignatureMs:(T=Re?.stabilizeSignatureMs)!=null?T:0,primeSignatureMs:(I=Re?.primeSignatureMs)!=null?I:0,signatureCallCount:(R=Re?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(D=Re?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(W=Re?.primeSignatureCallCount)!=null?W:0,stabilizeMs:Se},ce??{}),We?Object.fromEntries(xq.map(fe=>{var H;return[fe,(H=We[fe])!=null?H:0]})):{}),he?{streamMode:he.lastMode,streamDelta:Lq(he,le),streamStats:he}:{}))}return fr(Q)});return{effectiveCustomHtmlTags:w,effectiveCustomHtmlTagsSet:S,mdBase:k,mdInstance:b,mergedParseOptions:y,parsedNodes:v}}function Oq(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(f,g){if((m=(h=e.shouldTrackVisibleNodeIndices)==null?void 0:h.call(e))!=null&&!m)return;var h,m;const _=n.value,w=_.has(f);if(g){if(w)return;const b=new Set(_);return b.add(f),void(n.value=b)}if(!w)return;const k=new Set(_);k.delete(f),n.value=k})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,g]of s.entries())f<c||(g(),s.delete(f));for(const[f,g]of o.entries())f<c||(g.destroy(),o.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of s.values())c();s.clear();for(const c of o.values())c.destroy();o.clear(),l()}}}function Rq(e={}){const t=ne(""),n=ne(""),o=ne(!1),s=XH(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 K1()&&G1(()=>{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 r2=/auto|scroll|overlay/i;function Dq(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return r2.test(t)||r2.test(n)}function Bq(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 Fq=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 g1((o=oa(e.estimatedPreviewHeightPx))!=null?o:p1(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"})])])])}}),Hq=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 m1((o=oa(e.estimatedPreviewHeightPx))!=null?o:h1(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"}})])])}}),Wq=["data-custom-id"],Uq={class:"m-0 p-0"},qq=["data-probe"],jq=["data-node-index","data-node-type"],YA=Jt(Qe(At(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=fo(),r=Bt("markstreamNestedRendererProps",void 0);function l(A){var B,q;const z=o[A];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()}`)))})(A)?z:(q=(B=r?.value)==null?void 0:B[A])!=null?q: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(A=l("mode"))==="chat"||A==="minimal"||A==="docs"?A:"docs";var A}),u=F(()=>{const A=l("renderCodeBlocksAsPre"),B=l("codeRenderer");return A===!0?"pre":B==="pre"||B==="shiki"||B==="monaco"?B:A===!1||c.value==="docs"?"monaco":"pre"}),d=F(()=>a[c.value]),f=F(()=>{var A;return(A=l("showTooltips"))!=null?A:d.value.showTooltips}),g=F(()=>{var A;return(A=l("fade"))!=null?A:d.value.fade}),h=F(()=>{var A;return(A=l("batchRendering"))!=null?A:d.value.batchRendering}),m=F(()=>{var A;return(A=l("initialRenderBatchSize"))!=null?A:d.value.initialRenderBatchSize}),_=F(()=>{var A;return(A=l("renderBatchSize"))!=null?A:d.value.renderBatchSize}),w=F(()=>{var A;return(A=l("renderBatchDelay"))!=null?A:d.value.renderBatchDelay}),k=F(()=>{var A;return(A=l("renderBatchBudgetMs"))!=null?A:d.value.renderBatchBudgetMs}),b=F(()=>{var A;return(A=l("renderBatchIdleTimeoutMs"))!=null?A:d.value.renderBatchIdleTimeoutMs}),y=F(()=>{var A;return(A=l("deferNodesUntilVisible"))!=null?A:d.value.deferNodesUntilVisible}),S=F(()=>{var A;return(A=l("maxLiveNodes"))!=null?A:d.value.maxLiveNodes}),L=F(()=>{var A;return(A=l("liveNodeBuffer"))!=null?A:d.value.liveNodeBuffer}),N=F(()=>{var A;return(A=l("nodeVirtual"))!=null?A:d.value.nodeVirtual}),v={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return o.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return g.value},get batchRendering(){return h.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return _.value},get renderBatchDelay(){return w.value},get renderBatchBudgetMs(){return k.value},get renderBatchIdleTimeoutMs(){return b.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return S.value},get liveNodeBuffer(){return L.value},get nodeVirtual(){return N.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function M(A){s("height-change",A)}function $(A){s("virtual-state-change",A)}function O(A){s("anchor-change",A)}const T=ne(),I=ne(null),R=ne(null),D=ne(null),W=as({1:null,2:null,3:null,4:null,5:null,6:null}),V=ne(!1),U=new Map,J=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 A,B;if(((A=o.virtualScroll)==null?void 0:A.enabled)!==!0)return null;const q=(B=o.virtualScroll)==null?void 0:B.scrollRoot;return ke(typeof q=="function"?q():q)}function ke(A){return A?typeof HTMLElement<"u"&&A instanceof HTMLElement?A:typeof A=="object"&&"value"in A?ke(A.value):typeof A=="object"&&"$el"in A?ke(A.$el):null:null}const{isClient:le,renderAsFragment:We,debugPerformanceEnabled:ue,resolvedShowTooltips:ve,resolvedHtmlPolicy:Ne,inheritedSmoothStreaming:Re,ownsTypewriterCursor:Q}=(function(A){const B=typeof window<"u",q=mu(),z=Bt("markstreamHtmlPolicy",void 0),Z=Bt("markstreamTypewriterCursor",void 0),me=Bt("markstreamSmoothStreaming",void 0),ye=F(()=>A.renderAsFragment===!0),_e=F(()=>!!(A.debugPerformance&&B&&typeof console<"u")),De=F(()=>{var Be;if(typeof A.showTooltips=="boolean")return A.showTooltips;const Ee=(Be=q.showTooltips)!=null?Be:q["show-tooltips"];return Ee===""||Ee===!0||Ee==="true"||Ee!==!1&&Ee!=="false"&&void 0}),Ae=F(()=>{var Be,Ee;return(Ee=(Be=A.htmlPolicy)!=null?Be:z?.value)!=null?Ee:"safe"}),Ue=F(()=>Z?.value!==!0);return{isClient:B,renderAsFragment:ye,debugPerformanceEnabled:_e,resolvedShowTooltips:De,resolvedHtmlPolicy:Ae,inheritedSmoothStreaming:me,inheritedTypewriterCursor:Z,ownsTypewriterCursor:Ue}})(v),{resolveViewportRoot:ce,resolveScrollContainer:Se,isReverseFlexScrollRoot:j,getNormalizedScrollTop:te,getOffsetTopWithinRoot:he}=(function(A,B){function q(){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=q();if(De)return De;const Ae=_e??A.value;if(!Ae)return null;const Ue=Ae.ownerDocument||document,Be=Ue.scrollingElement||Ue.documentElement;let Ee=Ae;for(;Ee&&Ee!==Ue.body&&Ee!==Be;){if(Dq(window.getComputedStyle(Ee))&&Bq(Ee))return Ee;Ee=Ee.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,Ae){var Ue,Be;if(Ae)return ye(De);const Ee=_e.scrollTop;if(!Z(_e))return Ee;const He=Ee<0?-Ee:Ee;return Math.max(0,((Ue=_e.scrollHeight)!=null?Ue:0)-((Be=_e.clientHeight)!=null?Be:0))-He}function ye(_e){var De,Ae,Ue,Be,Ee;const He=Number((De=_e.scrollingElement)==null?void 0:De.scrollTop),Ke=Number((Ue=(Ae=_e.documentElement)==null?void 0:Ae.scrollTop)!=null?Ue:0),Ge=Number((Ee=(Be=_e.body)==null?void 0:Be.scrollTop)!=null?Ee:0);return Math.max(0,Number.isFinite(He)?He:0,Number.isFinite(Ke)?Ke:0,Number.isFinite(Ge)?Ge:0)}return{resolveViewportRoot:z,resolveScrollContainer:function(_e){var De,Ae,Ue,Be;const Ee=q();if(Ee)return Ee;const He=z((De=_e??A.value)!=null?De:null);if(He)return He;const Ke=(Be=(Ue=_e?.ownerDocument)!=null?Ue:(Ae=A.value)==null?void 0:Ae.ownerDocument)!=null?Be:typeof document<"u"?document:null;return Ke?.scrollingElement||Ke?.documentElement||null},isReverseFlexScrollRoot:Z,getNormalizedScrollTop:me,getOffsetTopWithinRoot:function(_e,De){const Ae=De.ownerDocument||_e.ownerDocument||document;if((function(He,Ke){return He===Ke.documentElement||He===Ke.body||He===Ke.scrollingElement})(De,Ae))return _e.getBoundingClientRect().top+ye(Ae);const Ue=De.getBoundingClientRect(),Be=_e.getBoundingClientRect(),Ee=me(De,Ae,!1);return Be.top-Ue.top+Ee}}})(T,{isClient:le,scrollRoot:X});yn("markstreamShowTooltips",ve),yn("markstreamHtmlPolicy",Ne),yn("markstreamTypewriter",F(()=>v.typewriter!==!1)),yn("markstreamFade",F(()=>v.fade!==!1)),yn("markstreamTypewriterCursor",F(()=>!0)),yn("markstreamTextStreamState",U),yn("markstreamStreamVersion",J),yn("markstreamParseOptions",F(()=>v.parseOptions)),yn("markstreamCustomMarkdownIt",F(()=>v.customMarkdownIt));const{smoothStreamingEnabled:oe,renderContent:fe,effectiveFinal:H}=(function(A,B){const q=Rq(A.smoothStreamingOptions),z=F(()=>{var Ae,Ue,Be;return A.smoothStreaming!==!1&&!((Ae=A.nodes)!=null&&Ae.length)&&(A.smoothStreaming===!0||!((Ue=B.inheritedSmoothStreaming)!=null&&Ue.value))&&(A.smoothStreaming===!0||A.typewriter===!0||((Be=A.maxLiveNodes)!=null?Be:0)<=0)}),Z=ne(!B.isClient||A.smoothStreaming===!0);rn(()=>{Z.value=!0});const me=F(()=>Z.value&&z.value),ye=F(()=>{var Ae;return me.value?q.visible.value:(Ae=A.content)!=null?Ae:""}),_e=F(()=>{var Ae,Ue;const Be=(Ae=A.parseOptions)!=null?Ae:{};return(Ue=A.final)!=null?Ue:Be.final}),De=F(()=>{const Ae=_e.value;return me.value&&Ae!=null?!!Ae&&q.caughtUp.value:Ae});return ze([()=>A.content,()=>A.nodes,me,_e],([Ae,Ue,Be,Ee])=>{if(Ue?.length)return void q.reset("");const He=Ae??"";if(!Be)return q.reset(He),void(Ee&&q.finish({flush:!0}));const Ke=q.source.value;He?He===Ke||(He.startsWith(Ke)?q.enqueue(He.slice(Ke.length)):q.reset(He)):q.reset(""),Ee&&q.finish()},{immediate:!0}),{smoothStream:q,smoothStreamingEligible:z,smoothStreamingEnabled:me,renderContent:ye,requestedFinal:_e,effectiveFinal:De}})(v,{isClient:le,inheritedSmoothStreaming:Re});yn("markstreamSmoothStreaming",oe);const Y=ne(!1);let re="",ge=!1,xe=null;function $e(){le&&xe!=null&&(window.clearTimeout(xe),xe=null)}function se(){Y.value=!1,$e()}function ae(A,B){if(!ue.value)return;const q=(function(){if(!ue.value)return null;const z=_t(we),Z=_t(qe),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,Ae)=>Ae[1]-De[1]||De[0].localeCompare(Ae[0]))))};var _e;return we.clear(),qe.clear(),ct=0,ye})();console.info(`[markstream-vue][perf] ${A}`,q?At(et({},B),{layoutReads:q}):B)}ze([fe,()=>o.nodes,H],([A,B,q])=>{const z=A??"";return B?.length||q===!0?(se(),re=z,void(ge=!0)):ge?(re&&z.length>re.length&&z.startsWith(re)?(Y.value=!0,le&&($e(),xe=window.setTimeout(()=>{var Z;xe=null,H.value===!0||(Z=o.nodes)!=null&&Z.length||(Nl(),Y.value=!1,vi())},1200))):(z.length<re.length||!z.startsWith(re))&&se(),void(re=z)):(re=z,void(ge=!0))},{flush:"sync",immediate:!0});const we=new Map,qe=new Map;let nt=!1,ct=0;function _t(A){let B=0;for(const q of A.values())B+=q;return B}function $t(){ct=Math.max(ct,_t(qe)),qe.clear(),nt=!1}function lt(A,B){return(function(q){var z,Z;ue.value&&(we.set(q,((z=we.get(q))!=null?z:0)+1),qe.set(q,((Z=qe.get(q))!=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)))})(A),B()}const Rt=v.customId?`renderer-${v.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,fn=(function(A){const B=new Map;return{scope:A,cache:B,clear:()=>B.clear()}})(Rt),Mn=F(()=>`${Rt}:${J.value}`);yn(UA,fn);const Nt=qn(()=>v.customId),{effectiveCustomHtmlTagsSet:Ft,mergedParseOptions:jn,parsedNodes:Je}=Pq(v,{instanceMsgId:Rt,renderContent:fe,effectiveFinal:H,smoothStreamingEnabled:oe,debugPerformanceEnabled:ue,customComponentsMap:Nt,logPerf:ae});ze(Je,()=>{fn.clear(),J.value+=1},{immediate:!0});const Qn=F(()=>({customId:v.customId,customHtmlTags:jn.value.customHtmlTags,parseOptions:v.parseOptions,customMarkdownIt:v.customMarkdownIt,htmlPolicy:Ne.value,viewportPriority:v.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:v.codeBlockStream,codeBlockDarkTheme:v.codeBlockDarkTheme,codeBlockLightTheme:v.codeBlockLightTheme,codeBlockMonacoOptions:v.codeBlockMonacoOptions,renderCodeBlocksAsPre:v.renderCodeBlocksAsPre,codeBlockMinWidth:v.codeBlockMinWidth,codeBlockMaxWidth:v.codeBlockMaxWidth,codeBlockProps:v.codeBlockProps,mermaidProps:v.mermaidProps,d2Props:v.d2Props,infographicProps:v.infographicProps,showTooltips:ve.value,themes:v.themes,langs:v.langs,isDark:v.isDark,typewriter:v.typewriter,smoothStreamingOptions:v.smoothStreamingOptions,parseCoalesceMs:v.parseCoalesceMs,fade:v.fade}));yn("markstreamNestedRendererProps",Qn);const Xo=F(()=>Je.value),Po=F(()=>Je.value.length),ho=ne(null),Ln=ne(null),cn=ne(null),wn=ne(null),On=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),zn=!On&&v.customId?G_(v.customId):null,Zn=F(()=>zn?(K_.value,G_(v.customId)):null),Co=F(()=>{var A;return!!(le&&!We.value&&v.customId&&!On&&((A=Zn.value)!=null&&A.enabled))}),po=F(()=>{var A;return!!(!We.value&&((A=o.virtualScroll)!=null&&A.enabled))}),Oo=ne(!1);rn(()=>{Oo.value=!0});const Tt=F(()=>!!(le&&po.value));yn("markstreamHostScrollManaged",Tt);const io=F(()=>!!(Oo.value&&Tt.value)),nn=F(()=>Co.value||Tt.value),Ro=F(()=>Co.value||io.value),Qo=F(()=>{var A;return nn.value&&((A=Zn.value)==null?void 0:A.textEstimation)!==!1}),Jn=F(()=>{var A;return nn.value&&((A=Zn.value)==null?void 0:A.codeBlockEstimation)!==!1});function Ye(){const A=K.value||lt("getMeasuredContainerWidth.clientWidth",()=>{var B;return((B=T.value)==null?void 0:B.clientWidth)||0});return Number.isFinite(A)&&A>0?A:0}const je=F(()=>{const A=Ye();return A>0?Math.max(1,Math.round(A)):640}),tt=F(()=>{var A;return Math.max(1,(A=v.maxLiveNodes)!=null?A:320)}),it=F(()=>{var A;return!We.value&&v.nodeVirtual!==!1&&!(((A=v.maxLiveNodes)!=null?A:0)<=0)&&(v.nodeVirtual===!0?Je.value.length>0:Je.value.length>tt.value)}),Ie=F(()=>it.value||Co.value||Tt.value),be=F(()=>v.viewportPriority!==!1&&!V.value),Fe=_U(A=>{var B;return ce((B=A??T.value)!=null?B:null)},be),{requestFrame:Ct,cancelFrame:St,hasIdleCallback:mn,isTestEnv:gn}=(function(A){const B=A.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,q=A.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,z=A.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:q,hasIdleCallback:z,isTestEnv:Z?.NODE_ENV==="test"}})({isClient:le}),{resolvedBatchSize:ys,resolvedInitialBatch:Zo,batchingEnabled:Ui,incrementalRenderingActive:fi,renderedCount:Vn,previousRenderContext:hi,adaptiveBatchSize:de,previousBatchConfig:Te}=(function(A,B){var q;const z=F(()=>{var Be;const Ee=Math.trunc((Be=A.renderBatchSize)!=null?Be:80);return Number.isFinite(Ee)?Math.max(0,Ee):0}),Z=F(()=>{var Be;const Ee=Math.trunc((Be=A.initialRenderBatchSize)!=null?Be:z.value);return Number.isFinite(Ee)?Math.max(0,Ee):z.value}),me=F(()=>!B.renderAsFragment.value&&A.batchRendering!==!1&&z.value>0&&B.isClient&&!B.isTestEnv),ye=ne(0),_e=ne({key:A.indexKey,total:0}),De=ne(Math.max(1,z.value||1)),Ae=F(()=>{var Be;return me.value&&((Be=A.maxLiveNodes)!=null?Be:0)<=0}),Ue=ne({batchSize:z.value,initial:Z.value,delay:(q=A.renderBatchDelay)!=null?q:16,enabled:Ae.value});return{resolvedBatchSize:z,resolvedInitialBatch:Z,batchingEnabled:me,incrementalRenderingActive:Ae,renderedCount:ye,previousRenderContext:_e,adaptiveBatchSize:De,previousBatchConfig:Ue}})(v,{isClient:le,isTestEnv:gn,renderAsFragment:We}),Le=new Map,Me=new Map,ee=new WeakMap;let pe=null;const kt=new WeakMap,Lt=new Map,eo=ne(0),Bs=F(()=>(eo.value,Array.from(Le.entries()).sort((A,B)=>A[0]-B[0]))),hn=ne(null),Pt=ne(null);let pn=null,pi=0,Fs=null;const{activeRestoreAnchor:ks,getRelativeScrollTopWithinContainer:bl,setRelativeScrollTopWithinContainer:wl,resolveAnchorOffset:sp,clearRestoreReconcile:Tu,scheduleRestoreReconcile:Pa,captureRestoreAnchor:T0,restoreAnchor:A0,getAnchorDrift:aM}=(function(A){const{isClient:B,containerRef:q,parsedNodeCount:z,requestFrame:Z,cancelFrame:me,resolveScrollContainer:ye,getNormalizedScrollTop:_e,getOffsetTopWithinRoot:De,isReverseFlexScrollRoot:Ae,estimateIndexForOffset:Ue,estimateHeightRange:Be,getFallbackNodeHeight:Ee,clamp:He}=A,Ke=ne(null);let Ge=null,pt=[];function ot(){const yt=ye(),It=q.value;if(!yt||!It)return null;const Et=yt.ownerDocument||It.ownerDocument||document;if(yt===Et.documentElement||yt===Et.body||yt===Et.scrollingElement){const Xt=It.getBoundingClientRect();return Math.max(0,-Xt.top)}return Math.max(0,_e(yt,Et,!1)-De(It,yt))}function st(yt){var It;const Et=ye(),Xt=q.value;if(!Et||!Xt)return;const ns=Math.max(0,yt),So=Et.ownerDocument||Xt.ownerDocument||document,Hs=So.defaultView||(typeof window<"u"?window:null);if(Et===So.documentElement||Et===So.body||Et===So.scrollingElement){const Gi=_e(Et,So,!0)+Xt.getBoundingClientRect().top;return void((It=Hs?.scrollTo)==null||It.call(Hs,0,Math.max(0,Gi+ns)))}Q_(Et,So,De(Xt,Et)+ns,{isReverseFlexScrollRoot:Gi=>{var Yi;return(Yi=Ae?.(Gi))!=null&&Yi},getNormalizedScrollTop:_e})}function gt(yt){const It=z.value,Et=He(yt.nodeIndex,0,Math.max(0,It-1));return Be(0,Et)+Math.max(0,yt.offsetWithinNodePx)}function mt(){if(Ge!=null&&(me?.(Ge),Ge=null),B)for(const yt of pt)window.clearTimeout(yt);pt=[]}function Ut(yt){const It=gt(yt),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 yt=ot(),It=z.value;if(yt==null||It<=0)return null;const Et=He(Ue(yt+1),0,It-1),Xt=Be(0,Et),ns=Ee(Et);return{nodeIndex:Et,offsetWithinNodePx:He(yt-Xt,0,Math.max(0,ns-1))}},restoreAnchor:function(yt){const It=z.value;if(Ke.value={nodeIndex:He(yt.nodeIndex,0,Math.max(0,It-1)),offsetWithinNodePx:Math.max(0,yt.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(yt){const It=ot();return It==null?null:It-gt(yt)}}})({isClient:le,containerRef:T,parsedNodeCount:Po,requestFrame:Ct,cancelFrame:St,resolveScrollContainer:()=>hn.value||Se(),getNormalizedScrollTop:te,getOffsetTopWithinRoot:he,isReverseFlexScrollRoot:j,estimateIndexForOffset:qp,estimateHeightRange:Ki,getFallbackNodeHeight:Ru,clamp:lo}),{nodeHeights:bs,heightStats:ws,heightTreeSize:Oa,heightSumTree:ip,heightKnownTree:rp,averageNodeHeight:Xs,resetHeightMeasurements:cM,pruneHeightMeasurements:uM,rebuildHeightTrees:Au,recordNodeHeight:dM,removeNodeHeights:fM,exportHeightCache:hM,importHeightCache:pM,fenwickRangeSum:Mu}=(function(A={}){const B=as({}),q=as({total:0,count:0}),z=ne(0),Z=ne([]),me=ne([]);function ye(){for(const Ee of Object.keys(B))delete B[Number(Ee)];q.total=0,q.count=0,z.value=0,Z.value=[],me.value=[]}function _e(Ee,He,Ke){for(let Ge=He+1;Ge<Ee.length;Ge+=Ge&-Ge)Ee[Ge]+=Ke}function De(Ee,He){let Ke=0;for(let Ge=He+1;Ge>0;Ge-=Ge&-Ge)Ke+=Ee[Ge];return Ke}function Ae(Ee){z.value=Ee;const He=new Array(Ee+1).fill(0),Ke=new Array(Ee+1).fill(0);for(const[Ge,pt]of Object.entries(B)){const ot=Number(Ge),st=Number(pt);!Number.isFinite(ot)||ot<0||ot>=Ee||!Number.isFinite(st)||st<=0||(_e(He,ot,st),_e(Ke,ot,1))}Z.value=He,me.value=Ke}function Ue(Ee){if(!Number.isInteger(Ee)||Ee<0)return!1;const He=B[Ee];if(!Number.isFinite(He)||He<=0)return!1;if(delete B[Ee],q.total=Math.max(0,q.total-He),q.count=Math.max(0,q.count-1),z.value>Ee){const Ke=Z.value,Ge=me.value;Ke.length&&Ge.length&&(_e(Ke,Ee,-He),_e(Ge,Ee,-1))}return!0}const Be=F(()=>q.count>0?Math.max(12,q.total/q.count):32);return{nodeHeights:B,heightStats:q,heightTreeSize:z,heightSumTree:Z,heightKnownTree:me,averageNodeHeight:Be,resetHeightMeasurements:ye,pruneHeightMeasurements:function(Ee){if(Ee<=0)return void ye();let He=0,Ke=0;for(const[Ge,pt]of Object.entries(B)){const ot=Number(Ge),st=Number(pt);!Number.isFinite(ot)||ot<0||ot>=Ee||!Number.isFinite(st)||st<=0?delete B[ot]:(He+=st,Ke++)}q.total=He,q.count=Ke},rebuildHeightTrees:Ae,recordNodeHeight:function(Ee,He,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?q.total+=pt-gt:(q.total+=pt,q.count++),z.value>Ge){const mt=Z.value,Ut=me.value;if(mt.length&&Ut.length)if(gt){const yt=pt-gt;yt!==0&&_e(mt,Ge,yt)}else _e(mt,Ge,pt),_e(Ut,Ge,1)}ot.notify!==!1&&((st=A.onHeightRecorded)==null||st.call(A))})(Ee,He,At(et({},Ke),{notify:!0}))},removeNodeHeight:function(Ee,He={}){var Ke;const Ge=Ue(Ee);return Ge&&He.notify!==!1&&((Ke=A.onHeightRecorded)==null||Ke.call(A)),Ge},removeNodeHeights:function(Ee,He={}){var Ke;let Ge=0;for(const pt of Ee)Ue(Number(pt))&&Ge++;return Ge>0&&He.notify!==!1&&((Ke=A.onHeightRecorded)==null||Ke.call(A)),Ge},exportHeightCache:function(){return Object.entries(B).map(([Ee,He])=>({index:Number(Ee),height:Number(He)})).filter(Ee=>Number.isFinite(Ee.index)&&Ee.index>=0&&Number.isFinite(Ee.height)&&Ee.height>0).sort((Ee,He)=>Ee.index-He.index)},importHeightCache:function(Ee,He={}){var Ke;if(!Array.isArray(Ee))return;const Ge=z.value;let pt=!1;if(He.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 Ee){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 yt=Number(mt),It=Number(Ut);!Number.isFinite(yt)||yt<0||gt>0&&yt>=gt||!Number.isFinite(It)||It<=0?delete B[yt]:(ot+=It,st++)}q.total=ot,q.count=st})(),Ge>0&&Ae(Ge),(Ke=A.onHeightRecorded)==null||Ke.call(A))},fenwickRangeSum:function(Ee,He,Ke){if(Ke<=He)return 0;const Ge=De(Ee,Ke-1);return He<=0?Ge:Ge-De(Ee,He-1)}}})({onHeightRecorded:()=>{Cs(),Tt.value&&Qa(),ks.value&&Pa(),Pt.value&&El(),un("node-resize")}});function Eu(){cM(),Lt.clear()}function M0(A){!Number.isInteger(A)||A<0||A>=Je.value.length||Lt.set(A,Ha(A))}function E0(A,B,q={}){const z=bs[A];dM(A,B,q);const Z=bs[A];Z&&Z>0?M0(A):z&&Lt.delete(A)}function I0(A,B){const q=lt("getNodeLayoutHeight.slot.offsetHeight",()=>{var z,Z;return(Z=(z=Le.get(A))==null?void 0:z.offsetHeight)!=null?Z:0});return q>0?q:lt("getNodeLayoutHeight.content.offsetHeight",()=>B.offsetHeight)}function $0(A,B={}){pM(A,B),Pp()}const qi=F(()=>{var A;return!We.value&&v.deferNodesUntilVisible!==!1&&!(((A=v.maxLiveNodes)!=null?A:0)<=0)&&!it.value&&!(Je.value.length>900)&&be.value}),N0=F(()=>!!Fe&&(qi.value||it.value)),L0=F(()=>it.value||Tt.value),{liveNodeBufferResolved:Ra,focusIndex:_s,liveRange:ro,updateLiveRange:Lr}=(function(A,B){const{parsedNodeCount:q,virtualizationEnabled:z,maxLiveNodesResolved:Z,clamp:me}=B,ye=F(()=>{var Ae;return Math.max(0,(Ae=A.liveNodeBuffer)!=null?Ae:60)}),_e=ne(0),De=as({start:0,end:0});return{liveNodeBufferResolved:ye,focusIndex:_e,liveRange:De,updateLiveRange:function(){const Ae=q.value;if(!z.value||Ae===0)return De.start=0,void(De.end=Ae);const Ue=Math.min(Z.value,Ae),Be=ye.value,Ee=me(_e.value-Be,0,Math.max(0,Ae-Ue));De.start=Ee,De.end=Math.min(Ae,Ee+Ue)}}})(v,{parsedNodeCount:Po,virtualizationEnabled:it,maxLiveNodesResolved:tt,clamp:lo}),Qs=new Map,Pr=new Map,ji=new Map,Iu=[],mi=new Map,zi=new Set,P0=ne(0);let lp=!1;const O0=F(()=>(P0.value,zi.size)),Jo=new Map,Zs=new Map,R0=ne(0),ap=F(()=>{R0.value;let A=0;for(const B of Jo.values())A+=Math.max(0,B);return A});let es=null,cp=!0,D0=[0],B0="";function Cs(){cp=!0}const $u=F(()=>{if(!it.value)return Je.value.length;const A=Ra.value,B=Math.max(ro.end+A,Zo.value),q=Math.min(Je.value.length,B);return Math.max(Vn.value,q)});function Nu(){lp||(lp=!0,queueMicrotask(()=>{lp=!1,P0.value+=1}))}function F0(A,B,q="node-resize"){if(!le||typeof window>"u")return null;const z=window.setTimeout(()=>{zi.delete(z)&&Nu();try{B()}finally{un(q)}},Math.max(0,A));return zi.add(z),Nu(),z}function Lu(A){le&&A!=null&&(zi.delete(A)&&Nu(),window.clearTimeout(A))}function H0(){if(le&&typeof window<"u")for(const A of zi)window.clearTimeout(A);zi.size&&(zi.clear(),Nu()),Iu.length=0,ji.clear()}function mM(A){var B,q;return(q=(B=wn.value)==null?void 0:B[A])!=null?q:null}const{cancelScheduledFocusSync:up,scheduleFocusSync:Js}=(function(A){const{isClient:B,containerRef:q,virtualizationEnabled:z,requestFrame:Z,cancelFrame:me,syncFocusToScroll:ye}=A;let _e=null;function De(){var Ue,Be,Ee;return(Ee=(Be=(Ue=q.value)==null?void 0:Ue.ownerDocument)==null?void 0:Be.defaultView)!=null?Ee:typeof window<"u"?window:null}function Ae(){if(!_e)return;const Ue=De();_e.viaTimeout?Ue?Ue.clearTimeout(_e.id):clearTimeout(_e.id):me?.(_e.id),_e=null}return{cancelScheduledFocusSync:Ae,scheduleFocusSync:function(Ue={}){if(!z.value)return;if(!B)return void ye(!0);if(Ue.immediate)return Ae(),void ye(!0);if(_e)return;const Be=()=>{_e=null,ye()};if(Z)return void(_e={id:Z(Be),viaTimeout:!1});const Ee=De();_e={id:Ee?Ee.setTimeout(Be,16):setTimeout(Be,16),viaTimeout:!0}}}})({isClient:le,containerRef:T,virtualizationEnabled:it,requestFrame:Ct,cancelFrame:St,syncFocusToScroll:function(A=!1){var B;if(!it.value)return;const q=hn.value||Se();if(!q)return;const z=q.ownerDocument||((B=T.value)==null?void 0:B.ownerDocument)||document,Z=z?.defaultView||(typeof window<"u"?window:null),me=q===z?.documentElement||q===z?.body,ye=Je.value.length;if(!me&&ye>0&&j(q)){const Ke=lt("syncFocusToScroll.clientHeight",()=>q.clientHeight||0),Ge=lt("syncFocusToScroll.scrollTop",()=>q.scrollTop),pt=Ge<0?-Ge:Ge,ot=(function(gt){var mt,Ut;const yt=Je.value;if(!yt.length)return 0;if(gt<=0)return Math.max(0,yt.length-1);if(nn.value){const Et=(mt=mp()[yt.length])!=null?mt:0;return G0(Math.max(0,Et-gt))}if(Oa.value===yt.length){const Et=Ki(0,yt.length);return qp(Math.max(0,Et-gt))}let It=gt;for(let Et=yt.length-1;Et>=0;Et--){const Xt=(Ut=bs[Et])!=null?Ut:Xs.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((A||Math.abs(st-_s.value)>1)&&(_s.value=st,Lr()))}const _e=me?null:lt("syncFocusToScroll.root.getBoundingClientRect",()=>q.getBoundingClientRect()),De=me?0:_e.top,Ae=me?lt("syncFocusToScroll.viewport.clientHeight",()=>{var Ke,Ge;return(Ge=(Ke=Z?.innerHeight)!=null?Ke:q.clientHeight)!=null?Ge:0}):_e.bottom,Ue=Bs.value;let Be=null,Ee=null;for(const[Ke,Ge]of Ue){if(!Ge)continue;const pt=lt("syncFocusToScroll.slot.getBoundingClientRect",()=>Ge.getBoundingClientRect());pt.bottom<=De||pt.top>=Ae||(Be==null&&(Be=Ke),Ee=Ke)}if(Be==null||Ee==null){const Ke=T.value;if(!Ke)return;const Ge=me?{top:0}:lt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>q.getBoundingClientRect()),pt=lt("syncFocusToScroll.fallback.scrollTop",()=>te(q,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=he(Ke,q);return Math.max(0,pt-mt)})(),st=me?lt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var mt,Ut,yt,It;return(It=(yt=(Ut=Z?.innerHeight)!=null?Ut:(mt=z?.documentElement)==null?void 0:mt.clientHeight)!=null?yt:q.clientHeight)!=null?It:0}):lt("syncFocusToScroll.fallback.root.clientHeight",()=>q.clientHeight),gt=qp(ot+.5*Math.max(0,st));return _s.value=lo(gt,0,Math.max(0,Je.value.length-1)),void Lr()}const He=Math.round((Be+Ee)/2);!A&&Math.abs(He-_s.value)<=1||(_s.value=lo(He,0,Math.max(0,Je.value.length-1)),Lr())}}),{visibleNodeIndices:dp,nodeVisibilityHandles:_l,nodeVisibilityWatchStops:Pu,nodeVisibilityFallbackTimers:W0,clearVisibilityFallback:Ou,markNodeVisible:Vi,cleanupNodeVisibility:gM,destroyNodeVisibilityState:fp}=Oq({isClient:le,shouldTrackVisibleNodeIndices:()=>qi.value,shouldCleanupNodeVisibility:()=>it.value,onNodeMarkedVisible:A=>{it.value?Js():_s.value=lo(A,0,Math.max(0,Je.value.length-1))},onNodeVisibilityCleaned:A=>{Le.delete(A)&&gy()}}),{cleanupScrollListener:U0,setupScrollListener:vM}=(function(A){const{isClient:B,virtualizationEnabled:q,listenerEnabled:z,scrollRootElement:Z,resolveScrollContainer:me,scheduleFocusSync:ye,onScroll:_e}=A;let De=null,Ae=null;function Ue(){De&&(De(),De=null),Ae=null,Z.value=null}function Be(Ee){const He=A.getScrollTop?A.getScrollTop(Ee):Ee.scrollTop;return Math.max(0,Number.isFinite(He)?Math.abs(He):0)}return{cleanupScrollListener:Ue,setupScrollListener:function(){if(!B)return;if(!((Ee=z?.value)!=null?Ee:q.value))return void Ue();var Ee;const He=me();if(!He)return void Ue();if(Z.value===He&&De)return;Ue(),Ae=Be(He);const Ke=()=>{if(_e?.(),q.value){const Ge=(function(pt){const ot=Be(pt),st=Ae;Ae=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})(He);Ge?ye(Ge):ye()}};He.addEventListener("scroll",Ke,{passive:!0}),Z.value=He,De=()=>{He.removeEventListener("scroll",Ke)}}}})({isClient:le,virtualizationEnabled:it,listenerEnabled:L0,scrollRootElement:hn,resolveScrollContainer:Se,scheduleFocusSync:Js,onScroll:function(){const A=Pt.value;if(!A)return;const B=Fa();if(!B||(function(z){if(za()>=pi)return Fs=null,!1;const Z=Fs;if(Z==null)return!0;const me=Math.abs(z.scrollTop-Z)<=2;return me||(Fs=null),me})(B))return;const q=oy(B);q!=null?(q<-32||Math.abs(Math.max(0,q)-Math.max(0,A.distanceFromBottomPx))>32)&&Ml("restore"):Ml("restore")},getScrollTop:A=>{var B;const q=A.ownerDocument||((B=T.value)==null?void 0:B.ownerDocument)||document,z=A===q.documentElement||A===q.body||A===q.scrollingElement;return lt("scrollListener.getScrollTop",()=>te(A,q,z))}});function lo(A,B,q){return Math.min(Math.max(A,B),q)}function hp(A){return A?.firstElementChild}function q0(A,B){var q;return A?(q=A.matches)!=null&&q.call(A,B)?A:A.querySelector(B):null}function j0(){if(!nn.value)return void(K.value=0);const A=lt("updateExperimentContainerWidth.clientWidth",()=>{var B,q;return(q=(B=T.value)==null?void 0:B.clientWidth)!=null?q:0});K.value=A>0?A:0}let Da=null;function pp(){Da?.disconnect(),Da=null}const z0=ai({loader:()=>Cn(null,null,function*(){return(yield cs(()=>import("./index8-DC4X3Xlc.js"),__vite__mapDeps([5,4]))).default}),loadingComponent:OA,delay:0,suspensible:!1});function V0(A){return A===z0}const K0=F(()=>u.value==="pre"?ss:u.value==="shiki"?z0:Ym),Or=F(()=>{const A=Je.value;if(!A.length||!nn.value)return A.map(()=>null);const B=K.value||lt("estimatedNodeHeights.clientWidth",()=>{var q;return((q=T.value)==null?void 0:q.clientWidth)||0});return!Number.isFinite(B)||B<=0?A.map(()=>null):A.map((q,z)=>{const Z=bs[z],me=typeof Z=="number"&&Z>0;if(Qo.value&&!me){const _e=WA(q,B,G.value);if(_e)return _e}if(Jn.value&&q.type==="code_block"){const _e=(function(De){if(De.type!=="code_block")return null;const Ae=Ey(De,qu(De));return V0(Ae)?"markdown":Ae===ss?"pre":Ae===K0.value||Ae===Ym?"monaco":null})(q);if(_e==="monaco"||_e==="markdown"||_e==="pre")return bq(q,{rendererKind:_e,monacoOptions:v.codeBlockMonacoOptions,showHeader:((ye=v.codeBlockProps)==null?void 0:ye.showHeader)!==!1})}var ye;return null})});function Ru(A){var B;const q=bs[A];if(Number.isFinite(q)&&q>0)return q;const z=(B=Or.value[A])==null?void 0:B.height;return Number.isFinite(z)&&z>0?z:Math.max(Xs.value,(function(Z){var me,ye,_e,De,Ae,Ue,Be,Ee,He,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 Cl(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 Cl(String((Ae=(De=st.raw)!=null?De:st.content)!=null?Ae:""),mt,34);case"blockquote":return Cl(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 Cl(String((He=(Ee=st.code)!=null?Ee:st.raw)!=null?He:""),mt,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return Cl(String((Ge=(Ke=st.raw)!=null?Ke:st.content)!=null?Ge:""),mt,96);case"thematic_break":return 24;default:return Cl(String((ot=(pt=st.raw)!=null?pt:st.content)!=null?ot:""),mt,40)}})(A))}function Cl(A,B,q,z=22){const Z=String(A??"");if(!Z)return q;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(q,Math.ceil(De*z+12))}function Ba(A){const B=Number(A);return!Number.isFinite(B)||B<=0?-1:Math.round(B/32)}function mp(){var A,B;const q=Je.value.length,z=Ba(K.value||lt("getFallbackHeightPrefix.clientWidth",()=>{var _e;return((_e=T.value)==null?void 0:_e.clientWidth)||0})),Z=((A=o.virtualScroll)==null?void 0:A.measurementKey)==null?"":String(o.virtualScroll.measurementKey),me=[q,ws.count,Math.round(ws.total),Math.round(100*Xs.value),Z,z,nn.value?1:0,K_.value,J.value].join(":");if(!cp&&B0===me)return D0;const ye=new Array(q+1);ye[0]=0;for(let _e=0;_e<q;_e++)ye[_e+1]=ye[_e]+(nn.value?Ru(_e):(B=bs[_e])!=null?B:Xs.value);return D0=ye,B0=me,cp=!1,ye}function G0(A){var B,q;const z=Je.value.length;if(z<=0||A<=0)return 0;const Z=mp();if(A>=((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;((q=Z[De+1])!=null?q:0)>=A?(_e=De,ye=De-1):me=De+1}return _e}function Ki(A,B){var q,z;if(A>=B)return 0;if(nn.value)return(function(ye,_e){var De,Ae;const Ue=Je.value.length,Be=lo(Math.trunc(ye),0,Ue),Ee=lo(Math.trunc(_e),Be,Ue);if(Be>=Ee)return 0;const He=mp();return((De=He[Ee])!=null?De:0)-((Ae=He[Be])!=null?Ae:0)})(A,B);if(Oa.value!==Je.value.length){let ye=0;for(let _e=A;_e<B;_e++)ye+=(q=bs[_e])!=null?q:Xs.value;return ye}const Z=ip.value,me=rp.value;if(!Z.length||!me.length){let ye=0;for(let _e=A;_e<B;_e++)ye+=(z=bs[_e])!=null?z:Xs.value;return ye}return Mu(Z,A,B)+(B-A-Mu(me,A,B))*Xs.value}ze(()=>Je.value.length,A=>{Cs(),A<=0?Eu():(A<Oa.value&&uM(A),A!==Oa.value&&Au(A))},{immediate:!0});const yM=F(()=>{if(!it.value)return Je.value.map((z,Z)=>({node:z,index:Z}));const A=Je.value.length,B=lo(ro.start,0,A),q=lo(ro.end,B,A);return Je.value.slice(B,q).map((z,Z)=>({node:z,index:B+Z}))}),gp=F(()=>it.value?Ki(0,Math.min(ro.start,Je.value.length)):0),vp=F(()=>{if(!it.value)return 0;const A=Je.value.length;return Ki(Math.min(ro.end,A),A)});function Y0(){if(!nn.value)return 0;let A=0;const B=Or.value;for(let q=0;q<B.length;q++){if(!B[q])continue;const z=bs[q];Number.isFinite(z)&&z>0||A++}return A}function X0(){const A=Je.value.length;return{totalNodes:A,measuredCount:ws.count,estimatedCount:Y0(),averageNodeHeight:Xs.value,topSpacerHeight:gp.value,bottomSpacerHeight:vp.value,estimatedTotalHeight:Ki(0,A),width:Rr()}}function kM(){const A=Je.value,B=X0();return At(et({},B),{probe:{paragraphReady:!!G.value.paragraph,listItemReady:!!G.value.listItem,listWrapperOverhead:G.value.listWrapperOverhead,headingReadyLevels:Object.entries(G.value.headings).filter(([,q])=>!!q).map(([q])=>Number(q))},nodes:A.map((q,z)=>{var Z,me,ye,_e,De,Ae,Ue,Be,Ee;return{index:z,type:q.type,estimateKind:(me=(Z=Or.value[z])==null?void 0:Z.kind)!=null?me:null,rendererKind:(_e=(ye=Or.value[z])==null?void 0:ye.rendererKind)!=null?_e:null,estimatedHeight:(Ae=(De=Or.value[z])==null?void 0:De.height)!=null?Ae:null,estimatedContentHeight:(Be=(Ue=Or.value[z])==null?void 0:Ue.contentHeight)!=null?Be:null,measuredHeight:(Ee=bs[z])!=null?Ee:null}})})}function yp(){return o.indexKey!=null?String(o.indexKey):po.value?`virtual-${vn()}`:"markdown-renderer"}function Q0(A){const B=String(A),q=`${yp()}-`;if(!B.startsWith(q))return null;const z=B.slice(q.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 A,B,q;const z=(A=o.virtualScroll)==null?void 0:A.sessionKey;return String(z!=null&&z!==""?z:(q=(B=o.indexKey)!=null?B:v.customId)!=null?q:Rt)}function Kn(){var A;const B=(A=o.virtualScroll)==null?void 0:A.threadKey;return B==null||B===""?void 0:String(B)}function kp(A){var B;return(A??"")===((B=Kn())!=null?B:"")}function bM(){var A;const B=(A=o.virtualScroll)==null?void 0:A.measurementKey;return B==null?"":String(B)}function wM(){var A,B;const q=u.value,z=q==="monaco"?v.codeBlockMonacoOptions:void 0,Z=v.codeBlockProps,me=q==="shiki";return[v.isDark?"dark":"light",q==="monaco"?"code-rich":q==="pre"?"code-pre":"code-shiki",v.codeBlockStream===!1?"code-static":"code-stream",to(v.codeBlockMinWidth),to(v.codeBlockMaxWidth),...me?[zf((A=Z?.themes)!=null?A:v.themes,(B=Z?.langs)!=null?B:v.langs)]:[],to(z?.fontSize),to(z?.lineHeight),to(z?.fontFamily),to(z?.tabSize),to(z?.MAX_HEIGHT),to(z?.wordWrap),to(z?.wrappingIndent),to(z?.padding),to(Z?.showHeader),to(Z?.showCopyButton),to(Z?.showExpandButton),to(Z?.showPreviewButton),to(Z?.showCollapseButton),to(Z?.showFontSizeButtons)].join("\0")}function gi(){return[bM(),wM()].join("\0")}function Rr(){return Ye()}const Du=F(()=>Ba(Rr())),ts=F(()=>[gi(),Du.value].join("\0")),_M=F(()=>{var A;return po.value?["virtual",(A=Kn())!=null?A:"",vn(),ts.value].join("\0"):o.indexKey});function Sl(){R0.value+=1}function bp(A){return!(!A||!Number.isInteger(A.index)||A.index<0||A.index>=Je.value.length||A.sessionKey!==vn()||A.threadKey!==Kn()||A.layoutEpochKey!==ts.value)}function Z0(A){const B=String(A),q=Zs.get(B);return q?bp(q)?q.index:null:Q0(B)}function J0(A="async-node"){(Jo.size||Zs.size)&&(Jo.clear(),Zs.clear(),Sl(),un(A))}const xl=Bt(u1,null),wp={reportHeight(A,B){if(!Tt.value)return;const q=Z0(A);if(q==null)return;const z=Qs.get(q);if(!z)return;const Z=Number(B),me=I0(q,z);E0(q,Number.isFinite(Z)&&Z>0?Math.max(Z,me||0):me)},markPending(A){if(!Tt.value)return;const B=Q0(A);B!=null&&(function(q,z){var Z;const me=Zs.get(q);if(me&&bp(me))return Jo.set(q,Math.max(0,(Z=Jo.get(q))!=null?Z:0)+1),Sl(),void un("async-node");Jo.set(q,1),Zs.set(q,(function(ye){return{index:ye,sessionKey:vn(),threadKey:Kn(),layoutEpochKey:ts.value}})(z)),Sl(),un("async-node")})(String(A),B)},markSettled(A){if(!Tt.value)return;const B=String(A),q=Z0(A);(q!=null||(function(z){return Jo.has(String(z))})(B))&&(function(z){var Z;const me=(Z=Jo.get(z))!=null?Z:0;return!(me<=0||(me<=1?(Jo.delete(z),Zs.delete(z)):Jo.set(z,me-1),Sl(),me===1&&un("async-node"),0))})(B)&&q!=null&&vi()}};function CM(){let A=0;for(const B of Qs.values())A+=lt("getVisibleDomHeight.offsetHeight",()=>{var q;return(q=B?.offsetHeight)!=null?q:0});return Math.ceil(Math.max(0,A))}yn(u1,{reportHeight(A,B){wp.reportHeight(A,B),xl?.reportHeight(A,B)},markPending(A){wp.markPending(A),xl?.markPending(A)},markSettled(A){wp.markSettled(A),xl?.markSettled(A)}});let _p,Cp=null,Tl=null;function Bu(A){return A!==!1&&A!=null&&A!==""}function ey(){return it.value?(function(){if(!it.value)return!0;const A=Je.value.length,B=lo(ro.start,0,A),q=lo(ro.end,B,A);if(B>=q)return!0;for(let z=B;z<q;z++)if(!Le.has(z)||jp(z)&&!Qs.has(z))return!1;return!0})():Vn.value>=$u.value}function Sp(){return H.value===!0&&!Y.value&&ap.value===0&&zi.size===0&&mi.size===0&&es==null&&ey()}function ty(){var A,B;if(((A=o.virtualScroll)==null?void 0:A.settleMode)!=="manual"||Cp===vn()&&_p===Kn())return!0;const q=(B=o.virtualScroll)==null?void 0:B.settledToken;return!!Bu(q)&&Tl===Za(q)}function xp(){return Sp()&&ty()}function SM(A,B){return B.totalNodes<=0?A==="final"?"final":"estimate":B.measuredCount>=B.totalNodes?A==="final"?"final":"measured":B.measuredCount>0||B.estimatedCount>0?"mixed":"estimate"}function Dr(A="manual",B){const q=X0(),z=(function(Z){return Z||(H.value!==!0?Je.value.length>0?"streaming":"estimating":!ey()||mi.size>0||es!=null?"measuring":xp()?"settled":"settling")})(B);return{sessionKey:vn(),threadKey:Kn(),phase:z,nodeCount:q.totalNodes,liveRange:{start:ro.start,end:ro.end},renderedCount:Vn.value,measuredCount:q.measuredCount,estimatedCount:q.estimatedCount,averageNodeHeight:q.averageNodeHeight,topSpacerHeight:q.topSpacerHeight,bottomSpacerHeight:q.bottomSpacerHeight,visibleDomHeight:CM(),totalHeight:ny(),width:q.width,final:H.value===!0,stable:xp(),confidence:SM(z,q),reason:A}}function Fa(){const A=hn.value||Se(),B=T.value;if(!A||!B)return null;const q=A.ownerDocument||B.ownerDocument||document,z=A===q.documentElement||A===q.body||A===q.scrollingElement,Z=lt("getScrollBox.scrollTop",()=>te(A,q,z)),me=lt("getScrollBox.scrollHeight",()=>{var _e,De,Ae,Ue,Be;return z?Math.max((De=(_e=q.documentElement)==null?void 0:_e.scrollHeight)!=null?De:0,(Ue=(Ae=q.body)==null?void 0:Ae.scrollHeight)!=null?Ue:0,(Be=A.scrollHeight)!=null?Be:0):A.scrollHeight}),ye=lt("getScrollBox.clientHeight",()=>{var _e;return z?((_e=q.documentElement)==null?void 0:_e.clientHeight)||A.clientHeight||0:A.clientHeight});return{root:A,doc:q,isViewportRoot:z,scrollTop:Z,scrollHeight:me,clientHeight:ye}}function ny(){const A=Je.value.length,B=Math.max(0,Ki(0,A)),q=lt("getRendererLogicalHeight.offsetHeight",()=>{var Z,me;return(me=(Z=T.value)==null?void 0:Z.offsetHeight)!=null?me:0}),z=Math.max(0,q>0?q:lt("getRendererLogicalHeight.scrollHeight",()=>{var Z,me;return(me=(Z=T.value)==null?void 0:Z.scrollHeight)!=null?me:0}));return A<=0?Math.ceil(q):it.value?B>0?Math.max(1,Math.ceil(B),(function(){let Z=gp.value+vp.value;for(const me of Le.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)):Tt.value?B>0||ws.count>0||Y0()>0?(fi.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 oy(A){const B=T.value;if(!B)return null;const q=lt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>B.getBoundingClientRect());return(function(Z){return Z.isViewportRoot?Z.clientHeight:lt("getViewportBottomInRoot.getBoundingClientRect",()=>Z.root.getBoundingClientRect().bottom)})(A)-q.bottom}function xM(A={}){const B=A.requireViewport!==!1,q=(function(me=64){const ye=Fa(),_e=T.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),Ae=lt("isRendererNearVirtualViewport.getBoundingClientRect",()=>_e.getBoundingClientRect());return Ae.bottom>=De.top-me&&Ae.top<=De.bottom+me})();if(B&&!q)return null;const z=(function(){const me=Fa(),ye=T.value;if(!me||!ye||Math.max(0,me.scrollHeight-me.scrollTop-me.clientHeight)>64)return null;const _e=oy(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=T0();if(Z)return{anchor:{type:"node",nodeIndex:Z.nodeIndex,offsetWithinNodePx:Z.offsetWithinNodePx},captured:q};if(A.allowFallback===!0){const me=(function(){const ye=Je.value.length;return ye<=0?null:{type:"node",nodeIndex:lo(_s.value,0,Math.max(0,ye-1)),offsetWithinNodePx:0}})();return me?{anchor:me,captured:!1}:null}return null}function Tp(A){let B=2166136261;for(let q=0;q<A.length;q++)B^=A.charCodeAt(q),B=Math.imul(B,16777619);return(B>>>0).toString(36)}function TM(A,B){let q=A;for(let z=0;z<B.length;z++)q^=B.charCodeAt(z),q=Math.imul(q,16777619);return q^=31,q=Math.imul(q,16777619),q}const AM=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Fu(A,B=new WeakSet,q=0){if(A==null||typeof A=="number"||typeof A=="boolean")return String(A);if(typeof A=="string")return`s:${(function(z){const Z=z.length>8192?`${z.slice(0,8192)}...${z.length}`:z;return`${z.length}:${Tp(Z)}`})(A)}`;if(typeof A=="function")return"fn";if(typeof A!="object")return typeof A;if(B.has(A))return"cycle";if(q>=6)return"max-depth";B.add(A);try{if(Array.isArray(A)){if(A.length<=160){const Ae=[];for(let Ue=0;Ue<A.length;Ue++)Ae.push(Fu(A[Ue],B,q+1));return`a:${A.length}:${Ae.join(",")}`}const me=[],ye=[],_e=Math.max(0,A.length-32);let De=2166136261;for(let Ae=0;Ae<A.length;Ae++){const Ue=Fu(A[Ae],B,q+1);De=TM(De,Ue),Ae<32&&me.push(Ue),Ae>=_e&&ye.push(Ue)}return[`a:${A.length}`,`h=${me.join(",")}`,`t=${ye.join(",")}`,`all=${(De>>>0).toString(36)}`].join(":")}const z=A,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"||AM.has(me))}).sort();return`o:${Z.length}:${Z.map(me=>`${me}=${Fu(z[me],B,q+1)}`).join(";")}`}finally{B.delete(A)}}let sy=-1,Ap="";function Ha(A){const B=Je.value[A];return B?Tp(Fu(B)):""}function Mp(){const A=J.value;if(sy===A)return Ap;let B=2166136261;for(let q=0;q<Je.value.length;q++){const z=Ha(q);for(let Z=0;Z<z.length;Z++)B^=z.charCodeAt(Z),B=Math.imul(B,16777619)}return Ap=(B>>>0).toString(36),sy=A,Ap}function Al(A,B={}){var q;const z=B.includeHeightCache===!0,Z=(q=B.includeContentHash)!=null?q: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 Ae=new Map,Ue=Ge=>{!Ge||Ae.size>=De||Ae.set(Ge.index,Ge)},Be=Je.value.length,Ee=lo(ro.start-2*Ra.value,0,Be),He=lo(ro.end+2*Ra.value,Ee,Be);for(const Ge of _e)Ge.index>=Ee&&Ge.index<He&&Ue(Ge);const Ke=Math.max(1,Math.ceil(_e.length/De));for(let Ge=0;Ge<_e.length&&Ae.size<De;Ge+=Ke)Ue(_e[Ge]);for(let Ge=_e.length-1;Ge>=0&&Ae.size<De;Ge-=Ke)Ue(_e[Ge]);return Array.from(Ae.values()).sort((Ge,pt)=>Ge.index-pt.index).slice(0,De)})(hM().map(_e=>{var De;const Ae=Je.value[_e.index];return Ae?At(et({},_e),{nodeType:String((De=Ae.type)!=null?De:""),signature:Ha(_e.index)}):null}).filter(_e=>!!_e)):[],ye=xM({allowFallback:B.allowAnchorFallback===!0,requireViewport:B.requireViewport});return ye||me.length||B.includeEmptyState===!0?At(et({sessionKey:A.sessionKey,threadKey:A.threadKey},ye?{anchor:ye.anchor,anchorCaptured:ye.captured}:{anchorCaptured:!1}),{metrics:A,width:A.width,contentHash:Z?Mp():void 0,measurementKey:gi()||void 0,heightCache:me.length?me:void 0}):null}function Ep(A){var B,q;const z=Fa();if(!z)return;const Z=(function(_e){const De=T.value;if(!De)return null;const Ae=he(De,_e.root),Ue=Je.value.length,Be=lt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>De.offsetHeight||0),Ee=Math.max(0,Be>0?Be:Ue>0?lt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>De.scrollHeight||0):0),He=ny();return Ae+Math.max(Ee,He)})(z);if(Z==null)return;const me=Math.max(0,A.distanceFromBottomPx),ye=Math.max(0,Z-z.clientHeight-me);(function(_e){pi=za()+120,Fs=_e})(ye),z.isViewportRoot?(q=(B=z.doc.defaultView)==null?void 0:B.scrollTo)==null||q.call(B,0,ye):Q_(z.root,z.doc,ye,{isReverseFlexScrollRoot:j,getNormalizedScrollTop:te})}const Ip=[];function iy(){if(le)for(pn!=null&&(St?.(pn),pn=null);Ip.length;){const A=Ip.pop();A!=null&&window.clearTimeout(A)}}function Ml(A){const B=!!Pt.value;Pt.value=null,pi=0,Fs=null,iy(),B&&A&&un(A)}function El(){if(!Pt.value||!le||pn!=null)return;const A=()=>{pn=null;const B=Pt.value;B&&Ep(B)};pn=Ct?Ct(A):null,pn==null&&A()}function ry(A,B={}){const q=Je.value.length;return q<=0?[]:A.filter(z=>!(!Number.isInteger(z.index)||z.index<0||z.index>=q)&&!(!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!==Ha(Z.index))})(z))}function ly(A){const B=Ba(Rr()),q=Ba(A);return B!==-1&&q!==-1&&B===q}function $p(A){var B;const q=Number(A?.width);if(Number.isFinite(q)&&q>0)return q;const z=Number((B=A?.metrics)==null?void 0:B.width);return Number.isFinite(z)&&z>0?z:null}function ay(A){var B;return A.sessionKey===vn()&&!!kp(A.threadKey)&&((B=A.measurementKey)!=null?B:"")===gi()&&!!ly($p(A))&&!!(function(q){const z=q.heightCache;return!!z?.length&&(cy(q)?z.some(Z=>!!(Z.nodeType||Z.signature)):z.some(Z=>!!Z.signature))})(A)}function cy(A){return!!(A.contentHash&&A.contentHash===Mp())}function MM(A){return!cy(A)}let Br=null,Fr=null,Hu=null,Wa=null,Ua=null;function Np(A){var B;const q=A.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=Ba(Rr());return[(B=Kn())!=null?B:"",vn(),gi(),Je.value.length,z,A.length,Tp(q)].join(":")}function uy(A=(B=>(B=o.virtualScroll)==null?void 0:B.heightCache)()){if(!Tt.value||!A?.length||Je.value.length<=0||!ly((B=o.virtualScroll)==null?void 0:B.heightCacheWidth))return!1;var B;const q=ry(A,{requireSignature:!0});if(!q.length)return!1;const z=Np(q);return z===Br?(Fr="standalone",!0):($0(q,{mode:"merge"}),Cs(),Br=z,Fr="standalone",Ka(),un("restore"),!0)}function Lp(A,B={}){var q,z,Z;if(!Tt.value||!A||A.sessionKey!==vn()||!kp(A.threadKey)||Je.value.length<=0)return!1;const me=!!((q=A.heightCache)!=null&&q.length)&&!Wu(),ye=!A.anchor||A.anchorCaptured===!1&&B.allowUncapturedAnchor!==!0?null:A.anchor,_e=B.restoreAnchor===!0&&!!ye&&!Wu()&&Number($p(A))>0;let De=!1;if((z=A.heightCache)!=null&&z.length&&ay(A)){const Ue=ry(A.heightCache,{requireCompatibilityMetadata:!A.contentHash,requireSignature:MM(A)});Ue.length&&($0(Ue,{mode:"merge"}),Cs(),Br=Np(Ue),Fr="restore",Ka(),De=!0)}if(me||_e)return!1;if(!B.restoreAnchor||!ye)return De&&un("restore"),!0;const Ae=(function(Ue,Be){var Ee;const He=Ue.anchor,Ke=He?He.type==="bottom"?`bottom:${Math.round(He.distanceFromBottomPx)}`:`node:${He.nodeIndex}:${Math.round(He.offsetWithinNodePx)}`:"none";return[(Ee=Kn())!=null?Ee:"",vn(),gi(),Du.value,Be,Ke].join(":")})(A,(Z=B.restoreToken)!=null?Z:"imperative");return Hu===Ae?(De&&un("restore"),!0):(Hu=Ae,(function(Ue){const Be=()=>{if(Ue.type==="node")return Ml(),void A0({nodeIndex:Ue.nodeIndex,offsetWithinNodePx:Ue.offsetWithinNodePx});if(Tu(),ks.value=null,Pt.value=Ue,iy(),Ep(Ue),le)for(const Ee of[0,120,280,480])Ip.push(window.setTimeout(()=>{const He=Pt.value;He&&Ep(He)},Ee))};(function(Ee){if(!it.value)return!1;const He=Je.value.length;return!(He<=0||(_s.value=Ee.type==="node"?lo(Ee.nodeIndex,0,He-1):He-1,Lr(),0))})(Ue)?ht(Be):Be()})(ye),un("restore"),!0)}function Wu(){const A=Rr();return Number.isFinite(A)&&A>0}function dy(A){var B;return A.sessionKey===vn()&&!!kp(A.threadKey)&&(Je.value.length<=0||!(!((B=A.heightCache)!=null&&B.length)||Wu())||!(!(A.anchor&&Number($p(A))>0)||Wu()))}function Pp(){Lt.clear();for(const A of Object.keys(bs)){const B=Number(A);Number.isInteger(B)&&B>=0&&B<Je.value.length&&M0(B)}}function qa(){es!=null&&(St?.(es),es=null),zp()}function fy(){return!le||gn?Promise.resolve():new Promise(A=>{let B=!1,q=null;const z=()=>{B||(B=!0,q!=null&&window.clearTimeout(q),A())};if(Ct)return Ct(z),void(q=window.setTimeout(z,50));q=window.setTimeout(z,0)})}function Op(A,B=Kn(),q=ts.value){return vn()===A&&Kn()===B&&ts.value===q}function Rp(){return Cn(this,arguments,function*(A={}){var B,q,z,Z,me;const ye=vn(),_e=Kn(),De=ts.value,Ae=(B=A.frames)!=null?B:2,Ue=(q=A.timeoutMs)!=null?q:120,Be=(z=A.reason)!=null?z:"manual",Ee=A.expectedSettledTokenKey,He=A.flushPendingTimers===!0,Ke=Dr(Be),Ge=()=>At(et({},Ke),{phase:Ke.final?"settling":Ke.phase,stable:!1,confidence:Ke.confidence==="final"?"mixed":Ke.confidence,reason:Be}),pt=()=>Op(ye,_e,De)&&(Ee==null||Va()===Ee);for(let mt=0;mt<Ae;mt++){if(yield ht(),!pt()||(yield fy(),!pt()))return Ge();vi(),qa()}if(yield(function(mt){return!le||mt<=0?Promise.resolve():new Promise(Ut=>window.setTimeout(Ut,mt))})(Ue),!pt()||(He&&H0(),vi(),qa(),!pt()))return Ge();const ot=Sp();ot&&(Cp=ye,_p=_e,((Z=o.virtualScroll)==null?void 0:Z.settleMode)==="manual"&&Ee!=null&&Bu((me=o.virtualScroll)==null?void 0:me.settledToken)&&Va()===Ee&&(Tl=Za(o.virtualScroll.settledToken)));const st=pt()&&ot&&ty(),gt=Dr(Be,st?"final":void 0);return Wp(gt,!0),gt})}let Dp="content",Hr=null,Wr=null,Bp=0,ja=null,Il=null,Fp=null,Hp=null;function za(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function hy(A){var B,q;const z=ja;if(!z)return!0;const Z=(q=(B=o.virtualScroll)==null?void 0:B.heightDiffThresholdPx)!=null?q:1;return Math.abs(A.totalHeight-z.totalHeight)>Z||A.sessionKey!==z.sessionKey||A.phase!==z.phase||A.stable!==z.stable||A.final!==z.final||A.threadKey!==z.threadKey||A.nodeCount!==z.nodeCount||A.measuredCount!==z.measuredCount||A.width!==z.width}function to(A){if(A==null)return"";if(typeof A=="string"||typeof A=="number"||typeof A=="boolean")return String(A);try{return JSON.stringify(A)}catch{return String(A)}}function Va(A=(B=>(B=o.virtualScroll)==null?void 0:B.settledToken)()){return to(A)}function py(A,B){var q,z;return[A,B.sessionKey,(q=B.threadKey)!=null?q:"",gi(),Mp(),to((z=o.virtualScroll)==null?void 0:z.settledToken),Math.round(B.totalHeight),Math.round(B.width)].join("\0")}function Ka(){Fp=null,Hp=null,Il=null}function EM(A){const B=A.heightCache;return B?.length?Np(B):""}function Ga(A){var B,q,z;const Z=A.metrics,me=A.anchor?(ye=A.anchor).type==="bottom"?`bottom:${Math.round(ye.distanceFromBottomPx)}`:`node:${ye.nodeIndex}:${Math.round(ye.offsetWithinNodePx)}`:"none";var ye;return[A.sessionKey,(B=A.threadKey)!=null?B:"",(q=A.measurementKey)!=null?q:gi(),(z=A.contentHash)!=null?z:"",EM(A),me,A.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 Wp(A,B=!1){if(!Tt.value||(function(ye=!1){return!ye&&po.value&&!io.value})(B))return;const q=B||hy(A),z=(function(ye,_e=!1){return _e||ye.stable||ye.phase==="final"?{state:Al(ye,{includeHeightCache:!0})}:{state:Al(ye)}})(A,B),Z=z.state,me=!!(Z&&(q||(function(ye,_e=!1){return!!_e||Ga(ye)!==Il})(Z,B)));if(q&&(M(A),ja=A,Bp=za()),Z&&me&&($(Z),Z.anchor&&O(Z.anchor),Il=Ga(Z)),A.stable){const ye=py("settled",A);if(ye!==Fp){Fp=ye;const _e=Al(A,{includeHeightCache:!0});_e&&($(_e),Il=Ga(_e)),(function(De){s("render-settled",De)})(A)}}if(A.phase==="final"){const ye=py("final",A);if(ye!==Hp){Hp=ye;const _e=Al(A,{includeHeightCache:!0});_e&&($(_e),Il=Ga(_e)),(function(De){s("render-final",De)})(A)}}}function Up(){Hr!=null&&(St?.(Hr),Hr=null),Wr!=null&&le&&(window.clearTimeout(Wr),Wr=null)}function my(){Hr=null,Wr=null,(function(A){if(mi.size>0||es!=null)return!0;switch(A){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Dp)&&(vi(),qa()),Wp(Dr(Dp))}function un(A){var B,q;if(!Tt.value||(Dp=A,Hr!=null||Wr!=null))return;const z=Math.max(0,(q=(B=o.virtualScroll)==null?void 0:B.emitIntervalMs)!=null?q:32),Z=Math.max(0,z-(za()-Bp)),me=()=>{Wr=null,Hr=Ct?Ct(my):null,Hr==null&&my()};le&&Z>0?Wr=window.setTimeout(me,Z):me()}function qp(A){var B;if(A<=0)return 0;const q=Je.value;if(nn.value)return G0(A);if(Oa.value===q.length&&ip.value.length&&rp.value.length){const Z=Xs.value,me=ip.value,ye=rp.value,_e=Be=>Be<=0?0:Mu(me,0,Be)+(Be-Mu(ye,0,Be))*Z;let De=0,Ae=q.length-1,Ue=q.length-1;for(;De<=Ae;){const Be=De+Ae>>1;_e(Be+1)>=A?(Ue=Be,Ae=Be-1):De=Be+1}return Ue}let z=A;for(let Z=0;Z<q.length;Z++){const me=(B=bs[Z])!=null?B:Xs.value;if(z<=me)return Z;z-=me}return Math.max(0,q.length-1)}function gy(){eo.value+=1}function jp(A){return!(fi.value&&A>=Vn.value)&&(!qi.value||A<Zo.value||dp.value.has(A))}function $l(A){const B=Pu.get(A);B&&(B(),Pu.delete(A));const q=_l.get(A);q&&(q.destroy(),_l.delete(A)),Ou(A)}function vy(A,B){let q=!1;if(B){const me=Le.get(A);Le.set(A,B),me!==B&&(q=!0)}else Le.delete(A)&&(q=!0);if(q&&gy(),B||Ou(A),!N0.value||!Fe||!it.value&&qi.value&&!V.value&&_l.size>=640&&(V.value||(V.value=!0,fp()),!N0.value||!Fe))return $l(A),void(B&&Vi(A,!0));if(A<Zo.value&&!it.value||dp.value.has(A))return $l(A),void Vi(A,!0);if(!B)return void $l(A);$l(A);const z=Fe(B,{rootMargin:"400px"});if(!z)return;_l.set(A,z),Vi(A,z.isVisible.value),qi.value&&(function(me){if(!le||!qi.value)return;Ou(me);const ye=me%17*23,_e=window.setTimeout(()=>{if(W0.delete(me),!qi.value||dp.value.has(me))return;const De=Le.get(me);if(!De)return;const Ae=Se(De),Ue=De.ownerDocument||document,Be=Ue.defaultView||window,Ee=!Ae||Ae===Ue.documentElement||Ae===Ue.body,He=!Ee&&Ae?lt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Ae.getBoundingClientRect()):null,Ke=Ee?0:He.top,Ge=Ee?lt("nodeVisibilityFallback.clientHeight",()=>{var ot,st;return(st=(ot=Be.innerHeight)!=null?ot:Ae?.clientHeight)!=null?st:0}):He.bottom,pt=lt("nodeVisibilityFallback.node.getBoundingClientRect",()=>De.getBoundingClientRect());pt.bottom>=Ke-500&&pt.top<=Ge+500&&Vi(me,!0)},1800+ye);W0.set(me,_e)})(A);let Z=null;Z=ze(()=>z.isVisible.value,me=>{if(me){Ou(A),Vi(A,!0),Z?.(),Pu.delete(A),_l.get(A)===z&&_l.delete(A);try{z.destroy()}catch{}}},{immediate:!0}),Pu.set(A,Z),it.value&&Js()}function zp(){es=null;for(const[A,B]of mi)mi.delete(A),Qs.get(A)===B.el&&Pr.get(A)===B.version&&E0(A,B.height,{allowShrink:B.allowShrink})}function Nl(){es!=null&&(St?.(es),es=null),mi.clear()}function Uu(A,B){(function(q,z,Z){var me;if(!Number.isFinite(Z)||Z<=0||Qs.get(q)!==z)return;const ye=Pr.get(q);if(ye==null)return;const _e=Je.value[q],De=Y.value&&H.value!==!0&&!((me=o.nodes)!=null&&me.length)&&q>=Je.value.length-2,Ae=!(_e?.loading===!0||De),Ue=mi.get(q),Be=Ue?Ue.allowShrink&&Ae:Ae,Ee=Ue&&!Be?Math.max(Ue.height,Z):Z;mi.set(q,{height:Ee,allowShrink:Be,version:ye,el:z}),es==null&&(es=Ct?Ct(zp):null,es==null&&zp())})(A,B,I0(A,B))}function vi(){for(const[A,B]of Qs)B&&Uu(A,B)}function yy(){pe?.disconnect(),pe=null,Me.clear()}function Vp(){for(;Iu.length;)Lu(Iu.pop())}ze(io,A=>{A&&un("content")},{flush:"post"}),t({getVirtualMetrics:Dr,captureVirtualState:function(A={}){var B;return Al(Dr("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:A.allowFallbackAnchor===!0,requireViewport:A.requireViewport===!0,includeEmptyState:(B=A.includeEmptyState)==null||B})},restoreVirtualState:function(A,B={}){const q=B.restoreAnchor===!0,z=B.restoreToken==null?"imperative":String(B.restoreToken);Wa=A,Ua={restoreAnchor:q,restoreToken:z,allowUncapturedAnchor:B.allowUncapturedAnchor===!0},!Lp(A,{restoreAnchor:q,restoreToken:z,allowUncapturedAnchor:B.allowUncapturedAnchor===!0})&&dy(A)||(Wa=null,Ua=null)},forceMeasure:function(A="manual"){return Cn(this,null,function*(){yield ht(),yield fy(),vi(),qa(),yield ht();const B=Dr(A);return Wp(B,!0),B})},settle:Rp,scrollToNode:function(A,B="start"){Ml(),Tu();const q=Je.value.length;if(q<=0)return;const z=lo(A,0,q-1),Z=()=>{var me;const ye=sp({nodeIndex:z,offsetWithinNodePx:0}),_e=Ru(z),De=Fa(),Ae=(me=De?.clientHeight)!=null?me:0,Ue=bl();let Be=ye;if(B==="center")Be=ye-Ae/2+_e/2;else if(B==="end")Be=ye-Ae+_e;else if(B==="nearest"&&Ue!=null){if(ye>=Ue&&ye+_e<=Ue+Ae)return;Be=ye<Ue?ye:ye-Ae+_e}wl(Math.max(0,Be)),Js({immediate:!0}),it.value&&(_s.value=z,Lr())};if(it.value)return _s.value=z,Lr(),void ht(Z);Z()}}),ze(()=>Ie.value,A=>{if(!A){yy();for(const B of ji.values())for(const q of B)Lu(q);ji.clear(),Pr.clear(),Vp(),Nl()}},{immediate:!0}),ze(H,A=>{A&&(function(){if(le&&H.value&&Qs.size){Vp();for(const B of[80,240,640]){const q=F0(B,()=>{for(const[z,Z]of Qs)Z&&Uu(z,Z)},"final");q!=null&&Iu.push(q)}}})(),un(A?"final":"content")}),ze([()=>Je.value.length,()=>Vn.value],()=>{Pt.value&&El(),un("content")},{flush:"post",immediate:!0}),ze([()=>ro.start,()=>ro.end],()=>{un("batch")},{flush:"post"});const{cleanupBatchScheduler:IM}=(function(A){const{props:B,isClient:q,isTestEnv:z,parsedNodesIdentity:Z,parsedNodeCount:me,desiredRenderedCount:ye,datasetKey:_e,batchingEnabled:De,incrementalRenderingActive:Ae,resolvedBatchSize:Ue,resolvedInitialBatch:Be,renderedCount:Ee,adaptiveBatchSize:He,previousRenderContext:Ke,previousBatchConfig:Ge,requestFrame:pt,cancelFrame:ot,hasIdleCallback:st,cleanupNodeVisibility:gt,onDatasetKeyChanged:mt,onDatasetChanged:Ut}=A;let yt=null,It=null,Et=!1,Xt=null,ns=null,So=0,Hs=!1,Gi=!1;const Yi=new Set,qr=new Set;function Ry(){if(q){yt!=null&&(ot?.(yt),yt=null),It!=null&&(window.clearTimeout(It),It=null),ns!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(ns),ns=null),So+=1;for(const mo of Yi)ot?.(mo);Yi.clear();for(const mo of qr)window.clearTimeout(mo);qr.clear(),Et=!1,Xt=null,Hs=!1,Gi=!1}}function Yu(){return typeof performance<"u"?performance.now():Date.now()}function Dy(mo){(function(yi){var Xi;if(!Ae.value)return;const ki=Math.max(2,(Xi=B.renderBatchBudgetMs)!=null?Xi:6),bi=Math.max(1,Ue.value||1),Ws=Math.max(1,Math.floor(bi/4));yi>1.2*ki?He.value=Math.max(Ws,Math.floor(.7*He.value)):yi<.5*ki&&He.value<bi&&(He.value=Math.min(bi,Math.ceil(1.2*He.value)))})(mo),Hs=!1;const Do=Gi||Ee.value<ye.value;Gi=!1,Do&&Hy()}function By(mo,Do={}){var yi,Xi;if(!Ae.value)return;const ki=ye.value;if(Ee.value>=ki)return;const bi=Math.max(1,mo),Ws=()=>{const Ol=Yu();let Rl=0;yt=null,It=null,ns=null,Et=!1;const Dl=Xt??bi;Xt=null;const em=Yu();Ee.value=Math.min(ki,Ee.value+Dl),gt(Ee.value),Rl=Yu()-em,(function(tm,Wy){if(!q)return void Dy(Wy);Hs=!0;const Uy=++So;ht().then(()=>{var qy;if(Uy!==So)return;const XM=Yu(),QM=Math.max(Wy,XM-tm),jy=()=>{Uy===So&&Dy(QM)};if(pt){let Vy=!1,wi=null;const Ky=()=>{Vy||(Vy=!0,jy())},Xu=pt(()=>{Yi.delete(Xu),wi!=null&&(window.clearTimeout(wi),qr.delete(wi),wi=null),Ky()});return Yi.add(Xu),wi=window.setTimeout(()=>{wi!=null&&qr.delete(wi),wi=null,ot?.(Xu),Yi.delete(Xu),Ky()},Math.max(32,(qy=B.renderBatchIdleTimeoutMs)!=null?qy:120)),void qr.add(wi)}const zy=window.setTimeout(()=>{qr.delete(zy),jy()},0);qr.add(zy)})})(Ol,Rl)};if(!q||Do.immediate)return void Ws();const Qi=Math.max(0,(yi=B.renderBatchDelay)!=null?yi:16);if(Xt=Xt!=null?Math.max(Xt,bi):bi,!Et){if(Et=!0,!z&&st&&window.requestIdleCallback){const Ol=Math.max(0,(Xi=B.renderBatchIdleTimeoutMs)!=null?Xi:120);return void(ns=window.requestIdleCallback(()=>Ws(),{timeout:Ol}))}pt&&!z?yt=pt(()=>{Qi!==0?It=window.setTimeout(()=>Ws(),Qi):Ws()}):It=window.setTimeout(()=>Ws(),Qi)}}function Fy(mo,Do={}){Hs?Gi=!0:mo==null?Hy():By(mo,Do)}function Hy(){Ae.value&&By(De.value?Math.max(1,Math.round(He.value)):Math.max(1,Ue.value))}return ze([Z,me,_e,Ae,Ue,Be,()=>B.renderBatchDelay],()=>{var mo;const Do=me.value,yi=Ke.value,Xi=_e.value,ki=!Object.is(Xi,yi.key),bi=Do!==yi.total,Ws=ki||bi;Ke.value={key:Xi,total:Do};const Qi=Ge.value,Ol=(mo=B.renderBatchDelay)!=null?mo:16,Rl=Qi.batchSize!==Ue.value||Qi.initial!==Be.value||Qi.delay!==Ol||Qi.enabled!==Ae.value;Ge.value={batchSize:Ue.value,initial:Be.value,delay:Ol,enabled:Ae.value},ki&&mt(Do),(Ws||Rl||!Ae.value)&&Ry(),(Ws||Rl)&&(He.value=Math.max(1,Ue.value||1)),Ws&&Ut();const Dl=ye.value;if(!Do)return Ee.value=0,void gt(0);if(!Ae.value)return Ee.value=Dl,void gt(Ee.value);const em=ki||yi.total===0;Ee.value=em||Rl?Math.min(Dl,Be.value):Math.min(Ee.value,Dl);const tm=Math.max(1,Be.value||Ue.value||Do);Ee.value<Dl?Fy(tm,{immediate:!q}):gt(Ee.value)},{immediate:!0}),ze(ye,(mo,Do)=>{Ae.value&&(typeof Do=="number"&&mo<=Do||mo>Ee.value&&Fy())}),{cleanupBatchScheduler:Ry}})({props:v,isClient:le,isTestEnv:gn,parsedNodesIdentity:Xo,parsedNodeCount:Po,desiredRenderedCount:$u,datasetKey:_M,batchingEnabled:Ui,incrementalRenderingActive:fi,resolvedBatchSize:ys,resolvedInitialBatch:Zo,renderedCount:Vn,adaptiveBatchSize:de,previousRenderContext:hi,previousBatchConfig:Te,requestFrame:Ct,cancelFrame:St,hasIdleCallback:mn,cleanupNodeVisibility:gM,onDatasetKeyChanged:A=>{Nl(),Eu(),Cs(),Ka(),A>0&&Au(A)},onDatasetChanged:()=>{it.value&&Js({immediate:!0})}});ze([L0,it,()=>T.value,()=>X()],([A,B])=>{if(!A)return U0(),void up();vM(),B?Js({immediate:!0}):up()},{flush:"post",immediate:!0}),ze([()=>Je.value.length,()=>it.value],A=>Cn(null,[A],function*([B,q]){q&&B&&le&&(yield ht(),Js({immediate:!0}))}),{flush:"post"}),ze(nn,A=>{A&&(function(){var B;if(ho.value&&Ln.value&&cn.value&&((B=wn.value)!=null&&B[1]))return;const q=fr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),z=fr({type:"list_item",children:[q],raw:"- Probe paragraph text"}),Z=fr({type:"list",ordered:!1,items:[z],raw:"- Probe paragraph text"});ho.value=q,Ln.value=z,cn.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]=fr({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([()=>T.value,nn],()=>{if(!nn.value)return pp(),void(K.value=0);j0(),pp(),nn.value&&T.value&&typeof ResizeObserver<"u"&&(Da=new ResizeObserver(()=>{j0(),ks.value&&Pa(),Pt.value&&El(),un("resize")}),Da.observe(T.value))},{immediate:!0}),ze([nn,je,ts],()=>Cn(null,null,function*(){if(!nn.value)return G.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Cs();yield ht(),(function(){if(!nn.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 Cs();const A={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},B=q0(hp(I.value),".paragraph-node");A.paragraph=og(I.value,B,"pre-wrap");const q=hp(R.value),z=q?.querySelector(".paragraph-node");A.listItem=og(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});A.listWrapperOverhead=Math.max(0,Z-me);for(let ye=1;ye<=6;ye++){const _e=q0(hp(W[ye]),`h${ye}`);A.headings[ye]=og(W[ye],_e,"pre-wrap")}G.value=A,Cs()})()}),{flush:"post",immediate:!0}),ze(()=>Je.value.length,()=>{it.value&&Js({immediate:!0})}),ze([nn,K],()=>{Cs(),it.value&&Js({immediate:!0}),ks.value&&Pa(),Pt.value&&El(),un("resize")},{immediate:!1}),ze(()=>qi.value,A=>{if(A)for(const[B,q]of Le)vy(B,q);else{fp();for(const[B,q]of Le)q&&Vi(B,!0)}},{immediate:!1}),ze([()=>v.viewportPriority,()=>Je.value.length],([A,B])=>{A!==!1?V.value&&B<=200&&(V.value=!1):V.value=!1}),ze(()=>Vn.value,()=>{it.value&&Js({immediate:!0})}),ze([_s,tt,Ra,()=>Je.value.length,it],()=>{Lr()},{immediate:!0});let Ya=null,Xa=!1,Ll=null;function Qa(){Ya=null,Cp=null,_p=void 0,Tl=null,Ka()}function Kp(){Nl(),Eu(),Cs(),Lt.clear();const A=Je.value.length;A>0&&Au(A),Pp()}function Gp(){Up(),H0(),ja=null,Br=null,Fr=null,Hu=null,Wa=null,Ua=null,Xa=!1,Qa(),J0("restore"),Tu(),Ml()}function Za(A){var B;return[(B=Kn())!=null?B:"",vn(),gi(),Du.value,Va(A),Je.value.length,Math.round(Ki(0,Je.value.length)),Math.round(Rr()),ws.count,Math.round(ws.total)].join(":")}function ky(){return Cn(this,null,function*(){var A,B,q,z;const Z=(A=o.virtualScroll)==null?void 0:A.settledToken,me=Va(Z),ye=vn(),_e=Kn(),De=ts.value;if(Tt.value&&((B=o.virtualScroll)==null?void 0:B.settleMode)==="manual"&&Bu(Z))if(Sp()){if(Za(Z)!==Tl&&!Xa){Xa=!0;try{const Ae=yield Rp({reason:"manual",expectedSettledTokenKey:me}),Ue=Va()===me;Op(ye,_e,De)&&Ae.sessionKey===ye&&Ae.threadKey===_e&&Ue&&Ae.stable&&Ae.phase==="final"&&(Tl=Za((q=o.virtualScroll)==null?void 0:q.settledToken))}finally{Xa=!1,yield ht();const Ae=(z=o.virtualScroll)==null?void 0:z.settledToken,Ue=Bu(Ae)?Za(Ae):"";Op(ye,_e,De)&&Ue&&Tl!==Ue&&ky()}}}else un("manual")})}ze(Tt,(A,B)=>{if(A!==B){if(!A)return Gp(),void Up();Gp(),Kp(),Ll=ts.value,un("content")}},{flush:"post"}),ze([Tt,ts],([A,B])=>{A?Ll!=null?Ll!==B&&(Ll=B,(function(q="resize"){Nl(),Eu(),Cs(),Lt.clear();const z=Je.value.length;z>0&&Au(z),Pp(),Br=null,Fr=null,Hu=null,ja=null,Xa=!1,Qa(),uy(),ht(()=>{vi(),ks.value&&Pa(),Pt.value&&El(),un(q)})})("resize")):Ll=B:Ll=null},{flush:"post",immediate:!0}),ze([Tt,()=>vn(),()=>Kn()],([A])=>{A&&(Gp(),Kp(),J0("content"),un("content"))}),ze([Tt,()=>vn(),()=>Kn(),ts,()=>Je.value.length],([A])=>{A&&(function(B="async-node"){let q=!1;for(const[z,Z]of Array.from(Zs.entries()))bp(Z)||(Zs.delete(z),Jo.delete(z),q=!0);q&&(Sl(),un(B))})("async-node")},{flush:"post"}),ze([Tt,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.sessionKey},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.measurementKey},()=>o.indexKey,()=>J.value],([A])=>{A&&(Ka(),(function(B="content"){if(!Tt.value)return;const q=[],z=Je.value.length;for(const Z of Array.from(Lt.keys())){if(Z>=z){q.push(Z);continue}const me=Ha(Z),ye=Lt.get(Z);ye!=null&&ye!==me&&q.push(Z),Lt.set(Z,me)}for(const Z of Array.from(Lt.keys()))Z>=z&&Lt.delete(Z);q.length&&((function(Z,me={}){const ye=Array.from(Z,Number);fM(ye,me)>0&&(function(De){for(const Ae of De)Lt.delete(Ae)})(ye)})(q,{notify:!1}),Cs(),Qa(),ks.value&&Pa(),Pt.value&&El(),un(B))})("content"))},{flush:"post",immediate:!0}),ze([Tt,()=>Je.value.length,()=>vn(),()=>Kn()],([A,B,q,z],[Z,me,ye,_e])=>{A&&Z&&q===ye&&z===_e&&B!==me&&Qa()},{flush:"post"}),ze([Tt,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.heightCache},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.heightCacheWidth},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.measurementKey},()=>Je.value.length,()=>vn(),K],()=>{uy()},{flush:"post",immediate:!0}),ze([Tt,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.restoreAnchor},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.measurementKey},()=>Je.value.length,()=>vn(),K],A=>Cn(null,[A],function*([B,q]){if(!B||!q)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)})();Lp(q,{restoreAnchor:z!=null,restoreToken:z??void 0})}),{flush:"post",immediate:!0}),ze([Tt,K,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.restoreState},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.measurementKey}],([A])=>{var B;if(!A)return;const q=(B=o.virtualScroll)==null?void 0:B.restoreState;q&&Br&&Fr==="restore"&&(ay(q)||(Kp(),Br=null,Fr=null,un("resize")))},{flush:"post"}),ze([Tt,()=>Je.value.length,()=>vn(),K],A=>Cn(null,[A],function*([B]){var q;const z=Wa,Z=Ua;B&&z&&(yield ht(),!Lp(z,{restoreAnchor:Z?.restoreAnchor===!0,restoreToken:(q=Z?.restoreToken)!=null?q:"imperative",allowUncapturedAnchor:Z?.allowUncapturedAnchor===!0})&&dy(z)||(Wa=null,Ua=null))}),{flush:"post",immediate:!0}),ze([Tt,H,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.settleMode},()=>vn(),()=>Kn(),ts,ap,O0,()=>Vn.value,$u,()=>ws.count,()=>ws.total],([A,B,q])=>{if(!A||B!==!0||q==="manual"||!xp())return;const z=(function(){var Z;const me=Je.value.length;return[(Z=Kn())!=null?Z:"",vn(),gi(),Du.value,me,Math.round(Ki(0,me)),Math.round(Rr()),ws.count,Math.round(ws.total)].join(":")})();Ya!==z&&(Ya=z,Rp({reason:"final"}).then(Z=>{Z.stable||Ya!==z||(Ya=null)}))},{flush:"post",immediate:!0}),ze([Tt,H,()=>{var A;return(A=o.virtualScroll)==null?void 0:A.settleMode},()=>{var A;return(A=o.virtualScroll)==null?void 0:A.settledToken},()=>vn(),()=>Kn(),ts,ap,O0,()=>Vn.value,$u,()=>Je.value.length,()=>ws.count,()=>ws.total],()=>{ky()},{flush:"post",immediate:!0}),ze([()=>Je.value.length,it,tt,Ra,()=>ro.start,()=>ro.end],([A,B,q,z,Z,me])=>{ue.value&&ae("virtualization",{nodes:A,virtualization:B,maxLiveNodes:q,buffer:z,focusIndex:_s.value,scroll:B?(()=>{const ye=hn.value||Se();return ye?{reverse:j(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([()=>v.customId],([A],B,q)=>{if(!A||On)return;const z=(function(Z,me){return Z?(Gn.controllers[Z]=me,()=>{Gn.controllers[Z]===me&&delete Gn.controllers[Z]}):()=>{}})(A,{captureRestoreAnchor:T0,restoreAnchor:A0,getAnchorDrift:aM,getReport:kM});q(()=>{z()})},{immediate:!0}),Yo(()=>{(function(){if(Tt.value)try{vi(),qa();const A=Dr("manual");hy(A)&&(M(A),ja=A,Bp=za());const B=Al(A,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});B&&($(B),B.anchor&&O(B.anchor),Il=Ga(B))}catch{}})(),IM(),fp(),$e(),yy();for(const A of ji.values())for(const B of A)Lu(B);ji.clear(),Pr.clear(),Lt.clear(),Vp(),Nl(),pp(),Tu(),Ml(),Up(),U0(),up()});const $M=ai({loader:()=>Cn(null,null,function*(){try{return(yield cs(()=>import("./index11-qzoItZ5X.js"),__vite__mapDeps([6,3]))).default}catch(A){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".',A),ss}}),loadingComponent:Hq,delay:0}),NM=ai({loader:()=>Cn(null,null,function*(){try{return(yield cs(()=>import("./index10-C0e1uOHF.js"),[])).default}catch(A){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.',A),ss}}),loadingComponent:Fq,delay:0}),LM=ai(()=>Cn(null,null,function*(){try{return(yield cs(()=>import("./index7-BU9c3C-0.js"),[])).default}catch(A){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".',A),ss}})),by={text:Nn,paragraph:dl,heading:Gf,code_block:Ym,list:ka,list_item:ya,blockquote:zd,table:Bc,definition_list:Vd,footnote:Kd,footnote_reference:hs,footnote_anchor:Rc,admonition:Qd,vmr_container:Yd,hardbreak:kr,link:No,image:yr,thematic_break:Gd,math_inline:Gs,math_block:RA,strong:Io,emphasis:Lo,strikethrough:$o,highlight:ms,insert:Ko,subscript:Vo,superscript:zo,emoji:jo,checkbox:fs,checkbox_input:fs,inline_code:_o,html_inline:ps,reference:Eo,html_block:Dc},PM=F(()=>yp()),wy=F(()=>X_(v.codeBlockProps)),OM=F(()=>X_(v.codeBlockProps,{omit:["langs"]})),_y=F(()=>et(et({stream:v.codeBlockStream,darkTheme:v.codeBlockDarkTheme,lightTheme:v.codeBlockLightTheme,monacoOptions:v.codeBlockMonacoOptions,themes:v.themes,langs:u.value==="shiki"?v.langs:void 0,minWidth:v.codeBlockMinWidth,maxWidth:v.codeBlockMaxWidth},typeof ve.value=="boolean"?{showTooltips:ve.value}:{}),OM.value)),Cy=F(()=>et(At(et({},_y.value),{langs:v.langs}),wy.value));function Sy(A){return typeof A=="boolean"?A:void 0}const RM=F(()=>{const A=v.codeBlockProps||{},B={},q=Sy(A.showLineNumbers);q!==void 0&&(B.showLineNumbers=q);const z=Sy(A.diffInline);z!==void 0&&(B.diffInline=z);const Z=(function(me){const ye=Number(me);return Number.isFinite(ye)&&ye>0?ye:void 0})(A.reservedHeightPx);return Z!==void 0&&(B.reservedHeightPx=Z),B}),DM=F(()=>et(et({stream:v.codeBlockStream,darkTheme:v.codeBlockDarkTheme,lightTheme:v.codeBlockLightTheme,themes:v.themes,langs:v.langs,minWidth:v.codeBlockMinWidth,maxWidth:v.codeBlockMaxWidth},typeof ve.value=="boolean"?{showTooltips:ve.value}:{}),wy.value)),BM=F(()=>et({},v.mermaidProps||{})),xy=F(()=>et({},v.d2Props||{})),FM=F(()=>et({},v.infographicProps||{})),Ja=F(()=>({typewriter:v.typewriter,fade:v.fade,customHtmlTags:jn.value.customHtmlTags})),HM=F(()=>et(et({},Ja.value),typeof ve.value=="boolean"?{showTooltip:ve.value}:{})),WM=F(()=>et(et({},Ja.value),typeof ve.value=="boolean"?{showTooltips:ve.value}:{})),UM=F(()=>et(et({},Ja.value),typeof ve.value=="boolean"?{showTooltips:ve.value}:{})),qM=F(()=>et(et({},Ja.value),typeof ve.value=="boolean"?{showTooltips:ve.value}:{}));function jM(A){return Array.isArray(A.children)&&A.children.length>0}const Yp=F(()=>yM.value.map(A=>{var B,q,z,Z,me,ye,_e,De;let Ae=(function(ot){var st,gt,mt,Ut,yt,It,Et;if(ot.type!=="code_block")return ot;const Xt=ot,ns=[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((yt=Xt.originalCode)!=null?yt:""),String((It=Xt.updatedCode)!=null?It:""),String((Et=Xt.raw)!=null?Et:"")].join("\0"),So=kt.get(Xt);if(So&&So.signature===ns)return So.node;const Hs=et({},Xt);return kt.set(Xt,{signature:ns,node:Hs}),Hs})(A.node);const Ue=qu(Ae);let Be=Ey(Ae,Ue);if((Ae.type==="html_block"||Ae.type==="html_inline")&&Be===by[Ae.type]){const ot=Ae,st=String((B=ot.tag)!=null?B:"").trim().toLowerCase()||TT(ot.content);if(st){const gt=Nt.value[st];if(Ft.value.has(st)&>)Be=gt,Ae=At(et({},ot),{type:st,tag:st,content:h7(ot.content,st)});else if(AT((q=ot.content)!=null?q:ot.raw,st)){const mt=String((Z=(z=ot.content)!=null?z:ot.raw)!=null?Z:"");Ae.type==="html_inline"?(Be=Nn,Ae={type:"text",content:mt,raw:mt}):(Be=dl,Ae={type:"paragraph",children:[{type:"text",content:mt,raw:mt}],raw:mt})}}}const Ee=Ae.type==="code_block"&&u.value==="pre"&&Be===ss&&!Xp(Nt.value,Ue);let He=et({},(function(ot,st,gt){const mt=st??qu(ot);if(ot.type==="code_block"){const Ut=mt?Xp(Nt.value,mt):void 0;if(gt&&u.value==="pre"&&!Ut&>===ss)return RM.value;if(gt&&mt&>===Ut)return mt==="mermaid"?Ay(ot):mt==="infographic"?My(ot):mt==="d2"||mt==="d2lang"?xy.value:Cy.value;if(gt&>===Nt.value.code_block)return Cy.value;if(V0(gt))return DM.value}return mt==="mermaid"?Ay(ot):mt==="infographic"?My(ot):mt==="d2"||mt==="d2lang"?xy.value:ot.type==="link"?HM.value:ot.type==="list"?WM.value:ot.type==="blockquote"?UM.value:ot.type==="table"?qM.value:ot.type==="code_block"?_y.value:Ja.value})(Ae,Ue,Be));const Ke=Or.value[A.index];Ae.type==="code_block"&&Ke?.kind==="code-block"&&(He=At(et({},He),Ee?{reservedHeightPx:(me=Ke.height)!=null?me:Ke.contentHeight}:{estimatedHeightPx:Ke.height,estimatedContentHeightPx:Ke.contentHeight})),Ee||Ae.type!=="code_block"||Ue!=="mermaid"||oa(He.estimatedPreviewHeightPx)!=null||(He=At(et({},He),{estimatedPreviewHeightPx:m1(h1(String((ye=Ae.code)!=null?ye:"")))})),Ee||Ae.type!=="code_block"||Ue!=="infographic"||oa(He.estimatedPreviewHeightPx)!=null||(He=At(et({},He),{estimatedPreviewHeightPx:g1(p1(String((_e=Ae.code)!=null?_e:"")))})),Ae.type==="math_block"&&(He=At(et({},He),{cacheScope:Mn.value}));const Ge=(function(ot,st){const gt=String(ot.type);return!_u(gt)&&Nt.value[gt]===st})(Ae,Be),pt=Ge?o0(Ae,Ne.value):void 0;return At(et({},A),{node:Ae,component:Be,bindings:He,customBindings:et(et({},pt??{}),He),rendersCustomNode:Ge,hasSlotChildren:jM(Ae),slotContent:String((De=Ae.content)!=null?De:""),isCodeBlock:Ae.type==="code_block",indexKey:`${PM.value}-${A.index}`})}));function qu(A){var B;return A?.type==="code_block"?String((B=A.language)!=null?B:"").trim().toLowerCase():""}function Xp(A,B){const q=B.trim().toLowerCase();if(q)for(const z of[q,Jv(q),wA(q)]){const Z=z&&A[z];if(Z)return Z}}function Ty(A,B,q,z){var Z,me;const ye=et({},A.value);return oa(ye.estimatedPreviewHeightPx)==null&&(ye.estimatedPreviewHeightPx=z(q(String((Z=B?.code)!=null?Z:"")),void 0,ye.maxHeight==="none"?null:(me=oa(ye.maxHeight))!=null?me:void 0)),ye}function Ay(A){return Ty(BM,A,h1,m1)}function My(A){return Ty(FM,A,p1,g1)}function Ey(A,B){if(!A)return T1;const q=Nt.value,z=q[String(A.type)];if(A.type==="code_block"){const Z=B??qu(A),me=Z?Xp(q,Z):void 0;return me||(u.value==="pre"?q.code_block||ss:Z==="mermaid"?q.mermaid||$M:Z==="infographic"?q.infographic||NM:Z==="d2"||Z==="d2lang"?q.d2||LM:z||q.code_block||K0.value)}return z||by[String(A.type)]||T1}function Qp(A){s("click",A)}function zM(A){var B;(B=A.target)!=null&&B.closest("[data-node-index]")&&s("mouseover",A)}function VM(A){var B;(B=A.target)!=null&&B.closest("[data-node-index]")&&s("mouseout",A)}function Iy(A){s("mouseover",A)}function $y(A){s("mouseout",A)}const Ur=ne(null),ei=ne(!1);let ec,Pl=null,Zp=0,ju=0,zu=0;const Ny=["code_block","admonition","table","math_block","html_block","image","thematic_break"],KM=new Set(Ny),Ly=[".typewriter-cursor",".height-estimation-probes",...Ny.map(A=>`[data-node-type="${A}"]`),"script","style"].join(",");function Py(A){if(!A||typeof A!="object")return!1;const B=A.type;return typeof B=="string"&&KM.has(B)}function Vu(A){var B,q;if(!A||typeof A!="object")return 0;const z=A,Z=(q=(B=z.raw)!=null?B:z.content)!=null?q:z.code;if(typeof Z=="string")return Z.length;const me=z.children;if(Array.isArray(me))return me.reduce((_e,De)=>_e+Vu(De),0);const ye=z.items;return Array.isArray(ye)?ye.reduce((_e,De)=>_e+Vu(De),0):0}function Ku(){ec&&(clearTimeout(ec),ec=void 0)}function Oy(){Zp+=1,Pl!=null&&(St?.(Pl),Pl=null)}function Gu(){Oy(),Ur.value&&(Ur.value.style.visibility="hidden")}function GM(A){var B;if(A.nodeType!==Node.TEXT_NODE||!((B=A.textContent)!=null?B:"").trim())return!1;const q=A.parentElement;return!!q&&!q.closest(Ly)}function YM(A){let B=A.lastChild;for(;B;){if(GM(B))return B;if(B.nodeType===Node.ELEMENT_NODE){const q=B;if(!q.matches(Ly)&&q.lastChild){B=q.lastChild;continue}}for(;B&&B!==A&&!B.previousSibling;)B=B.parentNode;if(!B||B===A)break;B=B.previousSibling}return null}function Jp(){if(!le||!ei.value||Pl!=null)return;const A=Zp,B=()=>{Pl=null,A===Zp&&(function(){var q,z;if(!(le&&ei.value&&T.value&&Ur.value))return;const Z=T.value,me=Ur.value;me.style.visibility="hidden";const ye=(function(){const Be=Yp.value;for(let Ee=Be.length-1;Ee>=0;Ee--){const He=Be[Ee];if(!He||Py(He.node)||!jp(He.index))continue;const Ke=Le.get(He.index);if(!Ke)continue;const Ge=YM(Ke);if(Ge)return Ge}return null})();if(!ye)return;let _e=0,De=0,Ae=20,Ue=!1;if(ye?.textContent){const Be=ye.textContent.length,Ee=document.createRange();Ee.setStart(ye,Math.max(0,Be-1)),Ee.setEnd(ye,Be);const He=typeof Ee.getClientRects=="function"?Ee.getClientRects():void 0,Ke=(z=He?.[He.length-1])!=null?z:(q=ye.parentElement)==null?void 0:q.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,Ae=Ke.height||Ae,Ue=!0}Ee.detach()}Ue&&(me.style.transform=`translate(${Math.max(0,_e)}px, ${Math.max(0,De)}px)`,me.style.height=`${Ae}px`,me.style.visibility="visible")})()};Ct?Pl=Ct(B):B()}return ze([fe,()=>o.content,()=>o.nodes,()=>v.typewriter,H],()=>Cn(null,null,function*(){var A,B;if(!le||We.value||!Q.value)return;if(H.value)return ei.value=!1,Ku(),void Gu();if((A=o.nodes)!=null&&A.length)return ei.value=!1,Ku(),Gu(),ju=((B=o.content)!=null?B:"").length,void(zu=fe.value.length);const q=(function(){var _e,De;return(_e=o.nodes)!=null&&_e.length?o.nodes.reduce((Ae,Ue)=>Ae+Vu(Ue),0):((De=o.content)!=null?De:"").length})(),z=(function(){var _e;return(_e=o.nodes)!=null&&_e.length?o.nodes.reduce((De,Ae)=>De+Vu(Ae),0):fe.value.length})(),Z=!Py(Je.value[Je.value.length-1]),me=q>ju,ye=z>zu;if(v.typewriter===!1||!Z||!me&&!ye)return v.typewriter!==!1&&Z||(ei.value=!1,Gu()),ju=q,void(zu=z);ju=q,zu=z,ei.value=!0,Ur.value&&(Ur.value.style.visibility="hidden"),Ku(),yield ht(),Jp(),ec=setTimeout(()=>{ec=void 0,ei.value=!1},3e3)}),{flush:"post",immediate:!0}),ze(ei,A=>Cn(null,null,function*(){A?(yield ht(),Jp()):Gu()}),{flush:"post"}),ze([()=>Vn.value,()=>ro.start,()=>ro.end],()=>Cn(null,null,function*(){le&&!We.value&&Q.value&&ei.value&&(yield ht(),Jp())}),{flush:"post"}),Yo(()=>{Ku(),Oy(),fn.clear()}),(A,B)=>{const q=_4("NodeRenderer",!0);return x(We)?(C(!0),E(Oe,{key:0},Xe(Yp.value,z=>(C(),E(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":v.customId,"is-dark":v.isDark,onClick:Qp,onMouseover:Iy,onMouseout:$y,onCopy:B[0]||(B[0]=Z=>s("copy",Z)),onHandleArtifactClick:B[1]||(B[1]=Z=>s("handleArtifactClick",Z))}),{default:$n(()=>[z.hasSlotChildren?(C(),Ve(q,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(q,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"])):ie("",!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":v.customId,"is-dark":v.isDark,onClick:Qp,onMouseover:Iy,onMouseout:$y,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(),E("div",{key:1,ref_key:"containerRef",ref:T,class:Pe(["markstream-vue markdown-renderer",[{dark:v.isDark},{virtualized:it.value},{"virtual-scroll-coordinated":io.value}]]),"data-custom-id":v.customId,onClick:Qp,onMouseover:zM,onMouseout:VM},[Ro.value||it.value?(C(),E(Oe,{key:0},[Ro.value?(C(),E("div",{key:0,class:"height-estimation-probes",style:Wt({width:`${je.value}px`}),"aria-hidden":"true"},[p("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[vt(x(dl),{node:ho.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",Uq,[vt(x(ya),{node:Ln.value,"index-key":"probe-list-item"},null,8,["node"])])],512),p("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[vt(x(ka),{node:cn.value,"index-key":"probe-list"},null,8,["node"])],512),(C(),E(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(x(Gf),{node:mM(z),"index-key":`probe-heading-${z}`},null,8,["node","index-key"])],8,qq)),64))],4)):ie("",!0),it.value?(C(),E("div",{key:1,class:"node-spacer",style:Wt({height:`${gp.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],64)):ie("",!0),(C(!0),E(Oe,null,Xe(Yp.value,z=>(C(),E("div",{key:z.index,ref_for:!0,ref:Z=>vy(z.index,Z),class:"node-slot","data-node-index":z.index,"data-node-type":z.node.type},[jp(z.index)?(C(),E("div",{key:0,ref_for:!0,ref:Z=>(function(me,ye){var _e;ye||(function(Be){const Ee=`${yp()}-${Be}`;let He=!1;for(const Ke of Array.from(Jo.keys())){const Ge=Zs.get(Ke);(Ge?.index===Be||Ke===Ee||Ke.startsWith(`${Ee}-`))&&(Jo.delete(Ke),Zs.delete(Ke),He=!0)}He&&(Sl(),un("async-node"))})(me),mi.delete(me),(function(Be){var Ee;const He=((Ee=Pr.get(Be))!=null?Ee:0)+1;Pr.set(Be,He)})(me);const De=ji.get(me);if(De){for(const Be of De)Lu(Be);ji.delete(me)}if((function(Be){const Ee=Me.get(Be);Ee&&(pe?.unobserve(Ee),ee.delete(Ee),Me.delete(Be))})(me),!ye||!Ie.value)return Qs.delete(me),void Pr.delete(me);Qs.set(me,ye);const Ae=()=>{Uu(me,ye)};queueMicrotask(Ae);const Ue=(pe||typeof ResizeObserver>"u"||(pe=new ResizeObserver(Be=>{if(Be.length)for(const Ee of Be){const He=ee.get(Ee.target),Ke=Me.get(He??-1);He!=null&&Ke&&Uu(He,Ke)}else vi()})),pe);if(Ue&&(Me.set(me,ye),ee.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 Ee=Be.map(He=>F0(He,Ae,"node-resize")).filter(He=>He!=null);Ee.length&&ji.set(me,Ee)}}})(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":v.customId,"is-dark":v.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(q,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(q,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"])):ie("",!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":v.customId,"is-dark":v.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(Fi,{key:0,name:"fade",css:v.fade!==!1,appear:v.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":v.customId,"is-dark":v.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(q,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(q,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"])):ie("",!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":v.customId,"is-dark":v.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(),E("div",{key:1,class:"node-placeholder",style:Wt({height:`${Ru(z.index)}px`})},null,4))],8,jq))),128)),ei.value?(C(),E("span",{key:1,ref_key:"typewriterCursorRef",ref:Ur,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ie("",!0),it.value?(C(),E("div",{key:2,class:"node-spacer",style:Wt({height:`${vp.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],42,Wq))}}})),[["__scopeId","data-v-2e8e6e17"]]),Go=YA;Go.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Go.__name,Go.name].filter(n=>!!n));for(const n of t)e.component(n,YA)};const u0=Object.freeze(Object.defineProperty({__proto__:null,default:Go},Symbol.toStringTag,{value:"Module"})),zq={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"},Vq={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"},Kq={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"},Gq={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"},Yq={class:"admonition-title"},Xq=["aria-expanded","aria-controls"],Qq=["id"],Qd=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(),E("div",{class:Pe(["admonition",[`admonition-${o.node.kind}`]])},[p("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(C(),E("svg",zq,[...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(),E("svg",Vq,[...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(),E("svg",Kq,[...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(),E("svg",Gq,[...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)])])):ie("",!0),p("span",Yq,P(i.value),1),o.node.collapsible?(C(),E("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(C(),E("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,Xq)):ie("",!0)]),jt(p("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[vt(x(Go),{"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,Qq),[[js,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Qd.install=e=>{e.component(Qd.__name,Qd)};const XA=()=>cs(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let xd=null,Zq=XA;function ime(){return Cn(this,null,function*(){if(xd)return xd;const e=Zq;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===XA?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(xd=(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),xd):null})}function rme(){return!1}function lme(){return Cn(this,null,function*(){return null})}const Td=ne(!1);let l2=!1;function ig(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Jq(){return!l2&&typeof window<"u"&&typeof document<"u"&&(l2=!0,Td.value=ig(),new MutationObserver(()=>{Td.value=ig()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Td.value=ig()})),Td}const QA=["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"],ej=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),$1=[...QA].sort((e,t)=>t.length-e.length).join("|"),rg=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${$1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${$1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),ZA=/[),.;!?,。;!?)]+$/;function tj(e){const t=e.toLowerCase();return QA.some(n=>t.endsWith(`.${n}`))}function nj(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${$1}))["']`,"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 oj(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(ZA,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=ej.has(i),a=tj(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 sj(e,t={}){const n=[];rg.lastIndex=0;let o;for(;(o=rg.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(ZA,""),u=a.length-c.length;a=c;const d=oj(a,t);if(!d)continue;const f=o.index+r,g=f+a.length;n.push({...d,start:f,end:g,text:a}),u>0&&(rg.lastIndex-=u)}return n}const ij=12e4,rj=6e4,lj=32,aj=3e4,a2=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function cj(e){let t=0,n=0,o=0;a2.lastIndex=0;let s;for(;(s=a2.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=ij||n>=rj||t>=lj||o>=aj?"pre":"shiki",codeFenceCount:t,codeChars:n}}const uj={key:1,class:"diff-wrap"},dj={class:"diff-bar"},fj=["title","onClick"],hj={class:"diff-pre"},pj="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",c2="github-light",u2="github-dark",mj=Qe({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){lW();function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=xt(),o=Bt("resolveImage"),s=ne(null),i=e,r=F(()=>!i.streaming),l=F(()=>nj(i.text??"")),a=F(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:cj(i.text??"")),c=Jq(),u=F(()=>!i.streaming),d=as(new Map),f=new Set,g=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,h=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(R){return!/^(https?:|data:|blob:)/i.test(R)}function _(R){if(!o)return;const D=[];for(const W of[g,h]){W.lastIndex=0;let V;for(;(V=W.exec(R))!==null;)D.push(V[2]??"")}for(const W of D)!W||!m(W)||d.has(W)||f.has(W)||(f.add(W),o(W).then(V=>{d.set(W,V!==W?V:"")}).catch(()=>{d.set(W,"")}).finally(()=>{f.delete(W)}))}function w(R){if(!o)return R;const D=W=>{if(!m(W))return null;const V=d.get(W);return V===void 0?pj:V===""?null:V};return R.replace(g,(W,V,U,J)=>{const K=D(U);return K===null?W:`${V}${K}${J}`}).replace(h,(W,V,U,J)=>{const K=D(U);return K===null?W:`${V}${K}${J}`})}ze(()=>i.text,R=>_(R??""),{immediate:!0});function k(){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")&&V.data.trim().length>0&&D.push(V),W=R.nextNode()}for(const V of D){const U=sj(V.data,{aliases:l.value});if(U.length===0||!V.parentNode)continue;const J=document.createDocumentFragment();let K=0;for(const G of U){G.start>K&&J.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})}),J.append(X),K=G.end}K<V.data.length&&J.append(document.createTextNode(V.data.slice(K))),V.parentNode.replaceChild(J,V)}}function b(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function y(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 S(){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")continue;const W=D.getAttribute("href")??"";b(W)&&(D.dataset.mdLinkHandled="true",D.addEventListener("click",V=>{V.preventDefault(),V.stopPropagation(),i.openFile?.({path:y(W)})}))}}function L(){ht().then(()=>{k(),S()})}ze(()=>i.text,L),ze(()=>i.streaming,L);let N=null;rn(()=>{L(),s.value&&(N=new MutationObserver(L),N.observe(s.value,{childList:!0,subtree:!0}))}),Yt(()=>{N?.disconnect()});const v={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},M=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,$=F(()=>{const R=w(i.text??""),D=[];let W=0;M.lastIndex=0;let V;for(;(V=M.exec(R))!==null;){const J=V[1]??"",K=R.slice(W,V.index)+(J||"");K.trim()&&D.push({kind:"md",text:K}),D.push({kind:"diff",code:V[2]??""}),W=M.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 T=ne(null);function I(R,D){wo(R).then(W=>{W&&(T.value=D,setTimeout(()=>{T.value=null},1400))})}return(R,D)=>(C(),E("div",{ref_key:"mdRef",ref:s,class:"md"},[(C(!0),E(Oe,null,Xe($.value,(W,V)=>(C(),E(Oe,{key:V},[W.kind==="md"?(C(),Ve(x(Go),{key:0,content:W.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":x(c),"code-block-light-theme":c2,"code-block-dark-theme":u2,themes:[c2,u2],"code-block-props":v,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(),E("div",uj,[p("div",dj,[D[0]||(D[0]=p("span",{class:"diff-lang"},"diff",-1)),p("button",{class:"diff-copy",title:x(n)("filePreview.copyCode"),onClick:U=>I(W.code,V)},P(T.value===V?"✓":"⧉"),9,fj)]),p("pre",hj,[p("code",null,[(C(!0),E(Oe,null,Xe(O(W.code),(U,J)=>(C(),E("span",{key:J,class:Pe(U.cls)},P(U.text),3))),128))])])]))],64))),128))],512))}}),lu=bt(mj,[["__scopeId","data-v-84213e3a"]]),gj={class:"tc-anim"},vj={class:"prev-anim"},yj={class:"prev"},kj=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 rn(()=>{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(),E("div",{class:Pe(["think",{mob:e.mobile}])},[i.value?(C(),E("div",{key:0,class:Pe(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[p("div",gj,[p("pre",{ref_key:"bodyEl",ref:a,class:"tc"},P(e.text),513)]),p("div",vj,[p("span",yj,P(l.value),1)])],2)):(C(),E("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},P(e.text),513))],2))}}),d2=bt(kj,[["__scopeId","data-v-42c6573c"]]),bj={class:"activity-notice",role:"status"},wj={class:"an-moon","aria-hidden":"true"},_j={class:"an-label"},Cj=120,Sj=Qe({__name:"ActivityNotice",props:{label:{}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"],n=ne(0);let o=null;return rn(()=>{o=setInterval(()=>{n.value=(n.value+1)%t.length},Cj)}),Yt(()=>{o&&(clearInterval(o),o=null)}),(s,i)=>(C(),E("div",bj,[p("span",wj,P(t[n.value]),1),p("span",_j,P(e.label),1)]))}}),f2=bt(Sj,[["__scopeId","data-v-dfa53d2b"]]),xj=["disabled"],Tj={class:"agent-main"},Aj={class:"agent-title-row"},Mj={class:"agent-name"},Ej={key:0,class:"agent-type"},Ij={class:"agent-phase"},$j={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"},Nj=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(),E("div",{class:Pe(["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",Tj,[p("span",Aj,[p("span",Mj,P(e.member.name),1),e.member.subagentType?(C(),E("span",Ej,P(e.member.subagentType),1)):ie("",!0),r.value?(C(),E("span",{key:1,class:Pe(["agent-live",{empty:!i.value}])},P(i.value),3)):ie("",!0)])]),p("span",Ij,P(a(e.member.phase)),1),l.value?(C(),E("svg",$j,[...d[0]||(d[0]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])])):ie("",!0)],8,xj)],2))}}),N1=bt(Nj,[["__scopeId","data-v-bb535d33"]]),Lj={class:"agent-group"},Pj={class:"group-count"},Oj={key:0,class:"group-live"},Rj={key:0,class:"group-body"},Dj=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(),E("section",Lj,[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",Pj,P(i.value)+"/"+P(e.members.length),1),r.value>0?(C(),E("span",Oj,P(r.value)+" running",1)):ie("",!0),(C(),E("svg",{class:Pe(["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(),E("div",Rj,[(C(!0),E(Oe,null,Xe(e.members,c=>(C(),Ve(N1,{key:c.id,member:c,compact:"",onOpen:a[1]||(a[1]=u=>o("open",u))},null,8,["member"]))),128))])):ie("",!0)]))}}),h2=bt(Dj,[["__scopeId","data-v-17ab3c41"]]),Bj=["aria-label"],Fj=120,Hj=60,Wj=Qe({__name:"MoonSpinner",props:{fast:{type:Boolean},label:{default:"Working…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*Fj}ms`,"--moon-frame-fast-delay":`${o*Hj}ms`}}return(o,s)=>(C(),E("span",{class:Pe(["moon-spin",{"moon-spin--fast":e.fast}]),"aria-label":e.label,role:"img"},[(C(),E(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,Bj))}}),L1=bt(Wj,[["__scopeId","data-v-e7ccbb9a"]]);function Uj(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 p2(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function m2(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 Vh(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 qj(e){return!(e.tool.status==="ok"&&e.tool.media)}function g2(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function v2(e){const t=Vh(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(qj(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 jj(e){return Vh(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
236
|
-
|
|
237
|
-
`)}function zj(e){const t=[];for(const n of Vh(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 P1(e){return e.tool.id||`tool-${e.sourceIndex}`}function y2(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?P1({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 Vj={key:0,class:"chat"},Kj={key:0,class:"chat-loading"},Gj={class:"chat-loading-text"},Yj={key:1,class:"chat-empty"},Xj={key:1,class:"top-sentinel-text"},Qj=["data-turn-id"],Zj={key:0,class:"u-imgs"},Jj=["src"],ez=["src","alt"],tz={key:1,class:"skill-act"},nz={class:"skill-act-head"},oz={key:0,class:"skill-act-args"},sz={key:2,class:"u-text"},iz={key:0,class:"u-meta"},rz=["data-tooltip","onClick"],lz={class:"u-edit-text"},az=["onClick"],cz=["data-tooltip","onClick"],uz={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"},dz={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"},fz=["onClick"],hz=["data-turn-id"],pz=["onClick"],mz={class:"cd-view"},gz={key:1,class:"cd-label"},vz=["data-turn-id"],yz={key:1,class:"msg"},kz={key:2,class:"tool-stack"},bz={key:0,class:"a-msg-ft"},wz=["title"],_z=["onClick"],Cz={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"},Sz={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"},xz={class:"a-cpbtn-text"},Tz={key:4,class:"sending-placeholder"},Az={key:1,class:"term"},Mz={key:0,class:"chat-loading"},Ez={class:"chat-loading-text"},Iz={key:1,class:"chat-empty"},$z={key:1,class:"top-sentinel-text"},Nz=["data-turn-id"],Lz=["onClick"],Pz={class:"cd-view"},Oz={key:1,class:"cd-label"},Rz=["data-turn-id"],Dz={class:"no"},Bz={class:"tx"},Fz={class:"role-row"},Hz=["onClick"],Wz={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"},Uz={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"},qz={class:"cpbtn-text"},jz=["title"],zz={key:0,class:"u-text"},Vz={key:0,class:"skill-act"},Kz={class:"skill-act-head"},Gz={key:0,class:"skill-act-args"},Yz={key:2,class:"tool-stack"},Xz=["data-tooltip","onClick"],Qz={class:"u-edit-text"},Zz=["onClick"],Jz={key:4,class:"ln sending-line"},eV={class:"tx"},tV=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}=xt();Yt(()=>{W!==null&&(clearTimeout(W),W=null),M!==null&&(clearTimeout(M),M=null),k!==null&&(clearTimeout(k),k=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))}rn(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,f=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 g(K){return K.role==="user"&&K.id===f.value&&!s.running&&!s.sending&&!K.skillActivation}function h(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:p2(G.tokensBefore),after:p2(G.tokensAfter)}):X}const m=ne(null),_=ne(null),w=ne(null);let k=null;const b=ne(new Set);function y(K){return b.value.has(K)}function S(K){const G=new Set(b.value);G.has(K)?G.delete(K):G.add(K),b.value=G}function L(K,G){if(y(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 Uj(K,o("conversation.yesterday"))}function N(K){w.value===null&&(_.value=null,w.value=K.id,k=setTimeout(()=>{k=null,d("editMessage",K.text),w.value=null},240))}const v=ne(!1);let M=null;function $(){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=zj(X);le.trim()&&K.push(`**${ke}**
|
|
250
|
-
|
|
251
|
-
${le}`)}const G=K.join(`
|
|
252
|
-
|
|
253
|
-
---
|
|
254
|
-
|
|
255
|
-
`);wo(G).then(X=>{X&&(v.value=!0,d("copyConversationCopied"),M!==null&&clearTimeout(M),M=setTimeout(()=>{M=null,v.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 T(K){return O(K).map(G=>jj(G)).filter(Boolean).join(`
|
|
256
|
-
|
|
257
|
-
`)}function I(){for(let K=s.turns.length-1;K>=0;K-=1)if(s.turns[K]?.role==="assistant")return T(K);return""}function R(){const K=I();K.trim()&&wo(K).then(G=>{G&&(v.value=!0,d("copyConversationCopied"),M!==null&&clearTimeout(M),M=setTimeout(()=>{M=null,v.value=!1},2e3))}).catch(()=>{})}t({copyConversation:$,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=T(K);X.trim()&&wo(X).then(ke=>{ke&&(m.value=G.id,W!==null&&clearTimeout(W),W=setTimeout(()=>{W=null,m.value=null},1400))}).catch(()=>{})}function U(K){const G=K.text;G.trim()&&wo(G).then(X=>{X&&(m.value=K.id,W!==null&&clearTimeout(W),W=setTimeout(()=>{W=null,m.value=null},1400))}).catch(()=>{})}function J(K,G){return K.id!==c.value?!1:G.sourceIndex===Vh(K).length-1}return(K,G)=>i.value?(C(),E("div",Vj,[e.sessionLoading?(C(),E("div",Kj,[G[18]||(G[18]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),p("span",Gj,P(x(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(C(),E("div",Yj)):ie("",!0),e.hasMoreMessages||e.loadingMore?(C(),E("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Pe(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(C(),E("span",Xj,[G[19]||(G[19]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),ft(" "+P(x(o)("conversation.loadingOlder")),1)])):(C(),E("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:G[0]||(G[0]=X=>d("loadOlderMessages"))},P(x(o)("conversation.loadOlder")),1))],2)):ie("",!0),(C(!0),E(Oe,null,Xe(e.turns,(X,ke)=>(C(),E(Oe,{key:X.id},[X.role==="user"?(C(),E(Oe,{key:0},[p("div",{class:Pe(["u-bub turn-anchor",{undoing:w.value===X.id}]),"data-turn-id":X.id},[X.images&&X.images.length>0?(C(),E("div",Zj,[(C(!0),E(Oe,null,Xe(X.images,(le,We)=>(C(),E(Oe,{key:We},[le.kind==="video"?(C(),E("video",{key:0,class:"u-img",src:le.url,controls:"",playsinline:"",preload:"metadata"},null,8,Jj)):(C(),E("img",{key:1,class:"u-img",src:le.url,alt:le.alt||"",loading:"lazy"},null,8,ez))],64))),128))])):ie("",!0),X.skillActivation?(C(),E("div",tz,[p("div",nz,[G[20]||(G[20]=p("span",{class:"skill-act-arrow"},"▶",-1)),p("span",null,P(x(o)("conversation.activatedSkill",{name:X.skillActivation.name})),1)]),X.skillActivation.args?(C(),E("div",oz,P(X.skillActivation.args),1)):ie("",!0)])):(C(),E("div",sz,P(X.text),1))],10,Qj),X.createdAt||g(X)?(C(),E("div",iz,[g(X)?(C(),E("div",{key:0,class:Pe(["u-edit-wrap",{undoing:w.value===X.id}])},[_.value!==X.id?(C(),E("button",{key:0,type:"button",class:"u-edit","data-tooltip":x(o)("conversation.undoTooltip"),onClick:le=>_.value=X.id},[p("span",lz,P(x(o)("conversation.undo")),1),G[21]||(G[21]=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,rz)):(C(),E("div",{key:1,class:"u-edit-confirm",onClick:G[2]||(G[2]=Ze(()=>{},["stop"]))},[p("span",null,P(x(o)("conversation.undoConfirm")),1),p("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ze(le=>N(X),["stop"])},P(x(o)("conversation.confirm")),9,az),p("button",{type:"button",class:"u-edit-confirm-btn",onClick:G[1]||(G[1]=Ze(le=>_.value=null,["stop"]))},P(x(o)("conversation.cancel")),1)]))],2)):ie("",!0),X.text.trim().length>0?(C(),E("button",{key:1,type:"button",class:"u-copy","data-tooltip":x(o)("filePreview.copy"),onClick:Ze(le=>U(X),["stop"])},[m.value!==X.id?(C(),E("svg",uz,[...G[22]||(G[22]=[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(),E("svg",dz,[...G[23]||(G[23]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])]))],8,cz)):ie("",!0),X.createdAt?(C(),E("button",{key:2,type:"button",class:"u-time",onClick:Ze(le=>S(X.id),["stop"])},P(L(X.createdAt,X.id)),9,fz)):ie("",!0)])):ie("",!0)],64)):X.role==="compaction"?(C(),E("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":X.id,role:"separator"},[G[24]||(G[24]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1)),X.text?(C(),E("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:le=>d("openCompaction",{turnId:X.id})},[p("span",null,P(h(X)),1),p("span",mz,P(x(o)("conversation.viewSummary")),1)],8,pz)):(C(),E("span",gz,P(h(X)),1)),G[25]||(G[25]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,hz)):(C(),E("div",{key:2,class:"a-msg turn-anchor","data-turn-id":X.id},[(C(!0),E(Oe,null,Xe(x(v2)(X),(le,We)=>(C(),E(Oe,{key:x(y2)(le,We)},[le.kind==="thinking"?(C(),Ve(d2,{key:0,text:le.thinking,mobile:i.value,streaming:J(X,le),onOpen:ue=>d("openThinking",{turnId:X.id,blockIndex:le.sourceIndex})},null,8,["text","mobile","streaming","onOpen"])):le.kind==="text"&&le.text?(C(),E("div",yz,[vt(lu,{text:le.text,streaming:J(X,le),"open-file":ue=>d("openFile",ue)},null,8,["text","streaming","open-file"])])):le.kind==="tool-stack"?(C(),E("div",kz,[(C(!0),E(Oe,null,Xe(le.tools,(ue,ve)=>(C(),Ve(ud,{key:x(P1)(ue),tool:ue.tool,mobile:i.value,"stack-position":x(g2)(ve,le.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[3]||(G[3]=Ne=>d("openMedia",Ne)),onOpenFile:G[4]||(G[4]=Ne=>d("openFile",Ne)),onOpenToolDiff:G[5]||(G[5]=Ne=>d("openToolDiff",Ne))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])):le.kind==="agent"?(C(),Ve(N1,{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(h2,{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(ud,{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"])):ie("",!0)],64))),128)),X.id!==c.value&&D(ke)&&(T(ke).trim().length>0||X.durationMs!==void 0)?(C(),E("div",bz,[X.durationMs!==void 0?(C(),E("span",{key:0,class:"a-duration",title:`${X.durationMs} ms`},P(x(m2)(X.durationMs)),9,wz)):ie("",!0),T(ke).trim().length>0?(C(),E("button",{key:1,class:"a-cpbtn",tabindex:"-1",onClick:le=>V(ke)},[m.value!==X.id?(C(),E("svg",Cz,[...G[26]||(G[26]=[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(),E("svg",Sz,[...G[27]||(G[27]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),p("span",xz,P(x(o)("filePreview.copy")),1)],8,_z)):ie("",!0)])):ie("",!0)],8,vz))],64))),128)),e.compaction?(C(),Ve(f2,{key:3,label:x(o)("conversation.compacting")},null,8,["label"])):ie("",!0),u.value?(C(),E("div",Tz,[vt(L1,{fast:e.fastMoon},null,8,["fast"])])):ie("",!0)])):(C(),E("div",Az,[e.sessionLoading?(C(),E("div",Mz,[G[28]||(G[28]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),p("span",Ez,P(x(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(C(),E("div",Iz)):ie("",!0),e.hasMoreMessages||e.loadingMore?(C(),E("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Pe(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(C(),E("span",$z,[G[29]||(G[29]=p("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),ft(" "+P(x(o)("conversation.loadingOlder")),1)])):(C(),E("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:G[9]||(G[9]=X=>d("loadOlderMessages"))},P(x(o)("conversation.loadOlder")),1))],2)):ie("",!0),(C(!0),E(Oe,null,Xe(e.turns,(X,ke)=>(C(),E(Oe,{key:X.id},[X.role==="compaction"?(C(),E("div",{key:0,class:"compact-divider turn-anchor","data-turn-id":X.id,role:"separator"},[G[30]||(G[30]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1)),X.text?(C(),E("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:le=>d("openCompaction",{turnId:X.id})},[p("span",null,P(h(X)),1),p("span",Pz,P(x(o)("conversation.viewSummary")),1)],8,Lz)):(C(),E("span",Oz,P(h(X)),1)),G[31]||(G[31]=p("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Nz)):(C(),E("div",{key:1,class:Pe(["ln turn-anchor",[X.role==="user"?"userline":"ai",{undoing:w.value===X.id}]]),"data-turn-id":X.id},[p("span",Dz,P(X.no),1),p("div",Bz,[p("div",Fz,[X.role==="user"?(C(),E(Oe,{key:0},[G[32]||(G[32]=p("span",{class:"pr"},"user@kimi",-1)),G[33]||(G[33]=p("span",{class:"who"}," $ ",-1))],64)):(C(),E(Oe,{key:1},[G[34]||(G[34]=p("span",{class:"pr"},"kimi",-1)),G[35]||(G[35]=p("span",{class:"who"}," > ",-1))],64)),X.id!==c.value&&D(ke)&&T(ke).trim().length>0?(C(),E("button",{key:2,class:"cpbtn",onClick:le=>V(ke),tabindex:"-1"},[m.value!==X.id?(C(),E("svg",Wz,[...G[36]||(G[36]=[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(),E("svg",Uz,[...G[37]||(G[37]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),p("span",qz,P(x(o)("filePreview.copy")),1)],8,Hz)):ie("",!0),X.durationMs!==void 0&&X.role==="assistant"?(C(),E("span",{key:3,class:"turn-duration",title:`${X.durationMs} ms`},P(x(m2)(X.durationMs)),9,jz)):ie("",!0)]),X.role==="user"?(C(),E("div",zz,[X.skillActivation?(C(),E("div",Vz,[p("div",Kz,[G[38]||(G[38]=p("span",{class:"skill-act-arrow"},"▶",-1)),p("span",null,P(x(o)("conversation.activatedSkill",{name:X.skillActivation.name})),1)]),X.skillActivation.args?(C(),E("div",Gz,P(X.skillActivation.args),1)):ie("",!0)])):(C(),E(Oe,{key:1},[ft(P(X.text),1)],64))])):(C(!0),E(Oe,{key:1},Xe(x(v2)(X),(le,We)=>(C(),E(Oe,{key:x(y2)(le,We)},[le.kind==="thinking"?(C(),Ve(d2,{key:0,text:le.thinking,streaming:J(X,le),onOpen:ue=>d("openThinking",{turnId:X.id,blockIndex:le.sourceIndex})},null,8,["text","streaming","onOpen"])):le.kind==="text"&&le.text?(C(),Ve(lu,{key:1,text:le.text,streaming:J(X,le),"open-file":ue=>d("openFile",ue)},null,8,["text","streaming","open-file"])):le.kind==="tool-stack"?(C(),E("div",Yz,[(C(!0),E(Oe,null,Xe(le.tools,(ue,ve)=>(C(),Ve(ud,{key:x(P1)(ue),tool:ue.tool,"stack-position":x(g2)(ve,le.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:G[10]||(G[10]=Ne=>d("openMedia",Ne)),onOpenFile:G[11]||(G[11]=Ne=>d("openFile",Ne)),onOpenToolDiff:G[12]||(G[12]=Ne=>d("openToolDiff",Ne))},null,8,["tool","stack-position","tool-diff-panel"]))),128))])):le.kind==="agent"?(C(),Ve(N1,{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(h2,{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(ud,{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"])):ie("",!0)],64))),128))]),X.role==="user"&&g(X)?(C(),E("div",{key:0,class:Pe(["u-edit-wrap ln-edit-wrap",{undoing:w.value===X.id}])},[_.value!==X.id?(C(),E("button",{key:0,type:"button",class:"u-edit","data-tooltip":x(o)("conversation.undoTooltip"),onClick:le=>_.value=X.id},[G[39]||(G[39]=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",Qz,P(x(o)("conversation.undo")),1)],8,Xz)):(C(),E("div",{key:1,class:"u-edit-confirm",onClick:G[17]||(G[17]=Ze(()=>{},["stop"]))},[p("span",null,P(x(o)("conversation.undoConfirm")),1),p("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ze(le=>N(X),["stop"])},P(x(o)("conversation.confirm")),9,Zz),p("button",{type:"button",class:"u-edit-confirm-btn",onClick:G[16]||(G[16]=Ze(le=>_.value=null,["stop"]))},P(x(o)("conversation.cancel")),1)]))],2)):ie("",!0)],10,Rz))],64))),128)),e.compaction?(C(),Ve(f2,{key:3,label:x(o)("conversation.compacting")},null,8,["label"])):ie("",!0),u.value?(C(),E("div",Jz,[G[41]||(G[41]=p("span",{class:"no"},"—",-1)),p("div",eV,[G[40]||(G[40]=p("div",{class:"role-row"},[p("span",{class:"pr"},"kimi"),p("span",{class:"who"}," > ")],-1)),vt(L1,{fast:e.fastMoon,label:"Sending…"},null,8,["fast"])])])):ie("",!0)]))}}),JA=bt(tV,[["__scopeId","data-v-4ea264b2"]]),nV={class:"chat-header"},oV={class:"ch-id"},sV={key:0,class:"ch-ws"},iV={key:1,class:"ch-sep"},rV=["onKeydown"],lV=["title"],aV=["title","aria-label","aria-expanded"],cV=["title"],uV=["title"],dV={key:0,class:"ch-pill ch-sync-pill"},fV={key:0,class:"ch-ahead"},hV={key:1,class:"ch-behind"},pV={key:1,class:"ch-pill ch-diff-pill"},mV={key:0,class:"ch-add"},gV={key:1,class:"ch-del"},vV=["title"],yV=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}=xt(),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),f=ne(null),g=ne({});function h(V){const U=V.target;f.value?.contains(U)||d.value?.contains(U)||w()}function m(){w()}async function _(V){if(V.stopPropagation(),u.value){w();return}u.value=!0,document.addEventListener("mousedown",h),document.addEventListener("scroll",m,!0),window.addEventListener("resize",m),await ht();const U=d.value,J=f.value;if(!U||!J)return;const K=U.getBoundingClientRect(),G=4,X=8,ke=J.offsetWidth,le=J.offsetHeight;let We=K.bottom+G;We+le>window.innerHeight-X&&(We=Math.max(X,K.top-le-G));let ue=K.left;ue+ke>window.innerWidth-X&&(ue=Math.max(X,K.right-ke)),g.value={top:`${Math.round(We)}px`,left:`${Math.round(ue)}px`}}function w(){u.value=!1,D(),document.removeEventListener("mousedown",h),document.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}Yt(()=>{document.removeEventListener("mousedown",h),document.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)});function k(){s("copyAll"),w()}function b(){s("copyFinalSummary"),w()}const y=ne(!1);function S(){o.sessionId&&wo(o.sessionId).then(V=>{V&&(y.value=!0,setTimeout(()=>{y.value=!1},1200))})}const L=ne(!1),N=ne(""),v=ne(null);async function M(){if(w(),!!o.sessionId){L.value=!0,N.value=o.sessionTitle??"",await ht();try{v.value?.focus(),v.value?.select()}catch{}}}function $(){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 T(){o.sessionId&&(w(),s("forkSession",o.sessionId))}const I=ne(!1);let R;function D(){clearTimeout(R),I.value=!1}function W(){if(o.sessionId){if(I.value){s("archiveSession",o.sessionId),w();return}I.value=!0,R=setTimeout(()=>{I.value=!1},2500)}}return(V,U)=>(C(),E("header",nV,[p("div",oV,[e.workspaceName?(C(),E("span",sV,P(e.workspaceName),1)):ie("",!0),e.workspaceName&&e.sessionTitle?(C(),E("span",iV,"/")):ie("",!0),L.value?jt((C(),E("input",{key:2,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":U[0]||(U[0]=J=>N.value=J),class:"ch-rename",type:"text",onKeydown:[Ns(Ze($,["stop"]),["enter"]),Ns(Ze(O,["stop"]),["esc"])],onBlur:$,onClick:U[1]||(U[1]=Ze(()=>{},["stop"]))},null,40,rV)),[[Wn,N.value]]):e.sessionTitle?(C(),E("span",{key:3,class:"ch-ses",title:e.sessionTitle},P(e.sessionTitle),9,lV)):ie("",!0)]),p("button",{ref_key:"kebabRef",ref:d,type:"button",class:Pe(["ch-act ch-act-more",{open:u.value}]),title:x(n)("header.options"),"aria-label":x(n)("header.options"),"aria-expanded":u.value,"aria-haspopup":"menu",onClick:U[2]||(U[2]=Ze(J=>_(J),["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,aV),u.value?(C(),E("div",{key:0,ref_key:"menuRef",ref:f,class:"ch-menu",style:Wt(g.value),onClick:U[3]||(U[3]=Ze(()=>{},["stop"]))},[p("button",{type:"button",class:"chm-item",onClick:Ze(k,["stop"])},P(e.copied?x(n)("header.copied"):x(n)("header.copyAll")),1),p("button",{type:"button",class:"chm-item",onClick:Ze(b,["stop"])},P(x(n)("header.copyFinalSummary")),1),e.sessionId?(C(),E(Oe,{key:0},[U[7]||(U[7]=p("div",{class:"chm-divider"},null,-1)),p("button",{type:"button",class:"chm-item",onClick:Ze(S,["stop"])},[p("span",null,P(y.value?x(n)("header.copied"):x(n)("header.copySessionId")),1)]),p("button",{type:"button",class:"chm-item",onClick:Ze(M,["stop"])},P(x(n)("header.renameSession")),1),p("button",{type:"button",class:"chm-item",onClick:Ze(T,["stop"])},P(x(n)("header.forkSession")),1),p("button",{type:"button",class:"chm-item del",onClick:Ze(W,["stop"])},P(I.value?x(n)("header.confirmArchive"):x(n)("header.archiveSession")),1)],64)):ie("",!0)],4)):ie("",!0),U[9]||(U[9]=p("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(C(),E("button",{key:1,type:"button",class:"ch-git",title:x(n)("header.gitTooltip"),onClick:U[4]||(U[4]=J=>s("openChanges"))},[p("span",{class:Pe(["ch-branch",{"ch-detached":!e.branch}]),title:e.branch||x(n)("header.detached")},P(e.branch||x(n)("header.detached")),11,uV),i.value>0||r.value>0?(C(),E("span",dV,[i.value>0?(C(),E("span",fV,"↑"+P(i.value),1)):ie("",!0),r.value>0?(C(),E("span",hV,"↓"+P(r.value),1)):ie("",!0)])):ie("",!0),c.value?(C(),E("span",pV,[l.value>0?(C(),E("span",mV,"+"+P(l.value),1)):ie("",!0),a.value>0?(C(),E("span",gV,"-"+P(a.value),1)):ie("",!0)])):ie("",!0)],8,cV)):ie("",!0),e.pr?(C(),E("button",{key:2,type:"button",class:Pe(["ch-pill ch-pr",`pr-${e.pr.state}`]),title:x(n)("header.openPr"),onClick:U[5]||(U[5]=J=>e.pr&&s("openPr",e.pr.url))},[U[8]||(U[8]=_r('<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-7eb81c61><circle cx="5" cy="6" r="3" data-v-7eb81c61></circle><path d="M5 9v12" data-v-7eb81c61></path><circle cx="19" cy="18" r="3" data-v-7eb81c61></circle><path d="m15 9-3-3 3-3" data-v-7eb81c61></path><path d="M12 6h5a2 2 0 0 1 2 2v7" data-v-7eb81c61></path></svg>',1)),p("span",null,"PR #"+P(e.pr.number)+" · "+P(e.pr.state),1)],10,vV)):ie("",!0)]))}}),kV=bt(yV,[["__scopeId","data-v-7eb81c61"]]),bV={key:0,class:"slash-menu",role:"listbox"},wV=["aria-selected","onMouseenter","onMousedown"],_V={class:"slash-name"},CV={class:"slash-desc"},SV=Qe({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=xt(),o=e,s=t,i=ne([]);return ze(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(C(),E("div",bV,[(C(!0),E(Oe,null,Xe(e.items,(a,c)=>(C(),E("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Pe(["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",_V,P(a.name),1),p("span",CV,P(a.isSkill?a.desc:x(n)(a.desc)),1)],42,wV))),128))])):ie("",!0)}}),xV=bt(SV,[["__scopeId","data-v-738976e5"]]),TV={class:"mention-menu",role:"listbox"},AV={key:0,class:"mention-state dim"},MV={key:1,class:"mention-state dim"},EV=["aria-selected","onMouseenter","onMousedown"],IV=["innerHTML"],$V={class:"mention-name"},NV={class:"mention-path"},LV='<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>',PV='<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>',OV='<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>',RV='<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>',k2='<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>',DV=Qe({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),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 LV;const d=c.name||u.split("/").pop()||u,f=d.lastIndexOf("."),g=f>0?d.slice(f+1).toLowerCase():"";return g?i.has(g)?PV:r.has(g)?OV:l.has(g)?RV:k2:k2}return(c,u)=>(C(),E("div",TV,[n.loading?(C(),E("div",AV,P(x(s)("mention.searching")),1)):n.items.length===0?(C(),E("div",MV,P(x(s)("mention.noMatch")),1)):(C(!0),E(Oe,{key:2},Xe(n.items,(d,f)=>(C(),E("div",{key:d.path,class:Pe(["mention-item",{active:f===n.activeIndex}]),role:"option","aria-selected":f===n.activeIndex,onMouseenter:g=>o("hover",f),onMousedown:Ze(g=>o("select",d),["prevent"])},[p("span",{class:"mention-icon",innerHTML:a(d),"aria-hidden":"true"},null,8,IV),p("span",$V,P(d.name),1),p("span",NV,P(d.path),1)],42,EV))),128))]))}}),BV=bt(DV,[["__scopeId","data-v-86e06bbf"]]),e3=[{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:"/provider",desc:"commands.provider.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/permission",desc:"commands.permission.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/status",desc:"commands.status.desc"}];function FV(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 t3(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...e3,...t]}function HV(e,t=e3){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 n3(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 b2(e,t){switch(n3(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const Qf=100;function WV(e){const t=bv(Mt.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>Qf?n.slice(-Qf):n,s={[e]:o};return Th(Mt.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function UV(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=ne(WV(s())),r=F(()=>i.value[s()??""]??[]);let l=-1,a="";function c(w){const k=s();if(l=-1,!k)return;const b=w.trim();if(!b)return;const y=i.value[k]??[];if(y.at(-1)===b)return;const S=[...y,b],L=S.length>Qf?S.slice(-Qf):S;i.value={...i.value,[k]:L},Th(Mt.inputHistory,i.value)}function u(){const w=n.value;if(!w)return!1;const k=w.selectionStart??0;return w.value.lastIndexOf(`
|
|
258
|
-
`,k-1)===-1}function d(w){t.value=w,ht(()=>{const k=n.value;if(!k)return;o();const b=w.length;k.setSelectionRange(b,b)})}function f(){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 g(){if(l===-1)return;const w=r.value;l<w.length-1?(l+=1,d(w[l])):(l=-1,d(a))}function h(){l=-1}function m(){return l!==-1}function _(){return r.value.length>0}return ze(s,()=>{l=-1}),{push:c,caretAtFirstLine:u,recallOlder:f,recallNewer:g,resetBrowsing:h,isBrowsing:m,hasHistory:_}}function qV(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 g=t.value;g.startsWith("/")&&!g.includes(" ")?(c.value=HV(g,t3(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(g){if(a.value=!1,g.acceptsInput){t.value=`${g.name} `,ht(()=>{const h=n.value;if(!h)return;const m=t.value.length;h.setSelectionRange(m,m),h.focus(),o()});return}t.value="",l?.(),r(g.name),i(g.name)}return{open:a,items:c,active:u,update:d,select:f}}function jV(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 g=t.value,h=n.value?.selectionStart??g.length;let m=h-1;for(;m>=0&&!/\s/.test(g[m]);)m--;m++;const _=g.slice(m,h);return _.startsWith("@")?{token:_.slice(1),start:m,end:h}:null}function d(){const g=u(),h=s();if(!g||!h){i.value=!1;return}const m=g.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await h(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(g){const h=u();if(!h)return;const m=t.value;t.value=m.slice(0,h.start)+g.path+m.slice(h.end),i.value=!1,ht(()=>{const _=n.value;if(!_)return;const w=h.start+g.path.length;_.setSelectionRange(w,w),_.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function zV(e){const{sessionId:t}=e;function n(c){return bn(pb(c))??""}function o(c,u){const d=pb(c);u?An(d,u):Zc(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 VV(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(v,M){o.value={...o.value,[v]:M}}function d(v){try{URL.revokeObjectURL(v.previewUrl)}catch{}}function f(v){return v.startsWith("image/")?"image":v.startsWith("video/")?"video":null}async function g(v){const M=t();if(!M)return;const $=n()??"",O=v.map(T=>({file:T,kind:f(T.type)})).filter(T=>T.kind!==null);if(O.length!==0)for(const{file:T,kind:I}of O){const R=c(),D=URL.createObjectURL(T),W={localId:R,name:T.name,kind:I,previewUrl:D,uploading:!0};u($,[...o.value[$]??[],W]),M(T,T.name).then(V=>{const U=o.value[$]??[];u($,U.map(J=>J.localId===R?{...J,uploading:!1,fileId:V?.fileId,error:V===null}:J))}).catch(()=>{const V=o.value[$]??[];u($,V.map(U=>U.localId===R?{...U,uploading:!1,error:!0}:U))})}}function h(v){const M=n()??"",$=o.value[M]??[],O=$.find(T=>T.localId===v);i.value?.localId===v&&(i.value=null),O&&d(O),u(M,$.filter(T=>T.localId!==v))}function m(v){i.value=v}function _(){i.value=null}function w(){r.value?.click()}function k(v){const M=v.target,$=Array.from(M.files??[]);g($),M.value=""}function b(v){if(!t())return;const M=v.clipboardData;if(!M)return;const $=[],O=new Set,T=(I,R)=>{const D=`${I.size}:${I.type}:${R}`;if(O.has(D))return;O.add(D);const W=I.type.split("/")[1]??"png",V=R.includes(".")?R:`paste-${Date.now()}.${W}`;$.push(I instanceof File?I:new File([I],V,{type:I.type}))};for(const I of Array.from(M.items))if(I.kind==="file"&&f(I.type)){const R=I.getAsFile();R&&T(R,R.name||`paste-${Date.now()}.${I.type.split("/")[1]??"png"}`)}for(const I of Array.from(M.files))f(I.type)&&T(I,I.name);$.length!==0&&(v.preventDefault(),g($))}function y(v){!t()||!Array.from(v.dataTransfer?.items??[]).some($=>$.kind==="file")||(v.preventDefault(),l.value=!0)}function S(){l.value=!1}function L(v){if(l.value=!1,!t())return;v.preventDefault();const M=Array.from(v.dataTransfer?.files??[]);g(M)}function N(){const v=n()??"";for(const M of o.value[v]??[])d(M);u(v,[])}return ze(n,()=>{i.value=null}),rn(()=>{document.addEventListener("paste",b)}),Yt(()=>{document.removeEventListener("paste",b);for(const v of Object.values(o.value))for(const M of v)d(M);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:h,openAttachmentPreview:m,closeAttachmentPreview:_,openFilePicker:w,handleFileInputChange:k,handleDragOver:y,handleDragLeave:S,handleDrop:L,clearAfterSubmit:N}}const KV={key:0,class:"att-strip"},GV=["title","onClick"],YV=["src"],XV=["src","alt"],QV={key:2,class:"att-video-badge","aria-hidden":"true"},ZV={class:"att-name"},JV=["aria-label"],eK=["title"],tK=["title","onClick"],nK={class:"att-lightbox-card"},oK=["title"],sK=["src"],iK=["src","alt"],rK={class:"att-lightbox-name"},lK={class:"composer-card"},aK={class:"cin-wrap"},cK={class:"input-row"},uK=["placeholder"],dK={class:"send-col"},fK=["aria-label","title"],hK={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"},pK={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"},mK=["aria-label","title"],gK={class:"toolbar-left"},vK=["title"],yK=["title","onKeydown"],kK=["onClick"],bK={class:"pd-check"},wK={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"},_K={class:"pd-info"},CK={class:"pd-desc"},SK=["title"],xK={class:"mode-label"},TK={key:0,class:"mode-tag"},AK={key:1,class:"mode-tag"},MK={key:2,class:"mode-tag"},EK={class:"mode-row-name"},IK={class:"mode-row-name"},$K={class:"mode-row-name"},NK={key:0,class:"mode-row-actions"},LK={class:"toolbar-right"},PK=["title"],OK={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},RK=["stroke-dasharray","stroke-dashoffset"],DK={class:"ctx-num"},BK=["title","onKeydown"],FK={key:0,class:"think-suffix"},HK={key:0,class:"md-section"},WK=["onClick"],UK={class:"md-check"},qK={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"},jK={class:"md-name"},zK={class:"md-provider"},VK={key:1,class:"md-divider"},KK={key:2,class:"md-section"},GK=["onClick"],YK={class:"md-check"},XK={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"},QK={class:"md-name"},ZK={key:0,class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},JK={key:3,class:"md-divider"},eG=["disabled"],tG={class:"md-check"},nG={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"},oG={class:"md-name"},sG={key:0,class:"md-note"},iG={key:1,class:"md-note"},rG={class:"md-name"},w2=56,lG=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}=xt(),{text:l,textareaRef:a,autosize:c,loadForEdit:u,clearDraft:d}=zV({sessionId:()=>o.sessionId}),f=ne(!1);function g(){f.value=!f.value,ht(()=>{c(),w(),a.value?.focus()})}function h(){f.value&&(f.value=!1,ht(c))}function m(Ye){if(typeof getComputedStyle>"u")return w2;const je=Number.parseFloat(getComputedStyle(Ye).minHeight);return Number.isFinite(je)&&je>0?je:w2}const _=ne(!1);function w(){const Ye=a.value;_.value=!!Ye&&Ye.scrollHeight>m(Ye)}ze(l,()=>{ht(w)}),ze(()=>o.sessionId,()=>{f.value=!1});const k=UV({text:l,textareaRef:a,autosize:c,sessionId:()=>o.sessionId}),{open:b,items:y,active:S,update:L,select:N}=qV({text:l,textareaRef:a,autosize:c,skills:()=>o.skills,emitCommand:Ye=>i("command",Ye),historyPush:Ye=>k.push(Ye),clearDraft:d}),{open:v,items:M,active:$,loading:O,update:T,select:I}=jV({text:l,textareaRef:a,autosize:c,searchFiles:()=>o.searchFiles});function R(){k.resetBrowsing(),L(),T()}const{attachments:D,previewAttachment:W,fileInputRef:V,isDragOver:U,removeAttachment:J,openAttachmentPreview:K,closeAttachmentPreview:G,openFilePicker:X,handleFileInputChange:ke,handleDragOver:le,handleDragLeave:We,handleDrop:ue,clearAfterSubmit:ve}=VV({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});rn(()=>{l.value&&ht(()=>{c(),w()})}),Yt(()=>{document.removeEventListener("mousedown",On),j()});function Ne(){a.value?.focus({preventScroll:!0})}t({loadForEdit:u,focus:Ne});function Re(){const Ye=l.value.trim();if(D.value.some(it=>it.uploading))return;const je=D.value.filter(it=>!it.uploading&&!it.error&&it.fileId);if(!Ye&&je.length===0)return;if(k.push(Ye),Ye){const it=FV(Ye),Ie=it?t3(o.skills).some(be=>be.name===it.cmd):!1;if(it&&Ie){l.value="",d(),b.value=!1,h(),i("command",it.arg?`${it.cmd} ${it.arg}`:it.cmd);return}}const tt={text:Ye,attachments:je.map(it=>({fileId:it.fileId,kind:it.kind}))};W.value=null,ve(),l.value="",d(),b.value=!1,v.value=!1,h(),i("submit",tt)}function Q(){if(!o.running||D.value.some(it=>it.uploading))return;const Ye=l.value.trim(),je=D.value.filter(it=>!it.uploading&&!it.error&&it.fileId);if(!Ye&&je.length===0&&o.queued.length===0)return;const tt={text:Ye,attachments:je.map(it=>({fileId:it.fileId,kind:it.kind}))};ve(),k.push(Ye),l.value="",d(),b.value=!1,v.value=!1,h(),i("steer",tt)}let ce=!1,Se=null;function j(){Se!==null&&(clearTimeout(Se),Se=null)}function te(){j(),ce=!0}function he(){j(),Se=setTimeout(()=>{Se=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(),se();return}if(ge.value){Ye.preventDefault(),we();return}}if(b.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),S.value=(S.value+1)%y.value.length;return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),S.value=(S.value-1+y.value.length)%y.value.length;return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const je=y.value[S.value];je&&N(je);return}if(Ye.key==="Escape"){Ye.preventDefault(),b.value=!1;return}}if(v.value&&!O.value){if(Ye.key==="ArrowDown"){Ye.preventDefault(),$.value=($.value+1)%Math.max(1,M.value.length);return}if(Ye.key==="ArrowUp"){Ye.preventDefault(),$.value=($.value-1+Math.max(1,M.value.length))%Math.max(1,M.value.length);return}if(Ye.key==="Enter"||Ye.key==="Tab"){Ye.preventDefault();const je=M.value[$.value];je&&I(je);return}if(Ye.key==="Escape"){Ye.preventDefault(),v.value=!1;return}}if(Ye.key==="s"&&(Ye.ctrlKey||Ye.metaKey)&&!Ye.shiftKey&&!Ye.altKey){o.running&&(Ye.preventDefault(),Q());return}if(!b.value&&!v.value&&!Ye.shiftKey&&!Ye.altKey&&!Ye.metaKey&&!Ye.ctrlKey){const je=k.isBrowsing();if(Ye.key==="ArrowUp"&&k.hasHistory()&&(je||k.caretAtFirstLine())){Ye.preventDefault(),k.recallOlder();return}if(Ye.key==="ArrowDown"&&je){Ye.preventDefault(),k.recallNewer();return}}if(Ye.key==="Enter"&&!Ye.shiftKey){if(f.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 $e(){re.value=!re.value,re.value?(ge.value=!1,document.addEventListener("click",qe,!0)):document.removeEventListener("click",qe,!0)}function se(){re.value=!1,ge.value||document.removeEventListener("click",qe,!0)}function ae(){ge.value=!ge.value,ge.value?(re.value=!1,document.addEventListener("click",qe,!0)):document.removeEventListener("click",qe,!0)}function we(){ge.value=!1,re.value||document.removeEventListener("click",qe,!0)}function qe(Ye){xe.value&&!xe.value.contains(Ye.target)&&(se(),we())}Yt(()=>{document.removeEventListener("click",qe,!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(),je=(o.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:Ye,max:je,pct:ct.value})}),$t=F(()=>ct.value>=80),lt=F(()=>{const Ye=o.status?.modelId??o.status?.model??"";return o.models?.find(je=>je.id===Ye||je.model===Ye||je.displayName===o.status?.model)}),Rt=F(()=>n3(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),jn=F(()=>o.swarmMode===!0),Je=F(()=>o.activationBadges?.goal!==null),Qn=F(()=>Je.value||o.goalMode===!0),Xo=ne(!1),Po=ne(null),ho=ne(null),Ln=ne({}),cn=F(()=>Ft.value||jn.value||Qn.value);function wn(){Xo.value=!1,document.removeEventListener("mousedown",On)}function On(Ye){const je=Ye.target;Po.value?.contains(je)||ho.value?.contains(je)||wn()}function zn(){if(Xo.value){wn();return}const Ye=Po.value?.getBoundingClientRect();Ye&&(Ln.value={left:`${Math.round(Ye.left)}px`,bottom:`${Math.round(window.innerHeight-Ye.top+8)}px`}),Xo.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 Co(Ye){i("setPermission",Ye),we()}const po=F(()=>Zn.find(Ye=>Ye.mode===o.status?.permission)),Oo=F(()=>po.value?r(po.value.labelKey):""),Tt=F(()=>lt.value?.provider??""),io=F(()=>!Tt.value||!o.models?.length?[]:o.models.filter(Ye=>Ye.provider===Tt.value)),nn=F(()=>new Set(o.starredIds??[]));function Ro(Ye){return nn.value.has(Ye)}const Qo=F(()=>o.models?.length?o.models.filter(Ye=>Ro(Ye.id)&&Ye.provider!==Tt.value):[]);function Jn(Ye){i("selectModel",Ye),se()}return(Ye,je)=>(C(),E("div",{class:Pe(["composer",{"drag-over":x(U),expanded:f.value}]),onDragover:je[18]||(je[18]=(...tt)=>x(le)&&x(le)(...tt)),onDragleave:je[19]||(je[19]=(...tt)=>x(We)&&x(We)(...tt)),onDrop:je[20]||(je[20]=(...tt)=>x(ue)&&x(ue)(...tt))},[x(D).length>0?(C(),E("div",KV,[(C(!0),E(Oe,null,Xe(x(D),tt=>(C(),E("div",{key:tt.localId,class:Pe(["att-chip",{"att-error":tt.error}])},[p("button",{type:"button",class:"att-preview",title:x(r)("composer.previewAttachment",{name:tt.name}),onClick:it=>x(K)(tt)},[tt.kind==="video"?(C(),E("video",{key:0,class:"att-thumb",src:tt.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,YV)):(C(),E("img",{key:1,class:"att-thumb",src:tt.previewUrl,alt:tt.name},null,8,XV)),tt.kind==="video"?(C(),E("span",QV,[...je[21]||(je[21]=[p("svg",{viewBox:"0 0 16 16",width:"9",height:"9",fill:"currentColor"},[p("path",{d:"M5 3.5v9l7-4.5z"})],-1)])])):ie("",!0)],8,GV),p("span",ZV,P(tt.name),1),tt.uploading?(C(),E("span",{key:0,class:"att-spinner","aria-label":x(r)("composer.uploading")},[...je[22]||(je[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,JV)):tt.error?(C(),E("span",{key:1,class:"att-err-icon",title:x(r)("composer.uploadFailed")},[...je[23]||(je[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,eK)):ie("",!0),p("button",{class:"att-rm",title:x(r)("composer.removeNamed",{name:tt.name}),onClick:it=>x(J)(tt.localId)},[...je[24]||(je[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,tK)],2))),128))])):ie("",!0),x(W)?(C(),E("div",{key:1,class:"att-lightbox",onClick:je[1]||(je[1]=Ze((...tt)=>x(G)&&x(G)(...tt),["self"]))},[p("div",nK,[p("button",{type:"button",class:"att-lightbox-close",title:x(r)("model.close"),onClick:je[0]||(je[0]=(...tt)=>x(G)&&x(G)(...tt))},"✕",8,oK),x(W).kind==="video"?(C(),E("video",{key:0,class:"att-lightbox-media",src:x(W).previewUrl,controls:"",playsinline:""},null,8,sK)):(C(),E("img",{key:1,class:"att-lightbox-media",src:x(W).previewUrl,alt:x(W).name},null,8,iK)),p("div",rK,P(x(W).name),1)])])):ie("",!0),p("div",lK,[p("div",aK,[x(b)?(C(),Ve(xV,{key:0,items:x(y),"active-index":x(S),onSelect:x(N),onHover:je[2]||(je[2]=tt=>S.value=tt)},null,8,["items","active-index","onSelect"])):ie("",!0),x(v)?(C(),Ve(BV,{key:1,items:x(M),"active-index":x($),loading:x(O),onSelect:x(I),onHover:je[3]||(je[3]=tt=>$.value=tt)},null,8,["items","active-index","loading","onSelect"])):ie("",!0),p("div",cK,[jt(p("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":je[4]||(je[4]=tt=>Pn(l)?l.value=tt:null),class:"ph",placeholder:s.value,rows:"1",onKeydown:fe,onCompositionstart:te,onCompositionend:he,onInput:R},null,40,uK),[[Wn,x(l)]]),p("div",dK,[f.value||_.value?(C(),E("button",{key:0,class:"expand-btn",type:"button","aria-label":f.value?x(r)("composer.collapseTitle"):x(r)("composer.expandTitle"),title:f.value?x(r)("composer.collapseTitle"):x(r)("composer.expandTitle"),onClick:g},[f.value?(C(),E("svg",hK,[...je[25]||(je[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(),E("svg",pK,[...je[26]||(je[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,fK)):ie("",!0),p("button",{class:Pe(["send",{aborting:e.running}]),"aria-label":H.value,title:e.running?x(r)("composer.interruptTitle"):H.value,onClick:je[5]||(je[5]=tt=>e.running?i("interrupt"):Re())},[(C(),E("svg",{class:Pe(["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"},[...je[27]||(je[27]=[p("path",{d:"M8 3l6 5.5M8 3L2 8.5M8 3v10"},null,-1)])],2)),(C(),E("svg",{class:Pe(["send-icon",{hidden:!e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[...je[28]||(je[28]=[p("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1.5"},null,-1)])],2))],10,mK)])])]),Y.value?(C(),E("input",{key:0,ref_key:"fileInputRef",ref:V,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:je[6]||(je[6]=(...tt)=>x(ke)&&x(ke)(...tt))},null,544)):ie("",!0),p("div",{ref_key:"toolbarRef",ref:xe,class:"toolbar"},[p("div",gK,[Y.value?(C(),E("button",{key:0,class:"attach-btn",title:x(r)("composer.attachImage"),type:"button",onClick:je[7]||(je[7]=(...tt)=>x(X)&&x(X)(...tt))},[...je[29]||(je[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,vK)):ie("",!0),e.status?(C(),E("span",{key:1,class:Pe(["perm-pill",["perm-"+e.status.permission,{open:ge.value}]]),role:"button",tabindex:"0",title:x(r)("status.permissionTooltip"),onClick:Ze(ae,["stop"]),onKeydown:[Ns(ae,["enter"]),Ns(Ze(ae,["prevent"]),["space"])]},P(Oo.value),43,yK)):ie("",!0),ge.value&&e.status?(C(),E("div",{key:2,class:"perm-dropdown",role:"menu",onClick:je[8]||(je[8]=Ze(()=>{},["stop"]))},[(C(),E(Oe,null,Xe(Zn,tt=>p("button",{key:tt.mode,class:Pe(["pd-row",{"is-current":tt.mode===e.status.permission}]),role:"menuitem",onClick:it=>Co(tt.mode)},[p("span",bK,[tt.mode===e.status.permission?(C(),E("svg",wK,[...je[30]||(je[30]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),p("span",_K,[p("span",{class:"pd-name",style:Wt({color:tt.color})},P(x(r)(tt.labelKey)),5),p("span",CK,P(x(r)(tt.descKey)),1)])],10,kK)),64))])):ie("",!0),e.status?(C(),E("div",{key:3,ref_key:"modesRef",ref:Po,class:"modes"},[p("button",{type:"button",class:Pe(["mode-pill",{on:cn.value}]),title:x(r)("status.modesTooltip"),onClick:Ze(zn,["stop"])},[p("span",xK,P(x(r)("status.modesLabel")),1),Ft.value?(C(),E("span",TK,P(x(r)("status.planLabel")),1)):ie("",!0),jn.value?(C(),E("span",AK,P(x(r)("status.swarmLabel")),1)):ie("",!0),Qn.value?(C(),E("span",MK,P(x(r)("status.goalLabel")),1)):ie("",!0)],10,SK),Xo.value?(C(),E("div",{key:0,ref_key:"modesMenuRef",ref:ho,class:"modes-menu",style:Wt(Ln.value)},[p("button",{type:"button",class:Pe(["mode-row",{on:Ft.value}]),onClick:je[9]||(je[9]=tt=>i("togglePlan"))},[p("span",EK,P(x(r)("status.planLabel")),1),p("span",{class:Pe(["mode-switch",{on:Ft.value}])},[...je[31]||(je[31]=[p("span",{class:"mode-knob"},null,-1)])],2)],2),p("button",{type:"button",class:Pe(["mode-row",{on:jn.value}]),onClick:je[10]||(je[10]=tt=>i("toggleSwarm"))},[p("span",IK,P(x(r)("status.swarmLabel")),1),p("span",{class:Pe(["mode-switch",{on:jn.value}])},[...je[32]||(je[32]=[p("span",{class:"mode-knob"},null,-1)])],2)],2),p("div",{class:Pe(["mode-row mode-row-goal",{on:Je.value||o.goalMode}])},[p("button",{type:"button",class:"mode-row-main",onClick:je[11]||(je[11]=tt=>Je.value?i("controlGoal","cancel"):i("toggleGoal"))},[p("span",$K,P(x(r)("status.goalLabel")),1),Je.value?ie("",!0):(C(),E("span",{key:0,class:Pe(["mode-switch",{on:o.goalMode}])},[...je[33]||(je[33]=[p("span",{class:"mode-knob"},null,-1)])],2))]),Je.value?(C(),E("div",NK,[p("button",{type:"button",class:"mode-row-action",onClick:je[12]||(je[12]=tt=>i("controlGoal","pause"))},P(x(r)("status.goalPause")),1),p("button",{type:"button",class:"mode-row-action",onClick:je[13]||(je[13]=tt=>i("controlGoal","resume"))},P(x(r)("status.goalResume")),1)])):ie("",!0)],2)],4)):ie("",!0)],512)):ie("",!0)]),p("div",LK,[$t.value?(C(),E("button",{key:0,class:"compact-chip",onClick:je[14]||(je[14]=Ze(tt=>i("compact"),["stop"]))},"/compact")):ie("",!0),e.status&&!e.hideContext?(C(),E("span",{key:1,class:"ctx-group",title:_t.value},[(C(),E("svg",OK,[je[34]||(je[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,RK)])),p("span",DK,P(nt(e.status.ctxUsed))+"/"+P(nt(e.status.ctxMax)),1)],8,PK)):ie("",!0),e.status?(C(),E("span",{key:2,class:Pe(["model-pill",{open:re.value}]),role:"button",tabindex:"0",title:x(r)("status.modelTooltip"),onClick:Ze($e,["stop"]),onKeydown:[Ns($e,["enter"]),Ns(Ze($e,["prevent"]),["space"])]},[p("b",null,P(e.status.model),1),Mn.value?(C(),E("span",FK,P(x(r)("composer.thinkingSuffix")),1)):ie("",!0),je[35]||(je[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,BK)):ie("",!0)]),re.value&&e.status?(C(),E("div",{key:0,class:"model-dropdown",role:"menu",onClick:je[17]||(je[17]=Ze(()=>{},["stop"]))},[Qo.value.length>0?(C(),E("div",HK,P(x(r)("status.starredModels")),1)):ie("",!0),(C(!0),E(Oe,null,Xe(Qo.value,tt=>(C(),E("button",{key:tt.id,class:Pe(["md-row",{"is-current":tt.id===e.status.modelId}]),role:"menuitem",onClick:it=>Jn(tt.id)},[p("span",UK,[tt.id===e.status.model||tt.model===e.status.model||tt.displayName===e.status.model?(C(),E("svg",qK,[...je[36]||(je[36]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),p("span",jK,P(tt.displayName??tt.model),1),p("span",zK,P(tt.provider),1),je[37]||(je[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,WK))),128)),Qo.value.length>0?(C(),E("div",VK)):ie("",!0),io.value.length>0?(C(),E("div",KK,P(Tt.value),1)):ie("",!0),(C(!0),E(Oe,null,Xe(io.value,tt=>(C(),E("button",{key:tt.id,class:Pe(["md-row",{"is-current":tt.id===e.status.modelId}]),role:"menuitem",onClick:it=>Jn(tt.id)},[p("span",YK,[tt.id===e.status.model||tt.model===e.status.model||tt.displayName===e.status.model?(C(),E("svg",XK,[...je[38]||(je[38]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),p("span",QK,P(tt.displayName??tt.model),1),Ro(tt.id)?(C(),E("svg",ZK,[...je[39]||(je[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)])])):ie("",!0)],10,GK))),128)),io.value.length>0?(C(),E("div",JK)):ie("",!0),p("button",{class:Pe(["md-row md-row-toggle",{"is-on":Mn.value,"is-disabled":!fn.value}]),role:"menuitem",disabled:!fn.value,onClick:je[15]||(je[15]=tt=>Nt())},[p("span",tG,[Mn.value?(C(),E("svg",nG,[...je[40]||(je[40]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),p("span",oG,P(x(r)("status.thinkingLabel")),1),Rt.value==="always-on"?(C(),E("span",sG,P(x(r)("status.planOn")),1)):Rt.value==="unsupported"?(C(),E("span",iG,P(x(r)("status.modeNotSupported")),1)):ie("",!0)],10,eG),je[41]||(je[41]=p("div",{class:"md-divider"},null,-1)),p("button",{class:"md-row md-row-more",role:"menuitem",onClick:je[16]||(je[16]=tt=>{se(),i("pickModel")})},[p("span",rG,P(x(r)("status.moreModels")),1)])])):ie("",!0)],512)])],34))}}),o3=bt(lG,[["__scopeId","data-v-02652603"]]),aG=["id"],cG={class:"swarm-head"},uG={class:"swarm-count"},dG={class:"swarm-grid"},fG={class:"member-top"},hG={class:"member-name"},pG={class:"member-phase"},mG={class:"member-mid"},gG={class:"member-bar"},vG={key:0,class:"member-type"},yG={key:0,class:"member-bottom"},kG=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(),E("section",{class:"swarm-card",id:`swarm-${e.group.id}`},[p("header",cG,[a[0]||(a[0]=p("div",{class:"swarm-title"},[p("span",{class:"swarm-mark","aria-hidden":"true"}),p("span",null,"Swarm")],-1)),p("div",uG,P(o.value)+"/"+P(n.value),1)]),p("div",dG,[(C(!0),E(Oe,null,Xe(e.group.members,c=>(C(),E("article",{key:c.id,class:Pe(["swarm-member",`phase-${c.phase}`])},[p("div",fG,[p("span",hG,P(c.name),1),p("span",pG,P(s(c.phase)),1)]),p("div",mG,[p("span",gG,P(i(c)),1),c.subagentType?(C(),E("span",vG,P(c.subagentType),1)):ie("",!0)]),c.suspendedReason||r(c)||c.summary?(C(),E("div",yG,P(c.suspendedReason||r(c)||c.summary),1)):ie("",!0)],2))),128))])],8,aG))}}),bG=bt(kG,[["__scopeId","data-v-2cfb7bcf"]]),wG={class:"goal-progress","aria-hidden":"true"},_G={key:0,class:"goal-body"},CG={class:"goal-full"},SG={key:0,class:"goal-criterion"},xG={class:"goal-stats"},TG={key:0},AG={class:"goal-actions"},MG=Qe({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),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(),E("section",{class:Pe(["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:Pe(["goal-objective",{"expanded-hidden":i.value}])},P(e.goal.objective),3),p("span",{class:Pe(["goal-status",`status-${e.goal.status}`])},P(e.goal.status),3),p("span",wG,[p("span",{class:"goal-progress-fill",style:Wt({width:`${r.value}%`})},null,4)]),(C(),E("svg",{class:Pe(["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(),E("div",_G,[p("div",CG,P(e.goal.objective),1),e.goal.completionCriterion?(C(),E("div",SG,[c[6]||(c[6]=p("span",null,"Done when",-1)),p("p",null,P(e.goal.completionCriterion),1)])):ie("",!0),p("div",xG,[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(),E("span",TG,P(r.value)+"% token budget",1)):ie("",!0)]),p("div",AG,[e.goal.status!=="paused"?(C(),E("button",{key:0,type:"button",class:"goal-action",onClick:c[1]||(c[1]=Ze(u=>o("controlGoal","pause"),["stop"]))},P(x(s)("status.goalPause")),1)):ie("",!0),e.goal.status==="paused"?(C(),E("button",{key:1,type:"button",class:"goal-action primary",onClick:c[2]||(c[2]=Ze(u=>o("controlGoal","resume"),["stop"]))},P(x(s)("status.goalResume")),1)):ie("",!0),p("button",{type:"button",class:"goal-action danger",onClick:c[3]||(c[3]=Ze(u=>o("controlGoal","cancel"),["stop"]))},P(x(s)("status.goalCancel")),1)])])):ie("",!0)],2))}}),EG=bt(MG,[["__scopeId","data-v-dcbae4b7"]]),IG={class:"qh"},$G={class:"qtitle"},NG={key:0,class:"qstep"},LG={key:1,class:"qmin-peek"},PG=["title","aria-label"],OG={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"},RG={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"},DG={key:0,class:"qbody"},BG=["aria-label"],FG=["aria-selected","aria-label","onClick"],HG={class:"qstep-num"},WG={key:1,class:"qheader-chip"},UG={class:"qtext"},qG={class:"qopts"},jG=["onClick"],zG={class:"qopt-key"},VG={class:"qopt-glyph"},KG={key:0,class:"chk"},GG={key:1,class:"rad"},YG={class:"qopt-text"},XG={class:"qopt-label"},QG={key:0,class:"qopt-desc"},ZG={class:"qopt-glyph"},JG={key:0,class:"chk"},eY={key:1,class:"rad"},tY={class:"qopt-label"},nY=["placeholder"],oY={key:1,class:"qfooter"},sY=["disabled"],iY=["disabled"],rY=["disabled"],lY=Qe({__name:"QuestionCard",props:{question:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=xt(),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 f(O){const T=h.value[O];return T?T.kind==="multi"?T.optionIds.length>0:T.kind==="multiWithOther"?T.optionIds.length>0||T.otherText.trim().length>0:T.kind==="other"?T.text.trim().length>0:!0:!1}function g(){return f(l.value.id)}const h=ne({});function m(O){return O.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${O.label} ${O.description??""}`.toLowerCase())}function _(){const O={...h.value};let T=!1;for(const I of n.question.questions){if(O[I.id])continue;const R=I.options.filter(m);R.length!==0&&(O[I.id]=I.multiSelect?{kind:"multi",optionIds:R.map(D=>D.id)}:{kind:"single",optionId:R[0].id},T=!0)}T&&(h.value=O)}ze(()=>n.question.questionId,()=>{i.value=0,r.value=!1,h.value={},b.value={}}),ze(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),_()},{immediate:!0,deep:!0});function w(O,T){const I=h.value[O];if(I&&I.kind==="single"&&I.optionId===T){const R={...h.value};delete R[O],h.value=R}else h.value={...h.value,[O]:{kind:"single",optionId:T}}}function k(O,T){const I=h.value[O],R=I&&(I.kind==="multi"||I.kind==="multiWithOther")?I.kind==="multi"?[...I.optionIds]:[...I.optionIds]:[],D=R.indexOf(T);D>=0?R.splice(D,1):R.push(T);const W=h.value[O],V=W&&W.kind==="multiWithOther"?W.otherText:"";V?h.value={...h.value,[O]:{kind:"multiWithOther",optionIds:R,otherText:V}}:h.value={...h.value,[O]:{kind:"multi",optionIds:R}}}const b=ne({});function y(O){const T=n.question.questions.find(R=>R.id===O),I=b.value[O]??"";if(T.multiSelect){const R=h.value[O],D=R&&(R.kind==="multi"||R.kind==="multiWithOther")?R.kind==="multi"?[...R.optionIds]:[...R.optionIds]:[];h.value={...h.value,[O]:{kind:"multiWithOther",optionIds:D,otherText:I}}}else h.value={...h.value,[O]:{kind:"other",text:I}}}function S(O,T){const I=h.value[O];return I?I.kind==="single"?I.optionId===T:I.kind==="multi"||I.kind==="multiWithOther"?I.optionIds.includes(T):!1:!1}function L(O){const T=h.value[O];return!!(T&&(T.kind==="other"||T.kind==="multiWithOther"))}function N(){return n.question.questions.every(O=>f(O.id))}function v(){if(!N())return;const O={answers:h.value,method:"click"};s("answer",n.question.questionId,O)}function M(){s("dismiss",n.question.questionId)}function $(O){const T=(document.activeElement?.tagName??"").toLowerCase();if(T==="input"||T==="textarea"||r.value&&O.key!=="Escape")return;if(O.key==="Escape"){O.preventDefault(),M();return}if(O.key==="Enter"){O.preventDefault(),i.value<a.value-1&&g()?u():N()&&v();return}const I=parseInt(O.key,10);if(!isNaN(I)&&I>=1&&I<=9){O.preventDefault();const R=l.value,D=I-1,W=R.options[D];W&&(R.multiSelect?k(R.id,W.id):w(R.id,W.id))}}return rn(()=>document.addEventListener("keydown",$)),Yt(()=>document.removeEventListener("keydown",$)),(O,T)=>(C(),E("div",{class:Pe(["qcard",{minimized:r.value}])},[p("div",IG,[p("span",$G,P(x(o)("question.title")),1),a.value>1&&!r.value?(C(),E("span",NG,P(x(o)("question.step",{current:i.value+1,total:a.value})),1)):ie("",!0),r.value?(C(),E("span",LG,P(l.value.question),1)):ie("",!0),p("button",{class:"qmin",title:r.value?x(o)("question.expand"):x(o)("question.minimize"),"aria-label":r.value?x(o)("question.expand"):x(o)("question.minimize"),onClick:T[0]||(T[0]=I=>r.value=!r.value)},[r.value?(C(),E("svg",OG,[...T[4]||(T[4]=[p("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(C(),E("svg",RG,[...T[5]||(T[5]=[p("path",{d:"M3 8h10"},null,-1)])]))],8,PG)]),r.value?ie("",!0):(C(),E("div",DG,[a.value>1?(C(),E("div",{key:0,class:"qsteps",role:"tablist","aria-label":x(o)("question.step",{current:i.value+1,total:a.value})},[(C(!0),E(Oe,null,Xe(n.question.questions,(I,R)=>(C(),E("button",{key:I.id,type:"button",class:Pe(["qstep-dot",{active:R===i.value,answered:f(I.id)}]),"aria-selected":R===i.value,"aria-label":x(o)("question.step",{current:R+1,total:a.value}),onClick:D=>d(R)},[p("span",HG,P(R+1),1)],10,FG))),128))],8,BG)):ie("",!0),l.value.header?(C(),E("div",WG,P(l.value.header),1)):ie("",!0),p("div",UG,P(l.value.question),1),l.value.body?(C(),Ve(lu,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ie("",!0),p("div",qG,[(C(!0),E(Oe,null,Xe(l.value.options,(I,R)=>(C(),E("label",{key:I.id,class:Pe(["qopt",{selected:S(l.value.id,I.id)}]),onClick:Ze(D=>l.value.multiSelect?k(l.value.id,I.id):w(l.value.id,I.id),["prevent"])},[p("span",zG,P(R+1),1),p("span",VG,[l.value.multiSelect?(C(),E("span",KG,P(S(l.value.id,I.id)?"■":"□"),1)):(C(),E("span",GG,P(S(l.value.id,I.id)?"●":"○"),1))]),p("span",YG,[p("span",XG,P(I.label),1),I.description?(C(),E("span",QG,P(I.description),1)):ie("",!0)])],10,jG))),128)),l.value.allowOther?(C(),E("label",{key:0,class:Pe(["qopt",{selected:L(l.value.id)}]),onClick:Ze(()=>{},["prevent"])},[T[6]||(T[6]=p("span",{class:"qopt-key"},null,-1)),p("span",ZG,[l.value.multiSelect?(C(),E("span",JG,P(L(l.value.id)?"■":"□"),1)):(C(),E("span",eY,P(L(l.value.id)?"●":"○"),1))]),p("span",tY,P(l.value.otherLabel??x(o)("question.otherDefault")),1),jt(p("input",{"onUpdate:modelValue":T[1]||(T[1]=I=>b.value[l.value.id]=I),class:"other-input",type:"text",placeholder:l.value.otherLabel??x(o)("question.otherDefault"),onInput:T[2]||(T[2]=I=>y(l.value.id)),onFocus:T[3]||(T[3]=I=>y(l.value.id))},null,40,nY),[[Wn,b.value[l.value.id]]])],2)):ie("",!0)])])),r.value?ie("",!0):(C(),E("div",oY,[i.value<a.value-1?(C(),E("button",{key:0,type:"button",class:"qbtn pri qfooter-main",disabled:!g(),onClick:u},P(x(o)("question.nextQuestion")),9,sY)):(C(),E("button",{key:1,type:"button",class:"qbtn pri qfooter-main",disabled:!N(),onClick:v},P(x(o)("question.submit")),9,iY)),a.value>1?(C(),E("button",{key:2,type:"button",class:"qbtn",disabled:i.value===0,onClick:c},P(x(o)("question.back")),9,rY)):ie("",!0),p("button",{type:"button",class:"qbtn qbtn-text",onClick:M},P(x(o)("question.dismiss")),1)]))],2))}}),aY=bt(lY,[["__scopeId","data-v-8babd5ae"]]),cY={class:"ah"},uY={class:"akind"},dY={class:"apath"},fY={key:0,class:"abadge"},hY={key:1,class:"aw"},pY=["title","aria-label"],mY={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"},gY={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"},vY=["title"],yY={key:1,class:"diff"},kY={class:"dg"},bY={class:"dc"},wY={key:2,class:"body-shell"},_Y={class:"shell-cmd"},CY={key:0,class:"shell-cwd"},SY={key:1,class:"shell-danger"},xY={key:3,class:"body-file"},TY={class:"file-bar"},AY={class:"file-lang"},MY={class:"file-content"},EY={class:"file-ln"},IY={class:"file-text"},$Y={key:4,class:"body-chip"},NY={class:"chip-label"},LY={class:"chip-value"},PY={key:0,class:"chip-detail"},OY={key:5,class:"body-chip"},RY={key:0,class:"chip-label"},DY={class:"chip-value"},BY={key:6,class:"body-chip"},FY={class:"chip-label"},HY={class:"chip-value"},WY={key:0,class:"chip-detail"},UY={key:7,class:"body-chip"},qY={class:"chip-label"},jY={class:"chip-value"},zY={key:0,class:"chip-detail"},VY={key:8,class:"body-todo"},KY={class:"todo-glyph"},GY={key:9,class:"body-plan"},YY={key:10,class:"body-generic"},XY={class:"gen-text"},QY={key:11,class:"feedback-wrap"},ZY=["placeholder"],JY={class:"feedback-hint"},eX={key:12,class:"plan-actions"},tX=["title","onClick"],nX={class:"k"},oX={key:0,class:"k"},sX={key:0,class:"k"},iX={key:13,class:"abtn"},rX=Qe({__name:"ApprovalCard",props:{block:{},agentName:{}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),i=F(()=>{const v=n.block;return v.kind!=="plan_review"?null:{plan:v.plan,path:v.path,options:v.options??[]}}),r=ne(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const v=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${v}`)}const c=ne(!1),u=ne(""),d=ne(null);function f(){c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0)}function g(){const v=u.value.trim();i.value?o("decide",{decision:"rejected",selectedLabel:"Revise",feedback:v||void 0}):o("decide",{decision:"rejected",feedback:v||void 0}),c.value=!1,u.value=""}function h(){c.value=!1,u.value=""}function m(v){v.key==="Enter"&&!v.shiftKey?(v.preventDefault(),g()):v.key==="Escape"&&(v.preventDefault(),h())}function _(){o("decide",{decision:"approved"})}function w(){o("decide",{decision:"approved",scope:"session"})}function k(){o("decide",{decision:"rejected"})}function b(){o("decide",{decision:"approved"})}function y(v){o("decide",{decision:"approved",selectedLabel:v})}function S(){f()}function L(){o("decide",{decision:"rejected",selectedLabel:"Reject and Exit"})}function N(v){const M=(document.activeElement?.tagName??"").toLowerCase();if(M==="input"||M==="textarea"||r.value)return;const $=i.value;if($){if($.options.length===0){v.key==="1"?(v.preventDefault(),b()):v.key==="2"?(v.preventDefault(),S()):v.key==="3"&&(v.preventDefault(),L());return}v.key==="1"&&$.options[0]?(v.preventDefault(),y($.options[0].label)):v.key==="2"&&$.options[1]?(v.preventDefault(),y($.options[1].label)):v.key==="3"&&$.options[2]&&(v.preventDefault(),y($.options[2].label));return}v.key==="1"?(v.preventDefault(),_()):v.key==="2"?(v.preventDefault(),w()):v.key==="3"?(v.preventDefault(),k()):v.key==="4"&&(v.preventDefault(),f())}return rn(()=>document.addEventListener("keydown",N)),Yt(()=>document.removeEventListener("keydown",N)),(v,M)=>(C(),E("div",{class:Pe(["appr",{minimized:r.value}])},[p("div",cY,[p("span",uY,P(a()),1),p("span",dY,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(C(),E(Oe,{key:0},[ft(P(e.block.path),1)],64)):e.block.kind==="shell"?(C(),E(Oe,{key:1},[ft(P(e.block.command),1)],64)):e.block.kind==="url"?(C(),E(Oe,{key:2},[ft(P(e.block.url),1)],64)):e.block.kind==="search"?(C(),E(Oe,{key:3},[ft(P(e.block.query),1)],64)):e.block.kind==="invocation"?(C(),E(Oe,{key:4},[ft(P(e.block.name),1)],64)):e.block.kind==="generic"?(C(),E(Oe,{key:5},[ft(P(e.block.summary),1)],64)):ie("",!0)]),e.agentName&&!r.value?(C(),E("span",fY,P(x(s)("approval.subagentBadge",{name:e.agentName})),1)):ie("",!0),r.value?ie("",!0):(C(),E("span",hY,P(x(s)("approval.required")),1)),p("button",{class:"amin",title:r.value?x(s)("question.expand"):x(s)("question.minimize"),"aria-label":r.value?x(s)("question.expand"):x(s)("question.minimize"),onClick:M[0]||(M[0]=$=>r.value=!r.value)},[r.value?(C(),E("svg",mY,[...M[2]||(M[2]=[p("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(C(),E("svg",gY,[...M[3]||(M[3]=[p("path",{d:"M3 8h10"},null,-1)])]))],8,pY)]),r.value?ie("",!0):(C(),E(Oe,{key:0},[e.block.kind==="plan_review"&&e.block.path?(C(),E("div",{key:0,class:"ah-path",title:e.block.path},P(e.block.path),9,vY)):ie("",!0),e.block.kind==="diff"?(C(),E("div",yY,[(C(!0),E(Oe,null,Xe(e.block.diff,($,O)=>(C(),E("div",{key:O,class:Pe(["dl",$.kind==="add"?"add":$.kind==="rem"?"del":""])},[p("span",kY,P($.gutter),1),p("span",bY,P($.text),1)],2))),128))])):e.block.kind==="shell"?(C(),E("div",wY,[p("div",_Y,[M[4]||(M[4]=p("span",{class:"shell-dollar"},"$",-1)),ft(" "+P(e.block.command),1)]),e.block.cwd?(C(),E("div",CY,"cwd: "+P(e.block.cwd),1)):ie("",!0),e.block.danger?(C(),E("div",SY,P(x(s)("approval.danger",{detail:e.block.danger})),1)):ie("",!0)])):e.block.kind==="file"?(C(),E("div",xY,[p("div",TY,[p("span",AY,P(e.block.language??""),1)]),p("div",MY,[(C(!0),E(Oe,null,Xe(e.block.content.split(`
|
|
259
|
-
`),($,O)=>(C(),E("div",{key:O,class:"file-line"},[p("span",EY,P(O+1),1),p("span",IY,P($),1)]))),128))])])):e.block.kind==="fileop"?(C(),E("div",$Y,[p("span",NY,P(e.block.op),1),p("span",LY,P(e.block.path),1),e.block.detail?(C(),E("span",PY,P(e.block.detail),1)):ie("",!0)])):e.block.kind==="url"?(C(),E("div",OY,[e.block.method?(C(),E("span",RY,P(e.block.method),1)):ie("",!0),p("span",DY,P(e.block.url),1)])):e.block.kind==="search"?(C(),E("div",BY,[p("span",FY,P(x(s)("approval.searchQueryLabel")),1),p("span",HY,P(e.block.query),1),e.block.scope?(C(),E("span",WY,P(x(s)("approval.searchScope",{scope:e.block.scope})),1)):ie("",!0)])):e.block.kind==="invocation"?(C(),E("div",UY,[p("span",qY,P(e.block.kind2),1),p("span",jY,P(e.block.name),1),e.block.description?(C(),E("span",zY,P(e.block.description),1)):ie("",!0)])):e.block.kind==="todo"?(C(),E("div",VY,[(C(!0),E(Oe,null,Xe(e.block.items,($,O)=>(C(),E("div",{key:O,class:"todo-item"},[p("span",KY,P($.status==="done"||$.status==="completed"?"✓":"○"),1),p("span",{class:Pe(["todo-title",{"todo-done":$.status==="done"||$.status==="completed"}])},P($.title),3)]))),128))])):e.block.kind==="plan_review"?(C(),E("div",GY,[vt(lu,{text:e.block.plan},null,8,["text"])])):(C(),E("div",YY,[p("span",XY,P(e.block.summary),1)])),c.value?(C(),E("div",QY,[jt(p("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":M[1]||(M[1]=$=>u.value=$),class:"feedback-ta",placeholder:x(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,ZY),[[Wn,u.value]]),p("div",JY,P(x(s)("approval.feedbackHint")),1)])):ie("",!0),i.value?(C(),E("div",eX,[i.value.options.length>0?(C(!0),E(Oe,{key:0},Xe(i.value.options,($,O)=>(C(),E("div",{key:O,class:"kbtn pri",title:$.description,onClick:T=>y($.label)},[ft(P($.label),1),p("span",nX,"["+P(O+1)+"]",1)],8,tX))),128)):(C(),E("div",{key:1,class:"kbtn pri",onClick:b},[ft(P(x(s)("approval.approvePlan")),1),M[5]||(M[5]=p("span",{class:"k"},"[1]",-1))])),p("div",{class:"kbtn",onClick:S},[ft(P(x(s)("approval.revise")),1),i.value.options.length===0?(C(),E("span",oX,"[2]")):ie("",!0)]),p("div",{class:"kbtn danger",onClick:L},[ft(P(x(s)("approval.rejectAndExit")),1),i.value.options.length===0?(C(),E("span",sX,"[3]")):ie("",!0)])])):(C(),E("div",iX,[p("div",{class:"kbtn pri",onClick:_},[ft(P(x(s)("approval.approve")),1),M[6]||(M[6]=p("span",{class:"k"},"[1]",-1))]),p("div",{class:"kbtn",onClick:w},[ft(P(x(s)("approval.approveSession")),1),M[7]||(M[7]=p("span",{class:"k"},"[2]",-1))]),p("div",{class:"kbtn",onClick:k},[ft(P(x(s)("approval.reject")),1),M[8]||(M[8]=p("span",{class:"k"},"[3]",-1))]),p("div",{class:"kbtn",onClick:f},[ft(P(x(s)("approval.feedback")),1),M[9]||(M[9]=p("span",{class:"k"},"[4]",-1))])]))],64))],2))}}),lX=bt(rX,[["__scopeId","data-v-341cf3fd"]]),aX={class:"taskspane"},cX={class:"tp-head"},uX={class:"tp-title"},dX={class:"tp-count"},fX={class:"tp-list"},hX={key:0,class:"tp-empty"},pX=["role","onClick"],mX={class:"tp-name"},gX={class:"tp-kind"},vX={class:"tp-time"},yX=["onClick"],kX={key:0,class:"tp-detail"},bX={key:0,class:"tp-codebox"},wX=["onClick"],_X={class:"tp-pre"},CX={class:"tp-cmd"},SX={key:1,class:"tp-codebox"},xX=["onClick"],TX={class:"tp-pre"},AX=Qe({__name:"TasksPane",props:{tasks:{}},emits:["cancel"],setup(e,{emit:t}){const n=t,{t:o}=xt(),s=as(new Set),i=as(new Set),r=as(new Set);function l(h){return!!(h.output&&h.output.length>0||h.meta)}function a(h){l(h)&&(s.has(h.id)?s.delete(h.id):s.add(h.id))}function c(h){switch(h){case"run":return"●";case"done":return"✓";case"fail":return"✗";default:return"○"}}function u(h){switch(h){case"run":return"s-run";case"done":return"s-done";case"fail":return"s-fail";default:return"s-pending"}}async function d(h,m,_){await wo(h)&&(_.add(m),setTimeout(()=>_.delete(m),1500))}async function f(h){h.meta&&await d(h.meta,h.id,i)}async function g(h){const m=h.output?.join(`
|
|
260
|
-
`)??"";m&&await d(m,h.id,r)}return(h,m)=>(C(),E("div",aX,[p("div",cX,[p("span",uX,P(x(o)("tasks.tag")),1),p("span",dX,P(e.tasks.length),1)]),p("div",fX,[e.tasks.length===0?(C(),E("div",hX,P(x(o)("tasks.emptyTasks")),1)):(C(!0),E(Oe,{key:1},Xe(e.tasks,_=>(C(),E("div",{key:_.id,class:Pe(["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:Pe(["tp-glyph",u(_.state)])},P(c(_.state)),3),p("span",mX,P(_.name),1),p("span",gX,P(_.kind),1),p("span",vX,P(_.timing),1),_.state==="run"?(C(),E("button",{key:0,class:"tp-stop",onClick:Ze(w=>n("cancel",_.id),["stop"])},P(x(o)("tasks.stop")),9,yX)):ie("",!0),l(_)?(C(),E("svg",{key:1,class:Pe(["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"},[...m[0]||(m[0]=[p("path",{d:"M6 4l4 4-4 4"},null,-1)])],2)):ie("",!0)],8,pX),s.has(_.id)&&l(_)?(C(),E("div",kX,[_.meta?(C(),E("div",bX,[p("button",{class:Pe(["tp-copy",{copied:i.has(_.id)}]),onClick:Ze(w=>f(_),["stop"])},P(i.has(_.id)?"已复制":"复制"),11,wX),p("pre",_X,[p("code",null,[p("span",CX,P(_.meta),1)])])])):ie("",!0),_.output&&_.output.length>0?(C(),E("div",SX,[p("button",{class:Pe(["tp-copy",{copied:r.has(_.id)}]),onClick:Ze(w=>g(_),["stop"])},P(r.has(_.id)?"已复制":"复制"),11,xX),p("pre",TX,[p("code",null,[m[1]||(m[1]=ft(`
|
|
261
|
-
`,-1)),(C(!0),E(Oe,null,Xe(_.output,(w,k)=>(C(),E("span",{key:k,class:"tp-line"},P(w),1))),128)),m[2]||(m[2]=ft(`
|
|
262
|
-
`,-1))])])])):ie("",!0)])):ie("",!0)],2))),128))])]))}}),_2=bt(AX,[["__scopeId","data-v-bdbdc201"]]),MX={class:"tc-title"},EX={key:0,class:"tc-count"},IX={key:0,class:"tc-list"},$X={key:0,class:"tc-empty"},NX={class:"tc-name"},LX=Qe({__name:"TodoCard",props:{todos:{},inline:{type:Boolean}},setup(e){const t=e,{t:n}=xt(),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(),E("div",{class:Pe(["todo-card",{"tab-mode":e.inline}])},[(C(),Ve(ko(s.value?"button":"div"),{class:Pe(["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",MX,P(x(n)("tasks.todoTag")),1),e.todos.length>0?(C(),E("span",EX,P(l.value)+"/"+P(e.todos.length),1)):ie("",!0),s.value&&e.todos.length>0?(C(),E("svg",{key:1,class:Pe(["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)):ie("",!0)]),_:1},8,["class","type"])),i.value?(C(),E("div",IX,[e.todos.length===0?(C(),E("div",$X,P(x(n)("tasks.emptyTodo")),1)):ie("",!0),(C(!0),E(Oe,null,Xe(e.todos,(d,f)=>(C(),E("div",{key:f,class:Pe(["tc-row",`s-${d.status}`])},[p("span",{class:Pe(["tc-glyph",`g-${a(d.status)}`])},null,2),p("span",NX,P(d.title),1)],2))),128))])):ie("",!0)],2))}}),PX=bt(LX,[["__scopeId","data-v-26afda08"]]),OX={key:0,class:"queue-head"},RX={class:"queue-label"},DX=["title"],BX={class:"queue-list"},FX=["disabled","title","onClick"],HX={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"},WX=["title","onClick"],UX=Qe({__name:"QueuePane",props:{queued:{},running:{type:Boolean},inline:{type:Boolean}},emits:["steer","unqueue","editQueued"],setup(e,{emit:t}){const n=t,{t:o}=xt();function s(i,r){r.attachmentCount>0||n("editQueued",i)}return(i,r)=>(C(),E("div",{class:Pe(["queue-pane",{"tab-mode":e.inline}])},[e.inline?ie("",!0):(C(),E("div",OX,[p("span",RX,P(x(o)("composer.queueLabel"))+" · "+P(e.queued.length),1),e.running?(C(),E("button",{key:0,class:"queue-steer",type:"button",title:x(o)("composer.steerTitle"),onClick:r[0]||(r[0]=l=>n("steer"))},P(x(o)("composer.steerNow")),9,DX)):ie("",!0)])),p("div",BX,[(C(!0),E(Oe,null,Xe(e.queued,(l,a)=>(C(),E("div",{key:a,class:"queue-item"},[p("button",{class:"queue-text",type:"button",disabled:l.attachmentCount>0,title:l.attachmentCount>0?x(o)("composer.queuedHasImage",{n:l.attachmentCount}):x(o)("composer.editQueued"),onClick:c=>s(a,l)},[l.attachmentCount>0?(C(),E("svg",HX,[...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)])])):ie("",!0),p("span",{class:Pe(["queue-text-inner",{placeholder:!l.text}])},P(l.text||x(o)("composer.queuedImageOnly",{n:l.attachmentCount})),3)],8,FX),p("button",{class:"queue-rm",title:x(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,WX)]))),128))])],2))}}),qX=bt(UX,[["__scopeId","data-v-b5832f1f"]]),jX={class:"dock-work-head"},zX={key:0,class:"dock-work-tab static"},VX={key:1,class:"dock-work-tab static"},KX={key:2,class:"dock-work-tab static"},GX={key:3,class:"dock-work-tab static"},YX=["title"],XX={class:"dock-work-body"},QX=["aria-pressed"],ZX={class:"dw-count"},JX=["aria-pressed"],eQ={class:"dw-count"},tQ=["aria-pressed"],nQ={class:"dw-count"},oQ=["aria-pressed"],sQ={class:"dw-count"},iQ=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}=xt(),r=ne(null),l=ne(null),a=ne(null);function c(g){r.value?.loadForEdit(g)}function u(){r.value?.focus()}function d(g){const h=o.queued?.[g]?.text??"";h&&c(h),s("editQueued",g)}function f(g){if(!o.dockPanel)return;const h=g.target;h&&(l.value?.contains(h)||a.value?.contains(h)||s("close-dock-panel"))}return ze(()=>o.dockPanel,g=>{typeof document>"u"||(document.removeEventListener("mousedown",f,!0),g&&document.addEventListener("mousedown",f,!0))},{immediate:!0}),Yt(()=>{typeof document<"u"&&document.removeEventListener("mousedown",f,!0)}),t({loadForEdit:c,focus:u}),(g,h)=>(C(),E("div",{class:Pe(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:h[31]||(h[31]=Ze(()=>{},["stop"]))},[vt(Fi,{name:"dock-panel"},{default:$n(()=>[e.dockPanel?(C(),E("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:h[5]||(h[5]=Ze(()=>{},["stop"]))},[p("div",jX,[e.dockPanel==="bash"?(C(),E("span",zX,P(x(i)("tasks.dockBash"))+" · "+P(e.bashRunning)+" "+P(x(i)("tasks.running")),1)):e.dockPanel==="subagent"?(C(),E("span",VX,P(x(i)("tasks.dockSubagent"))+" · "+P(e.subagentRunning)+" "+P(x(i)("tasks.running")),1)):e.dockPanel==="todos"?(C(),E("span",KX,P(x(i)("tasks.dockTodos"))+" · "+P(e.todoDoneCount)+"/"+P(e.todos?.length??0),1)):e.dockPanel==="queue"?(C(),E("span",GX,P(x(i)("tasks.dockQueue"))+" · "+P(e.queued?.length??0),1)):ie("",!0),e.dockPanel==="queue"&&e.running?(C(),E("button",{key:4,type:"button",class:"dock-queue-steer",title:x(i)("composer.steerTitle"),onClick:h[0]||(h[0]=m=>s("steer",{text:"",attachments:[]}))},P(x(i)("composer.steerNow")),9,YX)):ie("",!0)]),p("div",XX,[e.dockPanel==="bash"?(C(),Ve(_2,{key:0,tasks:e.bashTasks,onCancel:h[1]||(h[1]=m=>s("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(C(),Ve(_2,{key:1,tasks:e.subagentTasks,onCancel:h[2]||(h[2]=m=>s("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="todos"?(C(),Ve(PX,{key:2,todos:e.todos??[],inline:""},null,8,["todos"])):(C(),Ve(qX,{key:3,queued:e.queued??[],running:e.running,inline:"",onSteer:h[3]||(h[3]=m=>s("steer",{text:"",attachments:[]})),onUnqueue:h[4]||(h[4]=m=>s("unqueue",m)),onEditQueued:d},null,8,["queued","running"]))])],512)):ie("",!0)]),_:1}),e.goal?(C(),Ve(EG,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:h[6]||(h[6]=m=>s("controlGoal",m))},null,8,["goal","force-expanded"])):ie("",!0),e.hasDockWork?(C(),E("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(C(),E("button",{key:0,type:"button",class:Pe(["dock-work-chip",{on:e.dockPanel==="bash"}]),"aria-pressed":e.dockPanel==="bash",onClick:h[7]||(h[7]=m=>s("toggle-dock-panel","bash"))},[h[34]||(h[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(x(i)("tasks.dockBash")),1),p("span",ZX,[h[32]||(h[32]=ft("(",-1)),p("b",null,P(e.bashTasks.length),1),h[33]||(h[33]=ft(")",-1))])],10,QX)):ie("",!0),e.subagentTasks.length>0?(C(),E("button",{key:1,type:"button",class:Pe(["dock-work-chip",{on:e.dockPanel==="subagent"}]),"aria-pressed":e.dockPanel==="subagent",onClick:h[8]||(h[8]=m=>s("toggle-dock-panel","subagent"))},[h[37]||(h[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(x(i)("tasks.dockSubagent")),1),p("span",eQ,[h[35]||(h[35]=ft("(",-1)),p("b",null,P(e.subagentTasks.length),1),h[36]||(h[36]=ft(")",-1))])],10,JX)):ie("",!0),(e.todos?.length??0)>0?(C(),E("button",{key:2,type:"button",class:Pe(["dock-work-chip",{on:e.dockPanel==="todos"}]),"aria-pressed":e.dockPanel==="todos",onClick:h[9]||(h[9]=m=>s("toggle-dock-panel","todos"))},[h[40]||(h[40]=_r('<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(x(i)("tasks.dockTodos")),1),p("span",nQ,[h[38]||(h[38]=ft("(",-1)),p("b",null,P(e.todoDoneCount)+"/"+P(e.todos?.length??0),1),h[39]||(h[39]=ft(")",-1))])],10,tQ)):ie("",!0),(e.queued?.length??0)>0?(C(),E("button",{key:3,type:"button",class:Pe(["dock-work-chip",{on:e.dockPanel==="queue"}]),"aria-pressed":e.dockPanel==="queue",onClick:h[10]||(h[10]=m=>s("toggle-dock-panel","queue"))},[h[43]||(h[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(x(i)("tasks.dockQueue")),1),p("span",sQ,[h[41]||(h[41]=ft("(",-1)),p("b",null,P(e.queued?.length??0),1),h[42]||(h[42]=ft(")",-1))])],10,oQ)):ie("",!0)],512)):ie("",!0),e.pendingQuestion?(C(),Ve(aY,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,onAnswer:h[11]||(h[11]=(m,_)=>s("answer",m,_)),onDismiss:h[12]||(h[12]=m=>s("dismiss",m))},null,8,["question"])):e.pendingApproval?(C(),Ve(lX,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,onDecide:h[13]||(h[13]=m=>s("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name"])):(C(),Ve(o3,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:h[14]||(h[14]=m=>s("submit",m)),onSteer:h[15]||(h[15]=m=>s("steer",m)),onCommand:h[16]||(h[16]=m=>s("command",m)),onInterrupt:h[17]||(h[17]=m=>s("interrupt")),onSetPermission:h[18]||(h[18]=m=>s("setPermission",m)),onSetThinking:h[19]||(h[19]=m=>s("setThinking",m)),onTogglePlan:h[20]||(h[20]=m=>s("togglePlan")),onToggleSwarm:h[21]||(h[21]=m=>s("toggleSwarm")),onToggleGoal:h[22]||(h[22]=m=>s("toggleGoal")),onOpenBtw:h[23]||(h[23]=m=>s("openBtw")),onCreateGoal:h[24]||(h[24]=m=>s("createGoal",m)),onControlGoal:h[25]||(h[25]=m=>s("controlGoal",m)),onFocusGoal:h[26]||(h[26]=m=>s("focusGoal")),onFocusSwarm:h[27]||(h[27]=m=>s("focusSwarm")),onCompact:h[28]||(h[28]=m=>s("compact")),onPickModel:h[29]||(h[29]=m=>s("pickModel")),onSelectModel:h[30]||(h[30]=m=>s("selectModel",m))},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))}}),rQ=bt(iQ,[["__scopeId","data-v-b7c4b6e1"]]),lQ=["aria-label"],aQ={class:"toc-track"},cQ=["aria-label","onMouseenter","onClick"],uQ={class:"toc-no"},dQ=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}=xt(),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(),E("nav",{key:0,class:"conversation-toc","aria-label":x(s)("conversation.toc")},[p("div",aQ,[(C(!0),E(Oe,null,Xe(e.items,(d,f)=>(C(),E("button",{key:d.id,type:"button",class:Pe(["toc-bubble",[d.role,{active:e.activeTurnId===d.id}]]),style:Wt({height:e.metrics[f]?.height+"px"}),"aria-label":`#${d.no} ${d.title}`,onMouseenter:g=>l(d.title,g),onMouseleave:a,onClick:g=>o("select",d.id)},[p("span",uQ,P(d.no),1)],46,cQ))),128)),e.viewport?(C(),E("div",{key:0,class:"toc-viewport",style:Wt({top:e.viewport.top+"px",height:e.viewport.height+"px"})},null,4)):ie("",!0)]),vt(Fi,{name:"toc-tip"},{default:$n(()=>[jt(p("div",{class:"toc-tooltip",style:Wt({top:r.value.top+"px"})},P(r.value.text),5),[[js,r.value.visible]])]),_:1})],8,lQ)):ie("",!0)}}),fQ=bt(dQ,[["__scopeId","data-v-dc54da9a"]]),hQ=5;function pQ(e,t,n,o=hQ){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 mQ={class:"chat-layout"},gQ={class:"empty-hint"},vQ={class:"empty-hint-title"},yQ={class:"empty-hint-text"},kQ={key:0,class:"ws-pick"},bQ=["title"],wQ={class:"ws-pick-name"},_Q={key:1,class:"ws-pick-menu"},CQ=["onClick"],SQ={class:"ws-pick-item-name"},xQ={class:"ws-pick-item-path"},TQ={key:0,class:"swarm-stack"},AQ=["aria-label"],MQ={key:0,class:"abort-toast",role:"status","aria-live":"polite"},EQ={class:"abort-toast-text"},Ad=10,IQ=56,$Q=420,C2=80,NQ=1e3,LQ=3e3,PQ=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(()=>pQ(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 f(Ie){i.value=!1,Ie!==o.activeWorkspaceId&&s("selectWorkspace",Ie)}const{t:g}=xt();Zc(Mt.contentAlign);const h=ne(null),m=ne(null),_=ne(null),w=ne(!1),k=ne(0);let b=null;function y(Ie){(_.value??m.value)?.loadForEdit(Ie)}function S(){w.value=!0,b!==null&&clearTimeout(b),b=setTimeout(()=>{b=null,w.value=!1},2e3)}function L(){k.value++}function N(){ht(()=>{Re.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const v=F(()=>o.mobile===!0||o.modern===!0),M=F(()=>o.tasks.filter(Ie=>Ie.kind!=="subagent")),$=F(()=>o.tasks.filter(Ie=>Ie.kind==="subagent")),O=F(()=>M.value.filter(Ie=>Ie.state==="run").length),T=F(()=>$.value.filter(Ie=>Ie.state==="run").length),I=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 J(Ie){if(Ie.role==="compaction")return g("conversation.compactedPlain");if(Ie.role==="user"){if(Ie.skillActivation)return`/${Ie.skillActivation.name}`;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:J(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(Ct=>{const St=o.turns.find(mn=>mn.id===Ct.id);return St?G(St):Ad}),Fe=be.reduce((Ct,St)=>Ct+St,0)||Ie.length*Ad;return Ie.map((Ct,St)=>{const mn=be[St]??Ad,gn=Fe>0?mn/Fe:0,ys=Math.max(Ad,Math.min(IQ,gn*$Q));return{id:Ct.id,height:Math.round(ys)}})}),ke=F(()=>X.value.reduce((Ie,be)=>Ie+be.height,0)+(K.value.length-1)*4),le=ne(null),We=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(),Ct=Fe.height/2;let St=null,mn=1/0;be.forEach(Vn=>{const hi=Vn.getBoundingClientRect(),de=hi.top-Fe.top,Te=Math.abs(de+hi.height/2-Ct);Te<mn&&(mn=Te,St=Vn.dataset.turnId??null)}),le.value=St;const gn=Ie.scrollHeight-Ie.clientHeight,ys=gn>0?Ie.scrollTop/gn:0,Zo=ke.value,Ui=ys*Zo,fi=Ie.scrollHeight>0?Ie.clientHeight/Ie.scrollHeight*Zo:Zo;We.value={top:Math.max(0,Ui),height:Math.max(8,Math.min(fi,Zo-Ui))}}const ve=F(()=>o.questions&&o.questions.length>0?o.questions[0]:void 0),Ne=F(()=>o.approvals&&o.approvals.length>0?o.approvals[0]:void 0),Re=ne(null),Q=ne(null),ce=ne(0),Se=ne(0),j=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 he(){const Ie=Re.value;ce.value=Ie?Math.max(0,Ie.offsetWidth-Ie.clientWidth):0,Se.value=Q.value?.offsetHeight??0}function oe(Ie){const be=te(Ie);Re.value=be,be&&io()}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,Tt()}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,$e=0,se=0,ae=0;function we(){return Date.now()<xe}function qe(){const Ie=Re.value;if(!Ie)return;const be=Ie.scrollTop;if(performance.now()-$e<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<=C2&&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"?($e=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 Ct of Fe)if(Ct.offsetTop>=be){const St=Ct.dataset.turnId;if(St)return{id:St,top:Ct.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,Ct=be?.scrollHeight??0,St=be?ct(be,Fe):null;Co.value=!0;try{await o.loadOlderMessages(Ie),await ht()}finally{Co.value=!1}if(o.sessionId!==Ie)return;const mn=Re.value;if(!mn)return;let gn=0;if(St){const ys=mn.querySelector(`.turn-anchor[data-turn-id="${$t(St.id)}"]`);ys&&(gn=ys.offsetTop-St.top)}gn===0&&(gn=mn.scrollHeight-Ct),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()>C2,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,Ct=Q.value?.offsetHeight??0;return`${Ie.scrollHeight}:${Ie.clientHeight}:${Fe}:${Ct}`}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="",Ct=0,St=0;se&&(Mn(se),se=0);const mn=()=>{if(se=0,be!==ae||!H.value&&!we())return;nt(!1);const gn=Rt();Ct=gn===Fe?Ct+1:0,Fe=gn,St++,Ct<3&&St<Ie&&(se=fn(mn))};se=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 jn=F(()=>{const Ie=(o.approvals??[]).map(mn=>mn.approvalId).join(","),be=o.turns,Fe=be.at(-1),Ct=Fe?.thinking?.length??0,St=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:Ct,lastToolsLen:St,approvalIds:Ie}});ze(jn,async(Ie,be)=>{if(Co.value&&Ft(be,Ie)){ue();return}await ht(),H.value||we()?nt(!1):Y.value=!0,ue()}),ze(Q,()=>{Tt()}),ze(()=>o.mobile,async()=>{await ht(),he()});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 Ct=Re.value,St=Ie?Je.get(String(Ie)):void 0;St&&Ct?(H.value=St.following,Ct.scrollTop=St.top,ge=St.top,St.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()+NQ,ht(()=>{nt(!1),Nt(16)})}function Xo(Ie){Qn(),s("submit",Ie)}function Po(Ie,be){Qn(),s("answer",Ie,be)}function ho(Ie,be){!Ie||!be||s("approval",Ie,be)}let Ln=null,cn=null,wn=null,On=null,zn=0,Zn=!1;const Co=ne(!1);function po(Ie){if(Co.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 Oo(){if(!cn)return;const Ie=Re.value?.firstElementChild??null;Ie!==wn&&(wn&&cn.unobserve(wn),wn=Ie,Ie&&cn.observe(Ie))}function Tt(){if(!cn)return;const Ie=Q.value;Ie!==On&&(On&&cn.unobserve(On),On=Ie,Ie&&cn.observe(Ie))}function io(){const Ie=Re.value;he(),Ln&&(Ln.disconnect(),Ie&&Ln.observe(Ie,{childList:!0,subtree:!0,characterData:!0})),cn&&(cn.disconnect(),wn=null,On=null,Ie&&cn.observe(Ie),Oo(),Tt())}function nn(){Oo(),po(!0)}function Ro(){typeof document>"u"||document.visibilityState==="visible"&&H.value&&Nt()}const Qo=ne(!1);let Jn=null;function Ye(){Qo.value=!0,Jn!==null&&clearTimeout(Jn),Jn=setTimeout(()=>{Qo.value=!1},LQ)}function je(){Ye(),s("interrupt")}function tt(Ie){Ie.key==="Escape"&&(o.running||o.sending)&&(Ie.preventDefault(),je())}rn(()=>{ht(()=>{typeof MutationObserver=="function"&&(Ln=new MutationObserver(nn)),typeof ResizeObserver=="function"&&(cn=new ResizeObserver(()=>{he(),po(!1)})),io(),Nt(48),ue(),typeof document<"u"&&(document.addEventListener("visibilitychange",Ro),document.addEventListener("keydown",tt))})}),Yt(()=>{Ln&&Ln.disconnect(),cn&&cn.disconnect(),zn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(zn),se&&Mn(se),Jn!==null&&clearTimeout(Jn),b!==null&&(clearTimeout(b),b=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ro),document.removeEventListener("keydown",tt))});function it(){(_.value??m.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:it}),(Ie,be)=>(C(),E("section",{class:Pe(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(C(),Ve(kV,{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=>h.value?.copyConversation()),onCopyFinalSummary:be[2]||(be[2]=Fe=>h.value?.copyFinalSummary()),onOpenPr:be[3]||(be[3]=Fe=>e.pr&&s("openPr",e.pr.url)),onRenameSession:be[4]||(be[4]=(Fe,Ct)=>s("renameSession",Fe,Ct)),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"])):ie("",!0),e.betaToc?(C(),Ve(fQ,{key:1,items:K.value,metrics:X.value,"active-turn-id":le.value,viewport:We.value,mobile:e.mobile,"session-loading":e.sessionLoading,onSelect:lt},null,8,["items","metrics","active-turn-id","viewport","mobile","session-loading"])):ie("",!0),p("div",mQ,[p("div",{ref:oe,class:"panes chat-scroll",onScrollPassive:qe},[p("div",{class:Pe(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(C(),E(Oe,{key:0},[be[59]||(be[59]=p("div",{class:"empty-spacer"},null,-1)),p("div",gQ,[p("span",vQ,P(x(g)("composer.emptyConversationTitle")),1),p("span",yQ,P(x(g)("composer.emptyConversation")),1),a.value?(C(),E("div",kQ,[p("button",{type:"button",class:"ws-pick-btn",title:x(g)("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",wQ,P(l.value),1),(C(),E("svg",{class:Pe(["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,bQ),i.value?(C(),E("div",{key:0,class:"ws-pick-backdrop",onClick:be[8]||(be[8]=Fe=>i.value=!1)})):ie("",!0),i.value?(C(),E("div",_Q,[(C(!0),E(Oe,null,Xe(c.value,Fe=>(C(),E("button",{key:Fe.id,type:"button",class:Pe(["ws-pick-item",{on:Fe.id===e.activeWorkspaceId}]),onClick:Ze(Ct=>f(Fe.id),["stop"])},[p("span",SQ,P(Fe.name),1),p("span",xQ,P(Fe.shortPath),1)],10,CQ))),128)),u.value>0?(C(),E("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(x(g)("conversation.moreWorkspaces",{count:u.value})),1)])):ie("",!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(x(g)("conversation.addWorkspace")),1)])])):ie("",!0)])):(C(),E("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(x(g)("conversation.addWorkspace")),1)]))]),vt(o3,{ref_key:"emptyComposerRef",ref:m,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,"hide-context":"",onSubmit:Xo,onSteer:be[12]||(be[12]=Fe=>s("steer",Fe)),onCommand:be[13]||(be[13]=Fe=>s("command",Fe)),onInterrupt:je,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(),E(Oe,{key:1},[(C(),Ve(JA,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,bubble:v.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:S,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(),E("div",TQ,[(C(!0),E(Oe,null,Xe(d.value,Fe=>(C(),Ve(bG,{key:Fe.id,group:Fe},null,8,["group"]))),128))])):ie("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?ie("",!0):(C(),Ve(rQ,{key:0,ref:fe,style:Wt(j.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":k.value,"dock-panel":D.value,"bash-tasks":M.value,"subagent-tasks":$.value,"bash-running":O.value,"subagent-running":T.value,"todo-done-count":I.value,"has-dock-work":R.value,todos:e.todos,"pending-question":ve.value,"pending-approval":Ne.value,mobile:e.mobile,onToggleDockPanel:be[34]||(be[34]=Fe=>V(Fe)),onCloseDockPanel:be[35]||(be[35]=Fe=>U()),onAnswer:Po,onDismiss:be[36]||(be[36]=Fe=>s("dismiss",Fe)),onApproval:ho,onCancelTask:be[37]||(be[37]=Fe=>s("cancelTask",Fe)),onControlGoal:be[38]||(be[38]=Fe=>s("controlGoal",Fe)),onSubmit:Xo,onSteer:be[39]||(be[39]=Fe=>s("steer",Fe)),onCommand:be[40]||(be[40]=Fe=>s("command",Fe)),onInterrupt:je,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(Fi,{name:"pill"},{default:$n(()=>[Y.value?(C(),E("button",{key:0,class:"newmsg-pill",style:Wt({bottom:`${Se.value+12}px`}),"aria-label":x(g)("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)),ft(" "+P(x(g)("conversation.newMessages")),1)],12,AQ)):ie("",!0)]),_:1}),vt(Fi,{name:"abort-toast"},{default:$n(()=>[Qo.value?(C(),E("div",MQ,[p("span",EQ,P(x(g)("conversation.manuallyAborted")),1)])):ie("",!0)]),_:1})],2))}}),OQ=bt(PQ,[["__scopeId","data-v-6f934ca2"]]),RQ={key:0,class:"fp-empty fp-error"},DQ={key:1,class:"fp-empty"},BQ={key:2,class:"fp-loading"},FQ={class:"fp-header"},HQ={class:"fp-title"},WQ=["title"],UQ={class:"fp-meta"},qQ={key:0,class:"fp-lines"},jQ={class:"fp-size"},zQ=["aria-label"],VQ=["aria-label"],KQ=["aria-label"],GQ={key:3,class:"fp-search"},YQ=["placeholder"],XQ={key:0,class:"fp-search-count"},QQ=["disabled","title"],ZQ=["disabled","title"],JQ=["title"],eZ={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"},tZ={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"},nZ=["title"],oZ=["title"],sZ=["href","title"],iZ=["title"],rZ={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"},lZ={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"},aZ=["title","aria-label"],cZ={key:1,class:"fp-code"},uZ={class:"fp-line-table"},dZ=["data-line"],fZ={class:"fp-gutter"},hZ=["innerHTML"],pZ={key:1,class:"fp-body fp-code"},mZ={class:"fp-line-table"},gZ=["data-line"],vZ={class:"fp-gutter"},yZ=["innerHTML"],kZ={key:2,class:"fp-body"},bZ=["srcdoc","title"],wZ={key:1,class:"fp-code"},_Z={class:"fp-line-table"},CZ=["data-line"],SZ={class:"fp-gutter"},xZ=["innerHTML"],TZ={key:3,class:"fp-body fp-pdf-wrap"},AZ=["src","title"],MZ={key:1,class:"fp-binary-card"},EZ={class:"fp-binary-label"},IZ={key:4,class:"fp-body fp-table-wrap"},$Z={class:"fp-table"},NZ=["data-line"],LZ={key:5,class:"fp-body fp-image-wrap"},PZ=["src","alt"],OZ={key:1,class:"fp-binary-card"},RZ={class:"fp-binary-label"},DZ={key:6,class:"fp-body fp-code"},BZ={class:"fp-line-table"},FZ=["data-line"],HZ={class:"fp-gutter"},WZ=["innerHTML"],UZ={key:7,class:"fp-body fp-binary-wrap"},qZ={class:"fp-binary-card"},jZ={class:"fp-binary-label"},zZ=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}=xt();function o(ue,ve){const Ne=ve?ve.split("/").filter(Boolean):[];for(const Re of ue.split("/"))Re===""||Re==="."||(Re===".."?Ne.pop():Ne.push(Re));return Ne.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 Ne=i.value;return{...ue,path:o(ve,Ne)}}const c=e,u=t;function d(ue){c.openFile?.(a(ue))}const f=ne(null),g=F(()=>{const ue=c.file;if(!ue)return"binary";const ve=ue.mime??"",Ne=ue.languageId??"",Re=ue.path.toLowerCase();return ve==="text/markdown"||Ne==="markdown"||Ne==="md"||Re.endsWith(".mdx")?"markdown":ve==="application/json"||Ne==="json"?"json":ve==="text/html"||Ne==="html"||Re.endsWith(".html")||Re.endsWith(".htm")?"html":ve==="application/pdf"||Re.endsWith(".pdf")?"pdf":ve==="text/csv"||Ne==="csv"||Re.endsWith(".csv")?"csv":ve.startsWith("image/")?"image":ue.isBinary?"binary":ve.startsWith("text/")||Ne!==""?"text":"binary"});function h(ue){const ve=atob(ue),Ne=Uint8Array.from(ve,Re=>Re.charCodeAt(0));return new TextDecoder().decode(Ne)}const m=F(()=>{const ue=c.file;if(!ue)return"";if(ue.encoding==="base64")try{return h(ue.content)}catch{return ue.content}return ue.content}),_=F(()=>{if(g.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),w=F(()=>c.file?(g.value==="json"?_.value:m.value).split(`
|
|
263
|
-
`):[]),k=F(()=>c.file?g.value==="json"?_.value:m.value:""),b=ne(""),y=ne(0),S=F(()=>{const ue=b.value.trim().toLowerCase();if(!ue)return[];const ve=[];return w.value.forEach((Ne,Re)=>{Ne.toLowerCase().includes(ue)&&ve.push(Re+1)}),ve});ze(b,()=>{y.value=0});function L(ue,ve=!1){ue&&ht(()=>{const Ne=f.value?.querySelector(".fp-body"),Re=Ne?.querySelector(`[data-line="${ue}"]`);if(!Ne||!Re)return;ve&&(Ne.scrollTop=0);const Q=Ne.getBoundingClientRect(),ce=Re.getBoundingClientRect(),Se=ce.top-Q.top+Ne.scrollTop;Ne.scrollTop=Se-Ne.clientHeight/2+ce.height/2})}ze(()=>[c.file?.path,c.line],()=>L(c.line,!0),{immediate:!0});function N(ue){const ve=S.value;ve.length!==0&&(y.value=(y.value+ue+ve.length)%ve.length,L(ve[y.value]))}function v(ue){const ve=S.value;return{target:c.line===ue,hit:ve.includes(ue),active:ve[y.value]===ue}}function M(ue){return ue<1024?`${ue} B`:ue<1024*1024?`${(ue/1024).toFixed(1)} KB`:`${(ue/(1024*1024)).toFixed(1)} MB`}const $=ne(!1),O=ne(!1);function T(){c.file&&wo(k.value).then(ue=>{ue&&($.value=!0,setTimeout(()=>{$.value=!1},1400))})}function I(){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(g,ue=>{R.value=ue==="html"?"preview":"source",D.value="preview",W.value="fit"});const V=F(()=>{const ue=c.file;return!ue||g.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||g.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:ue.encoding==="base64"?`data:${ue.mime};base64,${ue.content}`:null}),J=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:;">`,m.value].join(""):"");function K(ue){const ve=[];let Ne="",Re=!1;for(let Q=0;Q<ue.length;Q++){const ce=ue[Q];ce==='"'&&ue[Q+1]==='"'?(Ne+='"',Q++):ce==='"'?Re=!Re:ce===","&&!Re?(ve.push(Ne),Ne=""):Ne+=ce}return ve.push(Ne),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 Ne=X(ue);return g.value==="json"||ve==="json"||ve==="jsonc"?(Ne=Ne.replace(/("[^&]*?")(\s*:)/g,'<span class="tok-key">$1</span>$2'),Ne=Ne.replace(/(:\s*)("[^&]*?")/g,'$1<span class="tok-string">$2</span>'),Ne=Ne.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),Ne=Ne.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),Ne):g.value==="html"||ve==="html"||ve==="xml"||ve==="svg"?(Ne=Ne.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),Ne=Ne.replace(/(".*?")/g,'<span class="tok-string">$1</span>'),Ne=Ne.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),Ne):(Ne=Ne.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>'),Ne=Ne.replace(/(".*?"|'.*?')/g,'<span class="tok-string">$1</span>'),Ne=Ne.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),Ne)}function We(ue,ve=55){return!ue||ue.length<=ve?ue:"…"+ue.slice(ue.length-ve+1)}return(ue,ve)=>(C(),E("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(C(),E("div",RQ,[p("span",null,P(e.error),1),e.closable?(C(),E("button",{key:0,type:"button",class:"fp-action",onClick:ve[0]||(ve[0]=Ne=>u("close"))},P(x(n)("filePreview.close")),1)):ie("",!0)])):!e.file&&!e.loading?(C(),E("div",DQ,P(x(n)("filePreview.empty")),1)):e.loading?(C(),E("div",BQ,[ve[13]||(ve[13]=p("span",{class:"spinner"},null,-1)),p("span",null,P(x(n)("filePreview.loading")),1)])):e.file?(C(),E(Oe,{key:3},[p("div",FQ,[p("span",HQ,P(x(n)("common.preview")),1),p("span",{class:"fp-path",title:e.file.path},P(We(e.file.path)),9,WQ),p("span",UQ,[e.file.lineCount?(C(),E("span",qQ,P(x(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ie("",!0),p("span",jQ,P(M(e.file.size)),1)]),g.value==="html"?(C(),E("div",{key:0,class:"fp-seg",role:"group","aria-label":x(n)("filePreview.htmlMode")},[p("button",{type:"button",class:Pe(["fp-seg-btn",{on:R.value==="preview"}]),onClick:ve[1]||(ve[1]=Ne=>R.value="preview")},P(x(n)("filePreview.preview")),3),p("button",{type:"button",class:Pe(["fp-seg-btn",{on:R.value==="source"}]),onClick:ve[2]||(ve[2]=Ne=>R.value="source")},P(x(n)("filePreview.source")),3)],8,zQ)):ie("",!0),g.value==="markdown"?(C(),E("div",{key:1,class:"fp-seg",role:"group","aria-label":x(n)("filePreview.markdownMode")},[p("button",{type:"button",class:Pe(["fp-seg-btn",{on:D.value==="preview"}]),onClick:ve[3]||(ve[3]=Ne=>D.value="preview")},P(x(n)("filePreview.preview")),3),p("button",{type:"button",class:Pe(["fp-seg-btn",{on:D.value==="source"}]),onClick:ve[4]||(ve[4]=Ne=>D.value="source")},P(x(n)("filePreview.source")),3)],8,VQ)):ie("",!0),g.value==="image"?(C(),E("div",{key:2,class:"fp-seg",role:"group","aria-label":x(n)("filePreview.imageFit")},[p("button",{type:"button",class:Pe(["fp-seg-btn",{on:W.value==="fit"}]),onClick:ve[5]||(ve[5]=Ne=>W.value="fit")},P(x(n)("filePreview.fit")),3),p("button",{type:"button",class:Pe(["fp-seg-btn",{on:W.value==="actual"}]),onClick:ve[6]||(ve[6]=Ne=>W.value="actual")},P(x(n)("filePreview.actual")),3)],8,KQ)):ie("",!0),g.value==="text"||g.value==="json"||g.value==="html"||g.value==="csv"?(C(),E("div",GQ,[jt(p("input",{"onUpdate:modelValue":ve[7]||(ve[7]=Ne=>b.value=Ne),class:"fp-search-input",type:"search",placeholder:x(n)("filePreview.search")},null,8,YQ),[[Wn,b.value]]),b.value.trim()?(C(),E("span",XQ,P(S.value.length),1)):ie("",!0),p("button",{type:"button",class:"fp-icon-btn",disabled:S.value.length===0,title:x(n)("filePreview.prevMatch"),onClick:ve[8]||(ve[8]=Ne=>N(-1))},"↑",8,QQ),p("button",{type:"button",class:"fp-icon-btn",disabled:S.value.length===0,title:x(n)("filePreview.nextMatch"),onClick:ve[9]||(ve[9]=Ne=>N(1))},"↓",8,ZQ)])):ie("",!0),p("button",{type:"button",class:Pe(["fp-action fp-act-icon",{copied:O.value}]),title:O.value?x(n)("filePreview.copied"):x(n)("filePreview.copyPath"),onClick:I},[O.value?(C(),E("svg",tZ,[...ve[15]||(ve[15]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(C(),E("svg",eZ,[...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,JQ),e.externalActions?(C(),E("button",{key:4,type:"button",class:"fp-action fp-act-icon",title:x(n)("filePreview.openInEditor"),onClick:ve[10]||(ve[10]=Ne=>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,nZ)):ie("",!0),e.externalActions?(C(),E("button",{key:5,type:"button",class:"fp-action fp-act-icon",title:x(n)("filePreview.reveal"),onClick:ve[11]||(ve[11]=Ne=>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,oZ)):ie("",!0),e.downloadUrl?(C(),E("a",{key:6,class:"fp-action fp-act-icon",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"",title:x(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,sZ)):ie("",!0),!e.file.isBinary&&g.value!=="image"?(C(),E("button",{key:7,type:"button",class:Pe(["fp-action fp-act-icon",{copied:$.value}]),title:$.value?x(n)("filePreview.copied"):x(n)("filePreview.copy"),onClick:T},[$.value?(C(),E("svg",lZ,[...ve[20]||(ve[20]=[p("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(C(),E("svg",rZ,[...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,iZ)):ie("",!0),e.closable?(C(),E("button",{key:8,type:"button",class:"fp-close",title:x(n)("filePreview.close"),"aria-label":x(n)("filePreview.close"),onClick:ve[12]||(ve[12]=Ne=>u("close"))}," × ",8,aZ)):ie("",!0)]),g.value==="markdown"?(C(),E("div",{key:0,class:Pe(["fp-body",{"fp-markdown":D.value==="preview"}])},[D.value==="preview"?(C(),Ve(lu,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(C(),E("div",cZ,[p("div",uZ,[(C(!0),E(Oe,null,Xe(w.value,(Ne,Re)=>(C(),E("div",{key:Re,class:Pe(["fp-line-row",v(Re+1)]),"data-line":Re+1},[p("span",fZ,P(Re+1),1),p("span",{class:"fp-line-text",innerHTML:le(Ne)},null,8,hZ)],10,dZ))),128))])]))],2)):g.value==="json"?(C(),E("div",pZ,[p("div",mZ,[(C(!0),E(Oe,null,Xe(w.value,(Ne,Re)=>(C(),E("div",{key:Re,class:Pe(["fp-line-row",v(Re+1)]),"data-line":Re+1},[p("span",vZ,P(Re+1),1),p("span",{class:"fp-line-text",innerHTML:le(Ne)},null,8,yZ)],10,gZ))),128))])])):g.value==="html"?(C(),E("div",kZ,[R.value==="preview"?(C(),E("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:J.value,title:e.file.path},null,8,bZ)):(C(),E("div",wZ,[p("div",_Z,[(C(!0),E(Oe,null,Xe(w.value,(Ne,Re)=>(C(),E("div",{key:Re,class:Pe(["fp-line-row",v(Re+1)]),"data-line":Re+1},[p("span",SZ,P(Re+1),1),p("span",{class:"fp-line-text",innerHTML:le(Ne)},null,8,xZ)],10,CZ))),128))])]))])):g.value==="pdf"?(C(),E("div",TZ,[U.value?(C(),E("iframe",{key:0,class:"fp-pdf-frame",src:U.value,title:e.file.path},null,8,AZ)):(C(),E("div",MZ,[p("span",EZ,P(x(n)("filePreview.pdfNoPreview")),1)]))])):g.value==="csv"?(C(),E("div",IZ,[p("table",$Z,[p("tbody",null,[(C(!0),E(Oe,null,Xe(G.value,(Ne,Re)=>(C(),E("tr",{key:Re,class:Pe(v(Re+1)),"data-line":Re+1},[p("th",null,P(Re+1),1),(C(!0),E(Oe,null,Xe(Ne,(Q,ce)=>(C(),E("td",{key:ce},P(Q),1))),128))],10,NZ))),128))])])])):g.value==="image"?(C(),E("div",LZ,[V.value?(C(),E("img",{key:0,src:V.value,alt:e.file.path,class:Pe(["fp-image",{actual:W.value==="actual"}])},null,10,PZ)):(C(),E("div",OZ,[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",RZ,P(x(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:M(e.file.size)})),1)]))])):g.value==="text"?(C(),E("div",DZ,[p("div",BZ,[(C(!0),E(Oe,null,Xe(w.value,(Ne,Re)=>(C(),E("div",{key:Re,class:Pe(["fp-line-row",v(Re+1)]),"data-line":Re+1},[p("span",HZ,P(Re+1),1),p("span",{class:"fp-line-text",innerHTML:le(Ne)},null,8,WZ)],10,FZ))),128))])])):(C(),E("div",UZ,[p("div",qZ,[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",jZ,P(x(n)("filePreview.binaryNoPreview",{mime:e.file.mime||x(n)("filePreview.unknownType"),size:M(e.file.size)})),1)])]))],64)):ie("",!0)],512))}}),VZ=bt(zZ,[["__scopeId","data-v-93380983"]]),KZ={class:"tp"},GZ={class:"tp-header"},YZ={class:"tp-title"},XZ={class:"tp-sub"},QZ=["title","aria-label"],ZZ=Qe({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),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(),E("div",KZ,[p("div",GZ,[p("span",YZ,P(x(s)("common.preview")),1),p("span",XZ,P(e.subtitle??x(s)("thinking.panelTitle")),1),p("button",{type:"button",class:"tp-close",title:x(s)("thinking.close"),"aria-label":x(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,QZ)]),p("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},P(e.text),513)]))}}),S2=bt(ZZ,[["__scopeId","data-v-2f5e8c0f"]]),JZ={class:"ap"},eJ={class:"ap-header"},tJ={class:"ap-title"},nJ={class:"ap-sub"},oJ=["title","aria-label"],sJ={key:0,class:"ap-type"},iJ={key:1,class:"ap-reason"},rJ={key:2,class:"ap-field"},lJ={class:"ap-field-body"},aJ={key:3,class:"ap-field"},cJ={class:"ap-field-body ap-progress"},uJ={key:0,class:"ap-call"},dJ={key:1,class:"ap-output"},fJ=["onClick"],hJ={key:4,class:"ap-field"},pJ={class:"ap-field-body"},mJ=8,x2=5,T2=2,gJ=Qe({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt(),i=F(()=>(n.member.outputLines??[]).map(h=>h.trimEnd()).filter(h=>h.length>0));function r(h){const m=[];let _=null,w=0;for(const k of h)k.startsWith("Calling ")?(_={key:`g${w++}`,call:k,output:[]},m.push(_)):_?_.output.push(k):(_={key:`g${w++}`,call:"",output:[k]},m.push(_));return m}const l=F(()=>r(i.value)),a=ne(new Set);function c(h){return a.value.has(h)}function u(h){const m=new Set(a.value);m.has(h)?m.delete(h):m.add(h),a.value=m}function d(h){return h.output.length-x2-T2}function f(h){switch(h){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const g=ne(null);return ze(()=>i.value.length,()=>{const h=g.value;!h||!(h.scrollHeight-h.scrollTop-h.clientHeight<24)||ht(()=>{g.value&&(g.value.scrollTop=g.value.scrollHeight)})},{immediate:!0}),(h,m)=>(C(),E("div",JZ,[p("div",eJ,[p("span",tJ,P(x(s)("common.preview")),1),p("span",nJ,P(e.member.name),1),p("span",{class:Pe(["ap-phase",`phase-${e.member.phase}`])},P(f(e.member.phase)),3),p("button",{type:"button",class:"ap-close",title:x(s)("thinking.close"),"aria-label":x(s)("thinking.close"),onClick:m[0]||(m[0]=_=>o("close"))},[...m[1]||(m[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,oJ)]),p("div",{ref_key:"bodyEl",ref:g,class:"ap-body"},[e.member.subagentType?(C(),E("div",sJ,P(e.member.subagentType),1)):ie("",!0),e.member.suspendedReason?(C(),E("div",iJ,P(e.member.suspendedReason),1)):ie("",!0),e.member.prompt?(C(),E("div",rJ,[m[2]||(m[2]=p("span",{class:"ap-field-label"},"Task",-1)),p("div",lJ,P(e.member.prompt),1)])):ie("",!0),l.value.length>0?(C(),E("div",aJ,[m[4]||(m[4]=p("span",{class:"ap-field-label"},"Progress",-1)),p("div",cJ,[(C(!0),E(Oe,null,Xe(l.value,_=>(C(),E("div",{key:_.key,class:"ap-group"},[_.call?(C(),E("div",uJ,[m[3]||(m[3]=p("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),ft(" "+P(_.call),1)])):ie("",!0),_.output.length>0?(C(),E("div",dJ,[_.output.length<=mJ||c(_.key)?(C(!0),E(Oe,{key:0},Xe(_.output,(w,k)=>(C(),E("div",{key:k,class:"ap-out-line"},P(w),1))),128)):(C(),E(Oe,{key:1},[(C(!0),E(Oe,null,Xe(_.output.slice(0,x2),(w,k)=>(C(),E("div",{key:k,class:"ap-out-line"},P(w),1))),128)),p("button",{type:"button",class:"ap-fold",onClick:w=>u(_.key)}," … ("+P(d(_))+" more) ",9,fJ),(C(!0),E(Oe,null,Xe(_.output.slice(-T2),(w,k)=>(C(),E("div",{key:"t"+k,class:"ap-out-line"},P(w),1))),128))],64))])):ie("",!0)]))),128))])])):ie("",!0),e.member.summary?(C(),E("div",hJ,[m[5]||(m[5]=p("span",{class:"ap-field-label"},"Result",-1)),p("div",pJ,P(e.member.summary),1)])):ie("",!0)],512)]))}}),vJ=bt(gJ,[["__scopeId","data-v-66bf53d2"]]),yJ={class:"diff-lines"},kJ={key:0,class:"hunk-text"},bJ={class:"dl-gutter old"},wJ={class:"dl-gutter new"},_J={class:"dl-sign"},CJ={class:"dl-text"},SJ=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(),E("div",yJ,[(C(!0),E(Oe,null,Xe(e.lines,(r,l)=>(C(),E("div",{key:l,class:Pe(["dl",o(r)])},[r.type==="hunk"?(C(),E("span",kJ,P(r.text),1)):(C(),E(Oe,{key:1},[p("span",bJ,P(t(r)),1),p("span",wJ,P(n(r)),1),p("span",_J,P(r.type==="add"?"+":r.type==="del"?"-":" "),1),p("span",CJ,P(r.text),1)],64))],2))),128))]))}}),s3=bt(SJ,[["__scopeId","data-v-b73eaacc"]]),xJ={class:"tdp"},TJ={class:"tdp-header"},AJ={class:"tdp-title"},MJ=["title"],EJ=["title","aria-label"],IJ={class:"tdp-body"},$J={key:1,class:"tdp-output"},NJ={key:2,class:"tdp-empty"},LJ=Qe({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=xt();return(s,i)=>(C(),E("div",xJ,[p("div",TJ,[p("span",AJ,P(e.target.title),1),e.target.path?(C(),E("span",{key:0,class:"tdp-sub",title:e.target.path},P(e.target.path),9,MJ)):ie("",!0),p("button",{type:"button",class:"tdp-close",title:x(o)("thinking.close"),"aria-label":x(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,EJ)]),p("div",IJ,[e.target.lines&&e.target.lines.length>0?(C(),Ve(s3,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(C(),E("div",$J,[(C(!0),E(Oe,null,Xe(e.target.output,(r,l)=>(C(),E("div",{key:l},P(r),1))),128))])):(C(),E("div",NJ,P(x(o)("diff.noDiff")),1))])]))}}),PJ=bt(LJ,[["__scopeId","data-v-9d022f5b"]]),OJ={class:"sc"},RJ={class:"sc-header"},DJ={class:"sc-title"},BJ=["title"],FJ=["title","aria-label"],HJ={key:0,class:"sc-empty"},WJ={key:2,class:"sc-loading","aria-hidden":"true"},UJ={class:"sc-composer"},qJ=["placeholder"],jJ=["disabled","title"],zJ=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}=xt(),i=F(()=>n.turns.find(k=>k.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"),f()}))}function f(){const w=u.value;w&&(w.scrollTop=w.scrollHeight)}const g=F(()=>{const w=n.turns;if(w.length===0)return"0";const k=w.at(-1),b=k.thinking?.length??0,y=k.tools?.reduce((S,L)=>S+L.name.length+(L.arg?.length??0)+(L.output?.join("").length??0),0)??0;return`${w.length}:${k.text.length}:${b}:${y}`});ze(g,async()=>{!n.running&&!n.sending||(await ht(),f())});const h=F(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(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,k)=>(C(),E("div",OJ,[p("div",RJ,[p("span",DJ,P(r.value),1),p("span",{class:"sc-subtitle",title:l.value},P(l.value),9,BJ),p("button",{type:"button",class:"sc-close",title:x(s)("thinking.close"),"aria-label":x(s)("thinking.close"),onClick:k[0]||(k[0]=b=>o("close"))},[...k[2]||(k[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,FJ)]),p("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(C(),E("div",HJ,P(x(s)("sideChat.empty")),1)):(C(),Ve(JA,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending,bubble:""},null,8,["turns","running","sending"])),h.value?(C(),E("div",WJ,[vt(L1)])):ie("",!0)],512),p("div",UJ,[jt(p("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":k[1]||(k[1]=b=>a.value=b),class:"sc-input",rows:"1",placeholder:x(s)("sideChat.placeholder"),onInput:_,onKeydown:m},null,40,qJ),[[Wn,a.value]]),p("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),title:x(s)("sideChat.send"),onClick:d},[...k[3]||(k[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,jJ)])]))}}),VJ=bt(zJ,[["__scopeId","data-v-5d7c220f"]]),KJ={class:"changes-pane"},GJ={class:"dv-panel-head"},YJ={class:"dv-title"},XJ=["title"],QJ=["title","aria-label"],ZJ={class:"diff-head"},JJ=["title"],eee={class:"back-label"},tee={key:0,class:"empty-state"},nee={key:1,class:"dv-lines-wrap"},oee={key:2,class:"empty-state"},see={class:"dv-panel-head"},iee={class:"dv-title"},ree={class:"dv-change-count"},lee=["aria-label"],aee=["aria-pressed"],cee=["aria-pressed"],uee=["title","aria-label"],dee={class:"ch-head"},fee={class:"br-label"},hee={class:"br-name"},pee={key:0,class:"sync-info"},mee=["title"],gee=["title"],vee={key:1,class:"empty-head"},yee={key:0,class:"ch-list"},kee=["title","onClick"],bee={class:"fpath"},wee={key:1,class:"ch-list ch-tree"},_ee={class:"tree-list"},Cee=["onClick"],See={class:"tree-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},xee=["d"],Tee={class:"tree-name"},Aee=["title","onClick"],Mee={class:"tree-name"},Eee={key:2,class:"empty-state"},Iee={key:3,class:"empty-state"},$ee=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}=xt(),o=e,s=t;function i(T){const I=T.toLowerCase();return I==="modified"?"modified":I==="added"?"added":I==="deleted"?"deleted":I==="renamed"?"renamed":I==="untracked"?"untracked":I==="conflicted"?"conflicted":I==="ignored"?"ignored":I==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(T){return r[i(T)]??"?"}function a(T,I=60){return T.length<=I?T:"…"+T.slice(T.length-I+1)}const c=F(()=>o.gitInfo!==null),u=F(()=>o.changes.length>0),d=F(()=>(o.selectedDiffPath??null)!==null),f=F(()=>o.mode==="detail"||o.mode==="full"&&d.value),g=F(()=>o.fileDiff??[]),h=F(()=>o.fileDiffLoading===!0);function m(T){s("open",T)}function _(){s("back")}function w(){s("close")}const k=ne("list");function b(T){k.value=T}function y(T){const I={children:[]},R=[...T].sort((D,W)=>D.path.localeCompare(W.path));for(const D of R){const W=D.path.split("/");let V=I;for(let U=0;U<W.length;U++){const J=W[U],K=U===W.length-1,G=W.slice(0,U+1).join("/");let X=V.children.find(ke=>ke.name===J&&ke.kind===(K?"file":"folder"));X||(X={name:J,path:G,kind:K?"file":"folder",status:K?D.status:void 0,children:[]},V.children.push(X)),V=X}}return I.children}const S=F(()=>y(o.changes)),L=ne(new Set);function N(T){return!L.value.has(T)}const v=F(()=>{const T=[];function I(R,D){for(const W of R)T.push({node:W,depth:D}),W.kind==="folder"&&N(W.path)&&I(W.children,D+1)}return I(S.value,0),T});function M(T){const I=new Set(L.value);I.has(T.path)?I.delete(T.path):I.add(T.path),L.value=I}const $=T=>"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(T){return`${16+T*16}px`}return(T,I)=>(C(),E("div",KJ,[f.value?(C(),E(Oe,{key:0},[p("div",GJ,[p("span",YJ,P(x(n)("diff.title")),1),p("span",{class:"dv-path",title:e.selectedDiffPath??""},P(a(e.selectedDiffPath??"",50)),9,XJ),e.closable?(C(),E("button",{key:0,type:"button",class:"dv-close",title:x(n)("diff.close"),"aria-label":x(n)("diff.close"),onClick:w},[...I[2]||(I[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,QJ)):ie("",!0)]),p("div",ZJ,[e.hideBack?ie("",!0):(C(),E("button",{key:0,class:"back-btn",type:"button",onClick:_,title:x(n)("diff.back")},[I[3]||(I[3]=p("span",{"aria-hidden":"true"},"←",-1)),p("span",eee,P(x(n)("diff.back")),1)],8,JJ))]),h.value?(C(),E("div",tee,P(x(n)("diff.loading")),1)):g.value.length>0?(C(),E("div",nee,[vt(s3,{lines:g.value},null,8,["lines"])])):(C(),E("div",oee,P(x(n)("diff.noDiff")),1))],64)):(C(),E(Oe,{key:1},[p("div",see,[p("span",iee,P(x(n)("diff.title")),1),p("span",ree,P(x(n)("diff.changeCount",{count:e.changes.length})),1),p("div",{class:"dv-toggle",role:"group","aria-label":x(n)("diff.list")+" / "+x(n)("diff.tree")},[p("button",{type:"button",class:Pe(["dv-toggle-btn",{active:k.value==="list"}]),"aria-pressed":k.value==="list",onClick:I[0]||(I[0]=R=>b("list"))},P(x(n)("diff.list")),11,aee),p("button",{type:"button",class:Pe(["dv-toggle-btn",{active:k.value==="tree"}]),"aria-pressed":k.value==="tree",onClick:I[1]||(I[1]=R=>b("tree"))},P(x(n)("diff.tree")),11,cee)],8,lee),e.closable?(C(),E("button",{key:0,type:"button",class:"dv-close",title:x(n)("diff.close"),"aria-label":x(n)("diff.close"),onClick:w},[...I[4]||(I[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,uee)):ie("",!0)]),p("div",dee,[c.value?(C(),E(Oe,{key:0},[p("span",fee,P(x(n)("diff.branch")),1),p("span",hee,P(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(C(),E("span",pee,[e.gitInfo.ahead>0?(C(),E("span",{key:0,class:"ahead",title:x(n)("diff.aheadTitle")},"↑"+P(e.gitInfo.ahead),9,mee)):ie("",!0),e.gitInfo.behind>0?(C(),E("span",{key:1,class:"behind",title:x(n)("diff.behindTitle")},"↓"+P(e.gitInfo.behind),9,gee)):ie("",!0)])):ie("",!0)],64)):(C(),E("span",vee,P(x(n)("diff.empty")),1))]),u.value&&k.value==="list"?(C(),E("div",yee,[(C(!0),E(Oe,null,Xe(e.changes,R=>(C(),E("button",{key:R.path,type:"button",class:"ch-row",title:R.path,onClick:D=>m(R.path)},[p("span",{class:Pe(["badge",i(R.status)])},P(l(R.status)),3),p("span",bee,P(a(R.path)),1)],8,kee))),128))])):u.value&&k.value==="tree"?(C(),E("div",wee,[p("ul",_ee,[(C(!0),E(Oe,null,Xe(v.value,({node:R,depth:D})=>(C(),E("li",{key:R.path,class:"tree-node"},[R.kind==="folder"?(C(),E("button",{key:0,type:"button",class:"tree-row tree-folder",style:Wt({paddingLeft:O(D)}),onClick:W=>M(R)},[(C(),E("svg",See,[p("path",{d:$(N(R.path))},null,8,xee)])),p("span",Tee,P(R.name),1)],12,Cee)):(C(),E("button",{key:1,type:"button",class:"tree-row tree-file",style:Wt({paddingLeft:O(D)}),title:R.path,onClick:W=>m(R.path)},[p("span",{class:Pe(["badge",i(R.status)])},P(l(R.status)),3),p("span",Mee,P(R.name),1)],12,Aee))]))),128))])])):c.value?(C(),E("div",Eee,P(x(n)("diff.clean")),1)):(C(),E("div",Iee,P(x(n)("diff.empty")),1))],64))]))}}),Nee=bt($ee,[["__scopeId","data-v-bb3f7593"]]);function Kh(e,t){let n=null;rn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,ht(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),Yo(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const Lee=["aria-label"],Pee={class:"dh"},Oee={class:"dtitle"},Ree=["title"],Dee={class:"search-wrap"},Bee=["placeholder"],Fee=["aria-label"],Hee=["aria-selected","onClick"],Wee={key:1,class:"loading-state"},Uee={key:2,class:"unavail-state"},qee={key:3,class:"model-list"},jee=["aria-selected","onClick","onMouseenter"],zee={class:"check"},Vee={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"},Kee={class:"model-main"},Gee={class:"model-name"},Yee={class:"model-id"},Xee={class:"model-provider"},Qee={class:"model-ctx"},Zee={key:0,class:"caps"},Jee=["title","onClick"],ete={viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true"},tte=["fill"],nte={key:0,class:"empty"},ote={class:"footer-hint"},ste=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}=xt(),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");Kh(c,a);const d=F(()=>{const b=new Set,y=[{id:"all",label:n("model.allTab")}];for(const S of o.models)b.has(S.provider)||(b.add(S.provider),y.push({id:S.provider,label:S.provider}));return y}),f=F(()=>{const b=l.value.toLowerCase().trim(),y=o.models.filter(S=>{if(u.value!=="all"&&S.provider!==u.value)return!1;const L=(S.displayName??S.model).toLowerCase().includes(b),N=S.provider.toLowerCase().includes(b),v=S.id.toLowerCase().includes(b);return!b||L||N||v});return u.value!=="all"?y:y.sort((S,L)=>{const N=r(S.id)?1:0;return(r(L.id)?1:0)-N})}),g=F(()=>f.value),h=ne(0);ze([l,u],()=>{h.value=0}),ze(d,b=>{b.some(y=>y.id===u.value)||(u.value="all")}),ze(g,b=>{h.value=Math.min(h.value,Math.max(b.length-1,0))});function m(b){if(b.key==="Escape"){s("close");return}if(b.key==="ArrowDown")b.preventDefault(),h.value=Math.min(h.value+1,g.value.length-1);else if(b.key==="ArrowUp")b.preventDefault(),h.value=Math.max(h.value-1,0);else if(b.key==="Enter"){const y=g.value[h.value];y&&s("select",y.id)}}rn(()=>{document.addEventListener("keydown",m)}),Yt(()=>{document.removeEventListener("keydown",m)});function _(b){s("select",b)}function w(b){return g.value.indexOf(b)}function k(b){u.value=b}return(b,y)=>(C(),E("div",{class:"backdrop",onClick:y[3]||(y[3]=Ze(S=>s("close"),["self"]))},[p("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":x(n)("model.dialogLabel")},[p("div",Pee,[p("span",Oee,P(x(n)("model.title")),1),p("button",{class:"close-btn",title:x(n)("model.close"),onClick:y[0]||(y[0]=S=>s("close"))},"✕",8,Ree)]),p("div",Dee,[jt(p("input",{ref_key:"searchRef",ref:a,"onUpdate:modelValue":y[1]||(y[1]=S=>l.value=S),class:"search-input",type:"text",placeholder:x(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Bee),[[Wn,l.value]])]),d.value.length>1?(C(),E("div",{key:0,class:"tab-strip",role:"tablist","aria-label":x(n)("model.providerTabs")},[(C(!0),E(Oe,null,Xe(d.value,S=>(C(),E("button",{key:S.id,type:"button",class:Pe(["tab-btn",{on:S.id===u.value}]),role:"tab","aria-selected":S.id===u.value,onClick:L=>k(S.id)},P(S.label),11,Hee))),128))],8,Fee)):ie("",!0),e.loading?(C(),E("div",Wee,[y[4]||(y[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(x(n)("model.loading")),1)])):e.unavailable?(C(),E("div",Uee,[y[5]||(y[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(x(n)("model.unavailable")),1)])):(C(),E("div",qee,[(C(!0),E(Oe,null,Xe(g.value,S=>(C(),E("div",{key:S.id,class:Pe(["model-row",{"is-current":S.id===e.current,"is-selected":w(S)===h.value}]),role:"option","aria-selected":S.id===e.current,onClick:L=>_(S.id),onMouseenter:L=>h.value=w(S)},[p("span",zee,[S.id===e.current?(C(),E("svg",Vee,[...y[6]||(y[6]=[p("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):ie("",!0)]),p("span",Kee,[p("span",Gee,P(S.displayName??S.model),1),p("span",Yee,P(S.id),1)]),p("span",Xee,P(S.provider),1),p("span",Qee,P(x(n)("model.contextSuffix",{size:Math.round(S.maxContextSize/1e3)})),1),S.capabilities&&S.capabilities.length>0?(C(),E("span",Zee,P(S.capabilities.join(", ")),1)):ie("",!0),p("button",{type:"button",class:Pe(["star-btn",{starred:r(S.id)}]),title:r(S.id)?x(n)("model.unstarTitle"):x(n)("model.starTitle"),onClick:Ze(L=>s("toggle-star",S.id),["stop"]),onMouseenter:y[2]||(y[2]=Ze(()=>{},["stop"]))},[(C(),E("svg",ete,[p("path",{fill:r(S.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,tte)]))],42,Jee)],42,jee))),128)),g.value.length===0&&!e.loading&&!e.unavailable?(C(),E("div",nte,P(o.models.length===0?x(n)("model.emptyNoModels"):x(n)("model.emptyNoMatch")),1)):ie("",!0)])),p("div",ote,P(x(n)("model.footerHint")),1)],8,Lee)]))}}),ite=bt(ste,[["__scopeId","data-v-34f036d8"]]),rte=["aria-label"],lte={class:"dh"},ate={class:"dtitle"},cte=["title"],ute={class:"prov-list"},dte={key:0,class:"state-row"},fte={key:1,class:"state-row unavail"},hte={key:2,class:"empty"},pte=["title"],mte={key:0,width:"8",height:"8",viewBox:"0 0 8 8"},gte=["fill"],vte={key:1,width:"8",height:"8",viewBox:"0 0 8 8"},yte=["fill"],kte={key:2,width:"8",height:"8",viewBox:"0 0 8 8"},bte={class:"prov-info"},wte={class:"prov-type"},_te={key:0,class:"prov-url"},Cte={class:"prov-meta"},Ste={key:0},xte={key:0,class:"confirm-row"},Tte={class:"confirm-text"},Ate={key:1,class:"prov-actions"},Mte=["title","onClick"],Ete=["title","onClick"],Ite={key:0,class:"add-section"},$te={key:0,class:"add-btns"},Nte={key:1,class:"add-form"},Lte={class:"form-row"},Pte={class:"flabel"},Ote=["value"],Rte={class:"form-row"},Dte={class:"flabel"},Bte={class:"form-row"},Fte={class:"flabel"},Hte=["placeholder"],Wte={class:"form-row"},Ute={class:"flabel"},qte=["placeholder"],jte={key:0,class:"add-error"},zte={class:"form-btns"},Vte={class:"footer-hint"},Kte=Qe({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=xt(),o=ne(null);Kh(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=as({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),d=ne(""),f=["moonshot","anthropic","openai","custom"];function g(){u.type="moonshot",u.apiKey="",u.baseUrl="",u.defaultModel="",d.value="",c.value=!0}function h(){c.value=!1}function m(){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){h();return}if(i.value){a();return}s("close")}}rn(()=>document.addEventListener("keydown",_)),Yt(()=>document.removeEventListener("keydown",_));function w(b){return b==="connected"?"var(--ok)":b==="error"?"var(--err)":"var(--faint)"}function k(b){return n(b==="connected"?"providers.status.connected":b==="error"?"providers.status.error":"providers.status.unconfigured")}return(b,y)=>(C(),E("div",{class:"backdrop",onClick:y[7]||(y[7]=Ze(S=>s("close"),["self"]))},[p("div",{ref_key:"dialogRef",ref:o,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":x(n)("providers.dialogLabel")},[p("div",lte,[p("span",ate,P(x(n)("providers.title")),1),p("button",{class:"close-btn",title:x(n)("providers.close"),onClick:y[0]||(y[0]=S=>s("close"))},"✕",8,cte)]),p("div",ute,[e.loading?(C(),E("div",dte,[y[8]||(y[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(x(n)("providers.loading")),1)])):e.unavailable?(C(),E("div",fte,[y[9]||(y[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(x(n)("providers.unavailable")),1)])):e.providers.length===0?(C(),E("div",hte,P(x(n)("providers.empty")),1)):(C(!0),E(Oe,{key:3},Xe(e.providers,S=>(C(),E("div",{key:S.id,class:"prov-row"},[p("span",{class:"status-dot",style:Wt({color:w(S.status)}),title:k(S.status)},[S.status==="connected"?(C(),E("svg",mte,[p("circle",{cx:"4",cy:"4",r:"3.5",fill:w(S.status)},null,8,gte)])):S.status==="error"?(C(),E("svg",vte,[p("circle",{cx:"4",cy:"4",r:"3.5",fill:w(S.status)},null,8,yte)])):(C(),E("svg",kte,[...y[10]||(y[10]=[p("circle",{cx:"4",cy:"4",r:"3",fill:"none",stroke:"var(--faint)","stroke-width":"1"},null,-1)])]))],12,pte),p("div",bte,[p("span",wte,P(S.type),1),S.baseUrl?(C(),E("span",_te,P(S.baseUrl),1)):ie("",!0),p("span",Cte,[p("span",{class:Pe(["prov-key-state",S.hasApiKey?"has-key":"no-key"])},P(S.hasApiKey?x(n)("providers.keySet"):x(n)("providers.keyNotSet")),3),S.models&&S.models.length>0?(C(),E("span",Ste," · "+P(x(n)("providers.modelCount",{count:S.models.length})),1)):ie("",!0)])]),i.value===S.id?(C(),E("div",xte,[p("span",Tte,P(x(n)("providers.confirmDelete")),1),p("button",{class:"act-btn danger",onClick:l},P(x(n)("providers.confirm")),1),p("button",{class:"act-btn",onClick:a},P(x(n)("providers.cancel")),1)])):(C(),E("div",Ate,[p("button",{class:"act-btn",title:x(n)("providers.refreshTitle",{type:S.type}),onClick:L=>s("refresh",S.id)},P(x(n)("providers.refresh")),9,Mte),p("button",{class:"act-btn danger",title:x(n)("providers.deleteTitle",{type:S.type}),onClick:L=>r(S.id)},P(x(n)("providers.delete")),9,Ete)]))]))),128))]),e.unavailable?ie("",!0):(C(),E("div",Ite,[c.value?(C(),E("div",Nte,[p("div",Lte,[p("label",Pte,P(x(n)("providers.fieldType")),1),jt(p("select",{"onUpdate:modelValue":y[3]||(y[3]=S=>u.type=S),class:"finput fselect"},[(C(),E(Oe,null,Xe(f,S=>p("option",{key:S,value:S},P(S),9,Ote)),64))],512),[[yf,u.type]])]),p("div",Rte,[p("label",Dte,P(x(n)("providers.fieldApiKey")),1),jt(p("input",{"onUpdate:modelValue":y[4]||(y[4]=S=>u.apiKey=S),class:"finput",type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,512),[[Wn,u.apiKey]])]),p("div",Bte,[p("label",Fte,P(x(n)("providers.fieldBaseUrl")),1),jt(p("input",{"onUpdate:modelValue":y[5]||(y[5]=S=>u.baseUrl=S),class:"finput",type:"text",placeholder:x(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Hte),[[Wn,u.baseUrl]])]),p("div",Wte,[p("label",Ute,P(x(n)("providers.fieldDefaultModel")),1),jt(p("input",{"onUpdate:modelValue":y[6]||(y[6]=S=>u.defaultModel=S),class:"finput",type:"text",placeholder:x(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,qte),[[Wn,u.defaultModel]])]),d.value?(C(),E("div",jte,P(d.value),1)):ie("",!0),p("div",zte,[p("button",{class:"act-btn primary",onClick:m},P(x(n)("providers.add")),1),p("button",{class:"act-btn",onClick:h},P(x(n)("providers.cancel")),1)])])):(C(),E("div",$te,[p("button",{class:"add-btn-oauth",onClick:y[1]||(y[1]=S=>s("openLogin","moonshot"))},[y[11]||(y[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)),ft(" "+P(x(n)("providers.loginKimi")),1)]),p("button",{class:"add-btn-oauth",onClick:y[2]||(y[2]=S=>s("openLogin","anthropic"))},[y[12]||(y[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)),ft(" "+P(x(n)("providers.loginAnthropic")),1)]),p("button",{class:"add-btn add-btn-key",onClick:g},[y[13]||(y[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)),ft(" "+P(x(n)("providers.enterApiKey")),1)])]))])),p("div",Vte,P(x(n)("providers.escClose")),1)],8,rte)]))}}),Gte=bt(Kte,[["__scopeId","data-v-28ec3774"]]),Yte={class:"backdrop"},Xte=["aria-label"],Qte={class:"dh"},Zte={class:"dtitle"},Jte=["title"],ene={key:0,class:"center-body"},tne={class:"center-text"},nne={key:1,class:"nb"},one={class:"nb-lead"},sne=["href"],ine={class:"nb-or"},rne={class:"nb-fallback"},lne={class:"nb-fb-text"},ane=["href"],cne={class:"nb-code-row"},une={class:"nb-code"},dne={class:"nb-status"},fne=["aria-label"],hne={class:"nb-status-text"},pne={class:"nb-countdown"},mne={key:2,class:"center-body"},gne={class:"center-text success-text"},vne={class:"center-hint"},yne={class:"center-body"},kne={class:"center-text err-text"},bne={class:"center-hint"},wne={class:"actions"},_ne={class:"center-body"},Cne={class:"center-text warn-text"},Sne={class:"center-hint"},xne={class:"actions"},Tne=Qe({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=xt(),o=ne(null);Kh(o);const s=t,i=e,r=ne("starting"),l=ne(null),a=ne(0),c=ne(!1);let u=null,d=null;rn(async()=>{document.addEventListener("keydown",b),await f()}),Yt(()=>{document.removeEventListener("keydown",b),m()});async function f(){m(),l.value=null,r.value="starting";const S=await i.onStartOAuthLogin();if(!S){r.value="error";return}l.value={flowId:S.flowId,verificationUri:S.verificationUri,verificationUriComplete:S.verificationUriComplete,userCode:S.userCode,expiresIn:S.expiresIn,interval:S.interval},a.value=S.expiresIn,r.value="device-code",g(),h(S.interval)}function g(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function h(S){u&&clearTimeout(u),u=setTimeout(async()=>{const L=await i.onPollOAuthLogin();L?.status==="authenticated"?(m(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):L?.status==="expired"||L?.status==="cancelled"?(m(),r.value="expired"):h(S)},S*1e3)}function m(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function _(){await f()}async function w(){!l.value||!await wo(l.value.userCode)||(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}async function k(){m(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function b(S){S.key==="Escape"&&k()}function y(S){const L=Math.floor(S/60),N=S%60;return`${L}:${String(N).padStart(2,"0")}`}return(S,L)=>(C(),E("div",Yte,[p("div",{ref_key:"dialogRef",ref:o,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":x(n)("login.title")},[p("div",Qte,[p("span",Zte,P(x(n)("login.title")),1),p("button",{class:"close-btn",title:x(n)("login.close"),onClick:k},[...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,Jte)]),r.value==="starting"?(C(),E("div",ene,[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",tne,P(x(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(C(),E("div",nne,[p("div",one,P(x(n)("login.lead")),1),p("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[ft(P(x(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,sne),p("div",ine,P(x(n)("login.orDivider")),1),p("div",rne,[p("div",lne,[ft(P(x(n)("login.fallbackPrefix")),1),p("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},P(l.value.verificationUri),9,ane),ft(P(x(n)("login.fallbackSuffix")),1)]),p("div",cne,[p("span",une,P(l.value.userCode),1),p("button",{class:Pe(["nb-copy",{"is-copied":c.value}]),onClick:w},[c.value?(C(),E(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)),ft(" "+P(x(n)("login.copied")),1)],64)):(C(),E(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)),ft(" "+P(x(n)("login.copy")),1)],64))],2)])]),p("div",dne,[p("span",{class:"nb-spinner","aria-label":x(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,fne),p("span",hne,P(x(n)("login.waitingAutoClose")),1),p("span",pne,P(y(a.value)),1)])])):r.value==="success"?(C(),E("div",mne,[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",gne,P(x(n)("login.success")),1),p("span",vne,P(x(n)("login.successHint")),1)])):r.value==="expired"?(C(),E(Oe,{key:3},[p("div",yne,[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",kne,P(x(n)("login.expiredTitle")),1),p("span",bne,P(x(n)("login.expiredHint")),1)]),p("div",wne,[p("button",{class:"act-btn primary",onClick:_},P(x(n)("login.retry")),1),p("button",{class:"act-btn",onClick:k},P(x(n)("login.closeBtn")),1)])],64)):r.value==="error"?(C(),E(Oe,{key:4},[p("div",_ne,[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",Cne,P(x(n)("login.errorTitle")),1),p("span",Sne,P(x(n)("login.errorHint")),1)]),p("div",xne,[p("button",{class:"act-btn primary",onClick:_},P(x(n)("login.retry")),1),p("button",{class:"act-btn",onClick:k},P(x(n)("login.closeBtn")),1)])],64)):ie("",!0)],8,Xte)]))}}),Ane=bt(Tne,[["__scopeId","data-v-98c6ec96"]]),Mne={class:"lang-switch",role:"group","aria-label":"Language"},Ene=["aria-pressed","onClick"],Ine=Qe({__name:"LanguageSwitcher",setup(e){const{locale:t}=xt();function n(o){t.value!==o&&mx(o)}return(o,s)=>(C(),E("div",Mne,[(C(!0),E(Oe,null,Xe(x(px),i=>(C(),E("button",{key:i.code,type:"button",class:Pe(["lang-opt",{on:x(t)===i.code}]),"aria-pressed":x(t)===i.code,onClick:Ze(r=>n(i.code),["stop"])},P(i.label),11,Ene))),128))]))}}),i3=bt(Ine,[["__scopeId","data-v-907613b6"]]),A2=1e3,lg=16384,ag=500,cg=50,$ne=6,Nne=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Lne=/^[A-Za-z0-9+/=_-]{200,}$/;let ug=null;function Ys(){if(ug!==null)return ug;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(Mt.debug)==="1"),ug=e,e}const pr=[];let Pne=1;const d0=ne(0),vc=gl(!1);function One(){return pr}function Rne(){pr.length=0,d0.value++}function Nr(e){vc.value||(pr.push({id:Pne++,ts:Date.now(),...e}),pr.length>A2&&pr.splice(0,pr.length-A2),d0.value++)}function O1(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 Lne.test(s)?`[base64-like, ${s.length} chars omitted]`:s.length>ag?`${s.slice(0,ag)}… [+${s.length-ag} chars]`:s}if(n!=="object")return String(e);if(t>=$ne)return"[max depth]";if(Array.isArray(e)){const s=e.slice(0,cg).map(i=>O1(i,t+1));return e.length>cg&&s.push(`[+${e.length-cg} more items]`),s}const o={};for(const[s,i]of Object.entries(e))o[s]=Nne.test(s)?"[redacted]":O1(i,t+1);return o}function kl(e){if(e===void 0)return;const t=O1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>lg)return{_truncated:`detail JSON was ${n.length} chars; first ${lg} kept`,preview:n.slice(0,lg)}}catch{return"[unserializable detail]"}return t}function M2(e){Ys()&&Nr({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:kl(e.body)}})}function E2(e){if(!Ys())return;const t=e.code!==0;Nr({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:kl(e.data)}})}function Md(e){Ys()&&Nr({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){Ys()&&Nr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:kl(t)})}function Dne(e){if(!Ys())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;Nr({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:kl(e)})}function Bne(e){if(!Ys())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);Nr({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:kl(t.payload)})}const Fne={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function dg(e,t,n){Ys()&&Nr({source:"client",kind:`client:${e}`,label:`${Fne[e]} ${t}`,detail:kl(n)})}function ar(e,t){Ys()&&Nr({source:"client",kind:"client:event",label:`· ${e}`,detail:kl(t)})}let I2=!1;function Hne(){if(!(I2||!Ys())){I2=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{dg("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;dg("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{dg(e,n.map(Wne).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function Wne(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 r3(e=pr){if(typeof document>"u")return;const t=new Blob([Une(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 Une(e=pr){return e.map(t=>JSON.stringify(t)).join(`
|
|
264
|
-
`)}const qne=["aria-label"],jne={class:"dh"},zne={class:"dtitle"},Vne=["title"],Kne={class:"settings-layout"},Gne=["aria-label"],Yne=["aria-selected","aria-controls","id","onClick"],Xne={class:"body"},Qne={id:"settings-panel-general",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-general"},Zne={class:"sec"},Jne={class:"sec-title"},eoe={class:"row"},toe={class:"rlabel"},noe=["aria-label"],ooe=["aria-pressed"],soe=["aria-pressed"],ioe={class:"row"},roe={class:"rlabel"},loe=["aria-label"],aoe=["aria-pressed"],coe=["aria-pressed"],uoe=["aria-pressed"],doe={class:"row"},foe={class:"rlabel"},hoe={class:"num-field"},poe=["value","aria-label"],moe={class:"row"},goe={class:"rlabel"},voe={class:"sec"},yoe={class:"sec-title"},koe={class:"row"},boe={class:"rlabel"},woe={key:0,class:"hint"},_oe=["aria-checked","disabled"],Coe={class:"row"},Soe={class:"rlabel"},xoe={key:0,class:"hint"},Toe=["aria-checked","disabled"],Aoe={class:"row"},Moe={class:"rlabel"},Eoe=["aria-checked"],Ioe={class:"sec"},$oe={class:"sec-title"},Noe={class:"row"},Loe={class:"rlabel"},Poe=["title"],Ooe={class:"actions"},Roe={class:"sec"},Doe={class:"sec-title"},Boe={class:"row"},Foe={class:"rlabel"},Hoe={class:"rvalue mono"},Woe={id:"settings-panel-agent",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-agent"},Uoe={class:"sec"},qoe={class:"sec-head"},joe={class:"sec-title"},zoe={key:0,class:"saving"},Voe={class:"row"},Koe={class:"rlabel"},Goe={class:"hint"},Yoe=["value","disabled","aria-label"],Xoe={key:0,value:"",disabled:""},Qoe=["label"],Zoe=["value"],Joe={key:1,class:"rvalue mono"},ese={class:"row"},tse={class:"rlabel"},nse={class:"hint"},ose=["aria-label"],sse=["aria-pressed","disabled","onClick"],ise={class:"row"},rse={class:"rlabel"},lse={class:"hint"},ase=["aria-checked","disabled"],cse={class:"row"},use={class:"rlabel"},dse={class:"hint"},fse=["aria-checked","disabled"],hse={class:"row"},pse={class:"rlabel"},mse={class:"hint"},gse=["aria-checked","disabled"],vse={key:0,class:"row"},yse={class:"rlabel"},kse=["aria-checked","disabled"],bse={key:1,class:"provider-list"},wse={class:"provider-main"},_se={class:"provider-id"},Cse={class:"provider-type"},Sse={class:"provider-meta"},xse={key:0,class:"provider-model"},Tse={key:1,class:"empty-config"},Ase={id:"settings-panel-advanced",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-advanced"},Mse={class:"sec"},Ese={class:"sec-title"},Ise={class:"row"},$se={class:"rlabel"},Nse={class:"rvalue mono"},Lse={class:"row"},Pse={class:"rlabel"},Ose={key:0,class:"hint"},Rse={id:"settings-panel-experimental",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-experimental"},Dse={class:"sec"},Bse={class:"sec-title"},Fse={class:"row"},Hse={class:"rlabel"},Wse={class:"hint"},Use=["aria-checked"],qse=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}=xt(),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=s5(),a=["manual","auto","yolo"],c=ne(null);Kh(c);function u(N){N.key==="Escape"&&s("close")}rn(()=>document.addEventListener("keydown",u)),Yt(()=>document.removeEventListener("keydown",u));function d(){r3()}const f=F(()=>{const N=new Map;for(const v of o.models??[])N.set(v.id,{id:v.id,label:v.displayName??v.model??v.id,provider:v.provider});for(const[v,M]of Object.entries(o.config?.models??{})){if(N.has(v))continue;const $=_(M);N.set(v,{id:v,label:w(v,M,$),provider:$??v})}return Array.from(N.values())}),g=F(()=>{const N=new Map;for(const v of f.value){const M=N.get(v.provider)??[];M.push(v),N.set(v.provider,M)}for(const v of N.values())v.sort((M,$)=>M.label.localeCompare($.label));return Array.from(N.entries()).toSorted(([v],[M])=>v.localeCompare(M)).map(([v,M])=>({provider:v,options:M}))}),h=F(()=>Object.entries(o.config?.providers??{}).map(([N,v])=>({id:N,provider:v})).sort((N,v)=>N.id.localeCompare(v.id))),m=F(()=>{const N=o.config?.defaultPermissionMode;return N==="auto"||N==="yolo"||N==="manual"?N:"manual"});function _(N){if(!N||typeof N!="object")return;const v=N;return typeof v.provider=="string"?v.provider:void 0}function w(N,v,M){if(!v||typeof v!="object")return N;const $=v,O=typeof $.model=="string"?$.model:void 0,T=M??_(v);return O&&T?`${N} (${T}/${O})`:O?`${N} (${O})`:N}function k(N){return N===!0}function b(N){const v=N.target.value;!v||v===o.config?.defaultModel||s("updateConfig",{defaultModel:v})}function y(N){N!==m.value&&s("updateConfig",{defaultPermissionMode:N})}function S(N){const v=o.config?.[N];s("updateConfig",{[N]:!k(v)})}function L(N){i.value=N}return(N,v)=>(C(),E("div",{class:"backdrop",onClick:v[18]||(v[18]=Ze(M=>s("close"),["self"]))},[p("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":x(n)("settings.title")},[p("div",jne,[p("span",zne,P(x(n)("settings.title")),1),p("button",{class:"close-btn",title:x(n)("settings.close"),onClick:v[0]||(v[0]=M=>s("close"))},[...v[19]||(v[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,Vne)]),p("div",Kne,[p("nav",{class:"settings-tabs",role:"tablist","aria-label":x(n)("settings.title")},[(C(),E(Oe,null,Xe(r,M=>p("button",{key:M.id,type:"button",class:Pe(["tab",{on:i.value===M.id}]),role:"tab","aria-selected":i.value===M.id,"aria-controls":`settings-panel-${M.id}`,id:`settings-tab-${M.id}`,onClick:$=>L(M.id)},P(x(n)(M.labelKey)),11,Yne)),64))],8,Gne),p("div",Xne,[jt(p("section",Qne,[p("section",Zne,[p("h3",Jne,P(x(n)("settings.appearance")),1),p("div",eoe,[p("span",toe,P(x(n)("theme.label")),1),p("div",{class:"seg",role:"group","aria-label":x(n)("theme.label")},[p("button",{type:"button",class:Pe(["opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:v[1]||(v[1]=M=>s("setTheme","modern"))},P(x(n)("theme.modern")),11,ooe),p("button",{type:"button",class:Pe(["opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:v[2]||(v[2]=M=>s("setTheme","kimi"))},P(x(n)("theme.kimi")),11,soe)],8,noe)]),p("div",ioe,[p("span",roe,P(x(n)("theme.colorSchemeLabel")),1),p("div",{class:"seg",role:"group","aria-label":x(n)("theme.colorSchemeLabel")},[p("button",{type:"button",class:Pe(["opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:v[3]||(v[3]=M=>s("setColorScheme","light"))},P(x(n)("theme.light")),11,aoe),p("button",{type:"button",class:Pe(["opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:v[4]||(v[4]=M=>s("setColorScheme","dark"))},P(x(n)("theme.dark")),11,coe),p("button",{type:"button",class:Pe(["opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:v[5]||(v[5]=M=>s("setColorScheme","system"))},P(x(n)("theme.system")),11,uoe)],8,loe)]),p("div",doe,[p("span",foe,P(x(n)("settings.uiFontSize")),1),p("label",hoe,[p("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":x(n)("settings.uiFontSize"),onInput:v[6]||(v[6]=M=>s("setUiFontSize",Number(M.target.value)))},null,40,poe),v[20]||(v[20]=p("span",{class:"num-unit"},"px",-1))])]),p("div",moe,[p("span",goe,P(x(n)("sidebar.language")),1),vt(i3)])]),p("section",voe,[p("h3",yoe,P(x(n)("settings.notifications")),1),p("div",koe,[p("span",boe,[ft(P(x(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(C(),E("span",woe,P(x(n)("settings.notifyDenied")),1)):ie("",!0)]),p("button",{type:"button",class:Pe(["switch",{on:e.notify}]),role:"switch","aria-checked":e.notify,disabled:e.notifyPermission==="denied",onClick:v[7]||(v[7]=M=>s("setNotify",!e.notify))},[...v[21]||(v[21]=[p("span",{class:"knob"},null,-1)])],10,_oe)]),p("div",Coe,[p("span",Soe,[ft(P(x(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(C(),E("span",xoe,P(x(n)("settings.notifyDenied")),1)):ie("",!0)]),p("button",{type:"button",class:Pe(["switch",{on:e.notifyQuestion}]),role:"switch","aria-checked":e.notifyQuestion,disabled:e.notifyPermission==="denied",onClick:v[8]||(v[8]=M=>s("setNotifyQuestion",!e.notifyQuestion))},[...v[22]||(v[22]=[p("span",{class:"knob"},null,-1)])],10,Toe)]),p("div",Aoe,[p("span",Moe,P(x(n)("settings.soundOnComplete")),1),p("button",{type:"button",class:Pe(["switch",{on:e.sound}]),role:"switch","aria-checked":e.sound,onClick:v[9]||(v[9]=M=>s("setSound",!e.sound))},[...v[23]||(v[23]=[p("span",{class:"knob"},null,-1)])],10,Eoe)])]),p("section",Ioe,[p("h3",$oe,P(x(n)("settings.account")),1),p("div",Noe,[p("span",Loe,P(e.authReady?"managed:kimi-code":x(n)("sidebar.notSignedIn")),1),e.authReady&&e.accountModel?(C(),E("span",{key:0,class:"rvalue",title:e.accountModel},P(e.accountModel),9,Poe)):ie("",!0)]),p("div",Ooe,[p("button",{type:"button",class:"act",onClick:v[10]||(v[10]=M=>{s("openOnboarding"),s("close")})},P(x(n)("onboarding.reopen")),1),e.authReady?(C(),E("button",{key:0,type:"button",class:"act danger",onClick:v[11]||(v[11]=M=>s("logout"))},P(x(n)("sidebar.signOut")),1)):(C(),E("button",{key:1,type:"button",class:"act signin",onClick:v[12]||(v[12]=M=>s("login"))},P(x(n)("sidebar.signIn")),1))])]),p("section",Roe,[p("h3",Doe,P(x(n)("settings.build")),1),p("div",Boe,[p("span",Foe,P(x(n)("settings.serverVersion")),1),p("span",Hoe,P(e.serverVersion||"-"),1)])])],512),[[js,i.value==="general"]]),jt(p("section",Woe,[p("section",Uoe,[p("div",qoe,[p("h3",joe,P(x(n)("settings.agentDefaults")),1),e.configSaving?(C(),E("span",zoe,P(x(n)("settings.saving")),1)):ie("",!0)]),e.config?(C(),E(Oe,{key:0},[p("div",Voe,[p("span",Koe,[ft(P(x(n)("settings.defaultModel"))+" ",1),p("span",Goe,P(x(n)("settings.defaultModelHint")),1)]),g.value.length>0?(C(),E("select",{key:0,class:"select-field",value:e.config.defaultModel??"",disabled:e.configSaving,"aria-label":x(n)("settings.defaultModel"),onChange:b},[e.config.defaultModel?ie("",!0):(C(),E("option",Xoe,P(x(n)("settings.noDefaultModel")),1)),(C(!0),E(Oe,null,Xe(g.value,M=>(C(),E("optgroup",{key:M.provider,label:M.provider},[(C(!0),E(Oe,null,Xe(M.options,$=>(C(),E("option",{key:$.id,value:$.id},P($.label),9,Zoe))),128))],8,Qoe))),128))],40,Yoe)):(C(),E("span",Joe,P(e.config.defaultModel??x(n)("settings.noDefaultModel")),1))]),p("div",ese,[p("span",tse,[ft(P(x(n)("settings.defaultPermission"))+" ",1),p("span",nse,P(x(n)("settings.defaultPermissionHint")),1)]),p("div",{class:"seg",role:"group","aria-label":x(n)("settings.defaultPermission")},[(C(),E(Oe,null,Xe(a,M=>p("button",{key:M,type:"button",class:Pe(["opt",{on:m.value===M}]),"aria-pressed":m.value===M,disabled:e.configSaving,onClick:$=>y(M)},P(x(n)(`settings.permission.${M}`)),11,sse)),64))],8,ose)]),p("div",ise,[p("span",rse,[ft(P(x(n)("settings.defaultThinking"))+" ",1),p("span",lse,P(x(n)("settings.defaultThinkingHint")),1)]),p("button",{type:"button",class:Pe(["switch",{on:k(e.config.defaultThinking)}]),role:"switch","aria-checked":k(e.config.defaultThinking),disabled:e.configSaving,onClick:v[13]||(v[13]=M=>S("defaultThinking"))},[...v[24]||(v[24]=[p("span",{class:"knob"},null,-1)])],10,ase)]),p("div",cse,[p("span",use,[ft(P(x(n)("settings.defaultPlanMode"))+" ",1),p("span",dse,P(x(n)("settings.defaultPlanModeHint")),1)]),p("button",{type:"button",class:Pe(["switch",{on:k(e.config.defaultPlanMode)}]),role:"switch","aria-checked":k(e.config.defaultPlanMode),disabled:e.configSaving,onClick:v[14]||(v[14]=M=>S("defaultPlanMode"))},[...v[25]||(v[25]=[p("span",{class:"knob"},null,-1)])],10,fse)]),p("div",hse,[p("span",pse,[ft(P(x(n)("settings.mergeSkills"))+" ",1),p("span",mse,P(x(n)("settings.mergeSkillsHint")),1)]),p("button",{type:"button",class:Pe(["switch",{on:k(e.config.mergeAllAvailableSkills)}]),role:"switch","aria-checked":k(e.config.mergeAllAvailableSkills),disabled:e.configSaving,onClick:v[15]||(v[15]=M=>S("mergeAllAvailableSkills"))},[...v[26]||(v[26]=[p("span",{class:"knob"},null,-1)])],10,gse)]),e.config.telemetry!==void 0?(C(),E("div",vse,[p("span",yse,P(x(n)("settings.telemetry")),1),p("button",{type:"button",class:Pe(["switch",{on:k(e.config.telemetry)}]),role:"switch","aria-checked":k(e.config.telemetry),disabled:e.configSaving,onClick:v[16]||(v[16]=M=>S("telemetry"))},[...v[27]||(v[27]=[p("span",{class:"knob"},null,-1)])],10,kse)])):ie("",!0),h.value.length>0?(C(),E("div",bse,[(C(!0),E(Oe,null,Xe(h.value,({id:M,provider:$})=>(C(),E("div",{key:M,class:"provider-row"},[p("div",wse,[p("span",_se,P(M),1),p("span",Cse,P($.type),1)]),p("div",Sse,[p("span",{class:Pe(["provider-badge",$.hasApiKey?"ok":"warn"])},P($.hasApiKey?x(n)("settings.credentialReady"):x(n)("settings.credentialMissing")),3),$.defaultModel?(C(),E("span",xse,P($.defaultModel),1)):ie("",!0)])]))),128))])):ie("",!0)],64)):(C(),E("div",Tse,P(x(n)("settings.configUnavailable")),1))])],512),[[js,i.value==="agent"]]),jt(p("section",Ase,[p("section",Mse,[p("h3",Ese,P(x(n)("settings.advanced")),1),p("div",Ise,[p("span",$se,P(x(n)("sidebar.daemon")),1),p("span",Nse,P(x(l)),1)]),p("div",Lse,[p("span",Pse,[ft(P(x(n)("settings.exportLog"))+" ",1),x(Ys)()?ie("",!0):(C(),E("span",Ose,P(x(n)("settings.logHint")),1))]),p("button",{type:"button",class:"act",onClick:d},P(x(n)("settings.exportLogBtn")),1)])])],512),[[js,i.value==="advanced"]]),jt(p("section",Rse,[p("section",Dse,[p("h3",Bse,P(x(n)("settings.beta")),1),p("div",Fse,[p("span",Hse,[ft(P(x(n)("settings.betaToc"))+" ",1),p("span",Wse,P(x(n)("settings.betaTocHint")),1)]),p("button",{type:"button",class:Pe(["switch",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc,onClick:v[17]||(v[17]=M=>s("setBetaToc",!e.betaToc))},[...v[28]||(v[28]=[p("span",{class:"knob"},null,-1)])],10,Use)])])],512),[[js,i.value==="experimental"]])])])],8,qne)]))}}),jse=bt(qse,[["__scopeId","data-v-d022b51c"]]),zse=["aria-label"],Vse={class:"dh"},Kse={class:"dtitle"},Gse=["aria-label"],Yse={class:"crumbbar"},Xse=["disabled","title","aria-label"],Qse={class:"crumbs"},Zse={key:0,class:"crumb-sep"},Jse=["onClick"],eie={key:0,class:"filterbar"},tie=["placeholder"],nie={key:0,class:"search-spin","aria-hidden":"true"},oie={class:"folder-list"},sie={key:0,class:"fl-loading"},iie=["onClick"],rie={class:"folder-name search-rel"},lie={key:0,class:"git-tag"},aie={key:0,class:"git-branch"},cie={key:0,class:"fl-empty"},uie={key:1,class:"fl-loading"},die=["onClick"],fie={class:"folder-name"},hie={key:0,class:"git-tag"},pie={key:0,class:"git-branch"},mie={key:0,class:"fl-empty"},gie={class:"paste-label",for:"aw-path"},vie=["placeholder","onKeydown"],yie=["disabled","title"],kie={class:"actions"},bie=["disabled","title"],wie={class:"footer-hint"},_ie=600,Cie=6,$2=150,Sie=Qe({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=xt(),o=e,s=t,i=ne(!1),r=ne(!1),l=ne(""),a=ne(null),c=ne([]),u=ne(""),d=ne(!1),f=ne([]),g=F(()=>u.value.trim().length>0);let h=0,m=null;function _(I,R){const D=I.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(I){const R=l.value,D=I.trim();if(!R||D===""){f.value=[],d.value=!1;return}const W=++h;d.value=!0;const V=[],U=[{path:R,depth:0}];let J=0;for(;U.length>0&&J<_ie&&V.length<$2;){if(W!==h)return;const K=U.shift();J++;let G;try{G=await o.browseFs(K.path)}catch{continue}if(W!==h)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>=$2))break;K.depth+1<Cie&&U.push({path:X.path,depth:K.depth+1})}W===h&&(f.value=[...V])}W===h&&(d.value=!1)}ze(u,I=>{if(m&&clearTimeout(m),I.trim()===""){h++,f.value=[],d.value=!1;return}m=setTimeout(()=>void w(I),220)});const k=ne(!1),b=ne(""),y=F(()=>b.value.trim()),S=F(()=>{const I=l.value;if(!I)return[];const R=I.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){i.value=!0;try{const R=await o.browseFs(I);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 v(I){I.isDir&&N(I.path)}function M(){a.value&&N(a.value)}function $(){L.value&&s("add",l.value)}function O(){y.value.length!==0&&s("add",y.value)}rn(async()=>{i.value=!0;try{if(o.defaultPath&&(await N(o.defaultPath),!r.value))return;const I=await o.getFsHome();I.home?await N(I.home):r.value=!0}catch{r.value=!0}finally{i.value=!1}});function T(I){I.key==="Escape"&&s("close")}return rn(()=>document.addEventListener("keydown",T)),Yt(()=>{document.removeEventListener("keydown",T),m&&clearTimeout(m)}),(I,R)=>(C(),E("div",{class:"backdrop",onClick:R[6]||(R[6]=Ze(D=>s("close"),["self"]))},[p("div",{class:"dialog",role:"dialog","aria-label":x(n)("workspace.addTitle")},[p("div",Vse,[p("span",Kse,P(x(n)("workspace.addTitle")),1),p("button",{class:"close-btn","aria-label":x(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,Gse)]),r.value?ie("",!0):(C(),E(Oe,{key:0},[p("div",Yse,[p("button",{class:"up-btn",disabled:!a.value,title:x(n)("workspace.up"),"aria-label":x(n)("workspace.up"),onClick:M},[...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,Xse),p("div",Qse,[(C(!0),E(Oe,null,Xe(S.value,(D,W)=>(C(),E(Oe,{key:D.path},[W>1?(C(),E("span",Zse,"/")):ie("",!0),p("button",{class:Pe(["crumb",{last:W===S.value.length-1}]),onClick:V=>N(D.path)},P(D.label),11,Jse)],64))),128))])]),i.value?ie("",!0):(C(),E("div",eie,[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)),jt(p("input",{"onUpdate:modelValue":R[1]||(R[1]=D=>u.value=D),class:"filter-input",type:"text",placeholder:x(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:R[2]||(R[2]=Ze(()=>{},["stop"]))},null,40,tie),[[Wn,u.value]]),d.value?(C(),E("span",nie)):ie("",!0)])),p("div",oie,[i.value?(C(),E("div",sie,P(x(n)("workspace.browsing")),1)):g.value?(C(),E(Oe,{key:1},[(C(!0),E(Oe,null,Xe(f.value,D=>(C(),E("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",rie,P(D.rel),1),D.isGitRepo?(C(),E("span",lie,[ft(P(x(n)("workspace.gitTag")),1),D.branch?(C(),E("span",aie,P(D.branch),1)):ie("",!0)])):ie("",!0)],8,iie))),128)),!d.value&&f.value.length===0?(C(),E("div",cie,P(x(n)("workspace.noFilterMatch",{q:u.value.trim()})),1)):d.value&&f.value.length===0?(C(),E("div",uie,P(x(n)("workspace.searching")),1)):ie("",!0)],64)):(C(),E(Oe,{key:2},[(C(!0),E(Oe,null,Xe(c.value,D=>(C(),E("button",{key:D.path,class:"folder-row",onClick:W=>v(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",fie,P(D.name),1),D.isGitRepo?(C(),E("span",hie,[ft(P(x(n)("workspace.gitTag")),1),D.branch?(C(),E("span",pie,P(D.branch),1)):ie("",!0)])):ie("",!0)],8,die))),128)),c.value.length===0?(C(),E("div",mie,P(x(n)("workspace.noSubfolders")),1)):ie("",!0)],64))])],64)),p("div",{class:Pe(["paste-section",{"paste-only":r.value}])},[!r.value&&!k.value?(C(),E("button",{key:0,type:"button",class:"paste-toggle",onClick:R[3]||(R[3]=D=>k.value=!0)},P(x(n)("workspace.pasteToggle")),1)):(C(),E(Oe,{key:1},[p("label",gie,P(x(n)("workspace.pathLabel")),1),jt(p("input",{id:"aw-path","onUpdate:modelValue":R[4]||(R[4]=D=>b.value=D),class:"paste-input",type:"text",placeholder:x(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:Ns(Ze(O,["stop"]),["enter"])},null,40,vie),[[Wn,b.value]]),p("button",{class:"paste-add",disabled:y.value.length===0,title:x(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,yie)],64))],2),p("div",kie,[r.value?ie("",!0):(C(),E("button",{key:0,class:"act-btn primary",disabled:!L.value,title:l.value,onClick:$},P(x(n)("workspace.openThisFolder")),9,bie)),p("button",{class:"act-btn",onClick:R[5]||(R[5]=D=>s("close"))},P(x(n)("workspace.cancel")),1)]),p("div",wie,P(x(n)("workspace.browseHint")),1)],8,zse)]))}}),xie=bt(Sie,[["__scopeId","data-v-da51b020"]]),Tie=["aria-label"],Aie={class:"dh"},Mie={class:"dtitle"},Eie=["title"],Iie={class:"rows"},$ie={class:"row"},Nie={class:"row"},Lie={class:"row"},Pie={class:"row"},Oie={class:"row"},Rie={class:"row"},Die={class:"ctx-text"},Bie={key:0,class:"bar"},Fie={class:"row"},Hie=Qe({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=xt(),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(h){return n(h==="yolo"?"status.permissionYolo":h==="auto"?"status.permissionAuto":"status.permissionManual")}const a=F(()=>{const h=o.status.permission;return h==="yolo"?"var(--err)":h==="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),f=F(()=>d.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));function g(h){h.key==="Escape"&&s("close")}return rn(()=>document.addEventListener("keydown",g)),Yt(()=>document.removeEventListener("keydown",g)),(h,m)=>(C(),E("div",{class:"backdrop",onClick:m[1]||(m[1]=Ze(_=>s("close"),["self"]))},[p("div",{class:"dialog",role:"dialog","aria-label":x(n)("status.statusPanelTitle")},[p("div",Aie,[p("span",Mie,P(x(n)("status.statusPanelTitle")),1),p("button",{class:"close-btn",title:x(n)("status.statusPanelClose"),onClick:m[0]||(m[0]=_=>s("close"))},"✕",8,Eie)]),p("dl",Iie,[p("div",$ie,[p("dt",null,P(x(n)("status.statusModel")),1),p("dd",null,P(e.status.model),1)]),p("div",Nie,[p("dt",null,P(x(n)("status.statusThinking")),1),p("dd",null,P(e.thinking),1)]),p("div",Lie,[p("dt",null,P(x(n)("status.statusPermission")),1),p("dd",{style:Wt({color:a.value})},P(l(e.status.permission)),5)]),p("div",Pie,[p("dt",null,P(x(n)("status.statusPlanMode")),1),p("dd",{class:Pe({"plan-on":e.planMode})},P(c.value),3)]),p("div",Oie,[p("dt",null,P(x(n)("status.statusSwarmMode")),1),p("dd",{class:Pe({"swarm-on":e.swarmMode})},P(u.value),3)]),p("div",Rie,[p("dt",null,P(x(n)("status.statusContext")),1),p("dd",null,[p("span",Die,P(r.value),1),e.status.ctxMax>0?(C(),E("span",Bie,[p("i",{style:Wt({width:i.value+"%"})},null,4)])):ie("",!0)])]),p("div",Fie,[p("dt",null,P(x(n)("status.statusCost")),1),p("dd",null,P(f.value),1)])])],8,Tie)]))}}),Wie=bt(Hie,[["__scopeId","data-v-230d4b38"]]),Uie={key:0,class:"toasts",role:"status","aria-live":"polite"},qie=["onPointerenter","onPointerleave"],jie={class:"body"},zie={class:"title"},Vie={key:0,class:"msg"},Kie={key:1,class:"actions"},Gie=["onClick"],Yie=["onClick"],Xie={key:2,class:"details"},Qie=["aria-label","onClick"],Zie=Qe({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=xt();function i(v){return typeof v=="object"&&v!==null}function r(v){return i(v)?v.title:v}function l(v){return i(v)?v.message??"":""}function a(v){return i(v)?v.details:void 0}function c(v){return i(v)?v.severity==="error":v.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(v)}function u(v){return i(v)?`notice:${v.severity}:${v.title}:${v.message??""}:${JSON.stringify(v.details??[])}`:`text:${v}`}function d(v){if(!i(v))return v;const M=[v.title];v.message&&M.push(v.message);const $=v.details??[];if($.length>0){M.push("",`${s("warnings.diagnostics")}:`);for(const O of $)M.push(`${O.label}: ${O.value}`)}return M.join(`
|
|
265
|
-
`)}let f=1;const g=ne([]),h=new Map,m=new Map;function _(v){const M=c(v)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?M+5e3:M}function w(v,M){const $=h.get(v)??{handle:null,deadline:0,remaining:0};$.handle=setTimeout(()=>N(v),M),$.deadline=Date.now()+M,h.set(v,$)}function k(v){const M=h.get(v);M&&M.handle!==null&&clearTimeout(M.handle),h.delete(v)}function b(v){const M=h.get(v);!M||M.handle===null||(clearTimeout(M.handle),M.handle=null,M.remaining=Math.max(0,M.deadline-Date.now()))}function y(v){if(g.value.find(O=>O.id===v)?.detailsOpen)return;const $=h.get(v);!$||$.handle!==null||w(v,$.remaining)}function S(v){v.detailsOpen=!v.detailsOpen,v.detailsOpen?b(v.id):y(v.id)}async function L(v){if(!await wo(d(v.warning)))return;v.copied=!0;const $=m.get(v.id);$&&clearTimeout($),m.set(v.id,setTimeout(()=>{v.copied=!1,m.delete(v.id)},1400))}function N(v){k(v);const M=m.get(v);M&&clearTimeout(M),m.delete(v);const $=g.value.findIndex(O=>O.id===v);$!==-1&&(g.value=g.value.filter(O=>O.id!==v),o("dismiss",$))}return ze(()=>n.warnings,v=>{const M=[...g.value];g.value=v.map($=>{const O=u($),T=M.findIndex(D=>D.key===O),I=T===-1?void 0:M.splice(T,1)[0];if(I)return I.warning=$,I;const R={id:f++,key:O,warning:$,detailsOpen:!1,copied:!1};return w(R.id,_($)),R});for(const $ of M){k($.id);const O=m.get($.id);O&&clearTimeout(O),m.delete($.id)}},{immediate:!0,flush:"post"}),Yt(()=>{h.forEach(v=>{v.handle!==null&&clearTimeout(v.handle)}),h.clear(),m.forEach(v=>clearTimeout(v)),m.clear()}),(v,M)=>g.value.length?(C(),E("div",Uie,[(C(!0),E(Oe,null,Xe(g.value,$=>(C(),E("div",{key:$.id,class:Pe(["toast",{err:c($.warning)}]),onPointerenter:O=>b($.id),onPointerleave:O=>y($.id)},[M[1]||(M[1]=p("span",{class:"dot","aria-hidden":"true"},null,-1)),p("div",jie,[p("div",zie,P(r($.warning)),1),l($.warning)?(C(),E("div",Vie,P(l($.warning)),1)):ie("",!0),a($.warning)?.length?(C(),E("div",Kie,[p("button",{class:"link",type:"button",onClick:O=>S($)},P($.detailsOpen?x(s)("warnings.hideDetails"):x(s)("warnings.showDetails")),9,Gie),p("button",{class:"link",type:"button",onClick:O=>L($)},P($.copied?x(s)("warnings.copied"):x(s)("warnings.copyDetails")),9,Yie)])):ie("",!0),$.detailsOpen&&a($.warning)?.length?(C(),E("dl",Xie,[(C(!0),E(Oe,null,Xe(a($.warning),O=>(C(),E("div",{key:`${O.label}:${O.value}`,class:"detail-row"},[p("dt",null,P(O.label),1),p("dd",null,P(O.value),1)]))),128))])):ie("",!0)]),p("button",{class:"x",type:"button","aria-label":x(s)("warnings.dismiss"),onClick:O=>N($.id)},[...M[0]||(M[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,Qie)],42,qie))),128))])):ie("",!0)}}),Jie=bt(Zie,[["__scopeId","data-v-45432ab6"]]),ere={class:"topbar"},tre={class:"wsq"},nre=["aria-label"],ore={class:"tb-path"},sre={class:"ws"},ire={class:"se"},rre={class:"tb-sub"},lre=["aria-label"],are=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}=xt(),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(),E("div",ere,[p("span",tre,P(i.value),1),p("button",{type:"button",class:"tb-mid","aria-label":x(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[p("span",ore,[p("span",sre,P(r.value),1),e.sessionTitle?(C(),E(Oe,{key:0},[c[2]||(c[2]=p("span",{class:"sl"},"/",-1)),p("span",ire,P(e.sessionTitle),1)],64)):ie("",!0),c[3]||(c[3]=p("span",{class:"cv"},"⌄",-1))]),p("span",rre,[p("span",{class:Pe(["rd",{on:e.running}])},null,2),p("span",null,P(l.value),1),e.branch?(C(),E(Oe,{key:0},[ft(" · "+P(e.branch),1)],64)):ie("",!0),e.sessionCount>0?(C(),E(Oe,{key:1},[ft(" · "+P(x(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ie("",!0)])],8,nre),p("button",{type:"button",class:"tb-set","aria-label":x(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},[...c[4]||(c[4]=[_r('<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,lre)]))}}),cre=bt(are,[["__scopeId","data-v-135bd6bf"]]),ure={key:0,class:"sheet-root"},dre=["aria-label"],fre=["aria-label"],hre={key:0,class:"sheet-head"},pre={class:"sheet-title"},mre={class:"sheet-body"},gre=Qe({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=xt(),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(Fi,{name:"sheet"},{default:$n(()=>[e.modelValue?(C(),E("div",ure,[p("div",{class:"sheet-scrim",onClick:i}),p("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||x(n)("mobile.sheetLabel")},[p("button",{type:"button",class:"sheet-grab","aria-label":x(n)("mobile.closeSheet"),onClick:i},null,8,fre),e.title?(C(),E("div",hre,[p("span",pre,P(e.title),1)])):ie("",!0),p("div",mre,[ca(l.$slots,"default",{},void 0,!0)])],8,dre)])):ie("",!0)]),_:3}))}}),l3=bt(gre,[["__scopeId","data-v-aa55810a"]]),vre={class:"mlist"},yre={key:0,class:"mempty"},kre=["onClick"],bre={class:"mgh-folder",width:"15",height:"15",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},wre={class:"mgh-main"},_re={class:"mgh-name"},Cre=["title"],Sre={key:0,class:"att"},xre=["title","aria-label","onClick"],Tre=["title","aria-label","onClick"],Are=["onClick"],Mre=["onClick"],Ere={key:0,class:"mempty small"},Ire=["onClick"],$re={class:"m"},Nre={class:"s"},Lre={key:0,class:"att"},Pre=["title","onClick"],Ore=["onClick"],Rre=["onClick"],Dre=["disabled","onClick"],Bre=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}=xt(),o=e,s=t;function i(){s("update:modelValue",!1)}function r($){s("select",$),i()}function l($){s("createInWorkspace",$),i()}function a(){s("create"),i()}function c(){s("addWorkspace"),i()}const u=ne(new Set);function d($){return u.value.has($)}function f($){const O=new Set(u.value);O.has($)?O.delete($):O.add($),u.value=O,h.value=null,y.value=null}function g($){return o.attentionByWorkspace[$]??0}const h=ne(null),m=ne(null);let _;function w($){h.value=h.value===$?null:$,y.value=null,clearTimeout(_),m.value=null}function k($){h.value=null;const T=(typeof window<"u"?window.prompt(n("sidebar.rename"),$.title):null)?.trim();T&&s("rename",$.id,T)}function b($){if(m.value===$){clearTimeout(_),m.value=null,h.value=null,s("archive",$);return}clearTimeout(_),m.value=$,_=setTimeout(()=>{m.value=null},2500)}const y=ne(null),S=ne(null);let L;function N($){y.value=y.value===$?null:$,h.value=null,clearTimeout(L),S.value=null}function v($){wo($.root),y.value=null}function M($){if(S.value===$){clearTimeout(L),S.value=null,y.value=null,s("deleteWorkspace",$);return}clearTimeout(L),S.value=$,L=setTimeout(()=>{S.value=null},2500)}return Yt(()=>{clearTimeout(_),clearTimeout(L)}),($,O)=>(C(),Ve(l3,{"model-value":e.modelValue,"onUpdate:modelValue":O[2]||(O[2]=T=>s("update:modelValue",T))},{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)),ft(" "+P(x(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)),ft(" "+P(x(n)("sidebar.newWorkspace")),1)]),p("div",vre,[e.groups.length===0?(C(),E("div",yre,P(x(n)("workspace.noWorkspace")),1)):ie("",!0),(C(!0),E(Oe,null,Xe(e.groups,T=>(C(),E("div",{key:T.workspace.id,class:"mgroup"},[p("div",{class:Pe(["mgh",{on:T.workspace.id===e.activeWorkspaceId}]),onClick:I=>f(T.workspace.id)},[(C(),E("svg",bre,[d(T.workspace.id)?(C(),E(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(),E(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",wre,[p("span",_re,P(T.workspace.name),1),p("span",{class:"mgh-path",title:T.workspace.root},P(T.workspace.branch||T.workspace.shortPath),9,Cre)]),d(T.workspace.id)&&g(T.workspace.id)>0?(C(),E("span",Sre,P(g(T.workspace.id)),1)):ie("",!0),p("button",{type:"button",class:"mgh-more",title:x(n)("sidebar.options"),"aria-label":x(n)("sidebar.options"),onClick:Ze(I=>N(T.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,xre),p("button",{type:"button",class:"mgh-add",title:x(n)("workspace.newInGroup"),"aria-label":x(n)("workspace.newInGroup"),onClick:Ze(I=>l(T.workspace.id),["stop"])},"+",8,Tre),y.value===T.workspace.id?(C(),E("div",{key:1,class:"kmenu wsmenu",onClick:O[0]||(O[0]=Ze(()=>{},["stop"]))},[p("button",{class:"kitem",onClick:Ze(I=>v(T.workspace),["stop"])},P(x(n)("sidebar.copyPath")),9,Are),p("button",{class:"kitem archive",onClick:Ze(I=>M(T.workspace.id),["stop"])},P(S.value===T.workspace.id?x(n)("sidebar.confirm"):x(n)("sidebar.delete")),9,Mre)])):ie("",!0)],10,kre),jt(p("div",null,[T.sessions.length===0?(C(),E("div",Ere,P(x(n)("sidebar.noSessions")),1)):ie("",!0),(C(!0),E(Oe,null,Xe(T.sessions,I=>(C(),E("div",{key:I.id,class:Pe(["srow",{cur:I.id===e.activeId}]),onClick:R=>r(I.id)},[p("div",$re,[p("div",{class:Pe(["t",{run:I.busy,aborted:I.status==="aborted"}])},P(I.title),3),p("div",Nre,P(I.time),1)]),(e.attentionBySession[I.id]??0)>0?(C(),E("span",Lre,P(e.attentionBySession[I.id]),1)):ie("",!0),p("button",{type:"button",class:"kb",title:x(n)("sidebar.options"),onClick:Ze(R=>w(I.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,Pre),h.value===I.id?(C(),E("div",{key:1,class:"kmenu",onClick:O[1]||(O[1]=Ze(()=>{},["stop"]))},[p("button",{class:"kitem",onClick:Ze(R=>k(I),["stop"])},P(x(n)("sidebar.rename")),9,Ore),p("button",{class:"kitem archive",onClick:Ze(R=>b(I.id),["stop"])},P(m.value===I.id?x(n)("sidebar.archiveConfirm"):x(n)("sidebar.archive")),9,Rre)])):ie("",!0)],10,Ire))),128)),T.hasMore||T.loadingMore?(C(),E("button",{key:1,type:"button",class:"mshow-more",disabled:T.loadingMore,onClick:Ze(I=>s("loadMore",T.workspace.id),["stop"])},P(T.loadingMore?x(n)("sidebar.loadingMore"):x(n)("sidebar.showMore",{count:Math.max(0,T.workspace.sessionCount-T.sessions.length)})),9,Dre)):ie("",!0)],512),[[js,!d(T.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),Fre=bt(Bre,[["__scopeId","data-v-d8b693db"]]),Hre={class:"srow-main"},Wre={class:"srow-label"},Ure={class:"srow-sub"},qre={class:"srow-main"},jre={class:"srow-label"},zre={class:"srow-val"},Vre={class:"srow-main"},Kre={class:"srow-label"},Gre={class:"srow-sub"},Yre=["aria-checked"],Xre={class:"srow-main"},Qre={class:"srow-label"},Zre={class:"srow-sub"},Jre=["aria-checked"],ele={class:"srow-main"},tle={class:"srow-label"},nle={class:"srow read-only"},ole={class:"srow-main"},sle={class:"srow-label"},ile={class:"srow-sub"},rle=["aria-label"],lle={class:"srow read-only pref"},ale={class:"srow-main"},cle={class:"srow-label"},ule=["aria-label"],dle=["aria-pressed"],fle=["aria-pressed"],hle={class:"srow read-only pref"},ple={class:"srow-main"},mle={class:"srow-label"},gle=["aria-label"],vle=["aria-pressed"],yle=["aria-pressed"],kle=["aria-pressed"],ble={class:"srow read-only pref"},wle={class:"srow-main"},_le={class:"srow-label"},Cle={class:"srow read-only pref"},Sle={class:"srow-main"},xle={class:"srow-label"},Tle={class:"num-field"},Ale=["value","aria-label"],Mle={class:"srow-main"},Ele={class:"srow-label"},Ile={class:"srow-sub"},$le=["aria-checked"],Nle={class:"srow-main"},Lle={class:"srow-label"},Ple={class:"srow-main"},Ole={class:"srow-label"},Rle={key:2,class:"srow read-only"},Dle={class:"srow-main"},Ble={class:"srow-label"},Fle={class:"srow-val dim"},Hle=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}=xt(),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,y=n(b==="yolo"?"mobile.permYoloSub":b==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${b} · ${y}`}),d=b=>`${Math.round(b/1e3)}k`,f=F(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(o.status.ctxUsed/o.status.ctxMax*100))):0),g=F(()=>o.status.ctxMax>0?`${d(o.status.ctxUsed)}/${d(o.status.ctxMax)}`:n("status.statusNone"));function h(){s("setThinking",r.value==="off"?"high":"off")}function m(){const b=i.indexOf(o.status.permission),y=i[(b+1)%i.length];s("setPermission",y)}function _(){s("pickModel"),s("update:modelValue",!1)}function w(){s("login"),s("update:modelValue",!1)}function k(){s("logout"),s("update:modelValue",!1)}return(b,y)=>(C(),Ve(l3,{"model-value":e.modelValue,title:x(n)("mobile.settingsTitle"),"onUpdate:modelValue":y[9]||(y[9]=S=>s("update:modelValue",S))},{default:$n(()=>[p("button",{type:"button",class:"srow",onClick:_},[p("span",Hre,[p("span",Wre,P(x(n)("status.statusModel")),1),p("span",Ure,P(e.status.model),1)]),y[10]||(y[10]=p("span",{class:"chev"},"›",-1))]),p("button",{type:"button",class:"srow",onClick:h},[p("span",qre,[p("span",jre,P(x(n)("status.statusThinking")),1)]),p("span",zre,P(r.value==="off"?x(n)("status.planOff"):x(n)("status.planOn")),1),y[11]||(y[11]=p("span",{class:"chev"},"›",-1))]),p("button",{type:"button",class:"srow",onClick:y[0]||(y[0]=S=>s("togglePlan"))},[p("span",Vre,[p("span",Kre,P(x(n)("status.statusPlanMode")),1),p("span",Gre,P(x(n)("mobile.planModeSub")),1)]),p("span",{class:Pe(["toggle",{on:l.value}]),role:"switch","aria-checked":l.value},null,10,Yre)]),p("button",{type:"button",class:"srow",onClick:y[1]||(y[1]=S=>s("toggleSwarm"))},[p("span",Xre,[p("span",Qre,P(x(n)("status.statusSwarmMode")),1),p("span",Zre,P(x(n)("mobile.swarmModeSub")),1)]),p("span",{class:Pe(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,Jre)]),p("button",{type:"button",class:"srow",onClick:m},[p("span",ele,[p("span",tle,P(x(n)("status.statusPermission")),1),p("span",{class:"srow-sub",style:Wt({color:c.value})},P(u.value),5)]),y[12]||(y[12]=p("span",{class:"chev"},"›",-1))]),p("div",nle,[p("span",ole,[p("span",sle,P(x(n)("status.statusContext")),1),p("span",ile,P(g.value),1)]),p("span",{class:"ctx-meter","aria-label":g.value},[p("i",{style:Wt({width:f.value+"%"})},null,4)],8,rle)]),p("div",lle,[p("span",ale,[p("span",cle,P(x(n)("theme.label")),1)]),p("div",{class:"seg",role:"group","aria-label":x(n)("theme.label")},[p("button",{type:"button",class:Pe(["seg-opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:y[2]||(y[2]=S=>s("setTheme","modern"))},P(x(n)("theme.modern")),11,dle),p("button",{type:"button",class:Pe(["seg-opt",{on:e.theme==="kimi"}]),"aria-pressed":e.theme==="kimi",onClick:y[3]||(y[3]=S=>s("setTheme","kimi"))},P(x(n)("theme.kimi")),11,fle)],8,ule)]),p("div",hle,[p("span",ple,[p("span",mle,P(x(n)("theme.colorSchemeLabel")),1)]),p("div",{class:"seg",role:"group","aria-label":x(n)("theme.colorSchemeLabel")},[p("button",{type:"button",class:Pe(["seg-opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:y[4]||(y[4]=S=>s("setColorScheme","light"))},P(x(n)("theme.light")),11,vle),p("button",{type:"button",class:Pe(["seg-opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:y[5]||(y[5]=S=>s("setColorScheme","dark"))},P(x(n)("theme.dark")),11,yle),p("button",{type:"button",class:Pe(["seg-opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:y[6]||(y[6]=S=>s("setColorScheme","system"))},P(x(n)("theme.system")),11,kle)],8,gle)]),p("div",ble,[p("span",wle,[p("span",_le,P(x(n)("sidebar.language")),1)]),vt(i3)]),p("div",Cle,[p("span",Sle,[p("span",xle,P(x(n)("settings.uiFontSize")),1)]),p("label",Tle,[p("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":x(n)("settings.uiFontSize"),onInput:y[7]||(y[7]=S=>s("setUiFontSize",Number(S.target.value)))},null,40,Ale),y[13]||(y[13]=p("span",{class:"num-unit"},"px",-1))])]),p("button",{type:"button",class:"srow",onClick:y[8]||(y[8]=S=>s("setBetaToc",!e.betaToc))},[p("span",Mle,[p("span",Ele,P(x(n)("settings.betaToc")),1),p("span",Ile,P(x(n)("settings.betaTocHint")),1)]),p("span",{class:Pe(["toggle",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc},null,10,$le)]),e.authReady?(C(),E("button",{key:0,type:"button",class:"srow acct out",onClick:k},[p("span",Nle,[p("span",Lle,P(x(n)("sidebar.signOut")),1)])])):(C(),E("button",{key:1,type:"button",class:"srow acct in",onClick:w},[p("span",Ple,[p("span",Ole,P(x(n)("sidebar.signIn")),1)])])),e.serverVersion?(C(),E("div",Rle,[p("span",Dle,[p("span",Ble,P(x(n)("settings.serverVersion")),1)]),p("span",Fle,P(e.serverVersion),1)])):ie("",!0)]),_:1},8,["model-value","title"]))}}),Wle=bt(Hle,[["__scopeId","data-v-33721a82"]]),Ule={class:"ob-backdrop"},qle=["aria-label"],jle=["aria-label"],zle={class:"ob-brand"},Vle={class:"ob-title"},Kle={class:"ob-sub"},Gle={class:"ob-sec"},Yle={class:"ob-label"},Xle={class:"ob-seg",role:"group"},Qle=["aria-pressed","onClick"],Zle={class:"ob-sec"},Jle={class:"ob-label"},eae={class:"ob-themes"},tae=["aria-pressed"],nae={class:"ob-theme-name"},oae={class:"ob-theme-desc"},sae=["aria-pressed"],iae={class:"ob-theme-name"},rae={class:"ob-theme-desc"},lae=Qe({__name:"Onboarding",props:{theme:{}},emits:["setTheme","complete","skip"],setup(e,{emit:t}){const n=e,o=t,{t:s,locale:i}=xt();function r(c){i.value!==c&&mx(c)}const l=ne(n.theme);function a(){l.value!==n.theme&&o("setTheme",l.value),o("complete")}return(c,u)=>(C(),E("div",Ule,[p("div",{class:"ob-card",role:"dialog","aria-modal":"true","aria-label":x(s)("onboarding.title")},[p("button",{type:"button",class:"ob-close","aria-label":x(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,jle),p("div",zle,[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",Vle,P(x(s)("onboarding.title")),1),p("div",Kle,P(x(s)("onboarding.subtitle")),1)])]),p("section",Gle,[p("div",Yle,P(x(s)("onboarding.languageLabel")),1),p("div",Xle,[(C(!0),E(Oe,null,Xe(x(px),d=>(C(),E("button",{key:d.code,type:"button",class:Pe(["ob-seg-btn",{on:x(i)===d.code}]),"aria-pressed":x(i)===d.code,onClick:f=>r(d.code)},P(d.label),11,Qle))),128))])]),p("section",Zle,[p("div",Jle,P(x(s)("onboarding.themeLabel")),1),p("div",eae,[p("button",{type:"button",class:Pe(["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",nae,P(x(s)("theme.modern")),1),p("span",oae,P(x(s)("onboarding.modernDesc")),1)],10,tae),p("button",{type:"button",class:Pe(["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",iae,P(x(s)("theme.kimi")),1),p("span",rae,P(x(s)("onboarding.kimiDesc")),1)],10,sae)])]),p("button",{type:"button",class:"ob-start",onClick:a},P(x(s)("onboarding.start")),1)],8,qle)]))}}),aae=bt(lae,[["__scopeId","data-v-0527a631"]]),cae=["aria-label"],uae={class:"gload-box"},dae={class:"gload-text"},fae=Qe({__name:"GlobalLoading",setup(e){const{t}=xt();return(n,o)=>(C(),E("div",{class:"gload",role:"status","aria-label":x(t)("app.connecting")},[p("div",uae,[o[0]||(o[0]=_r('<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",dae,P(x(t)("app.connecting")),1)])],8,cae))}}),hae=bt(fae,[["__scopeId","data-v-d8748888"]]),pae={class:"kap-root"},mae={class:"kap-head"},gae={class:"kap-count"},vae={class:"kap-head-actions"},yae={class:"kap-filters"},kae=["value"],bae={class:"kap-check"},wae={class:"kap-check"},_ae={class:"kap-view-toggle",role:"group"},Cae={key:0,class:"kap-empty"},Sae=["onClick"],xae={class:"kap-ts"},Tae={class:"kap-label"},Aae={key:0,class:"kap-detail"},Mae={class:"kap-detail-actions"},Eae=["onClick"],Iae={key:1,class:"kap-agg"},$ae={class:"mono"},Nae={class:"mono"},Lae={class:"num"},Pae={class:"num"},Oae={key:0},Rae={class:"mono"},Dae={class:"num"},Bae={class:"num"},Fae={key:0},Hae=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(()=>(d0.value,[...One()])),c=F(()=>{const M=new Set;for(const $ of a.value)$.sessionId&&M.add($.sessionId);return[...M].sort()});function u(M){return M.kind==="rest:error"||M.code!==void 0&&M.code!==0||M.eventType==="error"||M.eventType==="parse-error"}const d=F(()=>{const M=s.value.trim().toLowerCase();return a.value.filter($=>!(o.value!=="all"&&$.source!==o.value||i.value&&$.sessionId!==i.value||r.value&&!u($)||M&&!`${$.label} ${$.kind} ${$.eventType??""} ${$.sessionId??""} ${$.requestId??""}`.toLowerCase().includes(M)))}),f=F(()=>{const M=new Map;for(const $ of d.value){if($.kind!=="ws:in"&&$.kind!=="ws:out")continue;const O=$.kind==="ws:in"?"←":"→",T=`${O} ${$.eventType??"?"} @ ${$.sessionId??"-"}`,I=M.get(T)??{key:T,sessionId:$.sessionId??"-",eventType:$.eventType??"?",dir:O,count:0};I.count++,$.seq!==void 0&&(I.lastSeq=$.seq),M.set(T,I)}return[...M.values()].sort(($,O)=>O.count-$.count)}),g=F(()=>{const M=new Map;for(const $ of d.value){if($.source!=="rest"||$.kind==="rest:request")continue;const O=`${$.method??"?"} ${$.path??"?"}`,T=M.get(O)??{count:0,errors:0,totalMs:0,timed:0};T.count++,u($)&&T.errors++,$.durationMs!==void 0&&(T.totalMs+=$.durationMs,T.timed++),M.set(O,T)}return[...M.entries()].map(([$,O])=>({key:$,count:O.count,errors:O.errors,avgMs:O.timed>0?Math.round(O.totalMs/O.timed):0})).sort(($,O)=>O.count-$.count)}),h=ne(null),m=ne(!0),_=ne(null),w=ne(null);ze(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await ht();const M=_.value;M&&(M.scrollTop=M.scrollHeight)});function k(M){h.value=h.value===M?null:M}function b(M){const $=new Date(M),O=(T,I=2)=>String(T).padStart(I,"0");return`${O($.getHours())}:${O($.getMinutes())}:${O($.getSeconds())}.${O($.getMilliseconds(),3)}`}function y(M){return JSON.stringify(M,null,2)}async function S(M){await wo(y(M))&&(w.value=M.id,setTimeout(()=>{w.value===M.id&&(w.value=null)},1500))}function L(){r3(d.value)}function N(M){return u(M)||M.source==="client"?"b-err":M.source==="rest"?"b-rest":M.kind==="ws:lifecycle"?"b-life":M.kind==="ws:out"?"b-out":"b-in"}function v(M){return M.source==="rest"?"REST":M.source==="client"?"APP":"WS"}return(M,$)=>(C(),E("section",pae,[p("header",mae,[$[11]||($[11]=p("strong",null,"KAP debug",-1)),p("span",gae,P(d.value.length)+"/"+P(a.value.length),1),p("div",vae,[p("button",{type:"button",class:Pe({on:x(vc)}),onClick:$[0]||($[0]=O=>vc.value=!x(vc))},P(x(vc)?"resume":"pause"),3),p("button",{type:"button",onClick:$[1]||($[1]=O=>x(Rne)())},"clear"),p("button",{type:"button",onClick:$[2]||($[2]=O=>L())},"export jsonl"),p("button",{type:"button",title:"Close window",onClick:$[3]||($[3]=O=>n("close"))},"✕")])]),p("div",yae,[jt(p("select",{"onUpdate:modelValue":$[4]||($[4]=O=>o.value=O),"aria-label":"Source filter"},[...$[12]||($[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),[[yf,o.value]]),jt(p("select",{"onUpdate:modelValue":$[5]||($[5]=O=>i.value=O),"aria-label":"Session filter"},[$[13]||($[13]=p("option",{value:""},"all sessions",-1)),(C(!0),E(Oe,null,Xe(c.value,O=>(C(),E("option",{key:O,value:O},P(O),9,kae))),128))],512),[[yf,i.value]]),jt(p("input",{"onUpdate:modelValue":$[6]||($[6]=O=>s.value=O),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[Wn,s.value]]),p("label",bae,[jt(p("input",{"onUpdate:modelValue":$[7]||($[7]=O=>r.value=O),type:"checkbox"},null,512),[[vf,r.value]]),$[14]||($[14]=ft(" errors",-1))]),p("label",wae,[jt(p("input",{"onUpdate:modelValue":$[8]||($[8]=O=>m.value=O),type:"checkbox"},null,512),[[vf,m.value]]),$[15]||($[15]=ft(" follow",-1))]),p("div",_ae,[p("button",{type:"button",class:Pe({on:l.value==="timeline"}),onClick:$[9]||($[9]=O=>l.value="timeline")},"timeline",2),p("button",{type:"button",class:Pe({on:l.value==="aggregate"}),onClick:$[10]||($[10]=O=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(C(),E("div",{key:0,ref_key:"listRef",ref:_,class:"kap-list"},[d.value.length===0?(C(),E("div",Cae," No trace entries yet. REST calls and WS frames will appear here. ")):ie("",!0),(C(!0),E(Oe,null,Xe(d.value,O=>(C(),E("div",{key:O.id,class:"kap-row-wrap"},[p("button",{type:"button",class:Pe(["kap-row",{expanded:h.value===O.id}]),onClick:T=>k(O.id)},[p("span",xae,P(b(O.ts)),1),p("span",{class:Pe(["kap-badge",N(O)])},P(v(O)),3),p("span",Tae,P(O.label),1)],10,Sae),h.value===O.id?(C(),E("div",Aae,[p("div",Mae,[p("button",{type:"button",onClick:T=>S(O)},P(w.value===O.id?"copied ✓":"copy json"),9,Eae)]),p("pre",null,P(y(O)),1)])):ie("",!0)]))),128))],512)):(C(),E("div",Iae,[$[20]||($[20]=p("h4",null,"WS frames by session / type",-1)),p("table",null,[$[17]||($[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),E(Oe,null,Xe(f.value,O=>(C(),E("tr",{key:O.key},[p("td",null,P(O.dir),1),p("td",$ae,P(O.eventType),1),p("td",Nae,P(O.sessionId),1),p("td",Lae,P(O.count),1),p("td",Pae,P(O.lastSeq??"—"),1)]))),128)),f.value.length===0?(C(),E("tr",Oae,[...$[16]||($[16]=[p("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ie("",!0)])]),$[21]||($[21]=p("h4",null,"REST by endpoint",-1)),p("table",null,[$[19]||($[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),E(Oe,null,Xe(g.value,O=>(C(),E("tr",{key:O.key},[p("td",Rae,P(O.key),1),p("td",Dae,P(O.count),1),p("td",{class:Pe(["num",{err:O.errors>0}])},P(O.errors),3),p("td",Bae,P(O.avgMs),1)]))),128)),g.value.length===0?(C(),E("tr",Fae,[...$[18]||($[18]=[p("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ie("",!0)])])]))]))}}),Wae=bt(Hae,[["__scopeId","data-v-79eb55ae"]]),Uae=["title"],qae=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,f=u.documentElement;for(const g of i){const h=d.getAttribute(g);h!==null?f.setAttribute(g,h):f.removeAttribute(g)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const h of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(h.cloneNode(!0));r(d),d.body.style.margin="0";const g=d.createElement("div");return g.style.height="100vh",d.body.appendChild(g),g}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=kf(Wae,{onClose:()=>u.close()});f.mount(d),o=f,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return rn(()=>{c()}),Yo(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(C(),E("button",{class:"kap-fab",type:"button",title:t.value?"Focus KAP debug window":"Open KAP debug window",onClick:c}," KAP ",8,Uae))}}),jae=bt(qae,[["__scopeId","data-v-0a50ee88"]]);function a3(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 R1(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 zae(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 ii(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:R1(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:a3(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 Zf(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 N2(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 f0(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:N2(e.source)};case"video":return{type:"video",source:N2(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 D1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(f0),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Vae(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 Kae(e){return{content:e.content.map(Vae),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function Gae(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function c3(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function Yae(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function Xae(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(Yae),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function u3(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(Xae),createdAt:e.created_at}}function Qae(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 Zae(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=Qae(o);return{answers:t,method:e.method,note:e.note}}function B1(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index}}function L2(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 or(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Vl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function xs(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Jae(e){if(!e||typeof e!="object")return null;const t=e,n=or(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:or(t,"goalId")??or(t,"goal_id")??"goal",objective:or(t,"objective")??"",completionCriterion:or(t,"completionCriterion")??or(t,"completion_criterion"),status:n,turnsUsed:Vl(t,"turnsUsed")??Vl(t,"turns_used")??0,tokensUsed:Vl(t,"tokensUsed")??Vl(t,"tokens_used")??0,wallClockMs:Vl(t,"wallClockMs")??Vl(t,"wall_clock_ms")??0,terminalReason:or(t,"terminalReason")??or(t,"terminal_reason"),budget:{tokenBudget:xs(s,"tokenBudget")??xs(s,"token_budget"),remainingTokens:xs(s,"remainingTokens")??xs(s,"remaining_tokens"),turnBudget:xs(s,"turnBudget")??xs(s,"turn_budget"),remainingTurns:xs(s,"remainingTurns")??xs(s,"remaining_turns"),wallClockBudgetMs:xs(s,"wallClockBudgetMs")??xs(s,"wall_clock_budget_ms"),remainingWallClockMs:xs(s,"remainingWallClockMs")??xs(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function ece(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:ii(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:ii(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:Zf(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Zf(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:R1(t.payload.status),previousStatus:R1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:a3(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=Jae(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:D1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(f0),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:c3(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:u3(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:B1(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:F1(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 tce(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function P2(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 F1(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 nce(e){return e.session_id}function oce(e){return e.seq}const sce="main",ice=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 cr(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 rce(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 O2(){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 is(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Qr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Ts(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function lce(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=is(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=is(t,"goalId")??is(t,"goal_id")??"goal",r=is(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:is(t,"completionCriterion")??is(t,"completion_criterion"),status:s,turnsUsed:Qr(t,"turnsUsed")??Qr(t,"turns_used")??0,tokensUsed:Qr(t,"tokensUsed")??Qr(t,"tokens_used")??0,wallClockMs:Qr(t,"wallClockMs")??Qr(t,"wall_clock_ms")??0,terminalReason:is(t,"terminalReason")??is(t,"terminal_reason"),budget:{tokenBudget:Ts(o,"tokenBudget")??Ts(o,"token_budget"),remainingTokens:Ts(o,"remainingTokens")??Ts(o,"remaining_tokens"),turnBudget:Ts(o,"turnBudget")??Ts(o,"turn_budget"),remainingTurns:Ts(o,"remainingTurns")??Ts(o,"remaining_turns"),wallClockBudgetMs:Ts(o,"wallClockBudgetMs")??Ts(o,"wall_clock_budget_ms"),remainingWallClockMs:Ts(o,"remainingWallClockMs")??Ts(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function yc(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 ace(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=is(t,"name")??is(t,"toolName")??"tool",o=Sf(cce(n)),s=uce(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=is(n,"text");if(s)return fg(s);const i=is(n,"message");if(i)return fg(i)}const o=is(t,"message");if(o)return fg(o)}return null}function cce(e){return e.replace(/_\d+$/,"")}const R2=2e3;function fg(e){return e.length>R2?`${e.slice(0,R2)}…`:e}function uce(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Kg(e,n)}function dce(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];const r=ace(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=yc(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 Ed(e){return{...e,content:e.content.map(t=>({...t}))}}function D2(e,t,n){const o={id:cr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function fce(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 hce(e){return Array.isArray(e)?e.map(t=>f0(t)):[]}function B2(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 pce(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 mce(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 F2(e,t){e.messages.find(n=>n.id===t)}function gce(e,t,n,o,s,i){const r={id:cr("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 hg(e,t){return e.messages.find(n=>n.id===t)}function H2(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 vce(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=O2(),e.set(u,d)),d}function o(u){e.set(u,O2())}function s(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){o(u);const f=n(u),g=d.promptId??cr("pr_");f.currentPromptId=g,f.turnPromptId.set(d.turnId,g);const h=D2(f,u,g);d.thinkingText.length>0&&h.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&h.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const _=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;h.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:_}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=h.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:g},{type:"messageCreated",message:Ed(h)}]}function l(u,d,f,g){try{return c(u,d,f,g)}catch(h){return console.error("[agentProjector] Error projecting event:",u,h instanceof Error?h.message:h),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,g){const h=n(f),m=d,_=[],w=m?.agentId;if(typeof w=="string"&&w!==sce){const k=t.has(w);if(k&&(u==="thinking.delta"||u==="assistant.delta")){const b=m?.delta??"";return b?[{type:"agentDelta",sessionId:f,agentId:w,delta:{[u==="thinking.delta"?"thinking":"text"]:b}}]:[]}if(k&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:w,reason:m?.reason}];if(ice.has(u))return dce(h,f,w,u,m??{},t)}switch(u){case"session.meta.updated":{const k=m?.patch?.title??m?.title,b=m?.patch?.lastPrompt,y={};typeof k=="string"&&k.length>0&&(y.title=k),typeof b=="string"&&(y.lastPrompt=b),(y.title!==void 0||y.lastPrompt!==void 0)&&_.push({type:"sessionMetaUpdated",sessionId:f,...y});break}case"prompt.submitted":{const k=m?.promptId,b=m?.userMessageId;if(!k||!b)break;const y=hce(m?.content);if(y.length===0)break;h.currentPromptId=k;const S=fce(h,f,k,b,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());_.push({type:"messageCreated",message:Ed(S)});break}case"turn.started":{const k=m?.turnId,b=h.currentPromptId??cr("pr_");h.currentPromptId=b,k!==void 0&&h.turnPromptId.set(k,b),h.turnTextLen=0,h.turnThinkLen=0,_.push({type:"sessionStatusChanged",sessionId:f,status:"running",previousStatus:"idle",currentPromptId:b});break}case"turn.step.started":{const k=m?.turnId;let b=h.turnPromptId.get(k)??h.currentPromptId;b||(b=cr("pr_"),h.currentPromptId=b,k!==void 0&&h.turnPromptId.set(k,b));const y=D2(h,f,b);h.currentAssistantMsgId=y.id,_.push({type:"messageCreated",message:Ed(y)});break}case"thinking.delta":{const k=h.currentAssistantMsgId;if(!k)break;const b=m?.delta??"";if(!b)break;g?.offset===0&&h.turnThinkLen>0&&(h.turnThinkLen=0);const y=a(h.turnThinkLen,g?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const S=B2(h,k,"thinking",b);if(S<0)break;h.turnThinkLen+=b.length,_.push({type:"assistantDelta",sessionId:f,messageId:k,contentIndex:S,delta:{thinking:b}});break}case"assistant.delta":{const k=h.currentAssistantMsgId;if(!k)break;const b=m?.delta??"";if(!b)break;g?.offset===0&&h.turnTextLen>0&&(h.turnTextLen=0);const y=a(h.turnTextLen,g?.offset);if(y==="skip")break;if(y==="gap"){_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const S=B2(h,k,"text",b);if(S<0)break;h.turnTextLen+=b.length,_.push({type:"assistantDelta",sessionId:f,messageId:k,contentIndex:S,delta:{text:b}});break}case"tool.use":case"tool.call.started":{const k=h.currentAssistantMsgId,b=m?.turnId,y=h.turnPromptId.get(b)??h.currentPromptId;if(!k||!y)break;const S=m?.toolCallId,L=m?.name??m?.toolName??"",N=m?.args??m?.input??{};pce(h,k,S,L,N);const v=hg(h,k);v&&v.content.length-1,h.toolStartTimes.set(S,Date.now()),v&&_.push({type:"messageUpdated",sessionId:f,messageId:k,content:v.content.map(M=>({...M})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const k=m?.toolCallId,b=mce(m??{});k&&b&&_.push({type:"toolOutput",sessionId:f,toolCallId:k,outputChunk:b.outputChunk,stream:b.stream});break}case"tool.result":{const k=m?.turnId;let b=h.turnPromptId.get(k)??h.currentPromptId;b||(b=cr("pr_"),h.currentPromptId=b,k!==void 0&&h.turnPromptId.set(k,b));const y=m?.toolCallId,S=m?.output,L=m?.isError??!1;h.toolStartTimes.get(y)??Date.now(),h.toolStartTimes.delete(y);const N=gce(h,f,y,S,L,b);_.push({type:"messageCreated",message:Ed(N)}),h.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const k=h.currentAssistantMsgId,b=rce(m?.usage);if(h.totalInput+=b.input,h.totalOutput+=b.output,h.totalCacheRead+=b.cacheRead,h.totalCacheCreate+=b.cacheCreate,k){F2(h,k);const y=hg(h,k);y&&_.push({type:"messageUpdated",sessionId:f,messageId:k,content:y.content.map(S=>({...S})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(h.model=m.model),m?.contextTokens!==void 0&&(h.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(h.contextLimit=m.maxContextTokens),_.push({type:"sessionUsageUpdated",sessionId:f,usage:H2(h),model:h.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const k=h.currentAssistantMsgId,b=m?.reason??"completed",y=Qr(m??{},"durationMs");if(k){F2(h,k);const N=hg(h,k);N&&_.push({type:"messageUpdated",sessionId:f,messageId:k,content:N.content.map(v=>({...v})),status:b==="failed"||b==="filtered"?"error":"completed",durationMs:y})}h.turnCount++;const S=H2(h);_.push({type:"sessionUsageUpdated",sessionId:f,usage:S});const L=b==="cancelled"||b==="failed"||b==="filtered"?"aborted":"idle";_.push({type:"sessionStatusChanged",sessionId:f,status:L,previousStatus:"running"}),h.currentAssistantMsgId=void 0,h.currentPromptId=void 0,h.turnTextLen=0,h.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{h.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const b={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:cr("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0};h.subagentMeta.set(b.id,b),_.push({type:"taskCreated",sessionId:f,task:b});break}case"subagent.started":{const k=yc(h,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});k&&_.push({type:"taskCreated",sessionId:f,task:k});break}case"subagent.suspended":{const k=yc(h,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});k&&_.push({type:"taskCreated",sessionId:f,task:k});break}case"subagent.completed":{const k=typeof m?.resultSummary=="string"?m.resultSummary:void 0,b=yc(h,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:k});b&&_.push({type:"taskCreated",sessionId:f,task:b}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:k});break}case"subagent.failed":{const k=typeof m?.error=="string"?m.error:void 0,b=yc(h,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:k});b&&_.push({type:"taskCreated",sessionId:f,task:b}),_.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:k});break}case"error":{_.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{_.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"background.task.started":{const k=m?.info??{},b=typeof k.startedAt=="number"?new Date(k.startedAt).toISOString():void 0,y=typeof k.taskId=="string"?k.taskId:typeof k.taskId=="number"?String(k.taskId):cr("task_"),S=typeof k.description=="string"?k.description:typeof k.command=="string"?k.command:Sn.global.t("tasks.defaultDescription"),L=typeof k.command=="string"?k.command:void 0;_.push({type:"taskCreated",sessionId:f,task:{id:y,sessionId:f,kind:"bash",description:S,command:L,status:"running",createdAt:b??new Date().toISOString(),startedAt:b,outputPreview:L!==void 0?`$ ${L}`:void 0}});break}case"background.task.terminated":{const k=m?.info??{},b=k.status==="failed"||typeof k.exitCode=="number"&&k.exitCode!==0;_.push({type:"taskCompleted",sessionId:f,taskId:typeof k.taskId=="string"?k.taskId:typeof k.taskId=="number"?String(k.taskId):"",status:b?"failed":"completed"});break}case"compaction.completed":{const k=m?.result??{};_.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof k.tokensBefore=="number"?k.tokensBefore:void 0,tokensAfter:typeof k.tokensAfter=="number"?k.tokensAfter:void 0,summary:typeof k.summary=="string"?k.summary:void 0}),_.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{_.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{_.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const k=lce(m?.snapshot??null);_.push({type:"goalUpdated",sessionId:f,goal:k?.status==="complete"?null:k});break}}return _}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const yce=new Set(["server_hello","ack","ping","resync_required","error","pong"]),W2=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"]),kce=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"]),bce=new Set(["assistant.delta","thinking.delta"]);function wce(e,t){if(yce.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return bce.has(o)?_ce(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?kce.has(o)?{route:"protocol"}:W2.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:W2.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function _ce(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 H1 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 kc 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 Cu(e){return e instanceof H1||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function d3(e){return e instanceof kc||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const h0="kimi-web.server-credential",Cce="token";let au;const W1=new Set;function Sce(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Cce);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 xce(){try{return globalThis.sessionStorage?.getItem(h0)??void 0}catch{return}}function Tce(){const e=Sce();return e?(h3(e),!0):(au=xce(),au!==void 0)}function f3(){return au}function h3(e){au=e;try{globalThis.sessionStorage?.setItem(h0,e)}catch{}}function Ace(){au=void 0;try{globalThis.sessionStorage?.removeItem(h0)}catch{}}function Mce(e){return W1.add(e),()=>{W1.delete(e)}}function Ece(){Ace();for(const e of W1)try{e()}catch{}}const bc=3e4,p3="0123456789ABCDEFGHJKMNPQRSTVWXYZ",U2=500,Ice=40101;function q2(){try{return AbortSignal.timeout(bc)}catch{return}}function $ce(e,t){let n="",o=e;for(let s=0;s<t;s++)n=p3[o%32]+n,o=Math.floor(o/32);return n}function Nce(e){const t=new Uint8Array(e);if(globalThis.crypto?.getRandomValues)globalThis.crypto.getRandomValues(t);else for(let n=0;n<t.length;n++)t[n]=Math.floor(Math.random()*256);return Array.from(t,n=>p3[n%32]).join("")}function j2(){return`${$ce(Date.now(),10)}${Nce(16)}`}function Lce(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 z2(e){try{const t=await e.text();return t?t.length>U2?`${t.slice(0,U2)}...`:t:void 0}catch{return}}class Pce{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=Cf(this.origin,t),s=j2(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();M2({method:"POST",path:t,url:o,requestId:s,body:Lce(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:q2()})}catch(u){throw Md({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new kc({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:bc})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw Md({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new kc({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:bc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await z2(c)})}if(E2({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 H1({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=Cf(this.origin,n);if(s){const g=new URLSearchParams;for(const[m,_]of Object.entries(s))_!==void 0&&g.set(m,String(_));const h=g.toString();h&&(r=`${r}?${h}`)}const l=j2(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();M2({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:q2()})}catch(g){throw Md({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:g}),new kc({message:`Network error calling ${t} ${n}`,cause:g,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:bc})}let d;const f=u.clone();try{d=await u.json()}catch(g){throw Md({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:g}),new kc({message:`Failed to parse JSON response from ${t} ${n}`,cause:g,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:bc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await z2(f)})}if(E2({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 H1({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details});return d.data}addClientHeaders(t){const n=f3();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===Ice)&&Ece()}}const Oce="kimi-code.bearer.";class Rce{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=f3(),n=t!==void 0?[`${Oce}${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));Bne(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=Id(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(Id(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(Id(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=Id(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=wce(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)),Dne(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function Id(e,t){return`${e}\0${t}`}function pg(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 V2(e){return e==="auto_compact"||e==="manual_compact"}class Dce{http;config;constructor(t){this.config=t,this.http=new Pce(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?zae(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(ii),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 ii(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return ii(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 ii(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingLevel:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async listMessages(t,n){const 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(D1),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:ii(n.session),messages:n.messages.items.map(D1),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(o=>({toolCallId:o.tool_call_id,name:o.name,args:o.args,description:o.description,lastProgress:o.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(c3),pendingQuestions:n.pending_questions.map(u3)}}async submitPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Kae(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 ii(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 ii(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(ii)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,Gae(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,Zae(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(B1)}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 B1(i)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(pg)}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 pg(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return pg(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(L2)])):void 0;return{items:s.items.map(L2),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 Cf(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(Zf)}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 Zf(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(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(tce)}async listProviders(){return(await this.http.get("/providers")).items.map(P2)}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 P2(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 mg(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return mg(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return mg(t)}async getConfig(){const t=await this.http.get("/config");return F1(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 F1(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 Cf(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=i5(this.config.serverHttpUrl,this.config.clientId),o=vce(),s=new Rce(n,this.config.clientId,{onWireEvent:i=>{const r=nce(i),l=oce(i),a=ece(i);a.type==="historyCompacted"&&!V2(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=o.project(r,c,a,{offset:u});for(const f of d)f.type==="historyCompacted"&&!V2(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l})},onResync:(i,r,l)=>{o.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return s.connect(),{subscribe(i,r){s.subscribe(i,r??{seq:0})},unsubscribe(i){s.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){o.reset(i);return}const l=o.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){o.bindNextPromptId(i,r)},abort(i,r){s.abort(i,r)},terminalAttach(i,r,l){s.terminalAttach(i,r,l)},terminalInput(i,r,l){s.terminalInput(i,r,l)},terminalResize(i,r,l,a){s.terminalResize(i,r,l,a)},terminalDetach(i,r){s.terminalDetach(i,r)},terminalClose(i,r){s.terminalClose(i,r)},markSideChannelAgent(i){o.markSideChannelAgent(i)},close(){s.close()}}}}function mg(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 K2;function at(){return K2??=new Dce(e5()),K2}function Bce(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 Fce=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function Hce(e){return Fce.has(e.type)}function Wce(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(e,16)}function Uce(e,t,n=Wce){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 m3=["blue","mono"],g3=["light","dark","system"],v3=15,qce=12,jce=20;function zce(){const e=bn(Mt.accent);return e&&m3.includes(e)?e:"blue"}function Vce(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Kce(){const e=bn(Mt.colorScheme);return e&&g3.includes(e)?e:"system"}function Gce(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 Yce(){const e=bn(Mt.theme);return e==="terminal"||e==="modern"||e==="kimi"?e:"modern"}function Xce(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.theme=e)}function p0(e){return Number.isFinite(e)?Math.min(jce,Math.max(qce,Math.round(e))):v3}function Qce(){const e=bn(Mt.uiFontSize);return e===null?v3:p0(Number(e))}function Zce(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${p0(e)}px`)}const Gh=ne(Yce()),m0=ne(Kce()),g0=ne(zce()),v0=ne(Qce());ze(Gh,Xce,{immediate:!0});ze(m0,Gce,{immediate:!0});ze(g0,Vce,{immediate:!0});ze(v0,Zce,{immediate:!0});function y3(e){e!=="terminal"&&e!=="modern"&&e!=="kimi"||(Gh.value=e,An(Mt.theme,e))}function Jce(){y3(Gh.value==="modern"?"terminal":"modern")}function eue(e){g3.includes(e)&&(m0.value=e,An(Mt.colorScheme,e))}function tue(e){m3.includes(e)&&(g0.value=e,An(Mt.accent,e))}function nue(e){const t=p0(e);v0.value=t,An(Mt.uiFontSize,String(t))}const oue=600,sue=250,Yh=250,iue=1e3,rue=160,Jf=ne(!1);let tl=[],il=null,eh=-Yh;function lue(){tl=[],eh=-Yh,Jf.value=!1,il!==null&&(clearTimeout(il),il=null)}function aue(){Jf.value=!0,il!==null&&clearTimeout(il),il=setTimeout(()=>{il=null,tl=[],eh=-Yh,Jf.value=!1},iue)}function cue(e){if(e<=0)return;const t=Date.now();tl.push({time:t,chars:e});const n=t-oue;if(tl=tl.filter(l=>l.time>=n),t-eh<Yh)return;eh=t;const o=tl[0]?.time??t,s=Math.max(t-o,sue);tl.reduce((l,a)=>l+a.chars,0)/s*1e3>=rue&&aue()}function uue(){return{theme:Gh,colorScheme:m0,accent:g0,uiFontSize:v0,fastMoon:Jf,setTheme:y3,toggleTheme:Jce,setColorScheme:eue,setAccent:tue,setUiFontSize:nue,resetFastMoon:lue,recordMoonDelta:cue}}function k3(e,t){const n=bn(e);return n===null?t:n==="1"}const y0=ne(k3(Mt.notifyOnComplete,!0)),k0=ne(k3(Mt.notifyOnQuestion,!1)),b0=ne(typeof Notification<"u"?Notification.permission:"denied");async function b3(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{}b0.value=o,o==="granted"&&(e.value=!0,An(t,"1"))}function due(e){return b3(y0,Mt.notifyOnComplete,e)}function fue(e){return b3(k0,Mt.notifyOnQuestion,e)}function w3(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{b0.value=i,i==="granted"&&G2(t,n,o)});return}G2(t,n,o)}}function G2(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 hue(e,t){w3(y0.value,t,Sn.global.t("settings.notifyBody"),`kimi-complete-${e}`)}function pue(e,t){const n=t.questionPreview||Sn.global.t("settings.notifyQuestionBody");w3(k0.value,t,n,`kimi-question-${e}`)}function mue(){return{notifyOnComplete:y0,notifyOnQuestion:k0,notifyPermission:b0,setNotifyOnComplete:due,setNotifyOnQuestion:fue,maybeNotifyCompletion:hue,maybeNotifyQuestion:pue}}function gue(){return bn(Mt.soundOnComplete)==="1"}const Su=ne(gue());function vue(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let gg=null;function _3(){const e=vue();if(!e)return null;if(gg===null)try{gg=new e}catch{return null}return gg}function C3(){if(!Su.value)return;const e=_3();e!==null&&e.state==="suspended"&&e.resume().then(()=>{ar("sound: audio context resumed",{state:e.state})},t=>{ar("sound: audio context resume rejected",{error:String(t)})})}let Y2=!1;function yue(){if(Y2||typeof window>"u")return;Y2=!0;const e=()=>{C3()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}yue();function kue(e){Su.value=e,An(Mt.soundOnComplete,e?"1":"0"),e&&C3()}function X2(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 S3(){const e=_3();if(e===null){ar("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){ar("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{ar("sound: context resumed for next time",{state:e.state})},t=>{ar("sound: resume rejected",{error:String(t)})});return}try{X2(e,880,0,.16,.18),X2(e,1320,.1,.22,.16),ar("sound: chime scheduled",{state:e.state})}catch(t){ar("sound: failed to play",{error:String(t)})}}function bue(){Su.value&&S3()}function wue(){Su.value&&S3()}function _ue(){return{soundOnComplete:Su,setSoundOnComplete:kue,maybePlayCompletionSound:bue,maybePlayQuestionSound:wue}}function Q2(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 Cue=1e3,Sue=4096,Z2=32*1024;function xue(e,t){let n=null,o;const s=new Set;async function i(f){try{const h=await at().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:Q2(h,e.tasksBySession[f]??[])},await r(f,h)}catch{}}async function r(f,g){if(e.activeSessionId!==f)return;const h=g??e.tasksBySession[f]??[],m=at(),_=new Map;if(await Promise.all(h.map(async k=>{if((k.status==="completed"||k.status==="failed"||k.status==="cancelled")&&!s.has(k.id)&&!((k.outputLines?.length??0)>0))try{const y=await m.getTask(f,k.id,{withOutput:!0,outputBytes:Z2});y.outputPreview!==void 0&&_.set(k.id,{preview:y.outputPreview,bytes:y.outputBytes})}catch{}finally{s.add(k.id)}})),_.size===0)return;const w=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:w.map(k=>{const b=_.get(k.id);return b?{...k,outputPreview:b.preview,outputBytes:b.bytes}:k})}}async function l(f){if(e.activeSessionId!==f)return;const g=at();let h;try{h=await g.listTasks(f)}catch{return}const m=new Map;await Promise.all(h.map(async b=>{const y=b.status==="running",S=b.status==="completed"||b.status==="failed"||b.status==="cancelled";if(!(!y&&!S)&&!(S&&(s.has(b.id)||(b.outputLines?.length??0)>0)))try{const L=await g.getTask(f,b.id,{withOutput:!0,outputBytes:y?Sue:Z2});L.outputPreview!==void 0&&m.set(b.id,{preview:L.outputPreview,bytes:L.outputBytes})}catch{}finally{S&&s.add(b.id)}}));const _=e.tasksBySession[f]??[],w=new Map(_.map(b=>[b.id,b])),k=h.map(b=>{const y=w.get(b.id),S=m.get(b.id);return{...b,outputLines:y?.outputLines,outputPreview:S?.preview??y?.outputPreview,outputBytes:S?.bytes??y?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:Q2(k,_)}}function a(f){n!==null&&o===f||(c(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},Cue))}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(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),ze(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const g=e.tasksBySession[f]??[];return{sid:f,hasRunning:g.some(h=>h.status==="running")}},({sid:f,hasRunning:g},h,m)=>{let _;g&&f!==void 0?a(f):f!==void 0?_=setTimeout(()=>{(e.tasksBySession[f]??[]).some(k=>k.status==="running")||c()},1500):c(),m(()=>{_!==void 0&&clearTimeout(_)})},{deep:!0,immediate:!0}),{taskClock:F(()=>u.value),loadTasksForSession:i}}const x3=Mt.starredModels;function Tue(){try{const e=bn(x3);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Aue(e){try{An(x3,JSON.stringify(e))}catch{}}function Mue(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,inFlightPromptSessions:r,saveThinkingToStorage:l,updateSession:a,updateSessionMessages:c}=t,u=ne([]),d=ne(Tue()),f=ne({}),g=ne([]),h=ne(null);function m(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 m(V?.model??h.value??e.defaultModel)}function w(V){const U=b2(_(),V);return e.thinking=U,l(U),U}async function k(V){try{const J=await at().listSkills(V);f.value={...f.value,[V]:J}}catch{}}async function b(){try{const V=at();u.value=await V.listModels(),w(e.thinking)}catch(V){n("loadModels",V)}}async function y(){try{const V=await at().refreshOAuthProviderModels();for(const U of V.failed)n("refreshOAuthProviderModels",new Error(U.reason),{message:U.provider})}catch{}}async function S(){try{const V=at();g.value=await V.listProviders()}catch(V){n("loadProviders",V)}}async function L(V){const U=e.activeSessionId,J=b2(m(V),e.thinking),K=e.thinking;if(!U){h.value=V,w(J);return}const G=e.sessions.find(X=>X.id===U)?.model;a(U,X=>({...X,model:V})),J!==K&&(e.thinking=J,l(J));try{await at().updateSession(U,{model:V,thinking:J!==K?J:void 0})}catch(X){a(U,ke=>({...ke,model:G??ke.model})),J!==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),Aue(d.value)}async function v(V,U){const J=e.activeSessionId;if(!J)return;const K=i.value==="idle"&&!r.has(J),G=`msg_skill_opt_${Date.now().toString(36)}`;if(K){r.add(J),e.sendingBySession={...e.sendingBySession,[J]:!0};const X={id:G,sessionId:J,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(J,ke=>[...ke,X])}try{await at().activateSkill(J,V,U)}catch(X){K&&(r.delete(J),e.sendingBySession={...e.sendingBySession,[J]:!1},c(J,ke=>ke.filter(le=>le.id!==G))),n("activateSkill",X,{sessionId:J})}}async function M(V){try{await at().addProvider(V),await Promise.all([S(),b()])}catch(U){n("addProvider",U)}}async function $(V){try{await at().deleteProvider(V),await Promise.all([S(),b()])}catch(U){n("deleteProvider",U)}}async function O(V){try{const U=await at().refreshProvider(V);for(const J of U.failed)n("refreshProvider",new Error(J.reason),{message:J.provider});await Promise.all([S(),b()])}catch(U){n("refreshProvider",U)}}async function T(){try{const V=await at().refreshAllProviders();for(const U of V.failed)n("refreshAllProviders",new Error(U.reason),{message:U.provider});await Promise.all([S(),b()])}catch(V){n("refreshAllProviders",V)}}async function I(){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:g,draftModel:h,skillsBySession:f,loadSkillsForSession:k,loadModels:b,refreshOAuthProviderModels:y,loadProviders:S,setModel:L,toggleStarModel:N,activateSkill:v,addProvider:M,deleteProvider:$,refreshProvider:O,refreshAllProviders:T,startOAuthLogin:I,pollOAuthLogin:R,cancelOAuthLogin:D,setThinking:W}}const T3="kimiWeb.compaction",Eue=/^read[_-]?media(?:file)?$/i,Iue=/^agent$/i,$ue=/^data:([^;]+);base64,(.*)$/s,Nue=/^<(image|video|audio)\s+path="([^"]+)">$/,Lue=/Mime type:\s*([^.\s]+)/i,Pue=/Size:\s*(\d+)\s*bytes/i,Oue=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Rue(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 Due(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 Bue(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 Fue(e,t){if(!Eue.test(e))return;const n=Due(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 g=d.text,h=Nue.exec(g);h&&(s=h[1],o=h[2]);const m=Lue.exec(g);m?.[1]&&(i=m[1]);const _=Pue.exec(g);_?.[1]&&(r=Number(_[1]));const w=Oue.exec(g);w?.[1]&&w[2]&&(l=`${w[1]}x${w[2]}`);continue}const f=Bue(d);f&&(a=f)}if(a===null)return;const c=$ue.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Rue(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function A3(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 Hue(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 Wue(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 Uue(e,t,n,o){const s=Wue(t),i=n?n.isError?"failed":"completed":o?"working":"completed",r=n?A3(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 que(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 jue(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 zue(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:jue(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 Vue(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"?t?.trigger==="user-slash":!1}function Kue(e){return e.metadata?.origin?.kind==="compaction_summary"}function Gue(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function Yue(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 M3(e,t,n,o=!0,s=[],i={}){const r=[];let l=1;const a=new Map;for(const m of t)a.set(m.toolCallId,m);const c=new Map;for(const m of s){if(m.kind!=="subagent")continue;const _=[m.parentToolCallId,m.id].filter(w=>typeof w=="string"&&w.length>0);for(const w of _){const k=c.get(w)??[];k.push(m),c.set(w,k)}}for(const[m,_]of c.entries())c.set(m,_.toSorted(que));const u=new Map;for(const m of e)for(const _ of m.content)_.type==="toolResult"&&u.set(_.toolCallId,{output:_.output,isError:!!_.isError});let d=null;function f(m=!1){if(!d)return;const _=d;if(d=null,!m||!o)for(let w=0;w<_.tools.length;w++){const k=_.tools[w];if(k.status!=="running")continue;const b={...k,status:"ok"};_.tools[w]=b;const y=_.blocks.find(S=>S.kind==="tool"&&S.tool.id===b.id);y&&y.kind==="tool"&&(y.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 g(m,_){for(const w of _)if(w.type==="text"){if(w.text){m.textParts.push(w.text);const k=m.blocks.at(-1);k&&k.kind==="text"?k.text+=`
|
|
275
|
-
`+w.text:m.blocks.push({kind:"text",text:w.text})}}else if(w.type==="thinking"){if(w.thinking){m.thinkingParts.push(w.thinking);const k=m.blocks.at(-1);k&&k.kind==="thinking"?k.thinking+=`
|
|
276
|
-
`+w.thinking:m.blocks.push({kind:"thinking",thinking:w.thinking})}}else if(w.type==="toolUse"){const k=c.get(w.toolCallId);if(k&&k.length>0){if(k.filter(N=>N.swarmIndex!==void 0).length>1)continue;const L=k.map(Hue);L.length===1?m.blocks.push({kind:"agent",member:L[0]}):m.blocks.push({kind:"agentGroup",members:L});continue}if(Iue.test(w.toolName)){const S=Uue(w.toolCallId,w.input,u.get(w.toolCallId),o);m.blocks.push({kind:"agent",member:S});continue}const b=a.get(w.toolCallId),y={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};m.tools.push(y),m.blocks.push({kind:"tool",tool:y}),b&&(m.approval=zue(b),m.approvalId=b.approvalId)}else if(w.type==="toolResult"){const k=m.tools.findIndex(b=>b.id===w.toolCallId);if(k!==-1){const b=m.tools[k],y={...b,status:w.isError?"error":"ok",output:A3(w.output),media:w.isError?void 0:Fue(b.name,w.output)};y.name==="ExitPlanMode"&&!y.planPath&&(y.planPath=Yue(y.output)),m.tools[k]=y;const S=m.blocks.find(L=>L.kind==="tool"&&L.tool.id===w.toolCallId);S&&S.kind==="tool"&&(S.tool=y)}}}function h(m){if(m.type==="image"||m.type==="video"){const _=m.type,w=m.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(m.type==="file"&&n){if(m.mediaType.startsWith("image/"))return{url:n(m.fileId),kind:"image"};if(m.mediaType.startsWith("video/"))return{url:n(m.fileId),kind:"video"}}}for(const m of e){if(m.role==="system")continue;if(Kue(m)){f();const y=m.metadata?.[T3];r.push({id:m.id,role:"compaction",no:l,text:m.content.filter(S=>S.type==="text").map(S=>S.text).join(`
|
|
277
|
-
`),compaction:{trigger:y?.trigger,tokensBefore:y?.tokensBefore,tokensAfter:y?.tokensAfter}});continue}if(m.role==="user"){if(f(),!Vue(m))continue;const y=m.metadata?.origin,S=y?.kind==="skill_activation"&&y?.trigger==="user-slash",L=[],N=[];for(const v of m.content){v.type==="text"&&(S?L.push(y.skillArgs??""):L.push(v.text));const M=h(v);M&&N.push({url:M.url,kind:M.kind,alt:v.type==="file"?v.name:void 0})}r.push({id:m.id,role:"user",no:l++,text:L.join(`
|
|
278
|
-
`),images:N.length>0?N:void 0,skillActivation:S?{name:y.skillName,args:y.skillArgs}:void 0,createdAt:m.createdAt});continue}if(m.role==="tool"){d&&g(d,m.content);continue}const _=m.promptId;Gue(d,_)?d!==null&&d.promptId===void 0&&_!==void 0&&(d.promptId=_):(f(),d={id:m.id,promptId:_,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:m.durationMs});const k=d;if(k===null)continue;const b=JSON.stringify(m.content);k.promptId!==void 0&&k.seenSigs.has(b)||(k.seenSigs.add(b),g(k,m.content))}return f(!0),r}function Xue(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 v=r.value[N];return v?{parentId:N,agentId:v.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(v=>v.id===N.agentId&&v.status==="running"):!1}),f=F(()=>{const N=l.value;if(!N)return[];const v=e.sideChatMessagesByAgent[N.agentId]??[];return M3(v,[],M=>at().getFileUrl(M),d.value,[])});function g(N,v){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[N]:v(e.sideChatMessagesByAgent[N]??[])}}function h(N,v){g(N,M=>[...M,v])}function m(N){g(N,v=>{const M=[...v].reverse().findIndex(O=>O.role==="user");if(M===-1)return v;const $=v.length-1-M;return v.filter((O,T)=>T!==$)})}function _(N,v){g(N,M=>{const $=[...M];for(let O=$.length-1;O>=0;O-=1){const T=$[O];if(T.role==="user")return $[O]={...T,promptId:T.promptId??v},$}return M})}function w(N,v,M){M&&g(N,$=>{const O=$.at(-1);if(O?.role==="assistant"){const T=O.content[0],I=T?.type==="text"?T.text:"";return[...$.slice(0,-1),{...O,content:[{type:"text",text:`${I}${M}`}]}]}return[...$,{id:o(),sessionId:v,role:"assistant",content:[{type:"text",text:M}],createdAt:new Date().toISOString()}]})}function k(N,v,M){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[N]:!1},!M)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,v,M)}async function b(N){const v=e.activeSessionId;if(v){if(!r.value[v]){let M;try{({agentId:M}=await at().startBtw(v))}catch($){n("openSideChat",$,{sessionId:v});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[M]:e.sideChatMessagesByAgent[M]??[]},r.value={...r.value,[v]:{agentId:M}},s(),i()?.markSideChannelAgent(M)}N&&N.trim()&&await S(N.trim())}}function y(){const N=e.activeSessionId;if(!N)return;const{[N]:v,...M}=r.value;r.value=M}async function S(N){const v=l.value,M=N.trim();if(!v||!M)return;const $=v.parentId,O=v.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[O]:!0};const T={id:o(),sessionId:$,role:"user",content:[{type:"text",text:M}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};h(O,T);try{const I=await at().submitPrompt($,{content:[{type:"text",text:M}],agentId:O});_(O,I.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[$]:[...e.sideChatUserMessageIdsBySession[$]??[],I.userMessageId]}}catch(I){n("sendSideChatPrompt",I,{sessionId:$}),m(O),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[O]:!1}}}function L(N){if(!r.value[N])return;const{[N]:v,...M}=r.value;r.value=M}return{sideChatTargetBySession:r,sideChatSessionId:a,sideChatVisible:c,sideChatSending:u,sideChatRunning:d,sideChatTurns:f,appendSideChatAssistantText:w,finishSideChatAgent:k,openSideChat:b,closeSideChat:y,sendSideChatPrompt:S,clearSideChatForSession:L}}function Que(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 Zue(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&&Que(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 U1="/sessions/";function J2(e){const{pathname:t}=e;if(!t.startsWith(U1))return;const n=t.slice(U1.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function Jue(e){return e===void 0||e.length===0?"/":`${U1}${encodeURIComponent(e)}`}const ede=50,tde=40402;function nde(e,t){const{taskPoller:n,sideChat:o,modelProvider:s,pushOperationFailure:i,activity:r,inFlightPromptSessions:l,sessionsKnownEmpty:a,setSessions:c,updateSession:u,upsertSessionFront:d,appendSession:f,forgetSession:g,setActiveSessionId:h,updateSessionMessages:m,nextOptimisticMsgId:_,getEventConn:w,syncSessionFromSnapshot:k,subscribeToSessionEvents:b,hasLoadedMessages:y,refreshSessionStatus:S,persistSessionProfile:L,mergedWorkspaces:N,workspacesView:v,status:M,workspaceIdForSession:$,savePermissionToStorage:O,savePlanModeToStorage:T,saveSwarmModeToStorage:I,saveGoalModeToStorage:R,saveUnread:D,saveActiveWorkspaceToStorage:W,saveHiddenWorkspacesToStorage:V,goalErrorMessage:U,basename:J,resetFastMoon:K,initialized:G,selectedDiffPath:X,fileDiffLines:ke,fileDiffLoading:le}=t;async function We(de){if(e.messagesLoadingMoreBySession[de])return;const Te=e.messagesBySession[de];if(!Te||Te.length===0)return;const Le=Te[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[de]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[de]:!1};try{const Me=await at().listMessages(de,{beforeId:Le,pageSize:ede}),ee=[...Me.items].reverse();m(de,pe=>[...ee,...pe]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[de]:Me.hasMore}}catch(Me){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[de]:!0},i("loadOlderMessages",Me,{sessionId:de})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[de]:!1}}}function ue(de){n.loadTasksForSession(de),Re(de),S(de),Object.prototype.hasOwnProperty.call(s.skillsBySession.value,de)||s.loadSkillsForSession(de)}async function ve(de){const Te=e.activeSessionId;if(Te){X.value=de,ke.value=[],le.value=!0;try{const Me=await at().getFileDiff(Te,de);if(X.value!==de)return;ke.value=Zue(Me.diff)}catch(Le){X.value===de&&(ke.value=[]),console.warn("[loadFileDiff] diff unavailable for",de,Le)}finally{X.value===de&&(le.value=!1)}}}function Ne(){X.value=null,ke.value=[],le.value=!1}async function Re(de){try{const Le=await at().getGitStatus(de);e.gitStatusBySession={...e.gitStatusBySession,[de]:Le}}catch{}}async function Q(){try{const Te=await at().getAuth();e.authReady=Te.ready,e.defaultModel=Te.defaultModel,e.managedProviderStatus=Te.managedProvider?.status??null}catch{}}async function ce(){try{const de=at();e.config=await de.getConfig()}catch{}}async function Se(de){try{const Le=await at().setConfig(de);return e.config=Le,e.defaultModel=Le.defaultModel??null,!0}catch(Te){return i("setConfig",Te),!1}}const j=100,te=5,he=30;async function oe(){const de=at(),Te=[];let Le;for(;;){const Me=await de.listSessions({pageSize:j,beforeId:Le,excludeEmpty:!0});if(Te.push(...Me.items),!Me.hasMore||Me.items.length===0)break;Le=Me.items[Me.items.length-1].id}return Te}async function fe(){const de=at(),Te=e.workspaces;if(Te.length===0){const kt=await oe().catch(()=>[]);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsFullyLoaded=!0,kt}const Le=await Promise.all(Te.map(kt=>de.listSessions({workspaceId:kt.id,pageSize:te,excludeEmpty:!0}).then(Lt=>({workspaceId:kt.id,page:Lt})).catch(()=>({workspaceId:kt.id,page:{items:[],hasMore:!1}})))),Me=[],ee={},pe={};for(const{workspaceId:kt,page:Lt}of Le)Me.push(...Lt.items),ee[kt]=Lt.hasMore,pe[kt]=Lt.items.length>0?Lt.items[Lt.items.length-1].id:void 0;return e.sessionsHasMoreByWorkspace=ee,e.sessionsCursorByWorkspace=pe,e.sessionsFullyLoaded=!1,Me.sort((kt,Lt)=>new Date(Lt.updatedAt).getTime()-new Date(kt.updatedAt).getTime()),Me}async function H(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 Le=await at().listSessions({workspaceId:de,pageSize:he,beforeId:Te,excludeEmpty:!0}),Me=new Set(e.sessions.map(pe=>pe.id)),ee=Le.items.filter(pe=>!Me.has(pe.id));ee.length>0&&c([...e.sessions,...ee]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[de]:Le.items.length>0?Le.items[Le.items.length-1].id:Te},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[de]:Le.hasMore}}catch(Le){i("loadMoreSessions",Le)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[de]:!1}}}}async function Y(){if(e.sessionsFullyLoaded)return;const de=await oe().catch(()=>null);if(de===null)return;c(de),e.sessionsFullyLoaded=!0;const Te={};for(const Le of e.workspaces)Te[Le.id]=!1;e.sessionsHasMoreByWorkspace=Te}async function re(){e.loading=!0;try{const de=at();await Promise.all([de.getHealth().catch(()=>null),de.getMeta().then(kt=>{e.serverVersion=kt.serverVersion,e.availableOpenInApps=kt.openInApps}).catch(()=>null),s.loadModels()]),await Q(),await ce(),await ge();const Te=await fe();c(Te);const Le=Te[0],Me=e.activeWorkspaceId;!(Me!==null&&N.value.some(kt=>kt.id===Me))&&Le&&xe($(Le)),Nt();const pe=typeof window<"u"?J2(window.location):void 0;!e.activeSessionId&&pe!==void 0&&(e.sessions.some(Lt=>Lt.id===pe)||await Rt(pe))&&await Ft(pe,{urlMode:"replace"}),!e.activeSessionId&&Te.length>0&&await Ft(Te[0].id,{urlMode:"replace"})}catch(de){i("load",de)}finally{e.loading=!1,G.value=!0}}async function ge(){try{const de=at(),[Te,Le]=await Promise.all([de.listWorkspaces().catch(()=>[]),de.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Te,e.fsHome=Le.home||null,e.recentRoots=Le.recentRoots}catch{}}function xe(de){e.activeWorkspaceId=de,W(de)}function $e(de){xe(de);const Te=e.sessions.filter(Le=>$(Le)===de);if(Te.length>0){const Le=Te[0];Le&&Le.id!==e.activeSessionId&&Ft(Le.id)}else h(void 0),lt(void 0,"push")}function se(de){e.hiddenWorkspaceRoots.includes(de.root)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(Me=>Me!==de.root),V(e.hiddenWorkspaceRoots));const Te=e.workspaces.findIndex(Me=>Me.id===de.id||Me.root===de.root);if(Te===-1){e.workspaces=[de,...e.workspaces];return}const Le=[...e.workspaces];Le[Te]=de,e.workspaces=Le}function ae(de){if(de.type==="workspaceCreated"||de.type==="workspaceUpdated"){se(de.workspace);return}const Te=e.workspaces.find(Me=>Me.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(Me=>Me.id!==de.workspaceId&&Me.root!==Te),e.activeWorkspaceId===de.workspaceId||e.activeWorkspaceId===Te){const Me=v.value[0]?.id??null;if(e.activeWorkspaceId=Me,Me)W(Me);else try{Zc(Mt.activeWorkspace)}catch{}h(void 0),e.sessionLoading=!1,Ne(),lt(void 0,"replace")}}function we(){h(void 0),lt(void 0,"push")}function qe(de){xe(de),we(),Ne()}async function nt(de,Te,Le){const Me=N.value.find(ee=>ee.id===de);if(Me)try{const ee=at();let pe,kt=Me.root;try{const hn=await ee.addWorkspace({root:Me.root});pe=hn.id,kt=hn.root,se(hn)}catch{}const Lt=s.draftModel.value??void 0,eo=await ee.createSession({workspaceId:pe,cwd:kt,model:Lt});s.draftModel.value=null;const Bs=Lt!==void 0&&(!eo.model||eo.model.length===0)?{...eo,model:Lt}:eo;d(Bs),xe(eo.workspaceId??pe??de),await Ft(eo.id),await jn(eo.id,Te,Le)}catch(ee){i("startSessionAndSendPrompt",ee)}}async function ct(de){const Te=de.trim();if(!Te)return;const Le=at();try{const Me=await Le.addWorkspace({root:Te});se(Me),qe(Me.id)}catch{e.workspaces.find(ee=>ee.root===Te)||(e.workspaces=[{id:Te,root:Te,name:J(Te),isGitRepo:!1,sessionCount:0},...e.workspaces]),qe(Te)}}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 Le=Jue(de);if(window.location.pathname!==Le)try{Te==="push"?window.history.pushState(null,"",Le):window.history.replaceState(null,"",Le)}catch{}}async function Rt(de){try{const Te=await at().getSession(de);return e.sessions.some(Le=>Le.id===Te.id)||f(Te),!0}catch{return!1}}function fn(){const de=J2(window.location);if(de===void 0){h(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"}):(h(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 Le=y(de),Me=!Le&&a.has(de);a.delete(de);try{lt(de,Te?.urlMode??"push"),e.sessionLoading=!Le&&!Me,h(de),K(),e.unreadBySession[de]&&(e.unreadBySession={...e.unreadBySession,[de]:!1},D({[de]:!1})),Ne();const ee=e.sessions.find(pe=>pe.id===de);if(ee){const pe=$(ee);e.activeWorkspaceId!==pe&&xe(pe)}if(Le)b(de);else if(await k(de)==="not-found")return;ue(de)}catch(ee){i("selectSession",ee,{sessionId:de})}finally{e.activeSessionId===de&&(e.sessionLoading=!1)}}async function jn(de,Te,Le){l.add(de),e.sendingBySession={...e.sendingBySession,[de]:!0};const Me=_();try{const ee=at(),pe=[];Te&&pe.push({type:"text",text:Te});for(const hn of Le??[])hn.kind==="video"?pe.push({type:"video",source:{kind:"file",fileId:hn.fileId}}):pe.push({type:"image",source:{kind:"file",fileId:hn.fileId}});if(pe.length===0)return l.delete(de),e.sendingBySession={...e.sendingBySession,[de]:!1},!1;const kt={id:Me,sessionId:de,role:"user",content:pe,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};m(de,hn=>[...hn,kt]);const Lt=e.sessions.find(hn=>hn.id===de),eo=(Lt?.model&&Lt.model.length>0?Lt.model:e.defaultModel)??void 0;if(e.goalMode&&Te)try{await ee.updateSession(de,{goalObjective:Te.trim()})}catch(hn){return i("createGoal",hn,{sessionId:de}),l.delete(de),e.sendingBySession={...e.sendingBySession,[de]:!1},m(de,Pt=>Pt.some(pn=>pn.id===Me)?Pt.filter(pn=>pn.id!==Me):Pt),!1}const Bs=await ee.submitPrompt(de,{content:pe,model:eo,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]:Bs.promptId},m(de,hn=>{const Pt=hn.findIndex(pi=>pi.id===Me);if(Pt===-1)return hn;const pn=[...hn];return pn[Pt]={...pn[Pt],promptId:pn[Pt].promptId??Bs.promptId},pn}),w()?.bindNextPromptId(de,Bs.promptId),!0}catch(ee){return l.delete(de),e.sendingBySession={...e.sendingBySession,[de]:!1},m(de,pe=>pe.some(kt=>kt.id===Me)?pe.filter(kt=>kt.id!==Me):pe),i("sendPrompt",ee,{sessionId:de}),!1}}async function Je(de,Te){const Le=e.activeSessionId;if(Le){if(r.value!=="idle"||l.has(Le)){Po(de,Te);return}await jn(Le,de,Te)}}async function Qn(de,Te){const Le=e.activeSessionId;if(!Le)return;const Me=e.queuedBySession[Le]??[],ee=[],pe=[];for(const Pt of Me){const pn=Pt.text.trim();pn&&ee.push(pn),Pt.attachments?.length&&pe.push(...Pt.attachments)}const kt=de.trim();if(kt&&ee.push(kt),Te?.length&&pe.push(...Te),ee.length===0&&pe.length===0)return;Me.length>0&&(e.queuedBySession={...e.queuedBySession,[Le]:[]});const Lt=ee.join(`
|
|
280
|
-
|
|
281
|
-
`);if(r.value==="idle"&&!l.has(Le)){await jn(Le,Lt,pe);return}const eo=[];Lt&&eo.push({type:"text",text:Lt});for(const Pt of pe)Pt.kind==="video"?eo.push({type:"video",source:{kind:"file",fileId:Pt.fileId}}):eo.push({type:"image",source:{kind:"file",fileId:Pt.fileId}});const Bs=_(),hn={id:Bs,sessionId:Le,role:"user",content:eo,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};m(Le,Pt=>[...Pt,hn]);try{const Pt=at(),pn=e.sessions.find(ks=>ks.id===Le),pi=(pn?.model&&pn.model.length>0?pn.model:e.defaultModel)??void 0,Fs=await Pt.submitPrompt(Le,{content:eo,model:pi,thinking:e.thinking,permissionMode:e.permission,planMode:e.planMode,swarmMode:e.swarmMode});if(m(Le,ks=>{const bl=ks.findIndex(sp=>sp.id===Bs);if(bl===-1)return ks;const wl=[...ks];return wl[bl]={...wl[bl],promptId:wl[bl].promptId??Fs.promptId},wl}),Fs.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Le]:Fs.promptId},w()?.bindNextPromptId(Le,Fs.promptId);return}try{await Pt.steerPrompts(Le,[Fs.promptId])}catch{}}catch(Pt){m(Le,pn=>pn.filter(pi=>pi.id!==Bs)),i("steer",Pt,{sessionId:Le})}}async function Xo(de,Te){try{const Me=await at().uploadFile({file:de,name:Te});return{fileId:Me.id,name:Me.name,mediaType:Me.mediaType}}catch(Le){return i("uploadImage",Le),null}}function Po(de,Te){const Le=e.activeSessionId;if(!Le)return;const Me=e.queuedBySession[Le]??[];e.queuedBySession={...e.queuedBySession,[Le]:[...Me,{text:de,attachments:Te}]}}async function ho(){const de=e.activeSessionId;if(!de)return;const Te=e.sessions.find(ee=>ee.id===de);let Le=e.promptIdBySession[de];if(Le===void 0){const ee=Te?.currentPromptId;ee?.startsWith("prompt_")&&(Le=ee)}const Me=at();if(Le!==void 0)try{if((await Me.abortPrompt(de,Le)).aborted)return;const pe={...e.promptIdBySession};delete pe[de],e.promptIdBySession=pe}catch(ee){if(Cu(ee)&&ee.code===tde){const pe={...e.promptIdBySession};delete pe[de],e.promptIdBySession=pe}else{i("abortCurrentPrompt",ee,{sessionId:de});return}}try{await Me.abortSession(de)}catch(ee){i("abortCurrentPrompt",ee,{sessionId:de})}}async function Ln(de,Te){const Le=e.activeSessionId;if(Le)try{const Me=at(),ee={decision:Te.decision,scope:Te.scope,feedback:Te.feedback,selectedLabel:Te.selectedLabel};await Me.respondApproval(Le,de,ee);const pe=e.approvalsBySession[Le]??[];e.approvalsBySession={...e.approvalsBySession,[Le]:pe.filter(kt=>kt.approvalId!==de)}}catch(Me){i("respondApproval",Me,{sessionId:Le})}}async function cn(de,Te){const Le=e.activeSessionId;if(Le)try{await at().respondQuestion(Le,de,Te);const ee=e.questionsBySession[Le]??[];e.questionsBySession={...e.questionsBySession,[Le]:ee.filter(pe=>pe.questionId!==de)}}catch(Me){i("respondQuestion",Me,{sessionId:Le})}}async function wn(de){const Te=e.activeSessionId;if(Te)try{await at().dismissQuestion(Te,de);const Me=e.questionsBySession[Te]??[];e.questionsBySession={...e.questionsBySession,[Te]:Me.filter(ee=>ee.questionId!==de)}}catch(Le){i("dismissQuestion",Le,{sessionId:Te})}}async function On(de){const Te=e.activeSessionId;if(Te)try{await at().cancelTask(Te,de);const Me=e.tasksBySession[Te]??[];e.tasksBySession={...e.tasksBySession,[Te]:Me.map(ee=>ee.id===de?{...ee,status:"cancelled"}:ee)}}catch(Le){i("cancelTask",Le,{sessionId:Te})}}function zn(de){e.planMode=de,T(de),L({planMode:de})}function Zn(){zn(!e.planMode)}function Co(de){e.swarmMode=de,I(de),L({swarmMode:de})}function po(){const de=!e.swarmMode;de&&e.permission==="manual"&&!confirm("Enable swarm mode? The agent will run multiple sub agents in parallel.")||Co(de)}function Oo(de){e.goalMode=de,R(de)}function Tt(){Oo(!e.goalMode)}async function io(de){const Te=de.trim();if(!Te||e.permission==="manual"&&!confirm(`Start goal: "${Te}"? The agent will run autonomously toward this objective.`))return;const Le=e.activeSessionId;if(Le){try{await at().updateSession(Le,{goalObjective:Te})}catch(Me){i("createGoal",Me,{sessionId:Le,message:U(Me)});return}await Je(Te)}}function nn(de){const Te=e.activeSessionId;Te&&Promise.resolve(at().updateSession(Te,{goalControl:de})).catch(Le=>{i("controlGoal",Le,{sessionId:Te,message:U(Le)})})}function Ro(de){e.permission=de,O(de),L({permissionMode:de})}function Qo(de){const Te=[...e.warnings];Te.splice(de,1),e.warnings=Te}async function Jn(de,Te){try{await at().updateSession(de,{title:Te}),u(de,Me=>({...Me,title:Te}))}catch(Le){i("renameSession",Le,{sessionId:de})}}function Ye(de,Te){e.workspaces=e.workspaces.map(Le=>Le.id===de?{...Le,name:Te}:Le)}async function je(de){const Te=e.workspaces.find(pe=>pe.id===de)?.root??N.value.find(pe=>pe.id===de)?.root??de,Le=e.activeSessionId?e.sessions.find(pe=>pe.id===e.activeSessionId):void 0,Me=e.activeWorkspaceId===de||e.activeWorkspaceId===Te,ee=!!(Le&&(Le.cwd===Te||Le.workspaceId===de||$(Le)===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(pe=>pe.id!==de&&pe.root!==Te),Me||ee){const pe=v.value[0]?.id??null;if(e.activeWorkspaceId=pe,pe)W(pe);else try{Zc(Mt.activeWorkspace)}catch{}}(Me||ee)&&(h(void 0),e.sessionLoading=!1,Ne(),lt(void 0,"replace"))}async function tt(de){try{await at().archiveSession(de),g(de),o.clearSideChatForSession(de);const{[de]:Le,...Me}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Me,e.activeSessionId===de){const ee=e.sessions[0];ee?await Ft(ee.id,{urlMode:"replace"}):(h(void 0),lt(void 0,"replace"))}}catch(Te){i("archiveSession",Te,{sessionId:de})}}async function it(){try{await at().logout(),await Q(),await re()}catch(de){i("logout",de)}}function Ie(de){const Te=e.activeSessionId;Te&&at().compactSession(Te,de).catch(Le=>{i("compact",Le,{sessionId:Te})})}async function be(de){const Te=de??e.activeSessionId;if(Te)try{const Le=await at().forkSession(Te);d(Le),await Ft(Le.id)}catch(Le){i("fork",Le,{sessionId:Te})}}async function Fe(de=1){const Te=e.activeSessionId;if(!Te)return null;const Le=(()=>{const Me=e.messagesBySession[Te]??[];for(let ee=Me.length-1;ee>=0;ee--){const pe=Me[ee];if(pe.role==="user"&&!(pe.metadata?.origin&&pe.metadata.origin.kind!=="user"))return pe.content.filter(kt=>kt.type==="text").map(kt=>kt.text).join(`
|
|
282
|
-
`)}return null})();try{return await at().undoSession(Te,de),await k(Te),Le}catch(Me){return i("undo",Me,{sessionId:Te}),null}}function Ct(de){const Te=e.activeSessionId;if(!Te)return;const Le=e.queuedBySession[Te]??[];if(de<0||de>=Le.length)return;const Me=[...Le];Me.splice(de,1),e.queuedBySession={...e.queuedBySession,[Te]:Me}}async function St(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 Me=await at().readFile(Te,{path:de});return{path:Me.path,content:Me.content,encoding:Me.encoding,mime:Me.mime,languageId:Me.languageId,isBinary:Me.isBinary,size:Me.size,lineCount:Me.lineCount}}catch{return null}}const gn=10485760;function ys(de){const Te=e.activeSessionId;return Te?at().getFileDownloadUrl(Te,de):null}async function Zo(de,Te){const Le=e.activeSessionId;if(!Le)return!1;try{return await at().openFile(Le,{path:de,line:Te}),!0}catch(Me){return i("openFile",Me,{sessionId:Le}),!1}}async function Ui(de){const Te=e.activeSessionId;if(!Te)return;const Le=M.value.cwd||".";try{await at().openInApp(Te,de,Le)}catch(Me){i("openInApp",Me,{sessionId:Te})}}async function fi(de){const Te=e.activeSessionId;if(!Te)return!1;try{return await at().revealFile(Te,{path:de}),!0}catch(Le){return i("revealFile",Le,{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 Le=de;if(Le.startsWith("/")){const Me=e.sessions.find(ee=>ee.id===Te)?.cwd;if(Me&&(Le===Me||Le.startsWith(Me.endsWith("/")?Me:`${Me}/`))){if(Le=Le.slice(Me.length).replace(/^\//,""),!Le)return de}else return de}try{const ee=await at().readFile(Te,{path:Le,length:gn});return!ee.isBinary||ee.encoding!=="base64"||ee.truncated?de:`data:${ee.mime};base64,${ee.content}`}catch{return de}}async function hi(de){const Te=e.activeSessionId;if(!Te)return[];try{return(await at().searchFiles(Te,{query:de,limit:20})).items.map(ee=>({path:ee.path,name:ee.name}))}catch{return[]}}return{loadFileDiff:ve,clearFileDiff:Ne,loadGitStatus:Re,checkAuth:Q,loadConfig:ce,updateConfig:Se,listAllSessionsGlobal:oe,load:re,loadWorkspaces:ge,loadMoreSessions:H,loadAllSessions:Y,selectWorkspace:xe,openWorkspace:$e,upsertWorkspacePreserveOrder:se,applyWorkspaceEvent:ae,clearActiveSession:we,openWorkspaceDraft:qe,startSessionAndSendPrompt:nt,addWorkspaceByPath:ct,browseFs:_t,getFsHome:$t,writeSessionUrl:lt,fetchSessionIntoList:Rt,onSessionRoutePopState:fn,bindSessionRoute:Nt,selectSession:Ft,submitPromptInternal:jn,sendPrompt:Je,steerPrompt:Qn,uploadImage:Xo,enqueue:Po,unqueue:Ct,abortCurrentPrompt:ho,respondApproval:Ln,respondQuestion:cn,dismissQuestion:wn,cancelTask:On,setPlanMode:zn,togglePlanMode:Zn,setSwarmMode:Co,toggleSwarmMode:po,setGoalMode:Oo,toggleGoalMode:Tt,createGoal:io,controlGoal:nn,setPermission:Ro,dismissWarning:Qo,renameSession:Jn,renameWorkspace:Ye,deleteWorkspace:je,archiveSession:tt,logout:it,compact:Ie,forkSession:be,undo:Fe,listDir:St,readFileContent:mn,getFileDownloadUrl:ys,openWorkspaceFile:Zo,openInApp:Ui,revealWorkspaceFile:fi,resolveImageUrl:Vn,searchFiles:hi,loadOlderMessages:We,refreshSessionSidecars:ue}}const ode="kimiWeb.optimisticUserMessage";function sde(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function ide(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 rde(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 vg(e){return e.role==="user"&&e.metadata?.[ode]===!0}function lde(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function eC(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 ade(e,t){const n=eC(e),o=eC(t);return n.text===o.text&&n.media===o.media}function cde(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(vg(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(vg(s)&&lde(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(vg(s)&&ade(s,t))return o}return-1}function ude(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 dde(e,t,n){const o=ide(e);switch(rde(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"},[T3]: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=cde(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]=ude(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 fde(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function hde(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"||vl(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:fde(a.status)}]:[]})}}return[]}const pde=["queued","working","suspended","completed","failed"];function mde(e){return e.subagentPhase?e.subagentPhase:e.status==="completed"?"completed":e.status==="failed"?"failed":"working"}function gde(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function vde(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:mde(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=gde();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 yde(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of pde)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}const os=uue(),nl=mue(),th=_ue(),E3=Mt.permission,I3=Mt.activeWorkspace,$3=Mt.thinking,N3=Mt.planMode,L3=Mt.swarmMode,P3=Mt.goalMode,tC=40401,O3=Mt.onboarded,kde=["off","low","medium","high","xhigh","max"];Zc(Mt.codeFont);function bde(){try{const e=bn(E3);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function wde(e){try{An(E3,e)}catch{}}function _de(){try{const e=bn($3);if(e&&kde.includes(e))return e}catch{}return"high"}function Cde(e){try{An($3,e)}catch{}}function Sde(){try{return bn(N3)==="true"}catch{return!1}}function xde(e){try{An(N3,e?"true":"false")}catch{}}function Tde(){try{return bn(L3)==="true"}catch{return!1}}function Ade(e){try{An(L3,e?"true":"false")}catch{}}function Mde(){try{return bn(P3)==="true"}catch{return!1}}function Ede(e){try{An(P3,e?"true":"false")}catch{}}function Ide(){try{return bn(I3)}catch{return null}}const R3=Mt.hiddenWorkspaces;function $de(){try{const e=bn(R3);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Nde(e){try{An(R3,JSON.stringify(e))}catch{}}function Lde(e){try{An(I3,e)}catch{}}function D3(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Pde(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 Ce=as({...sde(),connected:!1,serverVersion:"",workspaceName:"kimi-web",connection:"disconnected",permission:bde(),thinking:_de(),planMode:Sde(),swarmMode:Tde(),goalMode:Mde(),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:wv(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Ide(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:$de(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsFullyLoaded:!1});function B3(e){Ce.sessions=e}function Xh(e,t){Ce.sessions=Ce.sessions.map(n=>n.id===e?t(n):n)}function Ode(e){Ce.sessions=[e,...Ce.sessions.filter(t=>t.id!==e.id)]}function Rde(e){Ce.sessions=[...Ce.sessions,e]}function Dde(e){Ce.sessions=Ce.sessions.filter(t=>t.id!==e)}function F3(){const e=Ce.activeSessionId;e&&Ce.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!1},_v({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Mt.unread&&(Ce.unreadBySession=wv(),F3())});typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&F3()});function w0(e){Ce.activeSessionId=e}function Bde(e){Ce.messagesBySession=e}function Fde(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t}}function H3(e,t){Ce.messagesBySession={...Ce.messagesBySession,[e]:t(Ce.messagesBySession[e]??[])}}function Hde(e){const{[e]:t,...n}=Ce.messagesBySession;Ce.messagesBySession=n}function W3(e){ui?.unsubscribe(e),cu.flush(),Dde(e),Hde(e),delete Ce.approvalsBySession[e],delete Ce.questionsBySession[e],delete Ce.tasksBySession[e],delete Ce.goalBySession[e],delete Ce.gitStatusBySession[e],delete Ce.lastSeqBySession[e],delete Ce.compactionBySession[e],delete Ce.messagesLoadingMoreBySession[e],delete Ce.messagesHasMoreBySession[e],delete Ce.messagesLoadMoreErrorBySession[e],delete Jh[e],Q3.delete(e),Zh.delete(e),delete Ce.queuedBySession[e],delete Ce.promptIdBySession[e],delete Ce.sendingBySession[e]}const U3=ne(null),q3=ne([]),j3=ne(!1),z3=ne(!1);async function Qh(e){let t;try{t=await at().getSessionStatus(e)}catch{return}Xh(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Ce.swarmMode=t.swarmMode,Ce.planMode=t.planMode}function V3(e){const t=Ce.activeSessionId;t&&Promise.resolve(at().updateSession(t,e)).then(()=>Qh(t)).catch(()=>{})}const K3=Mt.betaToc;function Wde(){try{return bn(K3)==="true"}catch{return!1}}function Ude(e){try{An(K3,e?"true":"false")}catch{}}const G3=ne(Wde());function qde(e){G3.value=e,Ude(e)}function jde(e){try{return bn(e)??""}catch{return""}}const Y3=ne(jde(O3)==="1");function zde(e){Y3.value=e;try{An(O3,e?"1":"0")}catch{}}let ui=null,nC=0;function X3(){return nC+=1,`msg_opt_${Date.now().toString(36)}_${nC}`}const Zh=new Set;function Vde(e,t,n){const o={sessions:Ce.sessions,activeSessionId:Ce.activeSessionId,messagesBySession:Ce.messagesBySession,approvalsBySession:Ce.approvalsBySession,planReviewByToolCallId:Ce.planReviewByToolCallId,questionsBySession:Ce.questionsBySession,tasksBySession:Ce.tasksBySession,goalBySession:Ce.goalBySession,lastSeqBySession:Ce.lastSeqBySession,compactionBySession:Ce.compactionBySession,config:Ce.config,warnings:Ce.warnings},s=dde(o,e,{sessionId:t,seq:n});B3(s.sessions),w0(s.activeSessionId),Bde(s.messagesBySession),Ce.approvalsBySession=s.approvalsBySession,Ce.planReviewByToolCallId=s.planReviewByToolCallId,Ce.questionsBySession=s.questionsBySession,Ce.tasksBySession=s.tasksBySession,Ce.goalBySession=s.goalBySession,Ce.lastSeqBySession=s.lastSeqBySession,Ce.compactionBySession=s.compactionBySession,Ce.config=s.config??null,Ce.warnings=s.warnings,e.type==="configChanged"&&(Ce.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(_n.loadModels(),_n.loadProviders()),e.type==="sessionUsageUpdated"&&e.sessionId===Ce.activeSessionId&&e.swarmMode!==void 0&&(Ce.swarmMode=e.swarmMode),e.type==="sessionUsageUpdated"&&e.sessionId===Ce.activeSessionId&&e.planMode!==void 0&&(Ce.planMode=e.planMode)}function Kde(e,t){Vde(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;Ce.promptIdBySession[o]!==e.message.promptId&&(Ce.promptIdBySession={...Ce.promptIdBySession,[o]:e.message.promptId})}e.type==="assistantDelta"&&t.sessionId===Ce.activeSessionId&&os.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="sessionStatusChanged"&&(e.status==="idle"||e.status==="aborted")&&she(e.sessionId,e.status),e.type==="questionRequested"&&ihe(e.sessionId,e.question)}const cu=Uce(({appEvent:e,meta:t})=>Kde(e,t),({appEvent:e})=>Hce(e));function _0(){if(ui!==null||typeof WebSocket>"u")return;Ce.connection="connecting",ui=at().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){dt.applyWorkspaceEvent(t);return}cu({appEvent:t,meta:n})},onResync(t,n,o){cu.flush(),o!==void 0&&(Jh[t]=o),ofe.request(t)},onError(t,n,o){C0({severity:"error",title:Sn.global.t("warnings.wsTitle"),message:n,details:[no("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){Ce.connected=t,Ce.connection=t?"connected":"disconnected"}})}const Jh={},Q3=new Set;function Gde(e){return Cu(e)&&e.code===tC?!0:typeof e=="object"&&e!==null&&e.code===tC}function no(e,t){if(!(t==null||t===""))return{label:Sn.global.t(`warnings.details.${e}`),value:Z3(t)}}function Z3(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 Yde(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Xde(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Qde(e,t,n){const o=[no("operation",e),no("sessionId",n)];return d3(t)?o.push(no("request",`${t.method} ${t.path}`),no("endpoint",t.url),no("requestId",t.requestId),no("phase",t.phase),no("timeout",`${t.timeoutMs}ms`),no("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),no("contentType",t.contentType),no("responsePreview",t.bodyPreview),no("cause",t.cause)):Cu(t)?o.push(no("code",t.code),no("requestId",t.requestId),no("message",t.message),no("details",t.details)):o.push(no("errorName",Yde(t)),no("message",Xde(t)??Z3(t))),o.filter(s=>s!==void 0)}function Zde(e,t,n={}){const o=d3(t),s=Cu(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:Qde(e,t,n.sessionId)}}function C0(e){Ce.warnings=[...Ce.warnings,e]}function ep(e,t,n){C0(Zde(e,t,n))}const Jde={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function efe(e){if(!Cu(e))return;const t=Jde[e.code];return t?Sn.global.t(t):void 0}async function tfe(e){if(W3(e),Ce.activeSessionId!==e)return;const t=Ce.sessions[0];t?await dt.selectSession(t.id,{urlMode:"replace"}):(w0(void 0),Ce.sessionLoading=!1,dt.writeSessionUrl(void 0,"replace"))}const oC=new Set;async function nfe(e){if(!oC.has(e)){oC.add(e);try{const t=await at().getSessionWarnings(e),n=Sn.global.t("warnings.noteLabel");for(const o of t)C0(`${n}: ${o.message}`)}catch{}}}async function J3(e){try{const n=await at().getSessionSnapshot(e);cu.flush(),Xh(e,o=>({...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:o.model})),Fde(e,n.messages),Ce.messagesHasMoreBySession={...Ce.messagesHasMoreBySession,[e]:n.hasMoreMessages},Ce.approvalsBySession={...Ce.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&&(Ce.planReviewByToolCallId={...Ce.planReviewByToolCallId,[o.toolCallId]:{plan:s.plan,path:typeof s.path=="string"?s.path:void 0}})}return Ce.questionsBySession={...Ce.questionsBySession,[e]:n.pendingQuestions},Ce.lastSeqBySession={...Ce.lastSeqBySession,[e]:n.asOfSeq},Jh[e]=n.epoch,_0(),ui&&(ui.seedSnapshot(e,n),ui.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch})),nfe(e),"ok"}catch(t){return Gde(t)?(await tfe(e),"not-found"):(ep("getSessionSnapshot",t,{title:Sn.global.t("warnings.sessionSnapshotTitle"),message:Sn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const ofe=Bce(J3);function sfe(e){return Object.prototype.hasOwnProperty.call(Ce.messagesBySession,e)}function ife(e){if(_0(),ui){cu.flush();const t=Ce.lastSeqBySession[e]??0,n=Jh[e];ui.subscribe(e,{seq:t,epoch:n})}}function tp(e){const t=Ce.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=vo.sideChatTargetBySession.value[e]?.agentId,s=(Ce.tasksBySession[e]??[]).filter(i=>i.status==="running");return s.length===0?!(n&&Ce.sideChatSendingByAgent[n]):s.some(i=>i.id!==n)}function S0(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 rfe=3e4,uu=ne(0);let yg=null;function lfe(){yg===null&&(yg=setInterval(()=>{uu.value=(uu.value+1)%Number.MAX_SAFE_INTEGER},rfe),yg.unref?.())}function afe(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 cfe(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:afe(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 ufe(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 dfe(e){const t=Ce.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 ffe(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??dfe(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 hfe=F(()=>{const e=Ce.sessions.find(n=>n.id===Ce.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Ce.workspaceName,branch:t}}),pfe=F(()=>(uu.value,Ce.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:S0(e.updatedAt,e.status),status:e.status,busy:tp(e.id)})))),mfe=F(()=>Ce.activeSessionId??""),gfe=F(()=>{const e=Ce.activeSessionId;return e?_n.skillsBySession.value[e]??[]:[]}),vfe=F(()=>{const e=Ce.activeSessionId;return e?Ce.sendingBySession[e]??!1:!1}),vo=Xue(Ce,{pushOperationFailure:ep,nextOptimisticMsgId:X3,connectEventsIfNeeded:_0,getEventConn:()=>ui}),np=F(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=vo.sideChatTargetBySession.value[e]?.agentId;return(Ce.tasksBySession[e]??[]).filter(n=>n.id!==t)}),eM=xue(Ce,np),yfe=F(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=new Set(Ce.sideChatUserMessageIdsBySession[e]??[]),n=(Ce.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=Ce.approvalsBySession[e]??[];return M3(n,o,s=>at().getFileUrl(s),op.value!=="idle",np.value,Ce.planReviewByToolCallId)}),kfe=F(()=>(eM.taskClock.value,np.value.map(ffe))),tM=F(()=>vde(np.value)),Xl=F(()=>{const e=Ce.activeSessionId;return e?Ce.goalBySession[e]??null:null}),bfe=F(()=>{const e=Ce.activeSessionId;return e?hde(Ce.messagesBySession[e]??[]):[]}),wfe=F(()=>{const e=Ce.activeSessionId;return e?Ce.compactionBySession[e]??null:null}),_fe=F(()=>Ce.connection),Cfe=F(()=>Ce.loading),Sfe=F(()=>Ce.sessionLoading),xfe=F(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadingMoreBySession[e]??!1:!1}),Tfe=F(()=>{const e=Ce.activeSessionId;return e?Ce.messagesHasMoreBySession[e]??!1:!1}),Afe=F(()=>{const e=Ce.activeSessionId;return e?Ce.messagesLoadMoreErrorBySession[e]??!1:!1}),Mfe=F(()=>Ce.serverVersion),Efe=F(()=>Ce.permission),Ife=F(()=>Ce.thinking),$fe=F(()=>Ce.planMode),Nfe=F(()=>Ce.swarmMode),Lfe=F(()=>Ce.goalMode),Pfe=F(()=>{const e=yde(tM.value);return{plan:Ce.planMode,goal:Xl.value&&Xl.value.status!=="complete"?{status:Xl.value.status,turnsUsed:Xl.value.turnsUsed,elapsedMs:Xl.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Ofe=F(()=>{const e=Ce.activeSessionId;return e?(Ce.queuedBySession[e]??[]).map(t=>({text:t.text,attachmentCount:t.attachments?.length??0})):[]}),Rfe=F(()=>Ce.warnings),Dfe=F(()=>{const e=Ce.activeSessionId;return e?(Ce.questionsBySession[e]??[]).map(ufe):[]}),Bfe=F(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:cfe(t),agentName:t.agentName})):[]}),op=F(()=>{const e=Ce.activeSessionId;return e?(Ce.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Ce.questionsBySession[e]??[]).length>0?"awaiting-question":tp(e)?"running":"idle":"idle"}),_n=Mue(Ce,{pushOperationFailure:ep,refreshSessionStatus:Qh,persistSessionProfile:V3,activity:op,inFlightPromptSessions:Zh,saveThinkingToStorage:Cde,updateSession:Xh,updateSessionMessages:H3}),nh=F(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Ffe=F(()=>{const e=Ce.activeSessionId;return e?Ce.gitStatusBySession[e]?.pullRequest??null:null}),Hfe=F(()=>{const e=Ce.activeSessionId;if(!e)return[];const t=Ce.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),Wfe=F(()=>{const e=Ce.activeSessionId;if(!e)return null;const t=Ce.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),nM=F(()=>{const e=Ce.sessions.find(r=>r.id===Ce.activeSessionId),t=nh.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??Ce.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:Ce.permission,branch:t,cwd:e?.cwd??"",isGitRepo:nh.value!==null}}),Ufe=F(()=>q3.value),qfe=F(()=>Ce.sessions.find(t=>t.id===Ce.activeSessionId)?.usage.totalCostUsd??0),jfe=F(()=>Ce.authReady),zfe=F(()=>Ce.defaultModel),Vfe=F(()=>Ce.managedProviderStatus),Kfe=F(()=>Ce.config),Gfe=F(()=>{const e=Ce.activeSessionId;if(!e)return{};const t=Ce.gitStatusBySession[e];return t?{...t.entries}:{}});function xu(e){return Ce.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const x0=F(()=>{const e=new Set(Ce.hiddenWorkspaceRoots),t=new Map;for(const a of Ce.workspaces)e.has(a.root)||t.set(a.root,{...a});for(const a of Ce.sessions){const c=a.cwd;c&&(e.has(c)||t.has(c)||t.set(c,{id:a.workspaceId??c,root:c,name:D3(c),isGitRepo:!1,sessionCount:0}))}const n=new Map;for(const a of Ce.sessions){const c=xu(a);n.set(c,(n.get(c)??0)+1)}const o=nh.value,s=Ce.sessions.find(a=>a.id===Ce.activeSessionId)?.cwd,i=Ce.workspaces.filter(a=>!e.has(a.root)).map(a=>a.root),r=[...t.keys()].filter(a=>!i.includes(a));r.sort((a,c)=>a.localeCompare(c));const l=[];for(const a of[...i,...r]){const c=t.get(a),u=n.get(c.id)??n.get(c.root)??0,d=Ce.sessionsHasMoreByWorkspace[c.id]===!1?u:Math.max(c.sessionCount,u);let f=c.branch;!f&&o&&s===c.root&&(f=o.branch),l.push({...c,sessionCount:d,branch:f})}return l}),oh=ne(Q6());ze(()=>[x0.value.map(e=>e.id).join("\0"),Ce.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=c5(n,oh.value);o!==null&&(oh.value=o,fx(o))});const La=F(()=>{const e=x0.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:Pde(t.root,Ce.fsHome),branch:t.branch,sessionCount:t.sessionCount}));return u5(e,oh.value)}),oM=F(()=>{const e=Ce.activeWorkspaceId,t=La.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),Yfe=F(()=>{const e=oM.value;return e?La.value.find(t=>t.id===e)??null:null}),Xfe=F(()=>{uu.value;const e=new Set(La.value.map(t=>t.id));return Ce.sessions.filter(t=>!t.parentSessionId&&e.has(xu(t))).map(t=>({id:t.id,title:t.title,time:S0(t.updatedAt,t.status),status:t.status,busy:tp(t.id),lastPrompt:t.lastPrompt}))}),Qfe=F(()=>{uu.value;const e=new Map;for(const t of Ce.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=xu(t),o={id:t.id,title:t.title,time:S0(t.updatedAt,t.status),status:t.status,busy:tp(t.id),updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return La.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Ce.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Ce.sessionsLoadingMoreByWorkspace[t.id]??!1}))});function Zfe(e){oh.value=e,fx(e)}const sM=F(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),Jfe=F(()=>{const e={};for(const[t,n]of Object.entries(Ce.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Ce.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),ehe=F(()=>{const e={};for(const[t,n]of Object.entries(Ce.unreadBySession))n&&(e[t]=!0);return e}),the=F(()=>{const e={},t=sM.value;for(const n of Ce.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=xu(n);e[s]=(e[s]??0)+o}return e}),nhe=F(()=>Ce.recentRoots),ohe=F(()=>Ce.availableOpenInApps),dt=nde(Ce,{taskPoller:eM,sideChat:vo,modelProvider:_n,pushOperationFailure:ep,activity:op,inFlightPromptSessions:Zh,sessionsKnownEmpty:Q3,setSessions:B3,updateSession:Xh,upsertSessionFront:Ode,appendSession:Rde,forgetSession:W3,setActiveSessionId:w0,updateSessionMessages:H3,nextOptimisticMsgId:X3,getEventConn:()=>ui,syncSessionFromSnapshot:J3,subscribeToSessionEvents:ife,hasLoadedMessages:sfe,refreshSessionStatus:Qh,persistSessionProfile:V3,mergedWorkspaces:x0,workspacesView:La,status:nM,workspaceIdForSession:xu,savePermissionToStorage:wde,savePlanModeToStorage:xde,saveSwarmModeToStorage:Ade,saveGoalModeToStorage:Ede,saveUnread:_v,saveActiveWorkspaceToStorage:Lde,saveHiddenWorkspacesToStorage:Nde,goalErrorMessage:efe,basename:D3,resetFastMoon:os.resetFastMoon,initialized:z3,selectedDiffPath:U3,fileDiffLines:q3,fileDiffLoading:j3});function she(e,t){if(Zh.delete(e),Ce.sendingBySession={...Ce.sendingBySession,[e]:!1},Ce.promptIdBySession[e]!==void 0){const i={...Ce.promptIdBySession};delete i[e],Ce.promptIdBySession=i}e===Ce.activeSessionId?(os.resetFastMoon(),dt.loadGitStatus(e),Qh(e)):t==="idle"&&(Ce.unreadBySession={...Ce.unreadBySession,[e]:!0},_v({[e]:!0})),nl.maybeNotifyCompletion(e,{isActiveAndVisible:e===Ce.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:Ce.sessions.find(i=>i.id===e)?.title??"",onClick:()=>{dt.selectSession(e)}}),t==="idle"&&th.maybePlayCompletionSound();const n=Ce.queuedBySession[e]??[];if(n.length===0)return;const[o,...s]=n;Ce.queuedBySession={...Ce.queuedBySession,[e]:s},o!==void 0&&dt.submitPromptInternal(e,o.text,o.attachments).then(i=>{if(!i){const r=Ce.queuedBySession[e]??[];Ce.queuedBySession={...Ce.queuedBySession,[e]:[o,...r]}}})}function ihe(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;nl.maybeNotifyQuestion(e,{isActiveAndVisible:e===Ce.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible",sessionTitle:Ce.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,onClick:()=>{dt.selectSession(e)}}),th.maybePlayQuestionSound()}function rhe(){return lfe(),{workspace:hfe,sessions:pfe,activeSessionId:mfe,workspacesView:La,visibleWorkspace:Yfe,activeWorkspaceId:oM,sessionsForView:Xfe,workspaceGroups:Qfe,attentionBySession:sM,pendingBySession:Jfe,attentionByWorkspace:the,unreadBySession:ehe,recentRoots:nhe,turns:yfe,tasks:kfe,todos:bfe,goal:Xl,swarms:tM,activationBadges:Pfe,compaction:wfe,status:nM,sessionCost:qfe,fileDiff:Ufe,selectedDiffPath:U3,fileDiffLoading:j3,changes:Hfe,gitInfo:nh,gitDiffStats:Wfe,activePullRequest:Ffe,changesByPath:Gfe,pendingApprovals:Bfe,availableOpenInApps:ohe,connection:_fe,loading:Cfe,sessionLoading:Sfe,loadingMoreMessages:xfe,hasMoreMessages:Tfe,loadMoreMessagesError:Afe,serverVersion:Mfe,initialized:z3,permission:Efe,thinking:Ife,planMode:$fe,swarmMode:Nfe,goalMode:Lfe,queued:Ofe,warnings:Rfe,questions:Dfe,activity:op,isSending:vfe,fastMoon:os.fastMoon,models:_n.models,starredModelIds:_n.starredModelIds,providers:_n.providers,theme:os.theme,setTheme:os.setTheme,toggleTheme:os.toggleTheme,uiFontSize:os.uiFontSize,setUiFontSize:os.setUiFontSize,betaToc:G3,setBetaToc:qde,colorScheme:os.colorScheme,setColorScheme:os.setColorScheme,accent:os.accent,setAccent:os.setAccent,notifyOnComplete:nl.notifyOnComplete,notifyOnQuestion:nl.notifyOnQuestion,notifyPermission:nl.notifyPermission,setNotifyOnComplete:nl.setNotifyOnComplete,setNotifyOnQuestion:nl.setNotifyOnQuestion,soundOnComplete:th.soundOnComplete,setSoundOnComplete:th.setSoundOnComplete,onboarded:Y3,setOnboarded:zde,load:dt.load,selectSession:dt.selectSession,clearActiveSession:dt.clearActiveSession,loadOlderMessages:dt.loadOlderMessages,loadWorkspaces:dt.loadWorkspaces,loadMoreSessions:dt.loadMoreSessions,loadAllSessions:dt.loadAllSessions,selectWorkspace:dt.selectWorkspace,openWorkspace:dt.openWorkspace,openWorkspaceDraft:dt.openWorkspaceDraft,startSessionAndSendPrompt:dt.startSessionAndSendPrompt,addWorkspaceByPath:dt.addWorkspaceByPath,browseFs:dt.browseFs,getFsHome:dt.getFsHome,sendPrompt:dt.sendPrompt,steerPrompt:dt.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:dt.uploadImage,abortCurrentPrompt:dt.abortCurrentPrompt,respondApproval:dt.respondApproval,respondQuestion:dt.respondQuestion,dismissQuestion:dt.dismissQuestion,cancelTask:dt.cancelTask,setPermission:dt.setPermission,setThinking:_n.setThinking,setPlanMode:dt.setPlanMode,togglePlanMode:dt.togglePlanMode,setSwarmMode:dt.setSwarmMode,toggleSwarmMode:dt.toggleSwarmMode,setGoalMode:dt.setGoalMode,toggleGoalMode:dt.toggleGoalMode,createGoal:dt.createGoal,controlGoal:dt.controlGoal,enqueue:dt.enqueue,dismissWarning:dt.dismissWarning,renameSession:dt.renameSession,renameWorkspace:dt.renameWorkspace,deleteWorkspace:dt.deleteWorkspace,reorderWorkspaces:Zfe,archiveSession:dt.archiveSession,compact:dt.compact,forkSession:dt.forkSession,undo:dt.undo,unqueue:dt.unqueue,searchFiles:dt.searchFiles,loadGitStatus:dt.loadGitStatus,loadFileDiff:dt.loadFileDiff,clearFileDiff:dt.clearFileDiff,listDir:dt.listDir,readFileContent:dt.readFileContent,getFileDownloadUrl:dt.getFileDownloadUrl,openWorkspaceFile:dt.openWorkspaceFile,openInApp:dt.openInApp,revealWorkspaceFile:dt.revealWorkspaceFile,resolveImageUrl:dt.resolveImageUrl,refreshOAuthProviderModels:_n.refreshOAuthProviderModels,loadModels:_n.loadModels,loadProviders:_n.loadProviders,skills:gfe,activateSkill:_n.activateSkill,setModel:_n.setModel,toggleStarModel:_n.toggleStarModel,addProvider:_n.addProvider,deleteProvider:_n.deleteProvider,refreshProvider:_n.refreshProvider,refreshAllProviders:_n.refreshAllProviders,authReady:jfe,defaultModel:zfe,managedProviderStatus:Vfe,config:Kfe,updateConfig:dt.updateConfig,checkAuth:dt.checkAuth,startOAuthLogin:_n.startOAuthLogin,pollOAuthLogin:_n.pollOAuthLogin,cancelOAuthLogin:_n.cancelOAuthLogin,logout:dt.logout}}function lhe({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 ahe({running:e,showAuthGate:t}){const{t:n}=xt(),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`});XE(()=>{typeof document<"u"&&(document.title=a.value)}),Yt(()=>{l()})}const iM=ne(typeof window>"u"?0:window.innerWidth);let $d=0,sh=!1;function q1(){iM.value=window.innerWidth}function che(){sh||typeof window>"u"||(window.addEventListener("resize",q1),sh=!0,q1())}function uhe(){!sh||typeof window>"u"||(window.removeEventListener("resize",q1),sh=!1)}function rM(e,t,n){return Math.max(t,e-n)}function j1(e,t,n){return Math.min(n,Math.max(t,e))}function lM(){return rn(()=>{$d+=1,che()}),Yo(()=>{$d=Math.max(0,$d-1),$d===0&&uhe()}),{viewportWidth:iM}}const dhe="kimi-web.file-preview-width",Ql=320;function fhe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=lM(),i=F(()=>Math.max(0,s.value-t.value)),r=F(()=>rM(i.value,Ql,Ql));function l(ce){return j1(Math.round(ce),Ql,r.value)}function a(){return l(i.value/2)}const c=F(()=>a()),u=ne(c.value),d=F(()=>j1(u.value,Ql,r.value)),f=ne(null),g=F(()=>{const ce=f.value;if(!ce)return null;const j=e.turns.value.find(te=>te.id===ce.turnId)?.blocks?.[ce.blockIndex];return j?.kind==="thinking"?j.thinking:null}),h=F(()=>g.value!==null);function m(ce){const Se=f.value;if(Se&&Se.turnId===ce.turnId&&Se.blockIndex===ce.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=ce}function _(){f.value=null,n.value==="thinking"&&(n.value=null)}const w=ne(null),k=F(()=>{const ce=w.value;if(!ce)return null;const Se=e.turns.value.find(j=>j.id===ce.turnId);return Se?.role==="compaction"&&Se.text?Se.text:null}),b=F(()=>k.value!==null);function y(ce){if(w.value?.turnId===ce.turnId){w.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",w.value=ce}function S(){w.value=null,n.value==="compaction"&&(n.value=null)}const L=ne(null),N=F(()=>{const ce=L.value;if(!ce)return null;const j=e.turns.value.find(te=>te.id===ce.turnId)?.blocks?.[ce.blockIndex];return j?j.kind==="agent"?j.member.id===ce.memberId?j.member:null:j.kind==="agentGroup"?j.members.find(te=>te.id===ce.memberId)??null:null:null}),v=F(()=>N.value!==null);function M(ce){const Se=L.value;if(Se&&Se.turnId===ce.turnId&&Se.memberId===ce.memberId){L.value=null,n.value==="agent"&&(n.value=null);return}n.value="agent",L.value=ce}function $(){L.value=null,n.value==="agent"&&(n.value=null)}const O=ne(null),T=F(()=>{const ce=O.value;if(!ce)return null;const Se=O8(e.turns.value,ce);return Se?{id:ce,title:Sf(Se.name),path:P8(Se.arg),lines:Se.status==="error"?null:yx(Se),output:Se.output}:null}),I=F(()=>T.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"){J();return}n.value="diff",W.value="list",V.value=null,e.loadGitStatus(e.activeSessionId.value)}function J(){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),We=F(()=>n.value!==null&&(n.value!=="thinking"||h.value)&&(n.value!=="compaction"||b.value)&&(n.value!=="agent"||v.value)&&(n.value!=="toolDiff"||I.value)&&(n.value!=="btw"||le.value)),ue=ne(!1),ve=ne({});function Ne(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.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":f.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"&&h.value?(_(),!0):n.value==="compaction"&&b.value?(S(),!0):n.value==="agent"&&v.value?($(),!0):n.value==="toolDiff"&&I.value?(D(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(J(),!0):n.value==="btw"?(X(),!0):!1}return ze(e.activeSessionId,(ce,Se)=>{if(Se){const j=Ne();j?ve.value[Se]=j:delete ve.value[Se]}o(),_(),S(),$(),D(),J(),ke(),ce&&Re(ve.value[ce])}),{PREVIEW_WIDTH_KEY:dhe,PREVIEW_MIN:Ql,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:g,thinkingVisible:h,openThinkingPanel:m,closeThinkingPanel:_,compactionPanelText:k,compactionPanelVisible:b,openCompactionPanel:y,closeCompactionPanel:S,agentPanelMember:N,agentPanelVisible:v,openAgentPanel:M,closeAgentPanel:$,toolDiffTarget:T,toolDiffVisible:I,openToolDiff:R,closeToolDiff:D,detailDiffMode:W,detailDiffPath:V,openDiffDetail:U,closeDiffDetail:J,selectDiffFile:K,btwVisible:le,openSideChatTab:G,closeSideChat:X,hideSideChatPanel:ke,sidePanelVisible:We,panelDragging:ue,closeOpenSidePanel:Q}}const hhe=Mt.sidebarWidth,sC=Mt.sidebarCollapsed,iC=270,kg=170,phe=36,mhe=320;function ghe(e={}){const{viewportWidth:t}=lM(),n=ne(iC),o=ne(!1),s=F(()=>{const c=mhe+(EC(e.previewOpen)?Ql:0);return rM(t.value,kg,c)}),i=F(()=>o.value?phe:j1(n.value,kg,s.value));function r(){try{o.value=bn(sC)==="true"}catch{o.value=!1}}function l(){try{An(sC,String(o.value))}catch{}}function a(){o.value=!o.value,l()}return{SIDEBAR_WIDTH_KEY:hhe,SIDEBAR_DEFAULT:iC,SIDEBAR_MIN:kg,sidebarMax:s,sessionColWidth:n,sidebarCollapsed:o,sideWidth:i,loadSidebarCollapsed:r,toggleSidebarCollapse:a}}function vhe({client:e,detailTarget:t}){const{t:n}=xt(),o=ne(null),s=ne(null),i=ne(!1),r=ne(null),l=ne(null);let a=0;const c=F(()=>{const y=l.value;return y?e.getFileDownloadUrl(y):null}),u=F(()=>o.value!==null);function d(y){return y.length>1?y.replace(/\/+$/,""):y}function f(y){const S=[];for(const L of y.split(/[\\/]+/))if(!(!L||L===".")){if(L===".."){S.pop();continue}S.push(L)}return S.join("/")}function g(y){const S=y.trim();if(!S)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(S))return{error:n("filePreview.errors.unsupportedPath")};if(S.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const L=d(e.status.value.cwd);if(S.startsWith("/")){if(!L||S!==L&&!S.startsWith(`${L}/`))return{error:n("filePreview.errors.outsideWorkspace")};const v=S===L?"":S.slice(L.length+1);if(v.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const M=f(v);return M?{path:M}:{error:n("filePreview.errors.isDirectory")}}if(S.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const N=f(S);return N?{path:N}:{error:n("filePreview.errors.emptyPath")}}async function h(y){const S=o.value;if(t.value==="file"&&S&&S.path===y.path&&S.line===y.line){w();return}const L=++a;t.value="file",s.value=null,r.value=null,i.value=!0,o.value=y,l.value=null;const N=g(y.path);if("error"in N){i.value=!1,r.value=N.error;return}l.value=N.path;try{const v=await e.readFileContent(N.path);if(L!==a)return;v?s.value={...v,path:v.path||N.path}:s.value={path:N.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(v){if(L!==a)return;r.value=v instanceof Error?v.message:n("filePreview.errors.loadFailed")}finally{L===a&&(i.value=!1)}}function m(y){return/^data:([^;,]+)/i.exec(y)?.[1]}function _(y){y.kind==="image"&&(t.value="file",o.value=null,l.value=null,r.value=null,i.value=!1,s.value={path:y.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:y.mimeType??m(y.url)??"image/*",sourceUrl:y.url,isBinary:!0,size:y.bytes??0})}function w(){o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,t.value==="file"&&(t.value=null)}function k(){const y=s.value?.path??o.value?.path;y&&e.openWorkspaceFile(y,o.value?.line)}function b(){const y=s.value?.path??o.value?.path;y&&e.revealWorkspaceFile(y)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:c,previewExternalActions:u,openFilePreview:h,openMediaPreview:_,closeFilePreview:w,openPreviewInEditor:k,revealPreviewFile:b}}const yhe=640,khe=`(max-width: ${yhe}px)`;function bhe(){const e=ne(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(khe);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 whe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},_he={class:"server-auth-card"},Che=["disabled"],She=["disabled"],xhe=Qe({__name:"ServerAuthDialog",setup(e){const t=ne(""),n=ne(null),o=ne(!1);rn(()=>{ht(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,h3(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(C(),E("div",whe,[p("div",_he,[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"},[ft(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),p("code",null,"KIMI_CODE_PASSWORD"),ft("). ")],-1)),jt(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,Che),[[Wn,t.value]]),p("button",{type:"button",class:"server-auth-button",disabled:!t.value||o.value,onClick:s},P(o.value?"Connecting…":"Connect"),9,She)])]))}}),The=bt(xhe,[["__scopeId","data-v-fb2ac094"]]),Ahe={class:"app-shell"},Mhe={key:1,class:"auth-page"},Ehe={class:"auth-page-inner"},Ihe={class:"auth-page-copy"},$he={key:0,class:"sidebar-rail"},Nhe=["title","aria-label"],Lhe={key:3,class:"coming-soon"},Phe={class:"cs-text"},Ohe=["aria-label","aria-hidden"],Rhe=Qe({__name:"App",setup(e){const t=Tce(),n=ne(!t);let o=null;const s=rhe();yn("resolveImage",s.resolveImageUrl);const{t:i}=xt(),r=Ys(),l=bhe(),a=ne(!1),c=ne(!1),u=F(()=>{const Me=s.activeSessionId.value;return s.sessions.value.find(ee=>ee.id===Me)?.title??""}),d=F(()=>s.visibleWorkspace.value?.sessionCount??0),f=F(()=>s.activity.value!=="idle"),g=ne(null),{showAuthGate:h,blinkAuthLogo:m}=lhe({client:s,authLogoRef:g});ahe({running:f,showAuthGate:h});function _(Me){return Me==="off"?"high":"off"}const w=ne(!s.onboarded.value);function k(){s.setOnboarded(!0),w.value=!1}function b(){w.value=!0}rn(()=>{s.load(),ue(),document.addEventListener("keydown",y,!0),o=Mce(()=>{n.value=!0})}),Yt(()=>{document.removeEventListener("keydown",y,!0),o!==null&&(o(),o=null)});function y(Me){Me.key==="Escape"&&(Co.value||jn()&&(Me.stopPropagation(),Me.preventDefault()))}const S=ne(null),L=ne(!1);ze(s.activeSessionId,()=>{L.value=!0,ht(()=>{L.value=!1})});const{previewTarget:N,previewFile:v,previewLoading:M,previewError:$,previewDownloadUrl:O,previewExternalActions:T,openFilePreview:I,openMediaPreview:R,closeFilePreview:D,openPreviewInEditor:W,revealPreviewFile:V}=vhe({client:s,detailTarget:S}),U=F(()=>S.value!==null),{SIDEBAR_WIDTH_KEY:J,SIDEBAR_DEFAULT:K,SIDEBAR_MIN:G,sidebarMax:X,sessionColWidth:ke,sidebarCollapsed:le,sideWidth:We,loadSidebarCollapsed:ue,toggleSidebarCollapse:ve}=ghe({previewOpen:U}),{PREVIEW_WIDTH_KEY:Ne,PREVIEW_MIN:Re,previewDefaultWidth:Q,previewMax:ce,previewWidth:Se,previewPanelWidth:j,thinkingPanelText:te,thinkingVisible:he,openThinkingPanel:oe,closeThinkingPanel:fe,compactionPanelText:H,compactionPanelVisible:Y,openCompactionPanel:re,closeCompactionPanel:ge,agentPanelMember:xe,openAgentPanel:$e,closeAgentPanel:se,toolDiffTarget:ae,openToolDiff:we,closeToolDiff:qe,detailDiffMode:nt,detailDiffPath:ct,openDiffDetail:_t,closeDiffDetail:$t,selectDiffFile:lt,btwVisible:Rt,openSideChatTab:fn,closeSideChat:Mn,sidePanelVisible:Nt,panelDragging:Ft,closeOpenSidePanel:jn}=fhe({client:s,sideWidth:We,detailTarget:S,closeFilePreview:D}),Je=ne(null),Qn=ne([]),Xo=F(()=>Qn.value.length>1);function Po(Me){Qn.value=Me}const ho=ne(!1),Ln=ne(!1),cn=ne(!1),wn=ne(!1),On=ne(!1),zn=ne(!1),Zn=ne(null),Co=F(()=>ho.value||Ln.value||cn.value||wn.value||On.value||zn.value||w.value||a.value||c.value),po=ne(!1),Oo=ne(!1),Tt=ne(!1),io=ne(!1),nn=ne(!1);async function Ro(){po.value=!0,Oo.value=!1,ho.value=!0;try{await s.refreshOAuthProviderModels(),await s.loadModels()}catch{Oo.value=!0}finally{po.value=!1}}async function Qo(){Tt.value=!0,io.value=!1,Ln.value=!0;try{await s.loadProviders()}catch{io.value=!0}finally{Tt.value=!1}}function Jn(){cn.value=!0}async function Ye(Me){ho.value=!1,await s.setModel(Me)}async function je(Me){await s.addProvider(Me)}async function tt(Me){await s.deleteProvider(Me)}async function it(Me){await s.refreshProvider(Me)}async function Ie(Me){nn.value=!0;try{await s.updateConfig(Me)&&await s.checkAuth()}finally{nn.value=!1}}async function be(){return s.startOAuthLogin()}async function Fe(){return s.pollOAuthLogin()}async function Ct(){return s.cancelOAuthLogin()}async function St(){cn.value=!1,await s.checkAuth(),await s.load()}async function mn(Me){await s.undo(1),await ht(),Je.value?.loadComposerForEdit(Me)}function gn(Me){if(Me==="/compact"||Me.startsWith("/compact ")){s.compact(Me.slice(8).trim()||void 0);return}if(Me==="/swarm"||Me.startsWith("/swarm ")){const ee=Me.slice(6).trim();ee==="on"?s.setSwarmMode(!0):ee==="off"?s.setSwarmMode(!1):ee?(s.setSwarmMode(!0),s.sendPrompt(ee)):s.toggleSwarmMode();return}if(Me==="/goal"||Me.startsWith("/goal ")){const ee=Me.slice(5).trim();ee==="pause"||ee==="resume"||ee==="cancel"?s.controlGoal(ee):ee?s.createGoal(ee):s.toggleGoalMode();return}if(Me==="/btw"||Me.startsWith("/btw ")){const ee=Me.slice(4).trim();!ee&&s.sideChatVisible.value?Mn():fn(ee||void 0);return}switch(Me){case"/new":case"/clear":de();break;case"/fork":s.forkSession();break;case"/undo":s.undo();break;case"/permission":{const ee=s.permission.value,pe=ee==="manual"?"auto":ee==="auto"?"yolo":"manual";s.setPermission(pe);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":Ro();break;case"/provider":Qo();break;case"/login":Jn();break;default:{const ee=Me.indexOf(" "),pe=(ee===-1?Me:Me.slice(0,ee)).slice(1),kt=ee===-1?void 0:Me.slice(ee+1).trim()||void 0;pe&&s.activateSkill(pe,kt);break}}}function ys(Me){s.unqueue(Me)}function Zo(Me){s.unqueue(Me)}async function Ui(Me){const ee=s.activeWorkspaceId.value;if(!s.activeSessionId.value&&ee){await s.startSessionAndSendPrompt(ee,Me.text,Me.attachments);return}if(!s.activeSessionId.value&&!ee){Zn.value=Me,wn.value=!0;return}s.sendPrompt(Me.text,Me.attachments)}async function fi(Me){wn.value=!1,await s.addWorkspaceByPath(Me);const ee=Zn.value;Zn.value=null;const pe=s.activeWorkspaceId.value;ee&&pe&&await s.startSessionAndSendPrompt(pe,ee.text,ee.attachments)}function Vn(){Zn.value=null,wn.value=!1}function hi(){ht(()=>{Je.value?.focusComposer()})}function de(){const Me=s.activeWorkspaceId.value;Me?s.openWorkspaceDraft(Me):s.clearActiveSession(),hi()}function Te(Me){s.openWorkspaceDraft(Me),hi()}function Le(Me){Me&&window.open(Me,"_blank","noopener")}return(Me,ee)=>(C(),E("div",Ahe,[n.value?(C(),Ve(The,{key:0})):ie("",!0),x(h)?(C(),E("section",Mhe,[p("div",Ehe,[(C(),E("svg",{ref_key:"authLogoRef",ref:g,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:ee[0]||(ee[0]=Ze(()=>{},["prevent"])),onClick:ee[1]||(ee[1]=(...pe)=>x(m)&&x(m)(...pe))},[...ee[95]||(ee[95]=[_r('<defs data-v-11449b16><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-11449b16><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-11449b16></rect><g class="ch-eyes" fill="#000" data-v-11449b16><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-11449b16></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-11449b16></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-11449b16></rect>',2)])],544)),p("div",Ihe,[p("h1",null,P(x(i)("app.authPageTitle")),1),p("p",null,P(x(i)("app.authPageMessage")),1)]),p("button",{type:"button",class:"auth-page-btn",onClick:Jn},[ee[96]||(ee[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(x(i)("app.authPageLogin")),1)])])])):(C(),E("div",{key:2,class:Pe(["app",{mobile:x(l),"sidebar-collapsed":x(le)&&!x(l)}]),style:Wt({"--side-w":x(We)+"px","--preview-w":x(j)+"px"})},[x(l)?(C(),Ve(cre,{key:1,workspace:x(s).visibleWorkspace.value,"session-title":u.value,running:f.value,branch:x(s).status.value.branch,"session-count":d.value,onOpenSwitcher:ee[17]||(ee[17]=pe=>a.value=!0),onOpenSettings:ee[18]||(ee[18]=pe=>c.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(C(),E(Oe,{key:0},[jt(vt(nN,{"col-width":x(We),"active-workspace":x(s).visibleWorkspace.value,"active-workspace-id":x(s).activeWorkspaceId.value,sessions:x(s).sessionsForView.value,groups:x(s).workspaceGroups.value,"active-id":x(s).activeSessionId.value,"attention-by-session":x(s).attentionBySession.value,"pending-by-session":x(s).pendingBySession.value,"unread-by-session":x(s).unreadBySession.value,onSelect:ee[2]||(ee[2]=pe=>x(s).selectSession(pe)),onCreate:de,onCreateInWorkspace:ee[3]||(ee[3]=pe=>Te(pe)),onSelectWorkspace:ee[4]||(ee[4]=pe=>x(s).openWorkspace(pe)),onAddWorkspace:ee[5]||(ee[5]=pe=>wn.value=!0),onRename:ee[6]||(ee[6]=(pe,kt)=>x(s).renameSession(pe,kt)),onArchive:ee[7]||(ee[7]=pe=>x(s).archiveSession(pe)),onFork:ee[8]||(ee[8]=pe=>x(s).forkSession(pe)),onRenameWorkspace:ee[9]||(ee[9]=(pe,kt)=>x(s).renameWorkspace(pe,kt)),onDeleteWorkspace:ee[10]||(ee[10]=pe=>x(s).deleteWorkspace(pe)),onReorderWorkspaces:ee[11]||(ee[11]=pe=>x(s).reorderWorkspaces(pe)),onLoadMoreSessions:ee[12]||(ee[12]=pe=>void x(s).loadMoreSessions(pe)),onLoadAllSessions:ee[13]||(ee[13]=pe=>void x(s).loadAllSessions()),onSelectWorkspaces:Po,onOpenSettings:ee[14]||(ee[14]=pe=>zn.value=!0),onCollapse:x(ve)},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","onCollapse"]),[[js,!x(le)]]),jt(vt(gb,{"storage-key":x(J),"default-width":x(K),min:x(G),max:x(X),"onUpdate:width":ee[15]||(ee[15]=pe=>ke.value=pe)},null,8,["storage-key","default-width","min","max"]),[[js,!x(le)]]),x(le)?(C(),E("div",$he,[p("button",{type:"button",class:"sidebar-expand-btn",title:x(i)("sidebar.expandSidebar"),"aria-label":x(i)("sidebar.expandSidebar"),onClick:ee[16]||(ee[16]=(...pe)=>x(ve)&&x(ve)(...pe))},[...ee[97]||(ee[97]=[_r('<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-11449b16><path d="M4 6h9" data-v-11449b16></path><path d="M4 12h9" data-v-11449b16></path><path d="M4 18h9" data-v-11449b16></path><path d="M17 9l3 3-3 3" data-v-11449b16></path></svg>',1)])],8,Nhe)])):ie("",!0)],64)),Xo.value?(C(),E("div",Lhe,[ee[98]||(ee[98]=p("span",{class:"cs-icon"},"🚧",-1)),p("span",Phe,P(x(i)("app.comingSoon")),1)])):(C(),Ve(OQ,{key:2,ref_key:"conversationPaneRef",ref:Je,mobile:x(l),modern:x(s).theme.value==="modern"||x(s).theme.value==="kimi",turns:x(s).turns.value,"session-id":x(s).activeSessionId.value,approvals:x(s).pendingApprovals.value,changes:x(s).changes.value,"git-info":x(s).gitInfo.value,tasks:x(s).tasks.value,todos:x(s).todos.value,goal:x(s).goal.value,swarms:x(s).swarms.value,"activation-badges":x(s).activationBadges.value,status:x(s).status.value,thinking:x(s).thinking.value,"plan-mode":x(s).planMode.value,"swarm-mode":x(s).swarmMode.value,"goal-mode":x(s).goalMode.value,models:x(s).models.value,"starred-ids":x(s).starredModelIds.value,skills:x(s).skills.value,questions:x(s).questions.value,running:f.value,queued:x(s).queued.value,"search-files":x(s).searchFiles,"upload-image":x(s).uploadImage,sending:x(s).isSending.value,"fast-moon":x(s).fastMoon.value,"file-reload-key":x(s).activeSessionId.value,"session-loading":x(s).sessionLoading.value,compaction:x(s).compaction.value,"has-more-messages":x(s).hasMoreMessages.value,"loading-more":x(s).loadingMoreMessages.value,"loading-more-error":x(s).loadMoreMessagesError.value,"load-older-messages":x(s).loadOlderMessages,"workspace-name":x(s).visibleWorkspace.value?.name,"workspace-root":x(s).visibleWorkspace.value?.root??x(s).status.value.cwd,"git-diff-stats":x(s).gitDiffStats.value,workspaces:x(s).workspacesView.value,"active-workspace-id":x(s).activeWorkspaceId.value,"session-title":u.value,pr:x(s).activePullRequest.value,"beta-toc":x(s).betaToc.value,onOpenChanges:ee[19]||(ee[19]=pe=>x(_t)()),onSelectWorkspace:ee[20]||(ee[20]=pe=>Te(pe)),onAddWorkspace:ee[21]||(ee[21]=pe=>wn.value=!0),onOpenPr:Le,onSubmit:ee[22]||(ee[22]=pe=>Ui(pe)),onSteer:ee[23]||(ee[23]=pe=>x(s).steerPrompt(pe.text,pe.attachments)),onApproval:ee[24]||(ee[24]=(pe,kt)=>x(s).respondApproval(pe,kt)),onCancelTask:ee[25]||(ee[25]=pe=>x(s).cancelTask(pe)),onAnswer:ee[26]||(ee[26]=(pe,kt)=>x(s).respondQuestion(pe,kt)),onDismiss:ee[27]||(ee[27]=pe=>x(s).dismissQuestion(pe)),onCommand:gn,onInterrupt:ee[28]||(ee[28]=pe=>x(s).abortCurrentPrompt()),onUnqueue:ys,onEditQueued:Zo,onSetPermission:ee[29]||(ee[29]=pe=>x(s).setPermission(pe)),onSetThinking:ee[30]||(ee[30]=pe=>x(s).setThinking(pe)),onTogglePlan:ee[31]||(ee[31]=pe=>x(s).togglePlanMode()),onToggleSwarm:ee[32]||(ee[32]=pe=>x(s).toggleSwarmMode()),onToggleGoal:ee[33]||(ee[33]=pe=>x(s).toggleGoalMode()),onCreateGoal:ee[34]||(ee[34]=pe=>x(s).createGoal(pe)),onControlGoal:ee[35]||(ee[35]=pe=>x(s).controlGoal(pe)),onRefreshGitStatus:ee[36]||(ee[36]=pe=>x(s).activeSessionId.value&&x(s).loadGitStatus(x(s).activeSessionId.value)),onRenameSession:ee[37]||(ee[37]=(pe,kt)=>x(s).renameSession(pe,kt)),onForkSession:ee[38]||(ee[38]=pe=>x(s).forkSession(pe)),onArchiveSession:ee[39]||(ee[39]=pe=>x(s).archiveSession(pe)),onCompact:ee[40]||(ee[40]=pe=>x(s).compact()),onPickModel:ee[41]||(ee[41]=pe=>Ro()),onSelectModel:ee[42]||(ee[42]=pe=>x(s).setModel(pe)),onOpenFile:ee[43]||(ee[43]=pe=>x(I)(pe)),onOpenMedia:ee[44]||(ee[44]=pe=>x(R)(pe)),onOpenThinking:ee[45]||(ee[45]=pe=>x(oe)(pe)),onOpenCompaction:ee[46]||(ee[46]=pe=>x(re)(pe)),onOpenAgent:ee[47]||(ee[47]=pe=>x($e)(pe)),onOpenToolDiff:ee[48]||(ee[48]=pe=>x(we)(pe)),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"])),x(Nt)&&!x(l)?(C(),Ve(gb,{key:4,"storage-key":x(Ne),"default-width":x(Q),min:x(Re),max:x(ce),reverse:"","aria-label":x(i)("layout.resizePreviewAria"),"onUpdate:width":ee[49]||(ee[49]=pe=>Se.value=pe),"onUpdate:dragging":ee[50]||(ee[50]=pe=>Ft.value=pe)},null,8,["storage-key","default-width","min","max","aria-label"])):ie("",!0),!x(l)||x(Nt)?(C(),E("aside",{key:5,class:Pe(["global-preview",{open:x(Nt),mobile:x(l),"no-anim":x(Ft)||L.value}]),role:"complementary","aria-label":x(i)("layout.detailPanelAria"),"aria-hidden":!x(Nt)},[S.value==="thinking"&&x(he)?(C(),Ve(S2,{key:0,text:x(te)??"",onClose:x(fe)},null,8,["text","onClose"])):S.value==="compaction"&&x(Y)?(C(),Ve(S2,{key:1,text:x(H)??"",subtitle:x(i)("conversation.summaryTitle"),onClose:x(ge)},null,8,["text","subtitle","onClose"])):S.value==="agent"&&x(xe)?(C(),Ve(vJ,{key:2,member:x(xe),onClose:x(se)},null,8,["member","onClose"])):S.value==="btw"&&x(Rt)?(C(),Ve(VJ,{key:3,turns:x(s).sideChatTurns.value,running:x(s).sideChatRunning.value,sending:x(s).sideChatSending.value,onSend:ee[51]||(ee[51]=pe=>x(s).sendSideChatPrompt(pe)),onClose:x(Mn)},null,8,["turns","running","sending","onClose"])):S.value==="diff"?(C(),Ve(Nee,{key:4,mode:x(nt),changes:x(s).changes.value,"git-info":x(s).gitInfo.value,"file-diff":x(s).fileDiff.value,"selected-diff-path":x(s).selectedDiffPath.value,"file-diff-loading":x(s).fileDiffLoading.value,closable:"",onOpen:x(lt),onBack:ee[52]||(ee[52]=pe=>{nt.value="list",ct.value=null,x(s).clearFileDiff()}),onClose:x($t)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):S.value==="toolDiff"&&x(ae)?(C(),Ve(PJ,{key:5,target:x(ae),onClose:x(qe)},null,8,["target","onClose"])):S.value==="file"?(C(),Ve(VZ,{key:6,file:x(v),loading:x(M),error:x($),line:x(N)?.line,"download-url":x(O),closable:"","external-actions":x(T),"open-file":x(I),onClose:x(D),onOpenExternal:x(W),onReveal:x(V)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ie("",!0)],10,Ohe)):ie("",!0),ho.value?(C(),Ve(ite,{key:6,models:x(s).models.value,current:x(s).status.value.modelId,"starred-ids":x(s).starredModelIds.value,loading:po.value,unavailable:Oo.value,onSelect:ee[53]||(ee[53]=pe=>Ye(pe)),onToggleStar:ee[54]||(ee[54]=pe=>x(s).toggleStarModel(pe)),onClose:ee[55]||(ee[55]=pe=>ho.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ie("",!0),zn.value?(C(),Ve(jse,{key:7,theme:x(s).theme.value,"color-scheme":x(s).colorScheme.value,"ui-font-size":x(s).uiFontSize.value,"auth-ready":x(s).authReady.value,"account-model":x(s).defaultModel.value,notify:x(s).notifyOnComplete.value,"notify-question":x(s).notifyOnQuestion.value,"notify-permission":x(s).notifyPermission.value,sound:x(s).soundOnComplete.value,"beta-toc":x(s).betaToc.value,config:x(s).config.value,models:x(s).models.value,"config-saving":nn.value,"server-version":x(s).serverVersion.value,onSetTheme:ee[56]||(ee[56]=pe=>x(s).setTheme(pe)),onSetColorScheme:ee[57]||(ee[57]=pe=>x(s).setColorScheme(pe)),onSetUiFontSize:ee[58]||(ee[58]=pe=>x(s).setUiFontSize(pe)),onSetNotify:ee[59]||(ee[59]=pe=>x(s).setNotifyOnComplete(pe)),onSetNotifyQuestion:ee[60]||(ee[60]=pe=>x(s).setNotifyOnQuestion(pe)),onSetSound:ee[61]||(ee[61]=pe=>x(s).setSoundOnComplete(pe)),onSetBetaToc:ee[62]||(ee[62]=pe=>x(s).setBetaToc(pe)),onUpdateConfig:ee[63]||(ee[63]=pe=>Ie(pe)),onLogin:ee[64]||(ee[64]=()=>{zn.value=!1,Jn()}),onLogout:x(s).logout,onOpenOnboarding:ee[65]||(ee[65]=()=>{zn.value=!1,b()}),onClose:ee[66]||(ee[66]=pe=>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"])):ie("",!0),Ln.value?(C(),Ve(Gte,{key:8,providers:x(s).providers.value,loading:Tt.value,unavailable:io.value,onAdd:ee[67]||(ee[67]=pe=>je(pe)),onRefresh:ee[68]||(ee[68]=pe=>it(pe)),onDelete:ee[69]||(ee[69]=pe=>tt(pe)),onOpenLogin:ee[70]||(ee[70]=()=>{Ln.value=!1,Jn()}),onClose:ee[71]||(ee[71]=pe=>Ln.value=!1)},null,8,["providers","loading","unavailable"])):ie("",!0),On.value?(C(),Ve(Wie,{key:9,status:x(s).status.value,thinking:x(s).thinking.value,"plan-mode":x(s).planMode.value,"swarm-mode":x(s).swarmMode.value,"cost-usd":x(s).sessionCost.value,onClose:ee[72]||(ee[72]=pe=>On.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ie("",!0),wn.value?(C(),Ve(xie,{key:10,"browse-fs":x(s).browseFs,"get-fs-home":x(s).getFsHome,"default-path":x(s).visibleWorkspace.value?.root??x(s).status.value.cwd,onAdd:ee[73]||(ee[73]=pe=>fi(pe)),onClose:Vn},null,8,["browse-fs","get-fs-home","default-path"])):ie("",!0),vt(Fi,{name:"gload-fade"},{default:$n(()=>[x(s).initialized.value?ie("",!0):(C(),Ve(hae,{key:0}))]),_:1}),w.value&&!x(h)?(C(),Ve(aae,{key:11,theme:x(s).theme.value,onSetTheme:ee[74]||(ee[74]=pe=>x(s).setTheme(pe)),onComplete:k,onSkip:k},null,8,["theme"])):ie("",!0),vt(Jie,{warnings:x(s).warnings.value,onDismiss:x(s).dismissWarning},null,8,["warnings","onDismiss"]),x(r)?(C(),Ve(jae,{key:12})):ie("",!0),x(l)?(C(),Ve(Fre,{key:13,modelValue:a.value,"onUpdate:modelValue":ee[75]||(ee[75]=pe=>a.value=pe),groups:x(s).workspaceGroups.value,"active-workspace-id":x(s).activeWorkspaceId.value,"active-id":x(s).activeSessionId.value,"attention-by-session":x(s).attentionBySession.value,"attention-by-workspace":x(s).attentionByWorkspace.value,onSelect:ee[76]||(ee[76]=pe=>x(s).selectSession(pe)),onCreate:de,onCreateInWorkspace:ee[77]||(ee[77]=pe=>Te(pe)),onAddWorkspace:ee[78]||(ee[78]=pe=>wn.value=!0),onRename:ee[79]||(ee[79]=(pe,kt)=>x(s).renameSession(pe,kt)),onArchive:ee[80]||(ee[80]=pe=>x(s).archiveSession(pe)),onDeleteWorkspace:ee[81]||(ee[81]=pe=>x(s).deleteWorkspace(pe)),onLoadMore:ee[82]||(ee[82]=pe=>void x(s).loadMoreSessions(pe))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ie("",!0),x(l)?(C(),Ve(Wle,{key:14,modelValue:c.value,"onUpdate:modelValue":ee[83]||(ee[83]=pe=>c.value=pe),status:x(s).status.value,thinking:x(s).thinking.value,"plan-mode":x(s).planMode.value,"swarm-mode":x(s).swarmMode.value,theme:x(s).theme.value,"color-scheme":x(s).colorScheme.value,"ui-font-size":x(s).uiFontSize.value,"auth-ready":x(s).authReady.value,"beta-toc":x(s).betaToc.value,"server-version":x(s).serverVersion.value,onPickModel:ee[84]||(ee[84]=pe=>Ro()),onSetThinking:ee[85]||(ee[85]=pe=>x(s).setThinking(pe)),onTogglePlan:ee[86]||(ee[86]=pe=>x(s).togglePlanMode()),onToggleSwarm:ee[87]||(ee[87]=pe=>x(s).toggleSwarmMode()),onSetPermission:ee[88]||(ee[88]=pe=>x(s).setPermission(pe)),onSetTheme:ee[89]||(ee[89]=pe=>x(s).setTheme(pe)),onSetColorScheme:ee[90]||(ee[90]=pe=>x(s).setColorScheme(pe)),onSetUiFontSize:ee[91]||(ee[91]=pe=>x(s).setUiFontSize(pe)),onSetBetaToc:ee[92]||(ee[92]=pe=>x(s).setBetaToc(pe)),onLogin:ee[93]||(ee[93]=()=>{c.value=!1,Jn()}),onLogout:x(s).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","theme","color-scheme","ui-font-size","auth-ready","beta-toc","server-version","onLogout"])):ie("",!0)],6)),cn.value?(C(),Ve(Ane,{key:3,"on-start-o-auth-login":be,"on-poll-o-auth-login":Fe,"on-cancel-o-auth-login":Ct,onSuccess:St,onClose:ee[94]||(ee[94]=pe=>cn.value=!1)})):ie("",!0)]))}}),Dhe=bt(Rhe,[["__scopeId","data-v-11449b16"]]);Hne();kf(Dhe).use(Sn).mount("#app");export{hE as $,upe as A,o4 as B,Bn as C,Bpe as D,fC as E,Oe as F,_r as G,ft as H,vt as I,RE as J,ape as K,ai as L,Qe as M,EI as N,hpe as O,ppe as P,vpe as Q,Jd as R,da as S,tpe as T,mpe as U,uv as V,fpe as W,Hpe as X,gpe as Y,Lpe as Z,Fhe as _,WC as a,ko as a$,fo as a0,K1 as a1,Khe as a2,J1 as a3,J4 as a4,Zt as a5,Ma as a6,Jhe as a7,jpe as a8,spe as a9,VC as aA,p4 as aB,b4 as aC,rn as aD,k4 as aE,y4 as aF,G1 as aG,v4 as aH,Yt as aI,tv as aJ,WE as aK,C as aL,TI as aM,Qhe as aN,yn as aO,IC as aP,Xhe as aQ,sf as aR,as as aS,tf as aT,ne as aU,Ape as aV,jI as aW,Xe as aX,ca as aY,_4 as aZ,cpe as a_,lpe as aa,rpe as ab,ipe as ac,Epe as ad,zpe as ae,Bt as af,iI as ag,yh as ah,mr as ai,Di as aj,Pn as ak,Mpe as al,us as am,wr as an,fr as ao,bpe as ap,wpe as aq,en as ar,ht as as,uI as at,Pe as au,Bhe as av,Wt as aw,h4 as ax,g4 as ay,Yo as az,Yhe as b,PW as b$,Rpe as b0,qc as b1,df as b2,Ppe as b3,br as b4,NE as b5,Whe as b6,gl as b7,GE as b8,Ope as b9,Wn as bA,js as bB,rI as bC,$pe as bD,ze as bE,XE as bF,epe as bG,QE as bH,Cpe as bI,$n as bJ,ype as bK,jt as bL,Ns as bM,Ipe as bN,Ze as bO,Zhe as bP,Jt as bQ,cs as bR,eme as bS,CU as bT,AA as bU,nme as bV,uW as bW,n0 as bX,tme as bY,u1 as bZ,sme as b_,Hhe as ba,P as bb,Nd as bc,dpe as bd,Ht as be,jhe as bf,qhe as bg,EC as bh,Tpe as bi,Uhe as bj,x as bk,mu as bl,Upe as bm,Fpe as bn,$I as bo,npe as bp,Spe as bq,YE as br,Wpe as bs,kpe as bt,ope as bu,HC as bv,vf as bw,FI as bx,NS as by,yf as bz,Npe as c,LW as c0,Jv as c1,NW as c2,Qpe as c3,sW as c4,Xpe as c5,zf as c6,Kpe as c7,$W as c8,wA as c9,ome as ca,Gpe as cb,rme as cc,g1 as cd,oa as ce,p1 as cf,lme as cg,ime as ch,Jpe as ci,ss as cj,Ype as ck,Zpe as cl,fW as cm,m1 as cn,h1 as co,Vpe as cp,xpe as d,gr as e,zhe as f,Fi as g,qpe as h,Vhe as i,Ghe as j,Rs as k,fu as l,Xn as m,uh as n,Bi as o,Dpe as p,F as q,kf as r,Ve as s,ie as t,E as u,p as v,j4 as w,_pe as x,q4 as y,zI as z};
|